/* ==========================================================================
   หน้าแรก โรงเรียนเมืองนครราชสีมา — ระบบดีไซน์ v3 (18 พ.ย. 2569)
   ========================================================================== */
:root {
  --em-950: #011a14; --em-900: #022c22; --em-800: #04382b; --em-700: #055a3c; --em: #007f3d; --em-400: #10b26a;
  --gold: #d4af37; --gold-2: #f3d774; --gold-3: #fbefc4; --gold-ink: #8a6a0c;
  --ivory: #fbf8ef; --paper: #ffffff; --ink: #10231d; --ink-2: #33433d; --mut: #5d6d67; --line: rgba(2, 44, 34, .09);
  --r-sm: 12px; --r: 20px; --r-lg: 28px; --r-xl: 36px;
  --sh-1: 0 1px 2px rgba(2, 44, 34, .06), 0 8px 24px -12px rgba(2, 44, 34, .18);
  --sh-2: 0 2px 6px rgba(2, 44, 34, .06), 0 24px 48px -20px rgba(2, 44, 34, .32);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --wrap: 1240px;
}
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body.home { margin: 0; font-family: 'Sarabun', system-ui, sans-serif; font-size: 1rem; line-height: 1.7; color: var(--ink-2); background: var(--ivory); text-rendering: optimizeLegibility; overflow-x: clip; }
body.home :where(h1, h2, h3, h4, h5) { font-family: 'Kanit', sans-serif; color: var(--ink); line-height: 1.25; margin: 0; }
:where(body.home) img { max-width: 100%; }
:where(body.home) a { color: inherit; }
[id] { scroll-margin-top: calc(var(--mn-nav-h, 72px) + 16px); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 8px; }
.h-wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- section heads ---------- */
.h-sec { padding: clamp(64px, 9vw, 120px) 0; position: relative; }
.h-head { max-width: 720px; margin: 0 auto clamp(32px, 4vw, 52px); text-align: center; }
.h-head.is-left { margin-left: 0; text-align: left; }
.h-eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 600 .8rem 'Kanit', sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-ink); background: rgba(212, 175, 55, .14); border: 1px solid rgba(212, 175, 55, .35); padding: 5px 14px; border-radius: 999px; margin-bottom: 14px; }
.h-title { font-size: clamp(1.9rem, 1.2rem + 2.8vw, 3.1rem); font-weight: 700; letter-spacing: -.01em; }
.h-title em { font-style: normal; background: linear-gradient(120deg, var(--em) 0%, var(--em-400) 40%, var(--gold) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.h-sub { margin: 12px 0 0; font-size: clamp(1rem, .95rem + .3vw, 1.15rem); color: var(--mut); }
.h-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; padding: 0 24px; border-radius: 14px; font: 600 1rem 'Kanit', sans-serif; text-decoration: none; border: 0; cursor: pointer; transition: transform .25s var(--ease), box-shadow .25s, background .25s, color .25s; }
.h-btn:hover { transform: translateY(-2px); }
.h-btn i { transition: transform .25s var(--ease); }
.h-btn:hover i.fa-arrow-right { transform: translateX(4px); }
.h-btn-gold { background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: var(--em-900) !important; box-shadow: 0 16px 30px -14px rgba(184, 134, 11, .9); }
.h-btn-em { background: linear-gradient(135deg, #00924a, var(--em-900)); color: #fff !important; box-shadow: 0 16px 30px -14px rgba(0, 127, 61, .9); }
.h-btn-glass { background: rgba(255, 255, 255, .12); color: #fff !important; border: 1px solid rgba(255, 255, 255, .35); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.h-btn-glass:hover { background: rgba(255, 255, 255, .22); }
.h-btn-line { background: #fff; color: var(--em-900) !important; border: 1.5px solid var(--line); box-shadow: var(--sh-1); }
.h-btn-line:hover { border-color: var(--gold); }

/* ---------- reveal ---------- */
.rv { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0s); }
.rv.is-in { opacity: 1; transform: none; }
.no-js .rv { opacity: 1; transform: none; }

/* ---------- spotlight hover (เลื่อนเมาส์แล้วมีแสง) ---------- */
.h-spot { position: relative; isolation: isolate; }
.h-spot::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 2; opacity: 0; transition: opacity .3s; background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(212, 175, 55, .18), transparent 45%); }
.h-spot:hover::after { opacity: 1; }

/* ==========================================================================
   HERO
   ========================================================================== */
.h-hero { position: relative; min-height: min(calc(100svh - var(--mn-nav-h, 72px)), 900px); display: flex; flex-direction: column; justify-content: center; color: #fff; overflow: hidden; isolation: isolate; background: var(--em-950); padding: clamp(48px, 8vh, 96px) 0 0; }
.h-hero-media { position: absolute; inset: 0; z-index: -3; }
.h-hero-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.12); transition: opacity 1.6s ease, transform 9s linear; }
.h-hero-media img.is-on { opacity: 1; transform: scale(1); }
.h-hero-shade { position: absolute; inset: 0; z-index: -2; background:
  radial-gradient(80% 70% at 85% 10%, rgba(212, 175, 55, .28), transparent 60%),
  linear-gradient(100deg, rgba(1, 26, 20, .96) 0%, rgba(2, 44, 34, .86) 38%, rgba(2, 44, 34, .45) 68%, rgba(2, 44, 34, .2) 100%),
  linear-gradient(to top, rgba(1, 26, 20, .95) 0%, transparent 38%); }
.h-hero-grid { position: absolute; inset: 0; z-index: -1; opacity: .35; background-image: radial-gradient(rgba(243, 215, 116, .45) 1px, transparent 1px); background-size: 26px 26px; -webkit-mask-image: linear-gradient(115deg, #000 0%, transparent 55%); mask-image: linear-gradient(115deg, #000 0%, transparent 55%); }
.h-orb { position: absolute; z-index: -1; border-radius: 50%; filter: blur(70px); opacity: .55; pointer-events: none; animation: hOrb 18s ease-in-out infinite alternate; }
.h-orb-1 { width: 420px; height: 420px; left: -120px; top: 10%; background: #0aa860; }
.h-orb-2 { width: 360px; height: 360px; right: 8%; bottom: -120px; background: #b8860b; animation-delay: -6s; }
@keyframes hOrb { to { transform: translate(60px, -40px) scale(1.15); } }
.h-hero-in { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: clamp(28px, 4vw, 64px); align-items: center; width: 100%; }
.h-chip { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 22px; padding: 7px 16px 7px 12px; border-radius: 999px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .22); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); font: 500 .92rem 'Kanit', sans-serif; color: #eafff4; }
.h-dot { width: 9px; height: 9px; border-radius: 50%; background: #22e07f; box-shadow: 0 0 0 0 rgba(34, 224, 127, .7); animation: hPing 2s infinite; }
@keyframes hPing { 70% { box-shadow: 0 0 0 10px rgba(34, 224, 127, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 224, 127, 0); } }
.h-hero h1 { color: #fff; font-weight: 700; font-size: clamp(2.6rem, 1.4rem + 5.4vw, 5.6rem); line-height: 1.04; letter-spacing: -.02em; }
.h-hero h1 span { display: block; opacity: 0; transform: translateY(40px); animation: hRise 1s var(--ease) forwards; }
.h-hero h1 span:nth-child(2) { animation-delay: .15s; }
.h-gold { background: linear-gradient(100deg, #f9e7a1 0%, var(--gold) 30%, #fff3c4 50%, var(--gold) 70%, #f9e7a1 100%); background-size: 220% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: hRise 1s var(--ease) .15s forwards, hShine 6s linear 1.2s infinite !important; padding-bottom: .08em; }
@keyframes hRise { to { opacity: 1; transform: none; } }
@keyframes hShine { to { background-position: -220% center; } }
.h-lead { max-width: 34em; margin: 22px 0 0; font-size: clamp(1.02rem, .95rem + .45vw, 1.28rem); line-height: 1.75; color: rgba(236, 253, 245, .88); opacity: 0; animation: hRise 1s var(--ease) .35s forwards; transform: translateY(20px); }
.h-hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; opacity: 0; animation: hRise 1s var(--ease) .5s forwards; transform: translateY(20px); }
.h-hero-card { position: relative; opacity: 0; animation: hRise 1.2s var(--ease) .55s forwards; transform: translateY(30px); perspective: 1000px; }
.h-tilt { position: relative; display: block; text-decoration: none; border-radius: 26px; padding: 14px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .25); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .7); transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .3s ease; transform-style: preserve-3d; }
.h-tilt img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: top; border-radius: 16px; transform: translateZ(30px); }
.h-tilt-badge { position: absolute; top: -14px; left: 22px; z-index: 2; display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font: 600 .82rem 'Kanit', sans-serif; color: var(--em-900); background: linear-gradient(135deg, var(--gold-2), var(--gold)); box-shadow: 0 10px 20px -8px rgba(0, 0, 0, .5); transform: translateZ(50px); }
.h-tilt-cap { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 6px 4px; color: #fff; transform: translateZ(40px); }
.h-tilt-cap b { font: 600 1.05rem 'Kanit', sans-serif; display: block; }
.h-tilt-cap small { color: rgba(255, 255, 255, .7); }
.h-tilt-cap i { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--em-900); flex: 0 0 auto; }
.h-float { position: absolute; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 16px; background: #fff; color: var(--ink); box-shadow: 0 20px 40px -18px rgba(0, 0, 0, .6); font: 500 .85rem 'Kanit', sans-serif; animation: hBob 5s ease-in-out infinite; }
.h-float i { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; }
.h-float-1 { left: -38px; bottom: 22%; } .h-float-1 i { background: linear-gradient(135deg, #f59e0b, #d97706); }
.h-float-2 { right: -26px; top: 18%; animation-delay: -2.5s; } .h-float-2 i { background: linear-gradient(135deg, #10b981, #047857); }
@keyframes hBob { 50% { transform: translateY(-10px); } }
.h-stats { margin: clamp(40px, 7vh, 72px) 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-radius: 22px 22px 0 0; overflow: hidden; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); border-bottom: 0; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.h-stat { padding: 22px 20px; border-right: 1px solid rgba(255, 255, 255, .12); }
.h-stat:last-child { border-right: 0; }
.h-stat dt { order: 2; font: 400 .9rem 'Sarabun', sans-serif; color: rgba(236, 253, 245, .75); margin-top: 2px; }
.h-stat dd { margin: 0; font: 700 clamp(1.7rem, 1.2rem + 1.6vw, 2.6rem) 'Kanit', sans-serif; color: #fff; line-height: 1.1; }
.h-stat dd small { font-size: .55em; color: var(--gold-2); margin-left: 2px; }
.h-stat { display: flex; flex-direction: column; }
.h-scroll { position: absolute; left: 50%; bottom: 112px; transform: translateX(-50%); width: 26px; height: 42px; border: 2px solid rgba(255, 255, 255, .45); border-radius: 14px; display: none; }
.h-scroll::after { content: ""; position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: #fff; animation: hWheel 1.8s infinite; }
@keyframes hWheel { 0% { opacity: 1; transform: translateY(0); } 80% { opacity: 0; transform: translateY(12px); } 100% { opacity: 0; } }
.h-hero-dots { position: absolute; right: 20px; bottom: 130px; display: flex; flex-direction: column; gap: 8px; z-index: 2; }
.h-hero-dots button { width: 10px; height: 10px; border-radius: 50%; border: 0; padding: 0; background: rgba(255, 255, 255, .35); cursor: pointer; transition: all .3s; }
.h-hero-dots button[aria-current=true] { height: 26px; border-radius: 6px; background: var(--gold); }

/* ---------- ticker ---------- */
.h-ticker { display: flex; align-items: center; gap: 14px; background: var(--em-900); color: #e9fbf1; border-top: 1px solid rgba(255, 255, 255, .08); border-bottom: 3px solid var(--gold); padding: 0 0 0 20px; overflow: hidden; }
.h-ticker-label { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; font: 600 .9rem 'Kanit', sans-serif; color: var(--em-900); background: linear-gradient(135deg, var(--gold-2), var(--gold)); padding: 6px 14px; border-radius: 10px; margin: 10px 0; }
.h-ticker-track { flex: 1; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.h-ticker-move { display: inline-flex; gap: 48px; white-space: nowrap; padding-left: 20px; animation: hTick 38s linear infinite; font-size: .98rem; }
.h-ticker-move span::before { content: "◆"; color: var(--gold); margin-right: 14px; font-size: .7em; vertical-align: 2px; }
.h-ticker:hover .h-ticker-move, .h-ticker:focus-within .h-ticker-move { animation-play-state: paused; }
.h-ticker-move a { color: #fff; text-decoration: underline; text-decoration-color: rgba(212, 175, 55, .6); text-underline-offset: 3px; }
@keyframes hTick { to { transform: translateX(-50%); } }

/* ==========================================================================
   QUICK ACCESS (bento)
   ========================================================================== */
.h-quick { padding-top: clamp(56px, 7vw, 96px); }
.h-bento { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(150px, auto); gap: 16px; }
.h-tile { position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; padding: 22px; border-radius: var(--r); background: var(--paper); border: 1px solid var(--line); box-shadow: var(--sh-1); text-decoration: none; overflow: hidden; transition: transform .35s var(--ease), box-shadow .35s, border-color .35s; }
.h-tile:hover { transform: translateY(-6px); box-shadow: var(--sh-2); border-color: rgba(212, 175, 55, .55); }
.h-tile-ic { position: absolute; top: 20px; left: 22px; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 1.35rem; color: #fff; background: var(--c, var(--em)); box-shadow: 0 12px 22px -12px var(--c, var(--em)); transition: transform .4s var(--ease); }
.h-tile:hover .h-tile-ic { transform: rotate(-8deg) scale(1.08); }
.h-tile b { font: 600 1.12rem 'Kanit', sans-serif; color: var(--ink); line-height: 1.3; }
.h-tile small { color: var(--mut); font-size: .9rem; line-height: 1.45; }
.h-tile-go { position: absolute; top: 22px; right: 20px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--mut); background: #f3f5f4; font-size: .8rem; transition: all .3s var(--ease); }
.h-tile:hover .h-tile-go { background: var(--em-900); color: var(--gold-2); transform: rotate(-45deg); }
.h-tile-xl { grid-column: span 2; grid-row: span 2; padding: 28px; color: #fff; justify-content: flex-end; min-height: 320px; background: var(--em-900); }
.h-tile-xl > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform 1.2s var(--ease); }
.h-tile-xl::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(1, 26, 20, .97) 0%, rgba(1, 26, 20, .9) 30%, rgba(2, 44, 34, .25) 62%, rgba(2, 44, 34, 0)); }
.h-tile-xl:hover > img { transform: scale(1.06); }
.h-tile-xl b { color: #fff; font-size: clamp(1.4rem, 1.1rem + 1vw, 2rem); }
.h-tile-xl small { color: rgba(255, 255, 255, .82); font-size: 1rem; max-width: 28em; }
.h-tile-xl .h-pill { align-self: flex-start; margin-bottom: 10px; }
.h-tile-xl .h-tile-go { background: rgba(255, 255, 255, .15); color: #fff; }
.h-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font: 600 .78rem 'Kanit', sans-serif; background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: var(--em-900); }
.h-tile-wide { grid-column: span 2; flex-direction: row; align-items: center; justify-content: flex-start; gap: 18px; min-height: 0; }
.h-tile-wide .h-tile-ic { position: static; flex: 0 0 auto; }
.h-tile-wide .h-tile-go { position: static; margin-left: auto; flex: 0 0 auto; }

/* ==========================================================================
   DIRECTOR
   ========================================================================== */
.h-dir { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.h-dir-photo { position: relative; max-width: 440px; margin: 0 auto; }
.h-dir-photo::before { content: ""; position: absolute; inset: -18px; border-radius: 40% 60% 55% 45% / 45% 45% 55% 55%; background: conic-gradient(from 120deg, var(--gold), var(--em-400), var(--em-900), var(--gold)); filter: blur(2px); opacity: .9; animation: hMorph 14s ease-in-out infinite alternate; }
@keyframes hMorph { 50% { border-radius: 55% 45% 40% 60% / 55% 60% 40% 45%; transform: rotate(8deg); } }
.h-dir-photo img { position: relative; display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 50%; border: 8px solid var(--ivory); box-shadow: var(--sh-2); }
.h-dir-tag { position: absolute; right: 2%; bottom: 8%; padding: 12px 18px; border-radius: 18px; background: var(--paper); box-shadow: var(--sh-2); font: 600 .95rem 'Kanit', sans-serif; color: var(--em-900); }
.h-dir-tag small { display: block; font: 400 .8rem 'Sarabun', sans-serif; color: var(--mut); }
.h-quote { position: relative; margin: 22px 0 26px; padding: 26px 28px 26px 30px; border-radius: var(--r); background: var(--paper); border: 1px solid var(--line); box-shadow: var(--sh-1); font-size: clamp(1.05rem, 1rem + .3vw, 1.25rem); line-height: 1.8; color: var(--ink-2); }
.h-quote::before { content: "\201C"; position: absolute; top: -26px; left: 18px; font: 700 5rem/1 'Playfair Display', Georgia, serif; color: var(--gold); }
.h-dir-name { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.2rem); }
.h-dir-role { color: var(--mut); margin: 4px 0 0; }
.h-dir .mnmc-wrap { padding: 0; justify-content: flex-start; margin-top: 18px; }

/* ==========================================================================
   NEWS
   ========================================================================== */
.h-news { background: linear-gradient(180deg, #fff 0%, var(--ivory) 100%); }
.h-news-top { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 24px; align-items: stretch; margin-bottom: 40px; }
.h-feature { border-radius: var(--r-lg); overflow: hidden; background: var(--em-950); box-shadow: var(--sh-2); position: relative; }
.h-feature .carousel, .h-feature .carousel-inner, .h-feature .carousel-item { height: 100%; }
.h-feature .carousel-item img { width: 100%; height: 100%; max-height: 520px; min-height: 360px; object-fit: contain; background: radial-gradient(circle at 50% 30%, #0b4a35, var(--em-950)); cursor: zoom-in; }
.h-feature .carousel-indicators { margin-bottom: .6rem; }
.h-feature .carousel-indicators [data-bs-target] { width: 8px; height: 8px; border-radius: 50%; border: 0; }
.h-feature-load { display: grid; place-items: center; min-height: 360px; color: rgba(255, 255, 255, .7); }
.h-latest { display: flex; flex-direction: column; justify-content: space-between; gap: 20px; padding: clamp(24px, 3vw, 36px); border-radius: var(--r-lg); color: #fff; background: radial-gradient(120% 80% at 100% 0%, rgba(212, 175, 55, .3), transparent 55%), linear-gradient(160deg, var(--em-800), var(--em-950)); box-shadow: var(--sh-2); position: relative; overflow: hidden; }
.h-latest::after { content: attr(data-m); position: absolute; right: -10px; bottom: -40px; font: 700 12rem/1 'Kanit', sans-serif; color: rgba(255, 255, 255, .05); }
.h-latest h3 { color: #fff; font-size: clamp(1.5rem, 1.2rem + 1vw, 2.1rem); }
.h-latest p { color: rgba(236, 253, 245, .8); margin: 10px 0 0; }
.h-latest .h-pill { margin-bottom: 14px; }
.h-latest-acts { display: flex; flex-wrap: wrap; gap: 10px; position: relative; z-index: 1; }
.h-tabs { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 0 0 26px; padding: 0; list-style: none; }
.h-tabs .nav-link { border: 1px solid var(--line); background: #fff; color: var(--ink-2); border-radius: 999px; padding: 9px 22px; font: 600 .95rem 'Kanit', sans-serif; transition: all .25s; }
.h-tabs .nav-link:hover { border-color: var(--gold); color: var(--em); }
.h-tabs .nav-link.active { background: var(--em-900); border-color: var(--em-900); color: var(--gold-2); box-shadow: 0 12px 24px -14px rgba(2, 44, 34, .9); }
.h-rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 6px 4px 18px; scrollbar-width: thin; scrollbar-color: var(--gold) transparent; }
.h-rail::-webkit-scrollbar { height: 8px; } .h-rail::-webkit-scrollbar-thumb { background: rgba(212, 175, 55, .6); border-radius: 8px; }
.h-month { scroll-snap-align: start; position: relative; display: block; border-radius: 18px; overflow: hidden; aspect-ratio: 3 / 4; text-decoration: none; background: #e7ece9; box-shadow: var(--sh-1); transition: transform .4s var(--ease), box-shadow .4s; }
.h-month img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .8s var(--ease); }
.h-month::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(1, 26, 20, .92) 0%, rgba(1, 26, 20, .1) 55%, transparent); }
.h-month-cap { position: absolute; left: 14px; right: 14px; bottom: 12px; z-index: 1; color: #fff; }
.h-month-cap b { display: block; font: 600 1.15rem 'Kanit', sans-serif; }
.h-month-cap small { color: rgba(255, 255, 255, .75); font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; }
.h-month-new { position: absolute; top: 12px; right: 12px; z-index: 1; }
.h-month:hover { transform: translateY(-6px); box-shadow: var(--sh-2); }
.h-month:hover img { transform: scale(1.06); }
.h-empty { text-align: center; padding: 40px 20px; border-radius: var(--r); background: #fff; border: 1px dashed rgba(2, 44, 34, .18); color: var(--mut); }
.h-empty .h-btn { margin-top: 14px; }
.h-center { text-align: center; margin-top: 28px; }

/* ---------- mom banner ---------- */
.h-mom { position: relative; overflow: hidden; display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: center; padding: clamp(24px, 3vw, 36px) clamp(22px, 4vw, 48px); border-radius: var(--r-xl); background: linear-gradient(120deg, #e0f2fe 0%, #f0f9ff 55%, #fdf2f8 100%); border: 1px solid rgba(56, 189, 248, .45); box-shadow: 0 30px 60px -36px rgba(14, 165, 233, .7); }
.h-mom::after { content: "\f004"; font-family: 'Font Awesome 6 Free'; font-weight: 900; position: absolute; right: -30px; top: -60px; font-size: 16rem; color: rgba(255, 255, 255, .7); transform: rotate(-14deg); pointer-events: none; }
.h-mom > * { position: relative; z-index: 1; }
.h-mom-ic { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; font-size: 2rem; color: #fff; background: linear-gradient(135deg, #38bdf8, #0284c7); box-shadow: 0 16px 30px -14px #0284c7; }
.h-mom-ic i { animation: hBeat 1.6s ease-in-out infinite; }
@keyframes hBeat { 15%, 45% { transform: scale(1.2); } 30% { transform: scale(1); } }
.h-mom h3 { color: #075985; font-size: clamp(1.3rem, 1.1rem + .8vw, 1.8rem); }
.h-mom p { margin: 4px 0 0; color: #0c4a6e; }
.h-mom .h-btn { position: relative; z-index: 1; background: linear-gradient(135deg, #0ea5e9, #0369a1); color: #fff !important; box-shadow: 0 16px 30px -14px #0369a1; }

/* ==========================================================================
   AWARDS (ข้อมูลจากสคริปต์ในหน้า)
   ========================================================================== */
.h-awards { background: var(--em-950); color: #e9fbf1; overflow: hidden; }
.h-awards::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 50% at 15% 0%, rgba(16, 178, 106, .25), transparent 60%), radial-gradient(50% 40% at 90% 100%, rgba(212, 175, 55, .2), transparent 60%); pointer-events: none; }
.h-awards .h-title, .h-awards h3 { color: #fff; }
.h-awards .h-sub { color: rgba(236, 253, 245, .7); }
.h-awards .h-tabs .nav-link { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .14); color: #e9fbf1; }
.h-awards .h-tabs .nav-link.active { background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: var(--em-900); border-color: transparent; }
.h-award-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.h-award { position: relative; display: flex; flex-direction: column; border-radius: 22px; overflow: hidden; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1); transition: transform .4s var(--ease), border-color .4s, background .4s; }
.h-award:hover { transform: translateY(-8px); border-color: rgba(212, 175, 55, .6); background: rgba(255, 255, 255, .08); }
.h-award-img { position: relative; aspect-ratio: 4 / 5; overflow: hidden; cursor: zoom-in; background: #0a2e23; border: 0; padding: 0; width: 100%; display: block; }
.h-award-img .bg { position: absolute; inset: -10%; background-size: cover; background-position: center; filter: blur(18px) brightness(.6); }
.h-award-img img { position: relative; width: 100%; height: 100%; object-fit: contain; padding: 10px; transition: transform .6s var(--ease); }
.h-award:hover .h-award-img img { transform: scale(1.05); }
.h-medal { position: absolute; top: 12px; right: 12px; z-index: 2; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-size: 1.1rem; color: #fff; box-shadow: 0 8px 18px -6px rgba(0, 0, 0, .6); border: 2px solid rgba(255, 255, 255, .8); }
.medal-gold { background: linear-gradient(135deg, #fde68a, #d4a017); color: #5a3e00; }
.medal-silver { background: linear-gradient(135deg, #f1f5f9, #94a3b8); color: #1e293b; }
.medal-bronze { background: linear-gradient(135deg, #f0a35e, #b45309); }
.medal-winner { background: linear-gradient(135deg, #fde047, #f59e0b); color: #5a3e00; }
.h-award-body { padding: 16px 18px 20px; }
.h-award-body b { display: block; font: 600 1.05rem 'Kanit', sans-serif; color: #fff; }
.h-award-cls { display: inline-block; margin: 6px 0 8px; padding: 2px 10px; border-radius: 999px; font-size: .8rem; background: rgba(16, 178, 106, .18); color: #7ef0b5; }
.h-award-body p { margin: 0; font-size: .9rem; line-height: 1.55; color: rgba(236, 253, 245, .72); }
.h-award-body p strong { color: var(--gold-2); font-weight: 600; }
.modal-award-zoom .modal-content { background: transparent; border: 0; }
.modal-award-zoom img { max-height: 82vh; object-fit: contain; border-radius: 14px; box-shadow: 0 20px 50px rgba(0, 0, 0, .6); }
.h-x { position: absolute; top: -14px; right: -14px; z-index: 5; width: 42px; height: 42px; border-radius: 50%; border: 2px solid #fff; background: #ef4444; color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 6px 16px rgba(0, 0, 0, .35); }

/* ==========================================================================
   ACADEMIC EXCELLENCE
   ========================================================================== */
.h-filter { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: -8px 0 30px; }
.h-filter button { border: 1px dashed rgba(2, 44, 34, .25); background: transparent; color: var(--ink-2); border-radius: 999px; padding: 6px 16px; font: 500 .9rem 'Kanit', sans-serif; cursor: pointer; transition: all .2s; }
.h-filter button.active, .h-filter button:hover { border-style: solid; border-color: var(--em); color: var(--em); background: rgba(0, 127, 61, .06); }
.h-exam-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.h-exam { display: flex; flex-direction: column; border-radius: 24px; overflow: hidden; background: var(--paper); border: 1px solid var(--line); box-shadow: var(--sh-1); transition: transform .4s var(--ease), box-shadow .4s; }
.h-exam:hover { transform: translateY(-8px); box-shadow: var(--sh-2); }
.h-exam-art { position: relative; height: 170px; overflow: hidden; display: flex; align-items: flex-end; padding: 18px 20px; color: #fff; background: var(--g); }
.h-exam-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .35; mix-blend-mode: luminosity; }
.h-exam-art strong { position: relative; font: 700 3.4rem/1 'Kanit', sans-serif; letter-spacing: -.02em; text-shadow: 0 6px 20px rgba(0, 0, 0, .25); }
.h-exam-art span { position: absolute; right: 18px; top: 16px; width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .2); border: 1px solid rgba(255, 255, 255, .4); font-size: 1.3rem; }
.h-exam-art::after { content: ""; position: absolute; width: 220px; height: 220px; right: -60px; bottom: -110px; border-radius: 50%; border: 30px solid rgba(255, 255, 255, .1); }
.type-onet { --g: linear-gradient(135deg, #6d28d9, #be185d); --c: #be185d; }
.type-nt { --g: linear-gradient(135deg, #d97706, #e11d48); --c: #e11d48; }
.type-rt { --g: linear-gradient(135deg, #06b6d4, #1d4ed8); --c: #1d4ed8; }
.h-exam-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.h-exam-body h3 { font-size: 1.2rem; }
.h-exam-body p { margin: 2px 0 14px; color: var(--mut); font-size: .9rem; }
.h-exam-stat { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-radius: 12px; background: #f5f7f6; margin-bottom: 16px; font-size: .92rem; }
.h-exam-stat b { font: 700 1.1rem 'Kanit', sans-serif; color: var(--c); }
.h-exam-go { margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; border-radius: 12px; border: 1.5px solid var(--c); color: var(--c) !important; text-decoration: none; font: 600 .95rem 'Kanit', sans-serif; transition: all .25s; }
.h-exam-go:hover { background: var(--c); color: #fff !important; }
.h-exam-go.is-off { border-style: dashed; opacity: .6; pointer-events: none; }

/* ---------- teacher fame ---------- */
.h-tf-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.h-tf { position: relative; display: block; border-radius: 22px; overflow: hidden; aspect-ratio: 3 / 4; background: #e7ece9; box-shadow: var(--sh-1); }
.h-tf img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.h-tf::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(1, 26, 20, .6), transparent 45%); }
.h-tf:hover img { transform: scale(1.07); }
.h-tf i { position: absolute; top: 12px; right: 12px; z-index: 1; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--gold); box-shadow: var(--sh-1); }

/* ==========================================================================
   PROGRAMS / CRAFTS
   ========================================================================== */
.h-prog-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.h-prog { position: relative; display: flex; flex-direction: column; min-height: 330px; padding: 24px; border-radius: 26px; color: #fff; text-decoration: none; overflow: hidden; background: var(--g); box-shadow: 0 30px 50px -30px var(--s); transition: transform .45s var(--ease), box-shadow .45s; }
.h-prog:hover { transform: translateY(-10px) rotate(-.5deg); color: #fff; }
.h-prog-code { position: absolute; right: -6px; bottom: -28px; font: 700 7.5rem/1 'Kanit', sans-serif; color: rgba(255, 255, 255, .14); letter-spacing: -.04em; transition: transform .6s var(--ease); }
.h-prog:hover .h-prog-code { transform: translateX(-10px) scale(1.05); }
.h-prog-ic { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 1.4rem; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .35); }
.h-prog .h-pill { position: absolute; top: 24px; right: 24px; background: rgba(255, 255, 255, .92); }
.h-prog h3 { color: #fff; font-size: 1.35rem; margin-top: 22px; }
.h-prog p { color: rgba(255, 255, 255, .85); font-size: .95rem; margin: 8px 0 0; }
.h-prog-more { margin-top: auto; padding-top: 18px; font: 600 .95rem 'Kanit', sans-serif; display: inline-flex; align-items: center; gap: 8px; position: relative; }
.h-prog-more i { transition: transform .3s; }
.h-prog:hover .h-prog-more i { transform: translateX(6px); }
.p-iep { --g: linear-gradient(150deg, #0ea5e9, #1d4ed8); --s: #1d4ed8; }
.p-msc { --g: linear-gradient(150deg, #a855f7, #5b21b6); --s: #5b21b6; }
.p-mep { --g: linear-gradient(150deg, #14b8a6, #0f766e); --s: #0f766e; }
.p-gep { --g: linear-gradient(150deg, #f59e0b, #c2410c); --s: #c2410c; }
.h-craft-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.h-craft { position: relative; display: flex; align-items: center; gap: 18px; padding: 22px 24px; border-radius: 22px; text-decoration: none; background: var(--paper); border: 1px solid var(--line); box-shadow: var(--sh-1); overflow: hidden; transition: transform .35s var(--ease), box-shadow .35s; }
.h-craft:hover { transform: translateY(-6px); box-shadow: var(--sh-2); }
.h-craft-n { flex: 0 0 auto; width: 76px; height: 76px; border-radius: 22px; display: grid; place-items: center; font: 700 1.8rem 'Kanit', sans-serif; color: #fff; background: var(--g); box-shadow: 0 14px 26px -14px var(--s); }
.h-craft b { display: block; font: 600 1.15rem 'Kanit', sans-serif; color: var(--ink); }
.h-craft small { color: var(--mut); }
.h-craft .h-tile-go { position: static; margin-left: auto; }
.c-71 { --g: linear-gradient(135deg, #f97316, #c2410c); --s: #c2410c; }
.c-72 { --g: linear-gradient(135deg, #3b82f6, #1e3a8a); --s: #1e3a8a; }
.c-73 { --g: linear-gradient(135deg, #facc15, #b8860b); --s: #b8860b; }

/* ---------- guidance ---------- */
.h-guide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center; padding: clamp(28px, 4vw, 56px); border-radius: var(--r-xl); background: radial-gradient(70% 90% at 100% 0%, rgba(212, 175, 55, .16), transparent 60%), var(--paper); border: 1px solid rgba(212, 175, 55, .3); box-shadow: var(--sh-2); }
.h-guide-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.h-guide-stats div { padding: 18px 12px; text-align: center; border-radius: 18px; background: var(--ivory); border: 1px solid var(--line); }
.h-guide-stats b { display: block; font: 700 clamp(1.4rem, 1.1rem + 1vw, 2rem)/1.1 'Kanit', sans-serif; color: var(--em); }
.h-guide-stats small { color: var(--mut); font-size: .82rem; }
.h-logos { margin-top: 14px; padding: 18px; border-radius: 18px; background: var(--ivory); border: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.h-logos img { width: 54px; height: 54px; object-fit: contain; filter: grayscale(1); opacity: .65; transition: all .3s; }
.h-logos img:hover { filter: none; opacity: 1; transform: scale(1.12); }
.h-logos-cap { width: 100%; text-align: center; font: 600 .82rem 'Kanit', sans-serif; color: var(--gold-ink); letter-spacing: .06em; }

/* ==========================================================================
   ORGANIZATION / SERVICES
   ========================================================================== */
.h-org { background: linear-gradient(180deg, var(--ivory), #fff); }
.h-dept-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.h-dept { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 22px 18px; border-radius: 22px; text-decoration: none; background: var(--paper); border: 1px solid var(--line); box-shadow: var(--sh-1); transition: transform .35s var(--ease), box-shadow .35s, border-color .35s; }
.h-dept:hover { transform: translateY(-6px); box-shadow: var(--sh-2); border-color: var(--c); }
.h-dept i { width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; font-size: 1.25rem; color: #fff; background: var(--c); box-shadow: 0 12px 22px -12px var(--c); }
.h-dept b { font: 600 1rem 'Kanit', sans-serif; color: var(--ink); line-height: 1.35; }
.h-dept small { color: var(--mut); font-size: .82rem; margin-top: -10px; }
.h-row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.h-entry { position: relative; display: flex; align-items: center; gap: 18px; padding: 22px 24px; border-radius: 22px; text-decoration: none; color: #fff; overflow: hidden; background: var(--g); box-shadow: 0 24px 40px -28px var(--s); transition: transform .35s var(--ease); }
.h-entry:hover { transform: translateY(-5px); color: #fff; }
.h-entry > i:first-child { flex: 0 0 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 1.4rem; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .3); }
.h-entry b { display: block; font: 600 1.15rem 'Kanit', sans-serif; }
.h-entry small { color: rgba(255, 255, 255, .78); }
.h-entry .fa-arrow-right { margin-left: auto; transition: transform .3s; }
.h-entry:hover .fa-arrow-right { transform: translateX(6px); }
.e-civil { --g: linear-gradient(135deg, #065f46, #022c22); --s: #022c22; }
.e-contract { --g: linear-gradient(135deg, #0369a1, #0f172a); --s: #0f172a; }
.e-demo { --g: linear-gradient(135deg, #3b82f6, #1e40af); --s: #1e40af; }
.e-council { --g: linear-gradient(135deg, #10b981, #047857); --s: #047857; }
.h-svc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.h-svc { position: relative; display: flex; flex-direction: column; gap: 6px; min-height: 190px; padding: 24px; border-radius: 24px; text-decoration: none; color: #fff; overflow: hidden; background: var(--g); transition: transform .4s var(--ease), box-shadow .4s; box-shadow: 0 26px 44px -30px var(--s); }
.h-svc:hover { transform: translateY(-8px); color: #fff; }
.h-svc .h-pill { align-self: flex-start; background: rgba(255, 255, 255, .92); }
.h-svc b { font: 600 1.3rem 'Kanit', sans-serif; margin-top: auto; }
.h-svc small { color: rgba(255, 255, 255, .82); font-size: .92rem; }
.h-svc > i { position: absolute; right: -10px; top: -10px; font-size: 7rem; opacity: .14; transform: rotate(-12deg); transition: transform .6s var(--ease); }
.h-svc:hover > i { transform: rotate(0) scale(1.08); }
.s-purple { --g: linear-gradient(135deg, #8b5cf6, #5b21b6); --s: #5b21b6; }
.s-cyan { --g: linear-gradient(135deg, #06b6d4, #0e7490); --s: #0e7490; }
.s-orange { --g: linear-gradient(135deg, #f59e0b, #b45309); --s: #b45309; }
.s-red { --g: linear-gradient(135deg, #f43f5e, #9f1239); --s: #9f1239; }
.s-green { --g: linear-gradient(135deg, #22c55e, #15803d); --s: #15803d; }
.s-gold { --g: linear-gradient(135deg, #eab308, #a16207); --s: #a16207; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.h-foot { position: relative; background: var(--em-950); color: rgba(236, 253, 245, .72); padding: clamp(56px, 7vw, 88px) 0 0; overflow: hidden; }
.h-foot::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--em), var(--gold), var(--em)); }
.h-foot-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; padding: clamp(22px, 3vw, 32px); margin-bottom: 48px; border-radius: 24px; background: linear-gradient(120deg, rgba(212, 175, 55, .18), rgba(16, 178, 106, .12)); border: 1px solid rgba(212, 175, 55, .3); }
.h-foot-cta h3 { color: #fff; font-size: clamp(1.3rem, 1.1rem + .8vw, 1.8rem); }
.h-foot-cta p { margin: 4px 0 0; }
.h-foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.3fr; gap: 36px; }
.h-foot h4 { font: 600 .82rem 'Kanit', sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-2); margin: 0 0 16px; }
.h-foot-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.h-foot-brand img { width: 54px; height: 54px; }
.h-foot-brand b { font: 600 1.15rem 'Kanit', sans-serif; color: #fff; display: block; }
.h-foot-brand small { font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; }
.h-foot ul { list-style: none; margin: 0; padding: 0; }
.h-foot li + li { margin-top: 8px; }
.h-foot a { color: rgba(236, 253, 245, .78); text-decoration: none; transition: color .2s; }
.h-foot a:hover { color: var(--gold-2); }
.h-foot-contact li { display: flex; gap: 10px; }
.h-foot-contact i { color: var(--gold); margin-top: 6px; width: 16px; }
.h-social { display: flex; gap: 10px; margin-top: 18px; }
.h-social a { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); color: #fff; }
.h-social a:hover { background: var(--gold); color: var(--em-900); }
.h-map { width: 100%; height: 170px; border: 0; border-radius: 16px; display: block; filter: saturate(.8) contrast(1.05); }
.h-counter[hidden] { display: none; }
.h-counter { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.h-counter div { padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1); }
.h-counter small { display: flex; align-items: center; gap: 6px; font-size: .8rem; }
.h-counter b { display: block; font: 700 1.4rem 'Kanit', sans-serif; color: #fff; }
.h-live { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 10px #22c55e; animation: hPing 2s infinite; }
.h-foot-bottom { margin-top: 48px; padding: 20px 0 calc(20px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(255, 255, 255, .08); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; font-size: .85rem; }

/* ---------- floating portal button ---------- */
.h-fab { position: fixed; right: 82px; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 1029; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 999px; background: linear-gradient(135deg, #00924a, var(--em-900)); color: #fff !important; text-decoration: none; font: 600 .95rem 'Kanit', sans-serif; border: 2px solid var(--gold); box-shadow: 0 16px 30px -14px rgba(2, 44, 34, .9); transition: opacity .3s, transform .3s var(--ease); }
.h-fab.is-hidden { opacity: 0; transform: translateY(14px); pointer-events: none; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1199px) {
  .h-bento { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .h-tile-xl { grid-column: span 3; grid-row: span 1; min-height: 280px; }
  .h-dept-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .h-prog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .h-foot-grid { grid-template-columns: 1fr 1fr; }
  .h-float-1 { left: -10px; } .h-float-2 { right: -10px; }
}
@media (max-width: 991px) {
  .h-hero-in { grid-template-columns: 1fr; }
  .h-hero-card { max-width: 420px; }
  .h-float { display: none; }
  .h-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .h-stat:nth-child(2) { border-right: 0; }
  .h-stat:nth-child(-n+2) { border-bottom: 1px solid rgba(255, 255, 255, .12); }
  .h-dir, .h-news-top, .h-guide { grid-template-columns: 1fr; }
  .h-tf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .h-craft-grid, .h-svc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .h-hero-dots { display: none; }
}
@media (max-width: 767px) {
  .h-wrap { padding: 0 16px; }
  .h-hero { padding-top: 40px; min-height: 0; }
  .h-hero-card { display: none; }
  .h-hero-cta .h-btn { flex: 1 1 100%; }
  .h-stats { margin-top: 40px; border-radius: 18px 18px 0 0; }
  .h-stat { padding: 16px 14px; }
  .h-ticker { padding-left: 12px; }
  .h-ticker-label span { display: none; }
  .h-bento { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; grid-auto-rows: minmax(140px, auto); }
  .h-tile-xl, .h-tile-wide { grid-column: span 2; }
  .h-tile { padding: 16px; }
  .h-tile-ic { top: 16px; left: 16px; width: 46px; height: 46px; font-size: 1.15rem; }
  .h-tile-go { top: 16px; right: 14px; }
  .h-tile b { font-size: 1rem; }
  .h-tile small { font-size: .82rem; }
  .h-mom { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .h-rail { grid-auto-columns: 62%; }
  .h-dept-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .h-dept:last-child { grid-column: span 2; }
  .h-row2, .h-craft-grid, .h-svc-grid, .h-prog-grid { grid-template-columns: 1fr; }
  .h-prog { min-height: 260px; }
  .h-guide-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .h-foot-grid { grid-template-columns: 1fr; gap: 28px; }
  .h-fab { right: 74px; bottom: calc(14px + env(safe-area-inset-bottom)); padding: 0 14px; }
  .h-quote { padding: 22px 20px 20px 22px; }
  .h-dir-photo { max-width: 290px; }
  .h-exam-art { height: 120px; } .h-exam-art strong { font-size: 2.6rem; }
  .h-award-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .h-award-body { padding: 12px 12px 14px; } .h-award-body b { font-size: .95rem; } .h-award-body p { font-size: .82rem; }
  .h-medal { width: 34px; height: 34px; font-size: .9rem; top: 8px; right: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .rv { opacity: 1; transform: none; }
  .h-hero h1 span, .h-lead, .h-hero-cta, .h-hero-card { opacity: 1; transform: none; }
  .h-hero-media img { transform: none !important; }
}
@media print {
  .h-fab, .h-ticker, .h-hero-media, .h-orb { display: none !important; }
  .h-hero { color: #000; background: none; min-height: 0; }
}

/* ==========================================================================
   ส่วนที่คงไว้จากหน้าเดิม: ประกาศไว้อาลัย / ห้องทำงานครู / หน้าปกเอกสาร
   ========================================================================== */
#mourning-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .95); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); z-index: 999999; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: all .5s ease; }
#mourning-overlay.show { opacity: 1; visibility: visible; }
.mourning-content { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 25px; padding: 20px; transform: scale(.95); transition: all .5s cubic-bezier(.165, .84, .44, 1); }
#mourning-overlay.show .mourning-content { transform: scale(1); }
.mourning-img { max-width: 1200px; width: 100%; max-height: 80vh; object-fit: contain; border-radius: 8px; box-shadow: 0 15px 50px rgba(0, 0, 0, .6); }
.btn-enter-site { background: transparent; color: #fff; font-family: 'Kanit', sans-serif; border: 2px solid rgba(255, 255, 255, .4); padding: 12px 50px; border-radius: 50px; font-size: 1.15rem; font-weight: 300; letter-spacing: 1px; cursor: pointer; transition: all .3s; }
.btn-enter-site:hover { background: #fff; color: #000; border-color: #fff; transform: translateY(-2px); }

.tp { position: relative; margin: 0 auto clamp(32px, 6vw, 72px); padding: 0 16px; max-width: 1240px; }
.tp-inner { position: relative; overflow: hidden; border-radius: 32px; padding: clamp(28px, 5vw, 56px) clamp(18px, 4vw, 52px); color: #ecfdf5; background: radial-gradient(120% 90% at 100% 0%, rgba(212,175,55,.22) 0%, transparent 55%), linear-gradient(160deg, #04382b 0%, var(--em-900) 60%, #011a14 100%); box-shadow: 0 30px 60px -25px rgba(2,44,34,.6); border: 1px solid rgba(212,175,55,.35); }
.tp-inner::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5; background-image: radial-gradient(rgba(243,229,171,.35) 1px, transparent 1px); background-size: 22px 22px; -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 70%); mask-image: linear-gradient(to bottom, #000 0%, transparent 70%); }
.tp-head { position: relative; max-width: 640px; margin-bottom: clamp(22px, 3vw, 34px); }
.tp-kicker { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 10px; font-family: 'Kanit', sans-serif; font-weight: 500; color: var(--gold-3); background: rgba(212,175,55,.14); border: 1px solid rgba(212,175,55,.4); padding: 4px 14px; border-radius: 999px; font-size: .95rem; }
.tp-head h2 { margin: 0 0 8px; color: #fff; font-weight: 700; font-size: clamp(1.6rem, 1.1rem + 2.2vw, 2.6rem); line-height: 1.25; }
.tp-lead { margin: 0; color: rgba(236,253,245,.82); font-size: clamp(1rem, .95rem + .3vw, 1.15rem); }
.tp-grid { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 2.4vw, 26px); }
.tp-card { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 250px; padding: clamp(22px, 3vw, 32px); border-radius: 24px; text-decoration: none; isolation: isolate; transition: transform .25s ease, box-shadow .25s ease; }
.tp-card:hover { transform: translateY(-4px); }
.tp-year { position: absolute; z-index: -1; right: -.06em; bottom: -.22em; font-family: 'Kanit', sans-serif; font-weight: 700; font-size: clamp(96px, 15vw, 190px); line-height: 1; letter-spacing: -.02em; pointer-events: none; transition: transform .4s ease; }
.tp-card:hover .tp-year { transform: translateX(-8px); }
.tp-badge { display: inline-flex; align-items: center; gap: 6px; font-family: 'Kanit', sans-serif; font-weight: 600; font-size: .85rem; padding: 4px 12px; border-radius: 999px; }
.tp-name { font-family: 'Kanit', sans-serif; font-weight: 700; font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); line-height: 1.15; margin-top: 6px; }
.tp-desc { font-size: 1.02rem; line-height: 1.55; max-width: 22em; }
.tp-desc strong { font-family: 'Kanit', sans-serif; font-weight: 600; font-size: 1.12rem; }
.tp-cta { margin-top: auto; display: inline-flex; align-items: center; gap: 10px; font-family: 'Kanit', sans-serif; font-weight: 600; font-size: 1.08rem; padding: 12px 22px; border-radius: 14px; min-height: 48px; transition: gap .25s ease, filter .25s ease; }
.tp-card:hover .tp-cta { gap: 16px; filter: brightness(1.06); }
.tp-new { background: linear-gradient(150deg, #fffdf5 0%, #f6efd6 100%); color: #14352b; box-shadow: 0 18px 40px -20px rgba(0,0,0,.6); }
.tp-new .tp-year { color: rgba(0,127,61,.13); }
.tp-new .tp-badge { background: var(--em); color: #fff; }
.tp-new .tp-name { color: var(--em-900); }
.tp-new .tp-cta { background: var(--em); color: #fff; box-shadow: 0 10px 20px -10px rgba(0,127,61,.8); }
.tp-new:hover { box-shadow: 0 26px 50px -20px rgba(0,0,0,.7), 0 0 0 2px var(--gold); }
.tp-old { background: linear-gradient(150deg, #0b6b45 0%, #054d32 100%); color: #e7f7ee; box-shadow: 0 18px 40px -20px rgba(0,0,0,.6); border: 1px solid rgba(243,229,171,.25); }
.tp-old .tp-year { color: rgba(243,229,171,.16); }
.tp-old .tp-badge { background: var(--gold); color: var(--em-900); }
.tp-old .tp-name { color: #fff; }
.tp-old .tp-cta { background: var(--gold); color: var(--em-900); box-shadow: 0 10px 20px -10px rgba(212,175,55,.8); }
.tp-old:hover { box-shadow: 0 26px 50px -20px rgba(0,0,0,.7), 0 0 0 2px #f3d774; }
.tp-more { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: clamp(14px, 2.4vw, 22px); }
.tp-link { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 18px; text-decoration: none; color: #ecfdf5 !important; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); min-height: 64px; transition: background .2s ease, border-color .2s ease; }
.tp-link:hover { background: rgba(255,255,255,.12); border-color: rgba(212,175,55,.6); }
.tp-link-ic { flex: 0 0 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(212,175,55,.18); color: var(--gold-3); font-size: 1.15rem; }
.tp-link-tx { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.tp-link-tx b { font-family: 'Kanit', sans-serif; font-weight: 600; font-size: 1.02rem; }
.tp-link-tx em { font-style: normal; font-size: .75rem; font-weight: 600; color: var(--em-900); background: #f6c453; border-radius: 999px; padding: 1px 8px; margin-left: 4px; vertical-align: 2px; }
.tp-link-tx small { color: rgba(236,253,245,.7); font-size: .88rem; }
.tp-link-go { margin-left: auto; opacity: .55; font-size: .9rem; }
.tp-note { position: relative; margin: 18px 0 0; font-size: .92rem; color: rgba(236,253,245,.7); }
@media (max-width: 767px) {
  .tp-inner { border-radius: 24px; }
  .tp-grid, .tp-more { grid-template-columns: 1fr; }
  .tp-card { min-height: 0; }
  .tp-year { top: -.12em; bottom: auto; font-size: 92px; }
  .tp-cta { width: 100%; justify-content: center; margin-top: 14px; }
}

.mnmc-wrap { display: flex; justify-content: center; align-items: center; width: 100%; box-sizing: border-box; padding: clamp(20px,5vw,48px) 16px; perspective: 900px; position: relative; }
.mnmc-btn { --rx: 0deg; --ry: 0deg; position: relative; display: flex; align-items: center; gap: clamp(12px,2.5vw,18px); width: min(100%,560px); box-sizing: border-box; padding: clamp(14px,3vw,20px) clamp(18px,4vw,30px); border: 1px solid rgba(212,175,55,.55); border-radius: 22px; cursor: pointer; text-align: left; color: #fff; font: 600 clamp(15px,2.6vw,19px)/1.35 'Sarabun',sans-serif; background: linear-gradient(145deg,#1f5a1f 0%,#143614 55%,#0c240c 100%); box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 -3px 0 rgba(0,0,0,.25) inset, 0 14px 28px rgba(20,54,20,.28), 0 30px 60px -18px rgba(20,54,20,.45); transform-style: preserve-3d; transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .25s ease, box-shadow .25s ease; animation: mnmcFloat 4.5s ease-in-out infinite; -webkit-tap-highlight-color: transparent; overflow: hidden; }
@keyframes mnmcFloat { 0%,100% { translate: 0 0; } 50% { translate: 0 -8px; } }
.mnmc-btn::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(115deg,transparent 30%,rgba(255,255,255,.28) 45%,transparent 60%); transform: translateX(-120%); animation: mnmcShine 5s ease-in-out infinite 1.2s; }
@keyframes mnmcShine { 0%,70% { transform: translateX(-120%); } 90%,100% { transform: translateX(120%); } }
.mnmc-btn:active { transform: rotateX(var(--rx)) rotateY(var(--ry)) scale(.97); transition-duration: .08s; }
.mnmc-btn .ic { flex: 0 0 auto; display: grid; place-items: center; width: clamp(46px,9vw,60px); height: clamp(46px,9vw,60px); border-radius: 16px; font-size: clamp(24px,5vw,32px); background: linear-gradient(145deg,#f3d774,#D4AF37); box-shadow: 0 6px 14px rgba(0,0,0,.25), 0 1px 0 rgba(255,255,255,.6) inset; transform: translateZ(30px); }
.mnmc-btn .tx { transform: translateZ(20px); min-width: 0; }
.mnmc-btn .tx small { display: block; margin-top: 2px; font-weight: 400; font-size: .82em; color: #f3e3a6; }
.mnmc-btn .hint { display: inline-block; margin-top: 6px; padding: 2px 10px; border-radius: 999px; font-style: normal; font-weight: 600; font-size: .72em; white-space: nowrap; background: rgba(212,175,55,.2); color: #f3d774; }
.mnmc-btn .go { margin-left: auto; flex: 0 0 auto; font-size: 1.3em; color: #D4AF37; transition: transform .25s; }
.mnmc-btn:hover .go { transform: translateX(4px); }
@media (max-width: 420px) { .mnmc-btn .go { display: none; } }
@media (prefers-reduced-motion: reduce) { .mnmc-btn, .mnmc-btn::after { animation: none; } }
.mnmc-overlay { position: fixed; inset: 0; z-index: 2147483000; background: rgba(40,44,48,.86); display: none; overflow-y: auto; padding: 70px 16px 40px; -webkit-overflow-scrolling: touch; perspective: 1400px; }
.mnmc-overlay.show { display: block; animation: mnmcFade .2s ease; }
@keyframes mnmcFade { from { opacity: 0; } to { opacity: 1; } }
.mnmc-overlay.show .mnmc-paper { animation: mnmcRise .55s cubic-bezier(.2,.8,.2,1); }
@keyframes mnmcRise { from { opacity: 0; transform: translateY(60px) rotateX(18deg) scale(.92); } to { opacity: 1; transform: none; } }
.mnmc-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 2147483001; display: flex; justify-content: center; gap: 10px; padding: 12px; background: #1a252f; box-shadow: 0 2px 10px rgba(0,0,0,.35); }
.mnmc-bar button { font: 600 15px 'Sarabun',sans-serif; border: none; border-radius: 8px; padding: 8px 18px; cursor: pointer; }
.mnmc-close { background: #e2e8f0; color: #222; }
.mnmc-print { background: #D4AF37; color: #143614; }
.mnmc-paper { position: relative; width: min(210mm,100%); aspect-ratio: 210/297; margin: 0 auto; background: #fff; color: #000; box-shadow: 0 10px 40px rgba(0,0,0,.5); container-type: inline-size; transform-origin: 50% 0; font-family: 'Sarabun','TH Sarabun New',sans-serif; }
.mnmc-block { position: absolute; left: 8%; right: 8%; text-align: center; line-height: 1.55; font-size: 2.55cqw; }
.mnmc-title { top: 12.3%; } .mnmc-author { top: 40.5%; } .mnmc-office { top: 77.5%; }
@supports not (font-size: 1cqw) { .mnmc-block { font-size: clamp(11px,2.4vw,21px); } }
@media print {
  @page { size: A4 portrait; margin: 0; }
  html.mnmc-printing body > *:not(#mnmCoverOverlay) { display: none !important; }
  html.mnmc-printing .mnmc-overlay { position: static; display: block; background: none; padding: 0; overflow: visible; }
  html.mnmc-printing .mnmc-bar { display: none !important; }
  html.mnmc-printing .mnmc-paper { width: 210mm; height: 297mm; box-shadow: none; margin: 0; }
}
/* ข่าวรายวันล่าสุด (จากระบบจดหมายข่าว) */
.h-latest p .h-news-h { display: block; font: 600 .8rem 'Kanit', sans-serif; letter-spacing: .04em; color: var(--gold-2, #f3d774); margin-bottom: 4px; }
.h-latest p .h-news { position: relative; z-index: 1; display: flex; gap: 10px; align-items: baseline; padding: 7px 0; border-top: 1px solid rgba(255, 255, 255, .12); color: #fff; text-decoration: none; line-height: 1.4; background: none; }
.h-latest p .h-news:hover { color: var(--gold-2, #f3d774); }
.h-latest p .h-news time { flex: 0 0 auto; font: 500 .75rem 'Kanit', sans-serif; padding: 1px 8px; border-radius: 999px; background: rgba(212, 175, 55, .22); color: var(--gold-2, #f3d774); }