/* ====================================================
       DESIGN SYSTEM — ทันสมัย สบายตา
    ==================================================== */
    *, *::before, *::after {
        box-sizing: border-box;  /* ป้องกัน element ล้นออกนอกขอบ */
    }
    html, body {
        overflow-x: hidden;      /* ป้องกันหน้าจอ zoom out เมื่อมีเนื้อหาเกิน */
        max-width: 100vw;
    }
    /* รูปภาพทุกตัวต้องไม่กว้างเกิน container */
    img, video, embed, object {
        max-width: 100%;
        height: auto;
    }
    /* iframe อนุญาตให้กำหนด height ได้เอง (เช่น Google Calendar) */
    iframe { max-width: 100%; }
    :root {
        --navy:      #1e3a5f;
        --navy2:     #2d5f8a;
        --teal:      #0e9488;
        --teal2:     #14b8a6;
        --amber:     #f59e0b;
        --amberl:    #fcd34d;
        --bg:        #f1f5f9;
        --white:     #ffffff;
        --surface:   #f8fafc;
        --border:    #e2e8f0;
        --text:      #1e293b;
        --muted:     #64748b;
        --r:         14px;
        --rpill:     50px;
        --ease:      .3s cubic-bezier(.4,0,.2,1);
        --sh1:       0 2px 10px rgba(30,58,95,.08);
        --sh2:       0 8px 28px rgba(30,58,95,.13);
        --sh3:       0 20px 56px rgba(30,58,95,.20);
    }
    *, *::before, *::after { box-sizing: border-box; }
    html { scroll-behavior: smooth; }
    body {
        font-family: 'Sarabun', sans-serif;
        background: var(--bg);
        color: var(--text);
        overflow-x: hidden;
        line-height: 1.65;
    }

    /* ---- Scroll-reveal (เริ่มแสดงทันที จะ fade-in เป็น bonus) ---- */
    .reveal {
        opacity: 0;
        transform: translateY(26px);
        transition: opacity .65s ease, transform .65s ease;
    }
    .reveal.in { opacity: 1; transform: translateY(0); }

    /* ====================================================
       HEADER — วิดีโอ Hero
       overlay อยู่ ในSIDE jarallax div เพื่อให้ z-index ทำงานถูก
    ==================================================== */
    header {
        /* ไม่ใส่ position / overflow / height — ให้ embed-responsive กำหนดเอง */
        background: #1e3a5f;  /* fallback ถ้าวิดีโอไม่โหลด */
    }
    /* jarallax div เป็น stacking context ของตัวเอง */
    .hero-overlay {
        position: absolute;   /* relative to .jarallax (embed-responsive) */
        inset: 0;
        z-index: 2;           /* เหนือ jarallax-container (z-index:-100) */
        background: linear-gradient(
            165deg,
            rgba(15,28,50,.88) 0%,
            rgba(30,58,95,.62) 55%,
            rgba(14,148,136,.22) 100%
        );
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 80px 20px 60px;
        pointer-events: none;  /* ให้ลิงก์/ปุ่มด้านในคลิกได้ */
    }
    .hero-overlay > * { pointer-events: auto; }
    .hero-badge {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: rgba(255,255,255,.12);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255,255,255,.22);
        color: var(--amberl);
        font-size: .72rem;
        font-weight: 700;
        letter-spacing: 2.5px;
        text-transform: uppercase;
        padding: 5px 18px;
        border-radius: var(--rpill);
        margin-bottom: 16px;
        animation: fadeUp .9s ease both;
    }
    .hero-title {
        color: #fff;
        font-size: clamp(1.5rem, 3.8vw, 2.8rem);
        font-weight: 700;
        line-height: 1.30;
        margin-bottom: 8px;
        text-shadow: 0 2px 20px rgba(0,0,0,.40);
        letter-spacing: -.01em;
        animation: fadeUp .9s .1s ease both;
    }
    .hero-sub {
        color: rgba(255,255,255,.75);
        font-size: clamp(.88rem, 1.6vw, 1.05rem);
        margin-bottom: 28px;
        animation: fadeUp .9s .2s ease both;
    }
    .hero-cta {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        background: var(--teal);
        color: #fff !important;
        font-size: .88rem;
        font-weight: 700;
        padding: 11px 28px;
        border-radius: var(--rpill);
        text-decoration: none !important;
        box-shadow: 0 4px 18px rgba(14,148,136,.45);
        transition: var(--ease);
        animation: fadeUp .9s .3s ease both;
    }
    .hero-cta:hover {
        background: var(--teal2);
        transform: translateY(-2px);
        box-shadow: 0 8px 28px rgba(14,148,136,.55);
        color: #fff !important;
    }

    /* ปรัชญา + วิสัยทัศน์ */
    .hero-philosophy,
    .hero-vision {
        margin-bottom: 18px;
        animation: fadeUp .9s ease both;
    }
    .hero-philosophy { animation-delay: .1s; }
    .hero-vision     { animation-delay: .22s; }

    .hero-label {
        display: inline-block;
        background: rgba(255,255,255,.18);
        backdrop-filter: blur(8px);
        border: 1px solid rgba(255,255,255,.28);
        color: var(--amberl);
        font-size: .68rem;
        font-weight: 800;
        letter-spacing: 2px;
        text-transform: uppercase;
        padding: 3px 14px;
        border-radius: var(--rpill);
        margin-bottom: 6px;
    }
    .hero-philosophy-text {
        color: rgba(255,255,255,.95);
        font-size: clamp(1rem, 2.2vw, 1.35rem);
        font-weight: 700;
        line-height: 1.45;
        margin: 0 0 4px;
        text-shadow: 0 1px 12px rgba(0,0,0,.35);
    }
    .hero-vision-text {
        color: rgba(255,255,255,.85);
        font-size: clamp(.88rem, 1.7vw, 1.08rem);
        font-weight: 400;
        line-height: 1.65;
        margin: 0 0 22px;
        text-shadow: 0 1px 10px rgba(0,0,0,.30);
    }
    /* เส้นคั่นระหว่างปรัชญากับวิสัยทัศน์ */
    .hero-vision::before {
        content: '';
        display: block;
        width: 48px;
        height: 2px;
        background: rgba(255,255,255,.30);
        margin: 0 auto 14px;
        border-radius: 1px;
    }
    .hero-scroll {
        position: absolute;
        bottom: 22px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 11;
        color: rgba(255,255,255,.5);
        font-size: .72rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 5px;
        animation: pulse 2.5s ease infinite;
        pointer-events: none;
    }
    @keyframes fadeUp {
        from { opacity: 0; transform: translateY(18px); }
        to   { opacity: 1; transform: translateY(0); }
    }
    @keyframes pulse {
        0%,100% { opacity: .5; transform: translateX(-50%) translateY(0); }
        50%     { opacity: .9; transform: translateX(-50%) translateY(7px); }
    }

    /* ====================================================
       QUICK LINKS — CSS Grid auto-fill
    ==================================================== */
    .links-bar {
        background: var(--white);
        padding: clamp(14px, 2.4vw, 24px) clamp(12px, 4vw, 44px);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--sh1);
    }
    /* auto-fill คำนวณจำนวน col อัตโนมัติ ไม่ต้องเขียน breakpoint */
    .links-wrap {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(clamp(116px, 17vw, 176px), 1fr));
        gap: clamp(10px, 1.8vw, 16px);
        max-width: 1180px;
        margin: 0 auto;
    }
    .link-tile {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: clamp(96px, 13vw, 132px);
        aspect-ratio: 1.12 / 1;
        border-radius: 10px;
        border: 1px solid var(--border);
        background: var(--white);
        box-shadow: 0 2px 8px rgba(30,58,95,.08);
        padding: clamp(8px, 1.3vw, 12px);
        overflow: hidden;
        text-decoration: none !important;
        transition: var(--ease);
    }
    .link-tile img {
        max-width: 94%;
        max-height: 84%;
        width: auto;
        height: auto;
        object-fit: contain;
        display: block;
        transition: transform var(--ease), opacity var(--ease);
    }
    .link-tile:hover {
        transform: translateY(-4px);
        box-shadow: var(--sh2);
        border-color: var(--navy2);
    }
    .link-tile:hover img { transform: scale(1.06); opacity: .85; }

    /* ====================================================
       SECTION HEADING
    ==================================================== */
    .sec-head { text-align: center; margin-bottom: 36px; }
    .sec-eyebrow {
        display: inline-block;
        font-size: .68rem;
        font-weight: 800;
        letter-spacing: 3px;
        text-transform: uppercase;
        color: var(--teal);
        background: rgba(14,148,136,.10);
        padding: 4px 14px;
        border-radius: var(--rpill);
        margin-bottom: 10px;
    }
    .sec-head h2 {
        font-size: clamp(1.3rem, 2.5vw, 1.9rem);
        font-weight: 700;
        color: var(--text);
        margin-bottom: 12px;
        letter-spacing: -.02em;
    }
    .sec-line {
        width: 48px; height: 3px;
        border-radius: 2px;
        background: linear-gradient(90deg, var(--teal), var(--amber));
        margin: 0 auto;
    }

    /* ====================================================
       ACTIVITIES
    ==================================================== */
    .activities-sec {
        background: var(--bg);
        padding: 56px 0 40px;
    }
    .act-card {
        background: var(--white);
        border-radius: var(--r);
        box-shadow: var(--sh1);
        overflow: hidden;
        display: flex;
        flex-direction: column;
        height: 100%;
        border: 1px solid var(--border);
        transition: transform var(--ease), box-shadow var(--ease), border-color var(--ease);
    }
    .act-card:hover {
        transform: translateY(-8px);
        box-shadow: var(--sh3);
        border-color: transparent;
    }
    .act-thumb {
        position: relative;
        height: 196px;
        overflow: hidden;
        background: var(--border);
    }
    .act-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transition: transform .6s ease;
    }
    .act-card:hover .act-thumb img { transform: scale(1.07); }
    .act-thumb-overlay {
        position: absolute;
        inset: 0;
        background: linear-gradient(to top, rgba(15,28,50,.60), transparent 55%);
        opacity: 0;
        transition: opacity var(--ease);
    }
    .act-card:hover .act-thumb-overlay { opacity: 1; }
    .act-body { flex: 1; padding: 18px 18px 10px; }
    .act-title {
        font-size: .97rem;
        font-weight: 700;
        color: var(--text);
        line-height: 1.5;
        display: -webkit-box;
        
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin-bottom: 8px;
    }
    .act-text {
        font-size: .84rem;
        color: var(--muted);
        line-height: 1.70;
        display: -webkit-box;
     
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .act-foot { padding: 12px 18px 18px; }
    .btn-read {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        background: linear-gradient(135deg, var(--navy), var(--navy2));
        color: #fff !important;
        font-size: .84rem;
        font-weight: 600;
        padding: 10px 20px;
        border-radius: var(--rpill);
        text-decoration: none !important;
        transition: var(--ease);
    }
    .btn-read i { transition: transform .25s ease; }
    .btn-read:hover {
        background: linear-gradient(135deg, var(--teal), var(--navy2));
        box-shadow: 0 6px 18px rgba(30,58,95,.25);
        color: #fff !important;
    }
    .btn-read:hover i { transform: translateX(4px); }

    .btn-all {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        background: transparent;
        color: var(--navy) !important;
        font-size: .94rem;
        font-weight: 700;
        padding: 12px 34px;
        border-radius: var(--rpill);
        text-decoration: none !important;
        border: 2px solid var(--navy);
        transition: var(--ease);
    }
    .btn-all:hover {
        background: var(--navy);
        color: #fff !important;
        box-shadow: var(--sh2);
        transform: translateY(-2px);
    }

    /* ====================================================
       CALENDAR
    ==================================================== */
    .calendar-sec {
        background: var(--white);
        padding: 52px 0 60px;
    }
    .cal-card {
        border-radius: var(--r);
        box-shadow: var(--sh2);
        overflow: hidden;
        border: 1px solid var(--border);
    }
    .cal-header {
        background: linear-gradient(135deg, var(--navy), var(--teal));
        padding: 16px 24px;
        display: flex;
        align-items: center;
        gap: 12px;
    }
    .cal-header i { color: var(--amberl); font-size: 1.25rem; }
    .cal-header span { color: #fff; font-size: .98rem; font-weight: 700; }
    .cal-body {
        position: relative;
        padding-bottom: 56.25%;
        height: 0;
    }
    .cal-body iframe {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        border: 0;
    }

    /* ====================================================
    RESPONSIVE
    ==================================================== */
    @media (max-width: 768px) {
        .links-wrap { grid-template-columns: repeat(3, minmax(0, 1fr)); }
        .link-tile {
            min-height: 106px;
            aspect-ratio: 1 / .92;
        }
        .link-tile img {
            max-width: 96%;
            max-height: 86%;
        }
        .act-thumb { height: 168px; }
        .hero-overlay { padding: 70px 16px 50px; }
    }
    @media (max-width: 480px) {
        .links-bar { padding: 12px 12px 18px; }
        .links-wrap {
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 12px;
        }
        .link-tile { min-height: 112px; }
        .hero-title { font-size: 1.45rem; }
    }
