/* ==========================================
   SKR CMS - Yaringdole.ac.th Exact Styling
   Matching layout.html exactly
   ========================================== */

/* ==================== CSS Variables (from layout.html) ==================== */
:root {
    /* Color Palette - Exact from yaringdole.ac.th */
    --s-color-1: #235b95;
    --s-color-2: #4e9fd6;
    --s-color-3: #47be9d;
    --s-color-4: #67d88f;
    --s-color-5: #ffa900;
    --s-color-6: #ff4d00;

    /* Text Colors */
    --s-text-1: #222;
    --s-text-2: #71767f;

    /* Background Colors */
    --s-bg-1: #fff;
    --s-bg-2: #f5f5f7;

    /* Border Colors */
    --s-border-1: #d5d5d7;
    --s-border-2: #e5e5e7;

    /* Layout Variables */
    --s-gap: 20px;
    --s-space: 40px;
    --s-container-width: 1200px;
    --s-rounded-1: 8px;
    --s-rounded-2: 16px;

    /* Header */
    --s-head-height: 145px;
    --s-nav-height: 60px;
    --s-nav-width: 280px;
    --s-head-hover: #235b95;
    --s-nav-bg: #235b95;
    --s-nav-text: #fff;
    --s-nav-hover: #77c8ff;

    /* Shadows */
    --s-shadow-1: 0 2px 12px rgba(0, 0, 0, .08);
    --s-shadow-2: 0 4px 24px rgba(0, 0, 0, .12);

    /* Typography */
    --s-body: -apple-system, "Helvetica Neue", "Sarabun", sans-serif;
    --s-heading-weight: 700;
}

/* ==================== Reset & Base ==================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    scroll-padding-top: var(--s-head-height);
    overflow-x: hidden;
}

body {
    font-family: var(--s-body);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.7;
    color: var(--s-text-1);
    background-color: var(--s-bg-1);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

strong {
    font-weight: 700;
}

a {
    color: var(--s-color-1);
    text-decoration: none;
    transition: all 0.3s ease-in-out;
}

a:hover {
    color: var(--s-head-hover);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: var(--s-heading-weight);
    line-height: 1.3;
    margin-bottom: 0.5em;
    color: var(--s-text-1);
}

h1 {
    font-size: 2em;
}

h2 {
    font-size: 1.75em;
}

h3 {
    font-size: 1.5em;
}

h4 {
    font-size: 1.25em;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul,
ol {
    list-style: none;
}

/* ==================== Container ==================== */
.s-container,
.container {
    width: 100%;
    max-width: var(--s-container-width);
    margin-left: auto;
    margin-right: auto;
    padding: 0 var(--s-gap);
}

/* ==================== Header ==================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--s-bg-1);
    transition: all 0.3s ease-in-out;
}

.site-header.active {
    box-shadow: var(--s-shadow-2);
}

@media(min-width:1024px) {
    .site-header {
        max-width: calc(var(--s-container-width) - 2 * var(--s-gap));
        margin-left: auto;
        margin-right: auto;
        border-bottom-right-radius: var(--s-rounded-2);
        border-bottom-left-radius: var(--s-rounded-2);
    }

    .site-header .s-container {
        max-width: 100%;
        padding: 0 var(--s-space);
    }
}

.site-header>.s-container {
    display: flex;
    align-items: center;
    height: calc(var(--s-head-height) - var(--s-nav-height));
}

/* Site Branding */
.site-branding {
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 0;
    flex: 1 1 auto;
}

.site-branding img,
.site-branding svg,
.custom-logo {
    height: 50px;
    width: auto;
    transition: all 0.3s ease;
}

.custom-logo-link {
    display: flex;
    align-items: center;
}

.site-title {
    font-size: 24px;
    font-weight: var(--s-heading-weight);
    margin: 0;
    line-height: 1.2;
    min-width: 0;
}

@media (max-width: 1023px) {
    .site-title {
        font-size: 1.05rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 0.88rem;
    }
}

.site-title a {
    color: var(--s-color-1);
    text-decoration: none;
}

.site-title a:hover {
    color: var(--s-head-hover);
}

/* Header Right - Social Icons */
.site-header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: var(--s-gap);
}

.s_social {
    display: flex;
    gap: 8px;
}

.s_social a {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--s-text-2);
    transition: all 0.3s ease;
}

.s_social svg {
    width: 24px;
    height: 24px;
}

.s_social a:hover {
    color: var(--s-color-1);
    transform: translateY(-2px);
}

/* Navigation Bar */
.site-nav {
    background: var(--s-nav-bg);
    color: var(--s-nav-text);
    height: var(--s-nav-height);
    display: flex;
    align-items: center;
    width: 100%;
    position: relative;
    z-index: 100;
}

.site-nav .s-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 8px;
}

.nav-inline {
    height: var(--s-nav-height);
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
}

.menu-primary-menu-container {
    height: 100%;
    display: flex;
    align-items: center;
}

/* Primary Menu */
.s-nav {
    display: flex;
    margin: 0;
    padding: 0;
    gap: 2px;
    height: 100%;
    list-style: none;
    align-items: center;
    flex-wrap: nowrap;
}

.s-nav>li {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
    flex-shrink: 0;
}

.s-nav>li>a {
    display: flex;
    align-items: center;
    height: 100%;
    color: var(--s-nav-text);
    padding: 0 6px;
    font-weight: 500;
    font-size: 0.79rem;
    letter-spacing: -0.15px;
    white-space: nowrap;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.s-nav>li>a i {
    margin-right: 4px !important;
    font-size: 0.88em;
    opacity: 0.9;
}

.s-nav>li>a:hover,
.s-nav>li:hover>a {
    color: var(--s-nav-hover);
    background: rgba(255, 255, 255, 0.08);
}

.s-nav>li:hover .i-down {
    opacity: 1;
    color: var(--s-nav-hover);
}

/* Dropdown Menu */
.s-nav .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--s-nav-bg);
    box-shadow: var(--s-shadow-2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    border-radius: var(--s-rounded-1);
    padding: 10px 0;
    z-index: 100;
}

.s-nav>li:hover>.sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.s-nav .sub-menu::before {
    content: "";
    position: absolute;
    top: -8px;
    left: 30px;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid var(--s-nav-bg);
}

.s-nav .sub-menu li {
    display: block;
}

.s-nav .sub-menu a {
    padding: 10px 20px;
    display: block;
    color: var(--s-nav-text);
    font-size: 0.78rem;
}

.s-nav .sub-menu a:hover {
    color: var(--s-nav-hover);
    background: rgba(255, 255, 255, 0.1);
}

