/* ═══════════════════════════════════════════════════════════════
   School Website — public stylesheet
   Navy + pink theme, mega-menu, hero, activity cards, pastel sections
   ═══════════════════════════════════════════════════════════════ */
:root {
    --navy: #12285a;
    --navy-900: #0b1b40;
    --navy-700: #1c3a7a;
    --blue: #2f5fd0;
    --sky: #dbeafe;
    --pink: #f2569b;
    --pink-600: #db2f7e;
    --pink-100: #ffe3ef;
    --red: #e11d48;
    --ink: #1e293b;
    --muted: #64748b;
    --line: #e2e8f0;
    --bg: #f6f8fd;
    --card: #ffffff;
    --r-sm: 10px; --r-md: 18px; --r-lg: 28px; --r-full: 999px;
    --shadow: 0 8px 28px rgba(18, 40, 90, .10);
    --shadow-lg: 0 18px 50px rgba(18, 40, 90, .18);
    --font-head: 'Prompt', 'Kanit', sans-serif;
    --font-body: 'Sarabun', 'Prompt', sans-serif;
}
body.contrast-mode { --navy:#000; --navy-900:#000; --navy-700:#111; --pink:#ffea00; --pink-600:#fff; --bg:#000; --card:#111; --ink:#fff; --muted:#ffea00; --line:#ffea00; --sky:#111; --pink-100:#222; background:#000; color:#fff; }
body.contrast-mode h1, body.contrast-mode h2, body.contrast-mode h3, body.contrast-mode h4 { color:#ffea00; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: var(--font-body); color: var(--ink); background: var(--bg); line-height: 1.65; overflow-x: hidden; }
h1, h2, h3, h4, h5 { font-family: var(--font-head); font-weight: 600; color: var(--navy); line-height: 1.3; }
a { color: var(--blue); text-decoration: none; transition: .2s; }
a:hover { color: var(--pink-600); }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }
.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 26px; border-radius: var(--r-full); border: 2px solid transparent; font-family: var(--font-head); font-weight: 500; font-size: .98rem; transition: .25s; }
.btn-pink { background: var(--pink); color: #fff; box-shadow: 0 8px 20px rgba(242,86,155,.35); }
.btn-pink:hover { background: var(--pink-600); color: #fff; transform: translateY(-2px); }
.btn-white { background: #fff; color: var(--navy); }
.btn-white:hover { background: var(--pink-100); color: var(--pink-600); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-700); color: #fff; }
.btn-outline { border-color: var(--navy); color: var(--navy); background: transparent; }
.btn-outline:hover { background: var(--navy); color: #fff; }

/* ═════════ Ticker ═════════ */
.ticker { background: var(--navy-900); color: #fff; font-size: .92rem; }
.ticker-inner { display: flex; align-items: center; gap: 16px; height: 42px; }
.ticker-label { flex-shrink: 0; background: var(--red); padding: 4px 16px; border-radius: var(--r-sm); font-family: var(--font-head); font-weight: 600; font-size: .82rem; display: flex; align-items: center; gap: 6px; }
.ticker-label::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.ticker-track { flex: 1; overflow: hidden; white-space: nowrap; mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent); }
.ticker-move { display: inline-flex; gap: 60px; padding-left: 100%; animation: marquee 38s linear infinite; }
.ticker-track:hover .ticker-move { animation-play-state: paused; }
.ticker-move a { color: #fff; }
.ticker-move a:hover { color: var(--pink); }
@keyframes marquee { to { transform: translateX(-100%); } }

/* ═════════ Hero ═════════ */
.hero { position: relative; min-height: clamp(380px, 62vh, 640px); background: linear-gradient(135deg, #8ec5ff 0%, #c7b8ff 45%, #ffc2de 100%) center/cover no-repeat; display: flex; align-items: flex-start; justify-content: center; padding-top: 28px; overflow: hidden; }
.hero::after { content: ''; position: absolute; inset: auto 0 0 0; height: 40%; background: linear-gradient(transparent, rgba(11,27,64,.35)); }
.hero-card { position: relative; z-index: 2; background: rgba(255,255,255,.95); backdrop-filter: blur(8px); border-radius: var(--r-md); padding: 14px 28px; display: flex; align-items: center; gap: 16px; box-shadow: var(--shadow-lg); max-width: 92%; }
.hero-card img, .hero-card .logo-fallback { width: 64px; height: 64px; object-fit: contain; flex-shrink: 0; }
.logo-fallback { display: grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg, var(--navy), var(--pink)); color: #fff; font-size: 1.8rem; }
.hero-card h1 { font-size: 1.55rem; color: var(--navy); }
.hero-card .en { color: var(--pink); font-family: var(--font-head); font-weight: 600; font-size: .78rem; letter-spacing: 2px; }
.hero-card .motto { font-size: .78rem; color: var(--muted); font-style: italic; }
.hero-chips { position: absolute; z-index: 2; top: 32px; right: 28px; display: flex; gap: 10px; }
.chip { background: rgba(18,40,90,.85); color: #fff; padding: 7px 16px; border-radius: var(--r-full); font-size: .85rem; display: flex; align-items: center; gap: 8px; font-family: var(--font-head); }
.chip i { color: var(--pink); }

/* ═════════ Navbar ═════════ */
.navbar { position: sticky; top: 0; z-index: 500; background: var(--navy); box-shadow: 0 6px 20px rgba(11,27,64,.25); }
.navbar-inner { display: flex; align-items: stretch; justify-content: space-between; min-height: 60px; }
.nav-list { display: flex; align-items: stretch; flex-wrap: nowrap; }
.nav-item { position: relative; display: flex; }
.nav-link { display: flex; align-items: center; gap: 6px; padding: 0 16px; color: #fff; font-family: var(--font-head); font-weight: 500; font-size: .95rem; white-space: nowrap; background: none; border: 0; }
.nav-link:hover, .nav-item:hover > .nav-link { color: var(--pink); background: rgba(255,255,255,.05); }
.nav-link .caret { font-size: .65rem; opacity: .8; }
.nav-link.is-current { color: var(--pink); }
.nav-home { background: var(--pink); border-radius: 0; gap: 10px; }
.nav-home:hover, .nav-item:hover > .nav-home { background: var(--pink-600); color: #fff; }
.nav-home .mini-logo { width: 34px; height: 34px; border-radius: 50%; background: #fff; display: grid; place-items: center; overflow: hidden; color: var(--navy); }
.nav-home .mini-logo img { width: 100%; height: 100%; object-fit: contain; }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.btn-staff { white-space: nowrap; background: #fff; color: var(--navy); padding: 9px 20px; border-radius: var(--r-sm); font-family: var(--font-head); font-weight: 600; font-size: .92rem; display: inline-flex; align-items: center; gap: 8px; }
.btn-staff i { color: var(--pink); }
.btn-staff:hover { background: var(--pink-100); color: var(--navy); }
.nav-burger { display: none; background: none; border: 0; color: #fff; font-size: 1.8rem; padding: 0 8px; }

.dropdown, .mega { position: absolute; top: 100%; left: 0; background: #fff; border-radius: 0 0 var(--r-md) var(--r-md); box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; transform: translateY(8px); transition: .22s; z-index: 600; border-top: 3px solid var(--pink); }
.nav-item:hover > .dropdown, .nav-item:hover > .mega, .nav-item:focus-within > .dropdown, .nav-item:focus-within > .mega { opacity: 1; visibility: visible; transform: none; }
.dropdown { min-width: 250px; padding: 10px; }
.dropdown a { display: block; padding: 10px 14px; border-radius: var(--r-sm); color: var(--navy); font-family: var(--font-head); font-size: .92rem; }
.dropdown a:hover { background: var(--pink-100); color: var(--pink-600); }
.mega { width: min(780px, 94vw); padding: 24px; display: grid; grid-template-columns: 1fr 1fr 1.1fr; gap: 24px; }
.mega-head { grid-column: 1 / -1; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.mega-head small { color: var(--pink); font-family: var(--font-head); font-weight: 600; letter-spacing: 2px; font-size: .72rem; }
.mega-head h3 { font-size: 1.25rem; }
.mega-head p { color: var(--muted); font-size: .88rem; }
.mega h4 { font-size: .85rem; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .5px; }
.mega-link { display: block; padding: 10px 12px; border-radius: var(--r-sm); color: var(--navy); }
.mega-link:hover { background: var(--pink-100); }
.mega-link strong { display: block; font-family: var(--font-head); font-weight: 500; font-size: .95rem; }
.mega-link span { color: var(--muted); font-size: .8rem; }
.mega-promo { background: linear-gradient(135deg, var(--navy), var(--blue)); border-radius: var(--r-md); color: #fff; padding: 18px; display: flex; flex-direction: column; justify-content: flex-end; min-height: 150px; }
.mega-promo strong { font-family: var(--font-head); font-size: 1.1rem; }
.mega-promo small { opacity: .8; }

/* Mobile drawer */
.drawer { position: fixed; inset: 0; z-index: 900; visibility: hidden; }
.drawer.is-open { visibility: visible; }
.drawer-bg { position: absolute; inset: 0; background: rgba(11,27,64,.6); opacity: 0; transition: .25s; }
.drawer.is-open .drawer-bg { opacity: 1; }
.drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(340px, 88vw); background: #fff; transform: translateX(100%); transition: .3s; overflow-y: auto; padding: 18px; }
.drawer.is-open .drawer-panel { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-family: var(--font-head); font-weight: 600; color: var(--navy); }
.drawer-head button { background: none; border: 0; font-size: 1.6rem; color: var(--navy); }
.drawer a, .drawer summary { display: flex; align-items: center; justify-content: space-between; padding: 12px 10px; border-radius: var(--r-sm); color: var(--navy); font-family: var(--font-head); font-weight: 500; cursor: pointer; list-style: none; }
.drawer summary::-webkit-details-marker { display: none; }
.drawer a:hover, .drawer summary:hover { background: var(--pink-100); }
.drawer details a { padding-left: 26px; font-weight: 400; font-size: .92rem; color: var(--muted); }
.drawer .btn-staff { background: var(--navy); color: #fff; justify-content: center; margin-top: 12px; }

/* ═════════ Banner slider ═════════ */
.slider { position: relative; background: var(--navy-900); }
.slider-viewport { position: relative; aspect-ratio: 16 / 6; max-height: 560px; width: 100%; overflow: hidden; }
.slide { position: absolute; inset: 0; opacity: 0; transition: opacity .7s; display: flex; align-items: center; background: linear-gradient(120deg, var(--navy) 0%, #5b3fd0 55%, var(--pink) 100%) center/cover no-repeat; }
.slide.is-active { opacity: 1; z-index: 2; }
.slide-text { position: relative; z-index: 2; color: #fff; max-width: 640px; }
.slide-text h2 { color: #fff; font-size: clamp(1.4rem, 4vw, 3rem); text-shadow: 0 2px 16px rgba(0,0,0,.3); }
.slide-text p { font-size: clamp(.95rem, 2vw, 1.25rem); opacity: .92; margin-top: 8px; }
.slide.has-img::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(11,27,64,.65), transparent 70%); }
.slide-link { position: absolute; inset: 0; z-index: 3; }
.slider-dots { position: absolute; bottom: 14px; left: 0; right: 0; z-index: 5; display: flex; justify-content: center; gap: 8px; }
.slider-dots button { width: 10px; height: 10px; padding: 0; border: 0; border-radius: var(--r-full); background: rgba(255,255,255,.55); transition: .25s; }
.slider-dots button.is-active { width: 34px; background: var(--pink); }
.slider-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 5; width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255,255,255,.2); backdrop-filter: blur(6px); color: #fff; font-size: 1.2rem; }
.slider-arrow:hover { background: var(--pink); }
.slider-arrow.prev { left: 16px; } .slider-arrow.next { right: 16px; }

/* ═════════ Sections ═════════ */
.section { padding: 84px 0; position: relative; }
.eyebrow { font-family: var(--font-head); font-weight: 600; letter-spacing: 3px; font-size: .8rem; text-transform: uppercase; color: var(--pink); display: block; }
.section-title { font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 700; margin-top: 8px; }
.section-title em { font-style: normal; color: var(--pink); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 36px; flex-wrap: wrap; }
.section-desc { color: var(--muted); max-width: 420px; }

/* Dark gradient activities section */
.section-dark { background: linear-gradient(160deg, #162d66 0%, #3a3e9a 55%, #7b3fa8 100%); color: #fff; overflow: hidden; }
.section-dark::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 85% 20%, rgba(242,86,155,.25), transparent 45%), radial-gradient(circle at 10% 90%, rgba(80,160,255,.25), transparent 40%); pointer-events: none; }
.section-dark .container { position: relative; }
.section-dark .section-title { color: #fff; }
.section-dark .eyebrow { color: #7dd3fc; }
.section-dark .section-desc { color: rgba(255,255,255,.8); }
.tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.tab { background: rgba(255,255,255,.12); color: #fff; border: 0; padding: 9px 24px; border-radius: var(--r-full); font-family: var(--font-head); font-size: .92rem; transition: .2s; }
.tab:hover { background: rgba(255,255,255,.22); }
.tab.is-active { background: var(--pink); box-shadow: 0 6px 18px rgba(242,86,155,.45); }
.activity-layout { display: grid; grid-template-columns: 340px 1fr; gap: 24px; align-items: start; }
.fb-card { background: #fff; border-radius: var(--r-lg); padding: 18px; color: var(--ink); position: sticky; top: 80px; box-shadow: var(--shadow-lg); }
.fb-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-family: var(--font-head); font-weight: 600; color: var(--navy); }
.fb-head i { width: 38px; height: 38px; border-radius: 50%; background: #1877f2; color: #fff; display: grid; place-items: center; font-size: 1.2rem; }
.fb-head a { margin-left: auto; font-size: .8rem; }
.fb-frame { border-radius: var(--r-md); overflow: hidden; background: #eef3ff; min-height: 200px; }
.fb-frame iframe { width: 100%; height: 520px; border: 0; display: block; }
.fb-empty { padding: 30px 16px; text-align: center; color: var(--muted); font-size: .9rem; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.cards.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cards.cols-4 { grid-template-columns: repeat(4, 1fr); }
.card { background: var(--card); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; color: var(--ink); transition: .3s; position: relative; }
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.card-img { position: relative; aspect-ratio: 16 / 10; background: var(--sky); overflow: hidden; display: block; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: .5s; }
.card:hover .card-img img { transform: scale(1.06); }
.ph { width: 100%; height: 100%; display: grid; place-items: center; background: linear-gradient(135deg, #c7d7fe, #fbcfe8); color: rgba(18,40,90,.35); font-size: 3rem; }
.badge-cat { position: absolute; top: 14px; left: 14px; background: var(--pink); color: #fff; padding: 4px 14px; border-radius: var(--r-full); font-family: var(--font-head); font-size: .78rem; display: inline-flex; align-items: center; gap: 6px; z-index: 2; }
.badge-count { position: absolute; top: 14px; right: 14px; background: rgba(11,27,64,.8); color: #fff; padding: 4px 12px; border-radius: var(--r-full); font-family: var(--font-head); font-size: .75rem; z-index: 2; }
.card-body { padding: 20px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.card-date { color: var(--muted); font-size: .85rem; margin-bottom: 6px; }
.card h3 { font-size: 1.12rem; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card h3 a { color: var(--navy); }
.card h3 a:hover { color: var(--pink-600); }
.card p { color: var(--muted); font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .more { margin-top: auto; padding-top: 14px; color: var(--pink-600); font-family: var(--font-head); font-weight: 600; font-size: .85rem; }
.card.is-hidden { display: none; }
.section-more { text-align: center; margin-top: 36px; }

/* Banner tiles */
.section-soft { background: linear-gradient(135deg, #f3e8ff 0%, #ffeaf3 45%, #fff6dd 100%); }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.tile { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-md); overflow: hidden; display: flex; align-items: flex-end; box-shadow: var(--shadow); color: #fff; transition: .3s; background: linear-gradient(135deg, var(--navy), var(--blue)); }
.tile:nth-child(3n+2) { background: linear-gradient(135deg, #7b3fa8, var(--pink)); }
.tile:nth-child(3n) { background: linear-gradient(135deg, #0f766e, #38bdf8); }
.tile:hover { transform: translateY(-6px) scale(1.01); box-shadow: var(--shadow-lg); color: #fff; }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile-text { position: relative; z-index: 2; padding: 22px; width: 100%; background: linear-gradient(transparent, rgba(11,27,64,.7)); }
.tile-text strong { font-family: var(--font-head); font-size: 1.35rem; display: block; line-height: 1.2; }
.tile-text span { font-size: .9rem; opacity: .9; }

/* Hall of fame */
.rank-card { counter-increment: rank; }
.rank-card .card-img::after { counter-increment: none; content: attr(data-rank); position: absolute; right: 16px; bottom: 6px; font-family: var(--font-head); font-weight: 800; font-size: 3.4rem; color: rgba(255,255,255,.85); text-shadow: 0 2px 14px rgba(0,0,0,.35); line-height: 1; }
.rank-card h3 { color: var(--blue); }

/* Kindergarten */
.kg { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.kg-img { border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 4 / 3; box-shadow: var(--shadow-lg); background: var(--sky); }
.kg-img img { width: 100%; height: 100%; object-fit: cover; }
.kg p { color: var(--muted); font-size: 1.08rem; margin: 14px 0 24px; }
.kg-points { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 26px; }
.kg-points li { background: #fff; border-radius: var(--r-md); padding: 14px 16px; box-shadow: var(--shadow); font-family: var(--font-head); font-size: .92rem; color: var(--navy); display: flex; gap: 10px; align-items: center; }
.kg-points i { color: var(--pink); font-size: 1.3rem; }

/* ═════════ Inner pages ═════════ */
.page-hero { background: linear-gradient(135deg, var(--navy) 0%, #3a3e9a 60%, #7b3fa8 100%); color: #fff; padding: 56px 0 64px; position: relative; overflow: hidden; }
.page-hero::after { content: ''; position: absolute; right: -80px; top: -80px; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgba(242,86,155,.4), transparent 70%); }
.page-hero h1 { color: #fff; font-size: clamp(1.7rem, 4vw, 2.6rem); position: relative; z-index: 1; }
.page-hero p { opacity: .85; margin-top: 6px; position: relative; z-index: 1; }
.breadcrumb { display: flex; gap: 8px; font-size: .88rem; opacity: .8; margin-bottom: 10px; position: relative; z-index: 1; flex-wrap: wrap; }
.breadcrumb a { color: #fff; }
.breadcrumb a:hover { color: var(--pink); }
.page-body { padding: 56px 0 80px; }
.panel { background: var(--card); border-radius: var(--r-lg); padding: 36px; box-shadow: var(--shadow); }
.prose { font-size: 1.05rem; line-height: 1.85; }
.prose p { margin-bottom: 1em; }
.prose h2, .prose h3 { margin: 1.4em 0 .5em; }
.prose ul, .prose ol { margin: 0 0 1em 1.4em; list-style: revert; }
.prose img { border-radius: var(--r-md); margin: 1em 0; }
.prose table { border-collapse: collapse; width: 100%; margin: 1em 0; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.info-card { background: var(--card); border-radius: var(--r-md); padding: 26px; box-shadow: var(--shadow); border-top: 4px solid var(--pink); }
.info-card h3 { margin-bottom: 8px; display: flex; gap: 10px; align-items: center; }
.info-card h3 i { color: var(--pink); }
.info-card p, .info-card li { color: var(--muted); }

.person { background: var(--card); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); text-align: center; transition: .3s; }
.person:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.person-photo { aspect-ratio: 1; background: var(--sky); }
.person-photo img { width: 100%; height: 100%; object-fit: cover; }
.person-photo .ph { font-size: 4.5rem; }
.person-info { padding: 16px 14px 22px; }
.person-info h4 { font-size: 1.05rem; }
.person-info .pos { color: var(--pink-600); font-weight: 600; font-size: .9rem; }
.person-info .std { color: var(--muted); font-size: .82rem; }
.group-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.group-tabs a { padding: 8px 20px; border-radius: var(--r-full); background: #fff; color: var(--navy); box-shadow: var(--shadow); font-family: var(--font-head); font-size: .9rem; }
.group-tabs a.is-active, .group-tabs a:hover { background: var(--pink); color: #fff; }

.level-card { display: flex; gap: 18px; background: var(--card); border-radius: var(--r-md); padding: 24px; box-shadow: var(--shadow); }
.level-icon { flex-shrink: 0; width: 60px; height: 60px; border-radius: 16px; background: linear-gradient(135deg, var(--navy), var(--pink)); color: #fff; display: grid; place-items: center; font-size: 1.7rem; }
.level-card h3 { font-size: 1.1rem; }
.level-card p { color: var(--muted); font-size: .94rem; }
.level-card .subjects { margin-top: 8px; font-size: .88rem; color: var(--navy); background: var(--sky); padding: 8px 12px; border-radius: var(--r-sm); }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-family: var(--font-head); font-weight: 500; font-size: .9rem; margin-bottom: 6px; color: var(--navy); }
.field input, .field select, .field textarea { width: 100%; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: var(--r-sm); font: inherit; background: #fff; color: var(--ink); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 4px rgba(242,86,155,.15); }
.field textarea { min-height: 130px; resize: vertical; }
.req { color: var(--red); }
.alert { padding: 14px 18px; border-radius: var(--r-sm); margin-bottom: 18px; font-size: .95rem; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-error, .alert-danger { background: #fee2e2; color: #991b1b; }
.alert-info { background: #dbeafe; color: #1e40af; }
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 28px; align-items: start; }
.contact-list li { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.contact-list li:last-child { border: 0; }
.contact-list i { width: 42px; height: 42px; border-radius: 12px; background: var(--pink-100); color: var(--pink-600); display: grid; place-items: center; font-size: 1.2rem; flex-shrink: 0; }
.contact-list strong { display: block; font-family: var(--font-head); color: var(--navy); font-weight: 500; font-size: .92rem; }
.map-frame { border-radius: var(--r-md); overflow: hidden; margin-top: 18px; }
.map-frame iframe { width: 100%; height: 300px; border: 0; display: block; }
.login-box { max-width: 440px; margin: 0 auto; }

.article-meta { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: .9rem; margin-bottom: 18px; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; }
.article { min-width: 0; }
.article-meta { align-items: center; }
.article-cover { margin: 0 0 28px; border-radius: var(--r-md); overflow: hidden; background: var(--sky); text-align: center; }
.article-cover img { display: inline-block; width: 100%; height: auto; max-height: 640px; object-fit: contain; }
.article .prose { max-width: 75ch; }
.article .prose img { max-width: 100%; height: auto; }
.gallery-title { margin: 36px 0 14px; display: flex; gap: 10px; align-items: center; }
.gallery-title i { color: var(--pink); }
.photo-grid a { cursor: zoom-in; position: relative; }
.photo-grid a::after { content: '\F52A'; font-family: 'bootstrap-icons'; position: absolute; right: 8px; bottom: 8px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: rgba(11,27,64,.7); color: #fff; font-size: .9rem; opacity: 0; transition: .25s; }
.photo-grid a:hover::after { opacity: 1; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 36px 0 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.post-nav a { display: block; padding: 14px 18px; border-radius: var(--r-md); background: var(--bg); color: var(--navy); }
.post-nav a:hover { background: var(--pink-100); }
.post-nav a.next { text-align: right; grid-column: 2; }
.post-nav small { display: block; color: var(--pink-600); font-family: var(--font-head); font-size: .78rem; }
.post-nav span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-family: var(--font-head); font-size: .92rem; }
.side-list { padding: 24px; position: sticky; top: 80px; }
.side-list h3 { margin-bottom: 8px; }
.side-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--navy); align-items: center; }
.side-list li:last-child .side-item { border: 0; }
.side-thumb { flex: 0 0 84px; height: 58px; border-radius: 10px; overflow: hidden; background: var(--sky); }
.side-thumb img, .side-thumb .ph { width: 100%; height: 100%; object-fit: cover; font-size: 1.4rem; }
.side-item strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font: 500 .9rem/1.35 var(--font-head); }
.side-item small { color: var(--muted); font-size: .78rem; }
.side-item:hover strong { color: var(--pink-600); }
.empty-note { color: var(--muted); padding: 10px 0; }
@media (max-width: 960px) { .article-layout { grid-template-columns: 1fr; } .side-list { position: static; } }

/* Lightbox */
.lb { position: fixed; inset: 0; z-index: 1000; background: rgba(5,12,32,.92); display: none; align-items: center; justify-content: center; padding: 24px; }
.lb.is-open { display: flex; }
.lb img { max-width: 100%; max-height: 88vh; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lb button { position: absolute; background: rgba(255,255,255,.14); color: #fff; border: 0; width: 46px; height: 46px; border-radius: 50%; font-size: 1.3rem; }
.lb button:hover { background: var(--pink); }
.lb .lb-x { top: 18px; right: 18px; } .lb .lb-prev { left: 18px; top: 50%; } .lb .lb-next { right: 18px; top: 50%; }
.lb .lb-count { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: #cbd5e1; font-size: .9rem; }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 24px; }
.photo-grid a { border-radius: var(--r-sm); overflow: hidden; aspect-ratio: 4 / 3; display: block; }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; transition: .4s; }
.photo-grid a:hover img { transform: scale(1.08); }
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 40px; flex-wrap: wrap; }
.pagination a { min-width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: #fff; color: var(--navy); box-shadow: var(--shadow); font-family: var(--font-head); }
.pagination a.is-active, .pagination a:hover { background: var(--pink); color: #fff; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty i { font-size: 3rem; color: var(--pink); display: block; margin-bottom: 8px; }
.job { background: var(--card); border-radius: var(--r-md); padding: 26px; box-shadow: var(--shadow); border-left: 5px solid var(--pink); }
.job h3 { margin-bottom: 6px; }
.job .meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: .88rem; margin-bottom: 10px; }

/* History page */
.history-feature { position:relative; min-height:420px; border-radius:28px; overflow:hidden; box-shadow:var(--shadow-lg); }
.history-feature>img { width:100%; height:100%; min-height:420px; object-fit:cover; }
.history-feature::after { content:''; position:absolute; inset:0; background:linear-gradient(0deg,rgba(8,29,49,.82),transparent 55%); }
.history-feature-caption { position:absolute; z-index:2; left:34px; bottom:30px; color:#fff; max-width:600px; }
.history-feature-caption span { display:block; color:#ffd0c8; letter-spacing:.2em; font-size:.75rem; font-weight:700; }
.history-feature-caption strong { display:block; color:#fff; font-family:var(--font-head); font-size:clamp(1.4rem,3vw,2.25rem); line-height:1.3; }
.history-feature-caption small { opacity:.72; }
.history-story { display:grid; grid-template-columns:1.05fr .95fr; gap:28px; margin-top:28px; align-items:stretch; }
.history-copy { box-shadow:none; border:1px solid var(--line); }
.history-copy h2 { font-size:clamp(1.7rem,3vw,2.5rem); margin:8px 0 20px; }
.history-today { position:relative; border-radius:28px; overflow:hidden; min-height:430px; box-shadow:var(--shadow); }
.history-today>img { width:100%; height:100%; object-fit:cover; }
.history-today figcaption { position:absolute; left:20px; right:20px; bottom:20px; display:flex; gap:12px; align-items:center; background:rgba(255,255,255,.93); backdrop-filter:blur(10px); border-radius:16px; padding:15px; color:var(--navy); }
.history-today figcaption>i { width:40px; height:40px; flex:none; display:grid; place-items:center; border-radius:50%; background:var(--pink); color:#fff; }
.history-today figcaption strong,.history-today figcaption small { display:block; }
.history-today figcaption strong { font-family:var(--font-head); }
.history-today figcaption small { color:var(--muted); }
.history-values { margin-top:28px; }
@media(max-width:768px){ .history-feature,.history-feature>img { min-height:340px; } .history-feature-caption{left:20px;right:20px;bottom:20px}.history-story{grid-template-columns:1fr}.history-today{min-height:360px} }

/* ═════════ Footer ═════════ */
.footer { background: var(--navy-900); color: #cbd5e1; padding-top: 64px; margin-top: 0; position: relative; }
.footer::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: linear-gradient(90deg, var(--pink), var(--blue), var(--pink)); }
.footer-grid { display: grid; grid-template-columns: 1.4fr .8fr 1.2fr; gap: 48px; padding-bottom: 48px; }
.footer h4 { color: #fff; font-size: 1.05rem; margin-bottom: 18px; }
.footer-brand { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.footer-brand img, .footer-brand .logo-fallback { width: 54px; height: 54px; object-fit: contain; }
.footer-brand strong { color: #fff; font-family: var(--font-head); font-size: 1.15rem; display: block; }
.footer-brand small { color: var(--pink); letter-spacing: 1.5px; font-size: .72rem; }
.footer li { padding: 5px 0; }
.footer a { color: #cbd5e1; }
.footer a:hover { color: var(--pink); }
.footer-contact li { display: flex; gap: 12px; }
.footer-contact i { color: var(--pink); margin-top: 4px; }
.social { display: flex; gap: 10px; margin-top: 16px; }
.social a { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.08); display: grid; place-items: center; font-size: 1.1rem; color: #fff; }
.social a:hover { background: var(--pink); color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 20px 0; font-size: .86rem; color: #94a3b8; }
.footer-bottom .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.to-top { position: fixed; right: 22px; bottom: 22px; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--pink); color: #fff; font-size: 1.3rem; box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; transition: .3s; z-index: 400; }
.to-top.is-visible { opacity: 1; visibility: visible; }

/* a11y toolbar */
.a11y { background: #fff; border-bottom: 1px solid var(--line); font-size: .8rem; }
.a11y .container { display: flex; gap: 14px; align-items: center; justify-content: flex-end; height: 34px; color: var(--muted); }
.a11y button { background: none; border: 0; color: var(--navy); font-weight: 600; padding: 2px 6px; }
.a11y button:hover { color: var(--pink-600); }

.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s, transform .7s; }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } .reveal { opacity: 1; transform: none; } }

/* ═════════ Responsive ═════════ */
@media (max-width: 1180px) {
    .nav-link { padding: 0 11px; font-size: .88rem; }
    .cards.cols-4 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1020px) {
    .nav-list, .nav-actions .btn-staff { display: none; }
    .nav-burger { display: block; }
    .navbar-inner { align-items: center; padding-top: 6px; padding-bottom: 6px; }
    .navbar .nav-home-mobile { display: flex; }
    .activity-layout { grid-template-columns: 1fr; }
    .fb-card { position: static; }
    .cards, .cards.cols-4 { grid-template-columns: repeat(2, 1fr); }
    .tiles { grid-template-columns: repeat(2, 1fr); }
    .kg, .contact-grid { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .hero-chips { position: static; justify-content: center; margin-top: 12px; }
    .hero { flex-direction: column; align-items: center; }
}
@media (max-width: 640px) {
    .container { padding: 0 16px; }
    .section { padding: 56px 0; }
    .hero-card { padding: 10px 16px; gap: 10px; }
    .hero-card h1 { font-size: 1.1rem; }
    .hero-card img, .hero-card .logo-fallback { width: 44px; height: 44px; }
    .chip { font-size: .74rem; padding: 5px 10px; }
    .slider-viewport { aspect-ratio: 4 / 3; }
    .slider-arrow { display: none; }
    .cards, .cards.cols-2, .cards.cols-4, .tiles, .grid-2, .grid-3, .form-grid, .kg-points, .photo-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 30px; }
    .panel { padding: 22px; }
    .ticker-label { font-size: .7rem; padding: 3px 8px; }
    .a11y .container { justify-content: center; }
}

/* 2026 visual refresh — warm, modern coeducational school */
:root { --navy:#112b46; --navy-900:#081d31; --navy-700:#1d4965; --blue:#287f91; --pink:#ed6a5a; --pink-600:#d94f42; --pink-100:#fff0ec; --sky:#e7f5f4; --bg:#fbfaf7; --ink:#23313d; --muted:#667681; --line:#dfe7e8; --shadow:0 12px 32px rgba(17,43,70,.09); --shadow-lg:0 24px 70px rgba(17,43,70,.17); }
body { background:#fbfaf7; }
.ticker { background:#0d263d; }
.ticker-inner { height:36px; }
.ticker-label { background:transparent; padding:0; color:#ffb5aa; }
.a11y { border:0; background:#f4f1e9; }
.a11y .container { height:32px; }
.home-hero { min-height:620px; padding:0; align-items:center; justify-content:flex-start; background-image:linear-gradient(90deg,rgba(6,26,43,.92) 0%,rgba(6,26,43,.75) 34%,rgba(6,26,43,.12) 68%,rgba(6,26,43,0) 100%),url('../images/school-hero-coed.png'); background-position:center; }
.home-hero::after { height:100%; background:linear-gradient(0deg,rgba(8,29,49,.36),transparent 32%); }
.hero-content { position:relative; z-index:2; color:#fff; padding-top:70px; padding-bottom:76px; }
.hero-brand { display:flex; align-items:center; gap:18px; max-width:700px; }
.hero-brand-mark { width:72px; height:72px; flex:none; }
.hero-brand-mark img,.hero-brand-mark .logo-fallback { width:100%; height:100%; object-fit:contain; }
.hero-brand h1 { color:#fff; font-size:clamp(2.2rem,5vw,4.5rem); letter-spacing:-.04em; margin-top:2px; }
.hero-kicker { display:block; color:#ffd2ca; font-family:var(--font-head); font-weight:600; letter-spacing:.05em; }
.hero-brand .en { color:#b9dde1; letter-spacing:.16em; font-size:.82rem; font-weight:600; }
.hero-lead { font-size:clamp(1.05rem,1.8vw,1.3rem); max-width:620px; margin:28px 0; color:rgba(255,255,255,.9); line-height:1.8; }
.hero-cta { display:flex; gap:12px; flex-wrap:wrap; }
.btn-coral { background:var(--pink); color:#fff; box-shadow:0 12px 30px rgba(237,106,90,.3); }
.btn-coral:hover { background:#fff; color:var(--navy); transform:translateY(-2px); }
.btn-ghost { border-color:rgba(255,255,255,.55); color:#fff; background:rgba(255,255,255,.08); backdrop-filter:blur(10px); }
.btn-ghost:hover { background:#fff; color:var(--navy); }
.hero-meta { display:flex; gap:32px; margin-top:44px; }
.hero-meta span { display:grid; grid-template-columns:34px auto; align-items:center; font-family:var(--font-head); }
.hero-meta i { grid-row:1/3; width:34px; height:34px; border-radius:50%; background:rgba(255,255,255,.13); display:grid; place-items:center; margin-right:10px; }
.hero-meta small { opacity:.65; font-size:.7rem; line-height:1.1; }
.navbar { background:rgba(8,29,49,.98); }
.navbar-inner { min-height:66px; }
.nav-home { background:transparent; }
.nav-home:hover,.nav-item:hover>.nav-home { background:rgba(255,255,255,.06); }
.nav-link:hover,.nav-item:hover>.nav-link,.nav-link.is-current { color:#ff9b8d; }
.quick-links { position:relative; z-index:20; margin-top:32px; }
.quick-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; }
.quick-grid>a { background:#fff; color:var(--navy); padding:20px; border-radius:18px; box-shadow:var(--shadow-lg); display:flex; gap:14px; align-items:center; border:1px solid rgba(17,43,70,.07); }
.quick-grid>a:hover { transform:translateY(-5px); border-color:#8fc9ca; }
.quick-grid i { width:46px; height:46px; border-radius:14px; flex:none; display:grid; place-items:center; background:#e7f5f4; color:#287f91; font-size:1.35rem; }
.quick-grid strong,.quick-grid small { display:block; }
.quick-grid strong { font-family:var(--font-head); font-size:.96rem; }
.quick-grid small { color:var(--muted); font-size:.76rem; }
.notice-strip { padding:72px 0 66px; }
.notice-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:18px; }
.notice-grid>a { color:var(--ink); display:grid; grid-template-columns:92px 1fr auto; gap:15px; align-items:center; padding:12px; background:#f1eee6; border-radius:18px; }
.notice-grid>a:hover { background:#e7f5f4; transform:translateY(-3px); }
.notice-photo { width:92px; height:82px; border-radius:13px; overflow:hidden; background:#dfeceb; display:block; }
.notice-photo img { width:100%; height:100%; object-fit:cover; }
.notice-photo .ph { font-size:1.5rem; }
.notice-grid small { color:var(--pink-600); font-weight:600; }
.notice-grid strong { display:block; color:var(--navy); font-family:var(--font-head); margin:2px 0 4px; }
.notice-grid p { color:var(--muted); font-size:.82rem; line-height:1.5; }
.section-dark { background:#0f3346; }
.section-dark::before { background:radial-gradient(circle at 88% 18%,rgba(66,166,165,.28),transparent 38%),radial-gradient(circle at 8% 95%,rgba(237,106,90,.18),transparent 35%); }
.section-soft { background:#f1eee6; }
.card,.tile,.fb-card,.kg-img,.kg-points li { border-radius:18px; }
.card { box-shadow:0 8px 26px rgba(8,29,49,.09); }
.badge-cat,.tab.is-active,.btn-pink { background:var(--pink); }
.footer::before { background:linear-gradient(90deg,var(--pink),#4aa3a2,#e6b85c); }

@media (max-width:1020px) {
 .home-hero { min-height:580px; background-position:62% center; }
 .home-hero::before { content:''; position:absolute; inset:0; background:rgba(6,26,43,.26); }
 .quick-grid { grid-template-columns:repeat(2,1fr); }
 .notice-grid { grid-template-columns:1fr; }
}
@media (max-width:640px) {
 .home-hero { min-height:640px; background-position:66% center; align-items:flex-end; }
 .home-hero::before { background:linear-gradient(0deg,rgba(6,26,43,.96) 4%,rgba(6,26,43,.55) 58%,rgba(6,26,43,.12)); }
 .hero-content { padding-top:170px; padding-bottom:66px; }
 .hero-brand { align-items:flex-start; }
 .hero-brand-mark { width:54px; height:54px; }
 .hero-brand h1 { font-size:2rem; }
 .hero-kicker { font-size:.78rem; }
 .hero-brand .en { font-size:.64rem; }
 .hero-lead br { display:none; }
 .hero-meta { gap:14px; flex-direction:column; margin-top:28px; }
 .quick-links { margin-top:20px; }
 .quick-grid { grid-template-columns:1fr 1fr; gap:10px; }
 .quick-grid>a { padding:14px 12px; gap:10px; }
 .quick-grid i { width:38px; height:38px; font-size:1.05rem; }
 .quick-grid small { display:none; }
 .notice-strip { padding:52px 0; }
 .notice-grid>a { grid-template-columns:78px 1fr auto; }
 .notice-photo { width:78px; height:72px; }
}
/* ── หมวดกิจกรรมหน้าแรก: พื้นหลังต่อหมวด + รูปแบบการแสดงผล (ตั้งค่าที่ admin/categories.php) ── */
.cat-section.tone-dark { color:#fff; }
.cat-section.tone-dark .section-title, .cat-section.tone-dark .section-title em { color:#fff; }
.cat-section.tone-dark .eyebrow { color:#ffb5aa; }
.cat-section.tone-dark .btn-outline { color:#fff; border-color:rgba(255,255,255,.6); }
.section-title i { font-size:.8em; margin-right:6px; color:var(--pink); }
.fb-wrap { display:flex; flex-direction:column; align-items:center; gap:24px; }
.fb-wrap .fb-card { position:static; width:100%; max-width:420px; }
.cards.cl-grid { grid-template-columns:repeat(3,1fr); }
.cards.cl-grid4 { grid-template-columns:repeat(4,1fr); }
.cards.cl-featured_left { grid-template-columns:1.5fr 1fr 1fr; }
.cl-featured_left .card-big { grid-row:span 2; }
.cl-featured_left .card-big .card-img { flex:1; aspect-ratio:auto; min-height:280px; }
.cl-featured_left .card-big .card-body { flex:none; }
.cards.cl-featured_top { grid-template-columns:repeat(3,1fr); }
.cl-featured_top .card-big { grid-column:1 / -1; flex-direction:row; }
.cl-featured_top .card-big .card-img { flex:0 0 55%; aspect-ratio:auto; min-height:300px; }
.cl-featured_top .card-big .card-body { justify-content:center; }
.card-big h3 { font-size:1.45rem; -webkit-line-clamp:4; }
.cards.cl-list { grid-template-columns:1fr; gap:18px; }
.cl-list .card { flex-direction:row; }
.cl-list .card-img { flex:0 0 300px; aspect-ratio:auto; min-height:170px; }
.cl-list .card-body { justify-content:center; }
@media (max-width:1000px) {
    .cards.cl-grid, .cards.cl-featured_top, .cards.cl-featured_left, .cards.cl-grid4 { grid-template-columns:repeat(2,1fr); }
    .cl-featured_left .card-big { grid-column:1 / -1; grid-row:auto; }
    .cl-featured_top .card-big { flex-direction:column; }
    .cl-featured_top .card-big .card-img { flex:none; aspect-ratio:16/9; min-height:0; }
}
@media (max-width:600px) {
    .cards.cl-grid, .cards.cl-grid4, .cards.cl-featured_left, .cards.cl-featured_top { grid-template-columns:1fr; }
    .cl-list .card { flex-direction:column; }
    .cl-list .card-img { flex:none; aspect-ratio:16/10; }
}


/* ═════════ Scrollable menu + global responsive safety ═════════ */
.navbar-inner { gap: 8px; }
.nav-list { flex: 1 1 auto; min-width: 0; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.35) transparent; overscroll-behavior-x: contain; }
.nav-list::-webkit-scrollbar { height: 4px; }
.nav-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.35); border-radius: 4px; }
.nav-item { flex: 0 0 auto; }
.nav-list .dropdown, .nav-list .mega { position: fixed; top: auto; left: auto; }
.nav-actions { flex: 0 0 auto; }

img, video, iframe, svg { max-width: 100%; }
img, video { height: auto; }
iframe { border: 0; }
table { max-width: 100%; }
.article-body, .page-content, .block, main { overflow-wrap: anywhere; }
.article-body table, .page-content table, .block table { display: block; overflow-x: auto; }
.a11y .container { flex-wrap: wrap; }
.ticker-label { flex-shrink: 0; }

@media (max-width: 1020px) {
    .mega { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .cards, .cards.cols-4, .tiles, .grid-3, .footer-grid { grid-template-columns: 1fr; }
    .page-hero { padding: 40px 0 44px; }
    .hero-cta { flex-wrap: wrap; }
    .a11y span { display: none; }
}

/* rich text from the admin editor (jobs etc.) */
.rt { overflow-wrap: anywhere; }
.rt img { max-width: 100%; height: auto; border-radius: 12px; margin: 8px 0; }
.rt ul, .rt ol { padding-left: 1.4em; margin: 8px 0; }
.rt ul { list-style: disc; } .rt ol { list-style: decimal; }
.rt h2, .rt h3, .rt h4 { margin: 14px 0 6px; }
.rt table { border-collapse: collapse; display: block; overflow-x: auto; max-width: 100%; }
.rt td, .rt th { border: 1px solid var(--line); padding: 6px 10px; }
.rt a { color: var(--pink-600); text-decoration: underline; }
.rt a.pdf-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; background: #fee2e2; color: #b91c1c; font-weight: 500; text-decoration: none; margin: 4px 0; }
.rt a.pdf-link:hover { background: #fecaca; }

/* ═════════ Responsive refinements (มือถือ/แท็บเล็ต ทุกหน้า) ═════════ */
html, body { overflow-x: hidden; }
.home-hero { background-size: cover; }
@media (max-width: 1020px) {
    .hero-meta { flex-wrap: wrap; gap: 16px 28px; }
    .hero-brand h1 { font-size: clamp(1.8rem, 6vw, 3rem); }
    .photo-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-2 { gap: 18px; }
}
@media (max-width: 640px) {
    .home-hero { min-height: min(640px, 100svh); }
    .hero-cta .btn { flex: 1 1 100%; justify-content: center; text-align: center; }
    .post-nav { grid-template-columns: 1fr; }
    .section-head { flex-direction: column; align-items: flex-start; gap: 8px; }
    .section-desc { max-width: none; }
    .btn, .nav-link, .quick-grid > a { min-height: 44px; }
    .notice-grid > a { grid-template-columns: 78px 1fr; }
    .notice-grid > a > .bi { display: none; }
    iframe { width: 100%; }
}
@media (max-width: 380px) {
    .container { padding: 0 12px; }
    .quick-grid { grid-template-columns: 1fr; }
    .hero-brand { flex-direction: column; gap: 10px; }
    .hero-brand h1 { font-size: 1.7rem; }
}

/* ═════════ Hero: ย่อภาพตามความกว้างจอ (ไม่ crop) บนแท็บเล็ต/มือถือ ═════════ */
/* ภาพต้นฉบับ 2048×768 → อัตราส่วน 8:3 = 37.5vw ของความกว้าง */
@media (max-width: 1020px) {
    .home-hero {
        min-height: 0; align-items: flex-start;
        background-color: var(--navy-900);
        background-image: url('../images/school-hero-coed.png');
        background-size: 100% auto; background-position: top center; background-repeat: no-repeat;
        padding-top: 37.5vw;
    }
    .home-hero::before, .home-hero::after { content: none; }
    .hero-content { padding-top: 28px; padding-bottom: 40px; }
}
@media (max-width: 640px) {
    .home-hero { min-height: 0; align-items: flex-start; }
    .hero-content { padding-top: 24px; padding-bottom: 36px; }
}

.contact-cover { margin: 0 0 28px; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 21 / 8; background: var(--pink-100); }
.contact-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 760px) { .contact-cover { aspect-ratio: 16 / 9; } }

/* ── Teacher directory cards ── */
.tsection { margin-bottom: 48px; }
.tsection .section-title { font-size: 1.6rem; margin-bottom: 6px; }
.tsection-sub { color: var(--muted); margin-bottom: 20px; }
.tcard { background: var(--card); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); text-align: center; transition: .3s; display: flex; flex-direction: column; }
.tcard:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.tcard-photo { aspect-ratio: 4 / 5; background: var(--sky); }
.tcard-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tcard-photo .ph { font-size: 4.5rem; height: 100%; }
.tcard-body { padding: 16px 14px 20px; }
.tcard-body h4 { font-size: 1.05rem; margin-bottom: 2px; }
.tcard-body .pos { color: var(--pink-600); font-weight: 600; font-size: .92rem; }
.tcard-body .std { color: var(--muted); font-size: .85rem; }
.tcard-meta { list-style: none; margin: 10px 0 0; padding: 0; font-size: .85rem; color: var(--muted); }
.tcard-meta li { padding: 2px 0; word-break: break-word; }
.tcard-meta i { color: var(--pink-600); margin-right: 4px; }
.tcard-motto { margin: 10px 0 0; font-size: .85rem; font-style: italic; color: var(--navy); }