/* Dropdown Icon */
.i-down {
    width: 12px;
    height: 12px;
    margin-left: 2px;
    margin-right: 4px;
    pointer-events: none;
    opacity: 0.75;
    flex-shrink: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.s-nav>li:hover>.i-down {
    transform: rotate(180deg);
}

.menu-item-has-children>a {
    padding-right: 2px;
}

/* Navbar Search Action */
.site-nav .site-action {
    margin-left: auto;
    padding-left: 8px;
    border-left: 1px solid rgba(255, 255, 255, 0.16);
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.site-nav .search-toggle-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--s-nav-text);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.site-nav .search-toggle-icon:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* Mobile Actions */
.site-action {
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-action.-right {
    margin-left: auto;
}

.nav-toggle {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: var(--s-rounded-1);
    background: var(--s-color-1);
    transition: all 0.3s ease;
}

.nav-toggle em {
    width: 20px;
    height: 2px;
    background: white;
    position: relative;
    display: block;
}

.nav-toggle em::before,
.nav-toggle em::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: white;
    left: 0;
    transition: all 0.3s ease;
}

.nav-toggle em::before {
    top: -6px;
}

.nav-toggle em::after {
    top: 6px;
}

.search-toggle-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--s-text-2);
    transition: all 0.3s ease;
}

.search-toggle-icon:hover {
    color: var(--s-color-1);
}

/* Responsive Navbar Adaptations for Desktop Screens */
@media (max-width: 1366px) and (min-width: 1024px) {
    .site-nav .s-container {
        padding: 0 10px;
        gap: 6px;
    }

    .s-nav {
        gap: 1px;
    }

    .s-nav>li>a {
        padding: 0 5px;
        font-size: 0.77rem;
        letter-spacing: -0.15px;
    }

    .s-nav>li>a i {
        margin-right: 3px !important;
        font-size: 0.82em;
    }

    .i-down {
        width: 9px;
        height: 9px;
        margin-left: 1px;
        margin-right: 1px;
    }

    .site-nav .search-toggle-icon {
        width: 30px;
        height: 30px;
        font-size: 0.82rem;
    }
}

@media (max-width: 1180px) and (min-width: 1024px) {
    .site-nav .s-container {
        padding: 0 6px;
        gap: 4px;
    }

    .s-nav {
        gap: 1px;
    }

    .s-nav>li>a {
        padding: 0 3px;
        font-size: 0.72rem;
        letter-spacing: -0.2px;
    }

    .s-nav>li>a i {
        margin-right: 2px !important;
        font-size: 0.78em;
    }

    .site-nav .search-toggle-icon {
        width: 28px;
        height: 28px;
        font-size: 0.78rem;
    }
}

/* Desktop vs Mobile */
._desktop {
    display: flex;
}

._mobile {
    display: none;
}

@media (max-width: 1023px) {
    ._desktop {
        display: none !important;
    }

    ._mobile {
        display: flex !important;
    }

    :root {
        --s-head-height: 64px;
    }

    .site-header {
        position: relative;
    }

    .site-header > .s-container {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        height: var(--s-head-height) !important;
        gap: 10px;
        padding-left: 14px;
        padding-right: 14px;
    }

    .site-branding {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        gap: 10px;
    }

    .site-branding img,
    .site-branding .custom-logo {
        height: 40px;
        width: 40px;
        flex-shrink: 0;
    }

    .site-title {
        font-size: 1.02rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        min-width: 0;
        margin: 0;
    }

    .site-action.-right._mobile {
        flex-shrink: 0 !important;
        margin-left: auto !important;
        display: flex !important;
        align-items: center !important;
        gap: 8px;
    }

    .nav-toggle {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
    }

    .search-toggle-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
        flex-shrink: 0;
    }

    .site-nav {
        display: none;
    }
}

@media (max-width: 480px) {
    :root {
        --s-head-height: 58px;
    }

    .site-header > .s-container {
        padding-left: 10px;
        padding-right: 10px;
        gap: 6px;
    }

    .site-title {
        font-size: 0.88rem;
    }

    .site-branding img,
    .site-branding .custom-logo {
        height: 34px;
        width: 34px;
    }

    .nav-toggle {
        width: 36px;
        height: 36px;
    }

    .search-toggle-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}

/* Mobile Menu Panel */
.nav-panel {
    position: fixed;
    z-index: 1001;
    left: -100%;
    top: 0;
    bottom: 0;
    width: var(--s-nav-width);
    background: var(--s-nav-bg);
    color: var(--s-nav-text);
    padding-top: 60px;
    overflow-y: auto;
    transition: all 0.3s ease-in-out;
    box-shadow: var(--s-shadow-2);
}

.nav-panel.-right {
    left: auto;
    right: -100%;
}

.nav-panel.active {
    left: 0;
    right: auto;
}

.nav-panel.-right.active {
    left: auto;
    right: 0;
}

.nav-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.nav-close:hover {
    opacity: 1;
}

.nav-close em {
    width: 20px;
    height: 2px;
    background: white;
    transform: rotate(45deg);
    position: relative;
}

.nav-close em::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: white;
    transform: rotate(90deg);
}

/* Mobile Menu Items */
.nav-panel .menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-panel .menu-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-panel .menu-item a {
    display: block;
    padding: 15px 20px;
    color: var(--s-nav-text);
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-panel .menu-item a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--s-nav-hover);
}

.nav-panel .sub-menu {
    background: rgba(0, 0, 0, 0.1);
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.nav-panel .menu-item-has-children {
    position: relative;
}

.nav-panel .i-down {
    position: absolute;
    right: 15px;
    top: 14px;
    width: 20px;
    height: 20px;
    opacity: 0.7;
    transition: transform 0.3s ease;
    cursor: pointer;
    pointer-events: auto;
}

.nav-panel .menu-item-has-children.active>.i-down {
    transform: rotate(180deg);
}

.nav-panel .menu-item-has-children.active>.sub-menu {
    max-height: 500px;
}

.nav-panel .sub-menu a {
    padding-left: 40px;
    font-size: 0.9rem;
}

/* Overlay */
.modal-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-bg.active {
    opacity: 1;
    visibility: visible;
}

/* ==================== Main Slider (Full Width) ==================== */
.main-slider-section {
    margin-top: var(--s-head-height, 145px);
    padding: 24px 0 0 0;
    background: #f8fafc;
}

@media (max-width: 767px) {
    .main-slider-section {
        padding: 12px 0 0 0;
    }

    .main-slider .slide img {
        width: 100%;
        height: auto;
        object-fit: contain;
    }

    .main-slider .slider-arrow {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }

    /* Hero slider mobile - ensure images don't get cropped */
    .hero-slider {
        height: auto;
    }

    .slider-wrapper {
        height: auto;
    }

    .slide {
        height: auto;
    }

    .slide img {
        width: 100%;
        height: auto;
        object-fit: contain;
    }
}

/* ==================== Hero Section - 2 Column Layout ==================== */
.hero-section {
    padding: var(--s-gap) 0;
    background: var(--s-bg-1);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.8fr 1.2fr;
    gap: var(--s-gap);
    align-items: stretch;
}

.hero-slider-column {
    position: relative;
    display: flex;
    flex-direction: column;
}

.hero-director-column {
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
}

/* Hero Slider */
.hero-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: var(--s-rounded-2);
    box-shadow: var(--s-shadow-1);
    background: #f8f9fa;
}

.slider-wrapper {
    display: flex;
    transition: transform 0.6s ease;
    width: 100%;
}

.slide {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    flex-shrink: 0;
    position: relative;
}

.slide img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
}

/* Slider Arrows */
.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--s-text-1);
    transition: all 0.3s ease;
    z-index: 10;
    opacity: 0;
}

.hero-slider:hover .slider-arrow {
    opacity: 1;
}

.slider-arrow:hover {
    background: var(--s-color-1);
    color: white;
}

.slider-prev {
    left: 15px;
}

.slider-next {
    right: 15px;
}

/* Slider Dots */
.slider-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.slider-dot:hover {
    background: rgba(255, 255, 255, 0.7);
}

.slider-dot.active {
    background: var(--s-text-1);
    border-color: var(--s-text-1);
}

/* Director Card in Hero */
.director-card-hero {
    background: var(--s-bg-1);
    border-radius: var(--s-rounded-2);
    box-shadow: var(--s-shadow-1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.director-card-hero .director-image-container {
    height: calc(100% - 120px);
    /* Reserve 120px for director-info */
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    overflow: hidden;
}

.director-card-hero .director-image-container img.director-image {
    width: auto;
    height: auto;
    max-width: 90%;
    max-height: 95%;
    object-fit: contain;
    object-position: center;
    display: block;
    margin: 0 auto;
}


.director-card-hero .director-placeholder {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--s-color-1), var(--s-color-2));
    color: white;
    font-size: 6rem;
    border-radius: 0;
}

.director-card-hero .director-info {
    padding: 20px 24px;
    text-align: center;
    background: var(--s-bg-1);
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-top: 1px solid var(--s-border-1);
}

.director-card-hero .director-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--s-color-1);
    margin-bottom: 2px;
}

.director-card-hero .director-position {
    color: var(--s-text-2);
    font-size: 1rem;
    margin-bottom: 8px;
}

.director-card-hero .btn {
    font-size: 0.8rem;
    padding: 6px 14px;
}

/* Responsive Hero Grid */
@media (max-width: 1023px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }

    .hero-director-column {
        order: 1;
    }

    .hero-slider-column {
        aspect-ratio: auto;
    }

    .director-card-hero {
        position: relative;
        height: auto;
        flex-direction: row;
        align-items: center;
    }

    .director-card-hero .director-image {
        width: 120px;
        height: 150px;
        border-radius: var(--s-rounded-1);
    }

    .director-card-hero .director-info {
        text-align: left;
    }
}

@media (max-width: 767px) {
    .director-card-hero {
        flex-direction: column;
    }

    .director-card-hero .director-image {
        width: 100%;
        height: 200px;
    }

    .director-card-hero .director-info {
        text-align: center;
    }

}


.slider-dot:hover {
    background: rgba(255, 255, 255, 0.7);
}

.slider-dot.active {
    background: var(--s-color-5);
    border-color: var(--s-color-5);
    transform: scale(1.2);
}

/* ==================== Sections ==================== */
.section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--s-color-1);
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--s-color-5), var(--s-color-3));
    border-radius: 3px;
}

.section-subtitle {
    color: var(--s-text-2);
    font-size: 1.1rem;
    margin-top: 20px;
}

/* ==================== Director Section ==================== */
.director-section {
    background: var(--s-bg-2);
}

.director-card {
    display: flex;
    align-items: center;
    gap: 50px;
    max-width: 900px;
    margin: 0 auto;
    background: var(--s-bg-1);
    padding: 40px;
    border-radius: var(--s-rounded-2);
    box-shadow: var(--s-shadow-1);
}



.director-name {
    font-size: 1.75rem;
    color: var(--s-color-1);
    margin-bottom: 8px;
}

.director-position {
    color: var(--s-color-5);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 20px;
}

.director-message {
    color: var(--s-text-2);
    line-height: 1.8;
    margin-bottom: 25px;
}

@media (max-width: 767px) {
    .director-card {
        flex-direction: column;
        text-align: center;
        padding: 30px 20px;
    }

    .director-image {
        width: 150px;
        height: 190px;
    }
}

/* ==================== Stats Section ==================== */
.stats-section {
    background: transparent;
    color: var(--s-text-1);
    padding: 30px 0;
}

.stats-section .section-title {
    color: var(--s-text-1);
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.stats-section .section-title::after {
    background: var(--s-color-1);
    width: 60px;
    height: 3px;
    bottom: -8px;
}

.stats-section .section-subtitle {
    color: var(--s-text-2);
    font-size: 1.1rem;
    margin-top: 15px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    text-align: center;
}

.stat-item {
    padding: 15px 10px;
}

.stat-icon {
    font-size: 2.5rem;
    color: var(--s-color-1);
    margin-bottom: 10px;
    opacity: 1;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--s-color-2);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--s-text-2);
    font-weight: 500;
}

@media (max-width: 767px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==================== News Section ==================== */
.news-section {
    background: var(--s-bg-2);
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--s-gap);
}

.news-card {
    background: var(--s-bg-1);
    border-radius: var(--s-rounded-2);
    overflow: hidden;
    box-shadow: var(--s-shadow-1);
    transition: all 0.3s ease;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--s-shadow-2);
}

.news-image {
    width: 100%;
    aspect-ratio: 210 / 297;
    position: relative;
    overflow: hidden;
}

.news-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
}

.news-card:hover .news-image img {
    transform: scale(1.05);
}

.news-content {
    padding: 20px;
}

.news-category {
    display: inline-block;
    padding: 4px 12px;
    background: var(--s-color-1);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    margin-bottom: 12px;
}

.news-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--s-text-1);
    margin-bottom: 10px;
    line-height: 1.4;
}

.news-title a {
    color: inherit;
}

.news-title a:hover {
    color: var(--s-color-1);
}

.news-date {
    color: var(--s-text-2);
    font-size: 0.875rem;
}

@media (max-width: 1023px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .news-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== E-Service Section ==================== */
.eservice-section {
    padding: 80px 0;
    background: var(--s-bg-1);
}

.eservice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--s-gap);
}

.eservice-item {
    background: none;
    color: var(--s-color-1);
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.eservice-item:hover {
    transform: translateY(-5px);
    color: var(--s-color-2);
}

.eservice-item i {
    font-size: 2.5rem;
    margin-bottom: 15px;
    display: block;
}

.eservice-item .eservice-icon-img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    margin: 0 auto 10px;
    display: block;
    border-radius: 8px;
}

.eservice-item span {
    font-weight: 600;
    font-size: 1rem;
}

/* ==================== Gallery Section ==================== */
.gallery-section {
    padding: 80px 0;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--s-gap);
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--s-rounded-1);
    box-shadow: var(--s-shadow-1);
}

.gallery-item-inner {
    position: relative;
    padding-top: 70%;
}

.gallery-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* ==================== Sponsors Section (ระบบร่วม) ==================== */
.sponsors-section {
    padding: 40px 0;
    background: var(--s-bg-2, #f8fafc);
    overflow: hidden;
}

.sponsors-slider {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 25px;
}

.sponsor-item {
    flex-shrink: 0;
    background: #ffffff;
    border-radius: 12px;
    padding: 14px 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.sponsor-item a {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.sponsor-item img {
    height: 60px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    filter: none !important;
    -webkit-filter: none !important;
    opacity: 1 !important;
    transition: transform 0.3s ease;
}

.sponsor-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
    border-color: rgba(99, 102, 241, 0.3);
}

.sponsor-item:hover img {
    transform: scale(1.05);
    filter: none !important;
    -webkit-filter: none !important;
    opacity: 1 !important;
}

/* ==================== Footer ==================== */
.site-footer {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    padding: 60px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer-widget h4,
.footer-widget-title {
    color: white;
    font-size: 1.25rem;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 12px;
}

.footer-widget h4::after,
.footer-widget-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--s-color-5);
}

.footer-contact-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-contact-list li {
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.85) !important;
}

.footer-contact-list li .label {
    color: var(--s-color-5);
    font-weight: 600;
}

.footer-widget p,
.footer-widget li {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    line-height: 1.8;
}

.footer-widget a {
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
}

.footer-widget a:hover {
    color: var(--s-color-5);
}

.footer-widget ul {
    list-style: none;
    padding: 0;
}

.footer-widget ul li {
    padding: 5px 0;
}

.footer-social {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.footer-social a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.footer-social a:hover {
    background: var(--s-color-5);
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 30px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
}

@media (max-width: 1023px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .section {
        padding: 50px 0;
    }

    .section-title {
        font-size: 1.5rem;
    }
}

/* ==================== Buttons ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--s-rounded-1);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--s-color-1), var(--s-color-2));
    color: white;
    box-shadow: 0 4px 15px rgba(35, 91, 149, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(35, 91, 149, 0.4);
    color: white;
}

.btn-accent {
    background: linear-gradient(135deg, var(--s-color-5), var(--s-color-6));
    color: white;
}

.btn-accent:hover {
    transform: translateY(-2px);
    color: white;
}

.btn-outline {
    background: transparent;
    color: var(--s-color-1);
    border: 2px solid var(--s-color-1);
}

.btn-outline:hover {
    background: var(--s-color-1);
    color: white;
}

/* ==================== Utilities ==================== */
.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: 10px;
}

.mt-2 {
    margin-top: 20px;
}

.mt-3 {
    margin-top: 30px;
}

.mt-4 {
    margin-top: 40px;
}

.mb-1 {
    margin-bottom: 10px;
}

.mb-2 {
    margin-bottom: 20px;
}

.mb-3 {
    margin-bottom: 30px;
}

.mb-4 {
    margin-bottom: 40px;
}

/* ==================== Skip Link ==================== */
.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.skip-link:focus {
    position: fixed;
    left: 10px;
    top: 10px;
    width: auto;
    height: auto;
    padding: 15px 25px;
    background: var(--s-color-1);
    color: white;
    z-index: 9999;
    border-radius: var(--s-rounded-1);
}

.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

/* ==================== Page Header ==================== */
.page-header {
    background: linear-gradient(135deg, var(--s-color-1), var(--s-color-2));
    padding: 70px 0 35px;
    margin-top: var(--s-head-height);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.page-title {
    color: white;
    font-size: 2.2rem;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    position: relative;
    z-index: 1;
}

.breadcrumb a {
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: white;
}

.breadcrumb .separator {
    opacity: 0.6;
    font-size: 0.75rem;
}

@media (min-width: 1024px) {
    .page-header {
        max-width: calc(var(--s-container-width) - 2 * var(--s-gap));
        margin-left: auto;
        margin-right: auto;
        margin-top: calc(var(--s-head-height) + 20px);
        margin-bottom: 20px;
        border-radius: var(--s-rounded-2, 16px);
        padding: 40px 24px 28px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    }

    .page-header .s-container {
        max-width: 100%;
        padding: 0;
    }
}

@media (max-width: 768px) {
    .page-header {
        padding: 20px 15px 16px;
    }
    .page-title {
        font-size: 1.45rem;
        margin-bottom: 6px;
        line-height: 1.25;
    }
    .breadcrumb {
        font-size: 0.82rem;
        gap: 6px;
    }
}

@media (max-width: 480px) {
    .page-header {
        padding: 16px 12px 14px;
    }
    .page-title {
        font-size: 1.3rem;
        margin-bottom: 4px;
    }
    .breadcrumb {
        font-size: 0.78rem;
        gap: 5px;
    }
}

/* ==================== Category Filter ==================== */
.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 40px;
    justify-content: center;
}

.filter-btn {
    padding: 10px 20px;
    border-radius: 30px;
    background: var(--s-bg-2);
    color: var(--s-text-1);
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.filter-btn:hover {
    background: var(--s-color-1);
    color: white;
}

.filter-btn.active {
    background: var(--s-color-1);
    color: white;
    box-shadow: 0 4px 15px rgba(35, 91, 149, 0.3);
}

/* ==================== News Grid ==================== */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.news-card {
    background: var(--s-bg-1);
    border-radius: var(--s-rounded-2);
    overflow: hidden;
    box-shadow: var(--s-shadow-1);
    transition: all 0.3s ease;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--s-shadow-2);
}

.news-image {
    position: relative;
    aspect-ratio: 210 / 297;
    overflow: hidden;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-card:hover .news-image img {
    transform: scale(1.05);
}

.news-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--s-bg-2);
    color: var(--s-text-2);
    font-size: 3rem;
}

.news-content {
    padding: 20px;
}

.news-category {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    margin-bottom: 10px;
}

.news-title {
    font-size: 1.1rem;
    line-height: 1.4;
    margin-bottom: 10px;
}

.news-title a {
    color: var(--s-text-1);
}

.news-title a:hover {
    color: var(--s-color-1);
}

.news-excerpt {
    color: var(--s-text-2);
    font-size: 0.9rem;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-meta {
    display: flex;
    gap: 15px;
    color: var(--s-text-2);
    font-size: 0.85rem;
}

.news-meta i {
    margin-right: 5px;
    opacity: 0.7;
}

/* ==================== News Single ==================== */
.news-single-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
}

.news-single-header {
    margin-bottom: 30px;
}

.news-single-title {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--s-text-1);
}

.news-single-meta {
    display: flex;
    gap: 20px;
    color: var(--s-text-2);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.news-single-image {
    margin-bottom: 30px;
    border-radius: var(--s-rounded-2);
    overflow: hidden;
}

.news-single-image img {
    width: 100%;
    height: auto;
}

.news-single-excerpt {
    background: var(--s-bg-2);
    padding: 20px;
    border-radius: var(--s-rounded-1);
    margin-bottom: 30px;
    font-style: italic;
    color: var(--s-text-2);
    border-left: 4px solid var(--s-color-1);
}

.news-single-content {
    font-size: 1.05rem;
    line-height: 1.8;
}

.news-single-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--s-rounded-1);
    margin: 20px 0;
}

.news-single-content h2,
.news-single-content h3,
.news-single-content h4 {
    margin-top: 30px;
}

.news-share {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid var(--s-border-1);
}

.share-label {
    font-weight: 600;
}

.share-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
    transition: all 0.3s ease;
}

.share-btn.facebook {
    background: #3b5998;
}

.share-btn.twitter {
    background: #1da1f2;
}

.share-btn.line {
    background: #00c300;
}

.share-btn:hover {
    transform: translateY(-3px);
    color: white;
}

.news-navigation {
    margin-top: 30px;
}

/* Sidebar */
.sidebar-widget {
    background: var(--s-bg-1);
    border-radius: var(--s-rounded-2);
    padding: 25px;
    box-shadow: var(--s-shadow-1);
}

.widget-title {
    font-size: 1.2rem;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--s-color-1);
}

.related-news-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.related-news-item {
    display: flex;
    gap: 15px;
    padding: 10px;
    border-radius: var(--s-rounded-1);
    transition: background 0.3s ease;
}

.related-news-item:hover {
    background: var(--s-bg-2);
}

.related-image {
    width: 80px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-content h4 {
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 5px;
    color: var(--s-text-1);
}

.related-date {
    font-size: 0.8rem;
    color: var(--s-text-2);
}

@media (max-width: 1023px) {
    .news-single-layout {
        grid-template-columns: 1fr;
    }

    .news-single-sidebar {
        order: -1;
    }
}

/* ==================== Gallery Page ==================== */
.gallery-page-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.gallery-item {
    background: var(--s-bg-1);
    border-radius: var(--s-rounded-1);
    overflow: hidden;
    box-shadow: var(--s-shadow-1);
}

.gallery-item-inner {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(35, 91, 149, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-overlay i {
    color: white;
    font-size: 2rem;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-caption {
    padding: 12px 15px;
    font-size: 0.9rem;
    color: var(--s-text-1);
    text-align: center;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 20px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: white;
    cursor: pointer;
    transition: color 0.3s;
}

.lightbox-close:hover {
    color: var(--s-color-5);
}

.lightbox-content {
    max-width: 90%;
    max-height: 80vh;
    border-radius: var(--s-rounded-1);
}

#lightbox-caption {
    color: white;
    margin-top: 15px;
    font-size: 1.1rem;
    text-align: center;
}

/* ==================== Contact Page ==================== */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
    margin-bottom: 50px;
}

.contact-card {
    background: var(--s-bg-1);
    border-radius: var(--s-rounded-2);
    padding: 30px;
    box-shadow: var(--s-shadow-1);
    height: 100%;
}

.contact-card h2 {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.5rem;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--s-bg-2);
}

.contact-card h2 i {
    color: var(--s-color-1);
}

.contact-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.contact-form .form-group {
    margin-bottom: 20px;
}

.contact-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.contact-form .required {
    color: var(--s-color-6);
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--s-border-2);
    border-radius: var(--s-rounded-1);
    font-size: 1rem;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--s-color-1);
}

.contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

.btn-lg {
    padding: 15px 35px;
    font-size: 1.1rem;
}

.contact-info-list {
    list-style: none;
}

.contact-info-list li {
    display: flex;
    gap: 20px;
    padding: 15px 0;
    border-bottom: 1px solid var(--s-border-2);
}

.contact-info-list li:last-child {
    border-bottom: none;
}

.contact-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--s-color-1), var(--s-color-2));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.contact-detail strong {
    display: block;
    margin-bottom: 5px;
    color: var(--s-text-1);
}

.contact-detail p {
    color: var(--s-text-2);
    margin: 0;
}

.contact-detail a {
    color: var(--s-color-1);
}

.contact-social {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--s-border-2);
}

.contact-social h3 {
    font-size: 1rem;
    margin-bottom: 15px;
}

.social-links {
    display: flex;
    gap: 10px;
}

.social-link {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.social-link.facebook {
    background: #3b5998;
}

.social-link.line {
    background: #00c300;
}

.social-link.youtube {
    background: #ff0000;
}

.social-link:hover {
    transform: translateY(-3px);
    color: white;
}

.contact-map {
    border-radius: var(--s-rounded-2);
    overflow: hidden;
    box-shadow: var(--s-shadow-1);
}

.contact-map iframe {
    width: 100%;
    height: 400px;
    border: none;
}

@media (max-width: 1023px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .contact-form .form-row {
        grid-template-columns: 1fr;
    }
}

/* ==================== About Page ==================== */
.about-intro {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.about-intro h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--s-color-1);
}

.about-intro .lead {
    font-size: 1.15rem;
    color: var(--s-text-2);
    line-height: 1.8;
}

.director-section {
    padding: 80px 0;
}

.director-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 50px;
    align-items: center;
}

.director-image-wrapper {
    text-align: center;
}

.director-photo {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.director-placeholder {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 5px solid rgba(255, 255, 255, 0.3);
    margin: 0 auto;
}

.director-placeholder i {
    font-size: 5rem;
    color: rgba(255, 255, 255, 0.7);
}

.director-content h2 {
    margin-bottom: 20px;
}

.director-content blockquote {
    font-size: 1.2rem;
    font-style: italic;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 25px;
    padding-left: 30px;
    border-left: 4px solid rgba(255, 255, 255, 0.5);
}

.director-info strong {
    font-size: 1.2rem;
    display: block;
    margin-bottom: 5px;
}

.vision-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.vision-card {
    background: var(--s-bg-1);
    border-radius: var(--s-rounded-2);
    padding: 40px 30px;
    text-align: center;
    box-shadow: var(--s-shadow-1);
    transition: all 0.3s ease;
}

.vision-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--s-shadow-2);
}

.vision-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--s-color-1), var(--s-color-2));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.vision-icon i {
    font-size: 2rem;
    color: white;
}

.vision-card h3 {
    margin-bottom: 15px;
    color: var(--s-color-1);
}

.vision-card p {
    color: var(--s-text-2);
    line-height: 1.7;
}

.about-stats {
    background: var(--s-bg-2);
}

.cta-section {
    padding: 60px 0;
}

.cta-section h2 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.cta-section p {
    color: var(--s-text-2);
    margin-bottom: 25px;
}

@media (max-width: 1023px) {
    .director-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .director-content blockquote {
        padding-left: 0;
        border-left: none;
        border-top: 4px solid rgba(255, 255, 255, 0.5);
        padding-top: 20px;
    }

    .vision-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== Dynamic Page ==================== */
.page-content-section {
    padding-bottom: 80px;
}

.page-content {
    max-width: 900px;
    margin: 0 auto;
}

.page-featured-image {
    margin-bottom: 30px;
    border-radius: var(--s-rounded-2);
    overflow: hidden;
}

.page-featured-image img {
    width: 100%;
    height: auto;
}

.content-body {
    font-size: 1.05rem;
    line-height: 1.9;
}

.content-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--s-rounded-1);
    margin: 25px 0;
}

.content-body h2 {
    margin-top: 40px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--s-bg-2);
}

.content-body ul,
.content-body ol {
    margin: 20px 0;
    padding-left: 30px;
}

.content-body li {
    list-style: disc;
    margin-bottom: 10px;
}

.content-body ol li {
    list-style: decimal;
}

/* ==================== Empty State ==================== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--s-text-2);
}

.empty-state i {
    font-size: 4rem;
    opacity: 0.3;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--s-text-1);
}

.empty-state p {
    margin-bottom: 25px;
}

/* ==================== Alerts ==================== */
.alert {
    padding: 15px 20px;
    border-radius: var(--s-rounded-1);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ==================== Pagination ==================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 50px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    background: var(--s-bg-1);
    border: 2px solid var(--s-border-2);
    border-radius: var(--s-rounded-1);
    color: var(--s-text-1);
    font-weight: 500;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background: var(--s-color-1);
    color: white;
    border-color: var(--s-color-1);
}

.pagination .current {
    background: var(--s-color-1);
    color: white;
    border-color: var(--s-color-1);
}

.pagination .disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========================================================
   HOMEPAGE 2-COLUMN LAYOUT & COMPONENTS (Wireframe 2)
   ======================================================== */

.homepage-layout-wrapper {
    padding: 24px 0 60px 0;
    background: #f8fafc;
}

.homepage-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 28px;
    align-items: start;
}

.main-content-column {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.sidebar-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: calc(var(--s-head-height, 145px) + 20px);
}

/* Unified Section Card */
.section-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--s-border-2, #e2e8f0);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.section-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

/* Card Header */
.section-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f1f5f9;
    flex-wrap: wrap;
}

.header-title-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--s-color-1, #1e3a8a), var(--s-color-2, #3b82f6));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.section-card-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 2px 0;
    line-height: 1.3;
}

.section-card-subtitle {
    font-size: 0.88rem;
    color: #64748b;
    margin: 0;
}

.view-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #f1f5f9;
    color: var(--s-color-1, #1e3a8a) !important;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
}

.view-all-btn:hover {
    background: var(--s-color-1, #1e3a8a);
    color: #ffffff !important;
    transform: translateX(2px);
}

/* ==================== 1. Sliders (Main Banner & Hero Slider) ==================== */
.slider-section {
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
}

.main-slider,
.hero-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    background: #0f172a;
}

.main-slider .slider-wrapper,
.hero-slider .slider-wrapper {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    width: 100%;
    align-items: center;
}

.main-slider .slide,
.hero-slider .slide {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    flex-shrink: 0;
    display: block;
    position: relative;
}

.main-slider .slide a,
.hero-slider .slide a {
    display: block;
    width: 100%;
    height: auto;
}

.main-slider .slide img,
.hero-slider .slide img {
    width: 100%;
    height: auto;
    max-height: 480px;
    object-fit: contain;
    display: block;
}

.main-slider .slide-placeholder,
.hero-slider .slide-placeholder {
    width: 100%;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    padding: 35px 24px 45px 24px;
    box-sizing: border-box;
    text-align: center;
    border-radius: 16px;
}

.main-slider .slide-placeholder .placeholder-content,
.hero-slider .slide-placeholder .placeholder-content {
    max-width: 90%;
    margin: auto;
}

.main-slider .slide-placeholder i,
.hero-slider .slide-placeholder i {
    font-size: 3.2rem;
    margin-bottom: 0.85rem;
    display: inline-block;
    opacity: 0.95;
    line-height: 1;
}

.main-slider .slide-placeholder h2,
.hero-slider .slide-placeholder h2 {
    font-size: 1.85rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: #ffffff;
    line-height: 1.3;
}

.main-slider .slide-placeholder p,
.hero-slider .slide-placeholder p {
    font-size: 1.05rem;
    margin: 0;
    opacity: 0.92;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .main-slider,
    .hero-slider {
        border-radius: 12px;
    }

    .main-slider .slide img,
    .hero-slider .slide img {
        width: 100%;
        height: auto;
        min-height: unset;
        max-height: none;
        object-fit: contain;
        display: block;
    }

    .main-slider .slide-placeholder,
    .hero-slider .slide-placeholder {
        min-height: 180px;
        padding: 20px 16px 36px 16px;
    }
    .main-slider .slide-placeholder i,
    .hero-slider .slide-placeholder i {
        font-size: 2rem;
        margin-bottom: 0.4rem;
    }
    .main-slider .slide-placeholder h2,
    .hero-slider .slide-placeholder h2 {
        font-size: 1.15rem;
    }
    .main-slider .slide-placeholder p,
    .hero-slider .slide-placeholder p {
        font-size: 0.85rem;
    }
}

.main-slider .slider-arrow,
.hero-slider .slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #1e293b;
    transition: all 0.3s ease;
    z-index: 10;
    opacity: 0.8;
}

.main-slider:hover .slider-arrow,
.hero-slider:hover .slider-arrow {
    opacity: 1;
}

.main-slider .slider-arrow:hover,
.hero-slider .slider-arrow:hover {
    background: var(--s-color-1, #1e3a8a);
    color: #ffffff;
    transform: translateY(-50%) scale(1.1);
}

.main-slider .slider-prev,
.hero-slider .slider-prev { left: 16px; }

.main-slider .slider-next,
.hero-slider .slider-next { right: 16px; }

.main-slider .slider-dots,
.hero-slider .slider-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.main-slider .slider-dot,
.hero-slider .slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.main-slider .slider-dot.active,
.hero-slider .slider-dot.active {
    background: #ffffff;
    width: 24px;
    border-radius: 12px;
}

/* ==================== 2. New Books Section (A4 Portrait) ==================== */
.new-books-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.new-book-card {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #fed7aa;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.35s ease;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.06);
    position: relative;
}

.new-book-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 25px rgba(245, 158, 11, 0.15);
    border-color: #f59e0b;
}

.new-book-cover-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 210 / 297; /* A4 Portrait แนวตั้ง */
    overflow: hidden;
    background: #fffbeb;
}

.new-book-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.new-book-card:hover .new-book-cover-img {
    transform: scale(1.05);
}

.new-book-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    text-align: center;
    color: #ffffff;
}

.new-book-cover-placeholder i {
    font-size: 2.5rem;
    margin-bottom: 8px;
    opacity: 0.9;
}

.new-book-cover-placeholder span {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.3;
}

.new-book-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
}

.new-book-info {
    padding: 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
    background: #ffffff;
}

.new-book-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 6px 0;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.7em;
}

.new-book-author {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0 0 12px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.new-book-read-btn {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff !important;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.25);
}

.new-book-read-btn:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

/* ==================== 3. E-books Section ==================== */
.ebooks-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.ebook-card {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.35s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.ebook-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
}

.ebook-cover-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #f1f5f9;
}

.ebook-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.ebook-card:hover .ebook-cover-img {
    transform: scale(1.05);
}

.ebook-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    text-align: center;
    color: #ffffff;
}

.ebook-cover-placeholder i {
    font-size: 2.5rem;
    margin-bottom: 8px;
    opacity: 0.9;
}

.ebook-cover-placeholder span {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.3;
}

.ebook-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
}

.ebook-info {
    padding: 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.ebook-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 6px 0;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.7em;
}

.ebook-author {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0 0 12px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ebook-read-btn {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff !important;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.ebook-read-btn:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

/* ==================== 3. News Section (6 Cards) ==================== */
.news-grid-6 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.news-item-card {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.news-item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.news-thumb-box {
    position: relative;
    width: 100%;
    aspect-ratio: 210 / 297;
    overflow: hidden;
    background: #f1f5f9;
}

.news-thumb-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.news-item-card:hover .news-thumb-box img {
    transform: scale(1.06);
}

.news-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--s-color-1, #1e3a8a), var(--s-color-2, #3b82f6));
    color: #ffffff;
    font-size: 2.5rem;
}

.news-cat-pill {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: var(--s-color-1, #1e3a8a);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.news-item-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.news-date-meta {
    font-size: 0.78rem;
    color: #64748b;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.news-item-title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 0;
}

.news-item-title a {
    color: #1e293b;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.news-item-title a:hover {
    color: var(--s-color-1, #1e3a8a);
}

/* ==================== 4. Info A4 Section (8 Cards) ==================== */
.info-a4-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.info-a4-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.info-a4-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.09);
    border-color: #cbd5e1;
}

.info-a4-image-box {
    position: relative;
    width: 100%;
    aspect-ratio: 210 / 297;
    overflow: hidden;
    background: #f8fafc;
}

.info-a4-image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    display: block;
}

.info-a4-card:hover .info-a4-image-box img {
    transform: scale(1.05);
}

.info-placeholder-box {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    gap: 8px;
}

.info-placeholder-box i {
    font-size: 2.2rem;
    opacity: 0.9;
}

.info-a4-tag {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
}

.info-a4-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    opacity: 0;
    transition: opacity 0.3s ease;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
}

.info-a4-card:hover .info-a4-overlay {
    opacity: 1;
}

.info-a4-overlay i {
    font-size: 1.5rem;
}

.info-a4-title {
    padding: 10px 12px;
    text-align: center;
    border-top: 1px solid #f1f5f9;
    background: #ffffff;
}

.info-a4-title h5 {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==================== 5. Facebook Page Embed ==================== */
.facebook-embed-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
    background: transparent;
    padding: 10px 0;
    text-align: center;
}

.facebook-embed-container iframe {
    width: 500px;
    max-width: 100%;
    margin: 0 auto;
    display: block;
}

/* ==================== 6. Map Section ==================== */
.map-content-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 20px;
    align-items: stretch;
}

.map-embed-wrapper {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.map-info-details {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.info-detail-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.icon-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: var(--s-color-1, #1e3a8a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.info-detail-item strong {
    display: block;
    font-size: 0.88rem;
    color: #1e293b;
    margin-bottom: 2px;
}

.info-detail-item p {
    font-size: 0.84rem;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
}

.info-detail-item p a {
    color: var(--s-color-1, #1e3a8a);
    font-weight: 600;
}

.directions-btn {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #ea4335, #c5221f);
    color: #ffffff !important;
    border-radius: 10px;
    padding: 10px 18px;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(234, 67, 53, 0.25);
    transition: all 0.3s ease;
}

.directions-btn:hover {
    background: linear-gradient(135deg, #c5221f, #991b1b);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(234, 67, 53, 0.35);
}

/* ==================== PERSONNEL & SIDEBAR COMPONENTS ==================== */

.personnel-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

/* Personnel Cards */
.personnel-card {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    transition: all 0.3s ease;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.personnel-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
}

.personnel-card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(217, 119, 6, 0.3);
    z-index: 2;
}

.personnel-card-badge.staff-badge {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    box-shadow: 0 2px 6px rgba(29, 78, 216, 0.3);
}

.personnel-image-box {
    width: 130px;
    height: 155px;
    border-radius: 14px;
    overflow: hidden;
    background: #f1f5f9;
    border: 3px solid #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    margin-top: 6px;
}

.personnel-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.personnel-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    color: #ffffff;
}

.personnel-img-placeholder.director-ph {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
}

.personnel-img-placeholder.staff-ph {
    background: linear-gradient(135deg, #059669, #10b981);
}

.personnel-info-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    flex: 1;
}

.personnel-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin: 4px 0 2px 0;
    line-height: 1.35;
    text-align: center;
}

.personnel-position {
    font-size: 0.82rem;
    color: #64748b;
    margin: 0 0 12px 0;
    line-height: 1.35;
    text-align: center;
}

.personnel-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    color: #ffffff !important;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    min-width: 42px;
    font-size: 1.05rem;
    text-decoration: none;
    margin-top: auto;
    box-shadow: 0 3px 10px rgba(30, 58, 138, 0.25);
    transition: all 0.3s ease;
}

.personnel-btn:hover {
    background: linear-gradient(135deg, #1e40af, #2563eb);
    transform: translateY(-2px) scale(1.08);
    box-shadow: 0 6px 16px rgba(30, 58, 138, 0.35);
}

.personnel-btn.staff-btn {
    background: linear-gradient(135deg, #059669, #10b981);
    box-shadow: 0 3px 10px rgba(5, 150, 105, 0.25);
}

.personnel-btn.staff-btn:hover {
    background: linear-gradient(135deg, #047857, #059669);
    box-shadow: 0 6px 16px rgba(5, 150, 105, 0.35);
}

/* Sidebar Links Card */
.sidebar-links-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.sidebar-links-header {
    background: linear-gradient(135deg, var(--s-color-1, #1e3a8a), var(--s-color-2, #3b82f6));
    color: #ffffff;
    padding: 16px 20px;
    font-weight: 700;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-links-list {
    list-style: none;
    margin: 0;
    padding: 8px 16px;
}

.sidebar-links-list li {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #f1f5f9;
}

.sidebar-links-list li:last-child {
    border-bottom: none;
}

.sidebar-links-list li a {
    display: flex;
    align-items: center;
    padding: 12px 6px;
    color: #334155;
    font-weight: 500;
    font-size: 0.92rem;
    transition: all 0.25s ease;
}

.sidebar-links-list li a:hover {
    color: var(--s-color-1, #1e3a8a);
    padding-left: 12px;
}

.sidebar-links-list .link-icon {
    color: var(--s-color-1, #1e3a8a);
    font-size: 0.85rem;
    margin-right: 12px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-links-list .arrow-toggle {
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform 0.3s ease;
    opacity: 0.6;
}

.sidebar-sub-menu {
    display: none;
    list-style: none;
    padding-left: 20px;
    background: #f8fafc;
    border-radius: 8px;
    margin: 4px 0 10px 0;
}

.sidebar-sub-menu li {
    border-bottom: none;
}

.sidebar-sub-menu li a {
    padding: 8px 6px;
    font-size: 0.85rem;
    color: #475569;
}

.empty-box {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
}

.empty-box i {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-box p {
    margin: 0;
    font-size: 0.95rem;
}

/* ========================================================
   COMPREHENSIVE RESPONSIVE DESIGN (All Screen Sizes)
   ======================================================== */

@media (max-width: 1200px) {
    .new-books-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .ebooks-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .info-a4-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1023px) {
    .homepage-grid {
        display: flex;
        flex-direction: column;
        gap: 24px;
    }

    .main-content-column {
        display: contents;
    }

    .sidebar-column {
        display: contents;
    }

    /* Responsive layout order:
       1. Hero Slider (Main Slider is at the very top)
       2. Director & Staff Cards (Personnel) - อยู่ล่าง main และ hero slider ทันที
       3. E-books
       4. News & Activities
       5. Infographics (Info A4)
       6. Facebook Page
       7. Google Maps & Contact
       8. Related Links
    */
    #heroSliderSection {
        order: 1;
    }

    #personnelGroup {
        order: 2;
        display: flex;
        flex-direction: column;
        gap: 18px;
        width: 100%;
        max-width: 540px;
        margin: 0 auto;
    }

    #newBooksSection {
        order: 3;
    }

    #ebooksSection {
        order: 4;
    }

    #newsSection {
        order: 5;
    }

    #infoA4Section {
        order: 6;
    }

    #mapSection {
        order: 7;
    }

    #pageSection,
    .page-embed-section,
    .facebook-section {
        order: 8;
    }

    .sidebar-links-card {
        order: 9;
        width: 100%;
    }

    .news-grid-6 {
        grid-template-columns: repeat(2, 1fr);
    }

    .map-content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .homepage-layout-wrapper {
        padding: 16px 0 40px 0;
    }

    .section-card {
        padding: 18px 14px;
        border-radius: 14px;
    }

    .section-card-title {
        font-size: 1.15rem;
    }

    .section-card-subtitle {
        font-size: 0.8rem;
    }

    .header-icon {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
    }

    #personnelGroup {
        gap: 16px;
        max-width: 100%;
    }

    .personnel-card {
        padding: 22px 18px 18px 18px;
        border-radius: 16px;
        height: auto;
    }

    .personnel-image-box {
        width: 125px;
        height: 150px;
    }

    .personnel-name {
        font-size: 1.05rem;
        min-height: unset;
        line-height: 1.35;
    }

    .personnel-position {
        font-size: 0.84rem;
        min-height: unset;
        line-height: 1.35;
    }

    .personnel-btn {
        width: 42px;
        height: 42px;
        min-width: 42px;
        max-width: 42px;
        min-height: 42px;
        max-height: 42px;
        border-radius: 50%;
        padding: 0;
        font-size: 1.05rem;
    }

    .new-books-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .ebooks-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .news-grid-6 {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .info-a4-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .news-grid-6 {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .news-item-body {
        padding: 10px 8px;
    }

    .news-item-title {
        font-size: 0.82rem;
    }

    #personnelGroup {
        gap: 14px;
    }

    .personnel-card {
        padding: 20px 16px 16px 16px;
    }

    .personnel-image-box {
        width: 120px;
        height: 145px;
    }

    .personnel-name {
        font-size: 1rem;
        min-height: unset;
        line-height: 1.35;
    }

    .personnel-position {
        font-size: 0.82rem;
        min-height: unset;
        line-height: 1.35;
        margin-bottom: 8px;
    }

    .personnel-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        max-width: 40px;
        min-height: 40px;
        max-height: 40px;
        border-radius: 50%;
        padding: 0;
        font-size: 1rem;
    }

    .section-card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .view-all-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================================================
   KSW SUBDISTRICTS (5 แขวง) - SWITCHER, DROPDOWN & PORTAL STYLES
   ========================================================================== */

/* 2. Desktop Navbar Dropdown Menu */
.subdistrict-menu-item {
    position: relative;
    flex-shrink: 0;
    margin-left: 2px;
}

.subdistrict-menu-item > a {
    background: rgba(254, 240, 138, 0.12) !important;
    border: 1px solid rgba(254, 240, 138, 0.25) !important;
    border-radius: 6px !important;
    padding: 4px 8px !important;
    height: auto !important;
    margin: auto 0 !important;
    font-size: 0.77rem !important;
    font-weight: 600 !important;
    color: #fef08a !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
}

.subdistrict-menu-item > a:hover,
.subdistrict-menu-item:hover > a {
    background: rgba(254, 240, 138, 0.22) !important;
    border-color: rgba(254, 240, 138, 0.5) !important;
    color: #ffffff !important;
}

.subdistrict-menu-item > a i {
    color: #fef08a !important;
    margin-right: 0 !important;
    font-size: 0.85em;
}

.subdistrict-menu-item .i-down {
    color: #fef08a !important;
    margin-left: 1px !important;
    margin-right: 0 !important;
}

.subdistrict-sub-menu {
    min-width: 270px !important;
    right: 0 !important;
    left: auto !important;
    background: #0f172a !important; /* premium dark slate background */
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.35) !important;
    padding: 6px 0 !important;
}

.subdistrict-sub-menu::before {
    left: auto !important;
    right: 25px !important;
    border-bottom-color: #0f172a !important;
}

.subdistrict-sub-menu a {
    padding: 10px 16px !important;
    font-size: 0.84rem !important;
    color: #cbd5e1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    transition: all 0.2s ease;
}

.subdistrict-sub-menu a:hover {
    background: rgba(59, 130, 246, 0.2) !important;
    color: #ffffff !important;
    padding-left: 20px !important;
}

.subdistrict-sub-menu li.current-menu-item a {
    background: rgba(37, 99, 235, 0.35) !important;
    color: #93c5fd !important;
    font-weight: 600;
}

/* 3. Mobile Drawer Subdistrict Cards */
.mobile-subdistrict-drawer {
    padding: 14px 14px 10px;
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.drawer-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #93c5fd;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mobile-subdistrict-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mobile-sub-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: #e2e8f0;
    text-decoration: none;
    transition: all 0.2s ease;
}

.mobile-sub-card:hover,
.mobile-sub-card:active {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.mobile-sub-card.active {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.4), rgba(29, 78, 216, 0.55));
    border-color: #3b82f6;
    color: #ffffff;
}

.mobile-sub-card .card-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    color: #93c5fd;
    flex-shrink: 0;
}

.mobile-sub-card.active .card-icon {
    background: #2563eb;
    color: #ffffff;
}

.mobile-sub-card .card-info {
    flex: 1;
    min-width: 0;
}

.mobile-sub-card .card-name {
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-sub-card .card-badge {
    font-size: 0.67rem;
    color: #94a3b8;
}

.mobile-sub-card.active .card-badge {
    color: #4ade80;
    font-weight: 600;
}

.mobile-sub-card .card-check {
    color: #4ade80;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.mobile-sub-card .card-arrow {
    color: #64748b;
    font-size: 0.72rem;
    flex-shrink: 0;
}

