/* home-premium.css — hero แผนภาพเครือข่าย 18 โรงเรียน + ตัวอักษรใหม่ (2026-12-03) */
@import url("https://fonts.googleapis.com/css2?family=Bai+Jamjuree:wght@500;600;700&family=IBM+Plex+Sans+Thai:wght@400;500&display=swap");

.hm {
  --p-ink: #0a1a33;
  --p-navy: #13315c;
  --p-gold: #c9a44c;
  --p-cyan: #8fd3e6;
  --p-mist: #eef2f7;
  font-family: "IBM Plex Sans Thai", Prompt, sans-serif;
}
.hm h1, .hm h2, .hm h3 { font-family: "Bai Jamjuree", Kanit, sans-serif !important; }

/* ---------- hero ---------- */
.hm2-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(3.5rem, 7vw, 6rem) 0 clamp(3rem, 6vw, 5rem);
  color: #fff;
  background:
    radial-gradient(75% 80% at 100% 100%, rgba(255, 120, 30, .42), rgba(255, 120, 30, .3) 15%, rgba(255, 120, 30, .19) 32%, rgba(255, 120, 30, .1) 50%, rgba(255, 120, 30, .04) 68%, rgba(255, 120, 30, .01) 84%, transparent),
    radial-gradient(50% 60% at 8% 90%, rgba(40, 120, 255, .28), transparent 70%),
    radial-gradient(70% 60% at 50% 0%, rgba(40, 100, 220, .45), transparent 75%),
    linear-gradient(180deg, #0b2a6e 0%, #08205a 45%, #061743 100%);
  isolation: isolate;
}
.hm2-bgnet { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; opacity: 0; animation: hm2-fade 2s .8s forwards; }
.hm2-aurora { position: absolute; inset: -20% -10%; z-index: -1; pointer-events: none; filter: blur(70px); opacity: .35; }
.hm2-aurora::before, .hm2-aurora::after { content: ""; position: absolute; border-radius: 50%; }
.hm2-aurora::before { width: 50vw; height: 50vw; right: -10%; bottom: -16%; background: radial-gradient(circle, rgba(255, 140, 50, .4), rgba(255, 140, 50, .2) 30%, rgba(255, 140, 50, .06) 55%, transparent 70%); animation: hm2-drift-a 26s ease-in-out infinite alternate; }
.hm2-aurora::after { width: 38vw; height: 38vw; right: 24%; bottom: 0; background: radial-gradient(circle, rgba(60, 140, 255, .4), transparent 65%); animation: hm2-drift-b 32s ease-in-out infinite alternate; }
@keyframes hm2-drift-a { to { transform: translate(-6vw, -4vh) scale(1.1); } }
@keyframes hm2-drift-b { to { transform: translate(10vw, -8vh) scale(.9); } }
.hm2-copy { position: relative; z-index: 1; } /* ข้อความอยู่หน้าแผนที่เสมอ */
.hm2-intro { display: flex; align-items: center; gap: .6rem; margin: 0 0 1.5rem; color: rgba(255, 255, 255, .75); font-size: 1rem; }
.hm2-intro img { border-radius: 50%; background: #fff; padding: 2px; }
/* คำนำเหนือหัวข้อ hero: PCSHS NETWORK */
.hm2-eyebrow {
  gap: .75rem; font-size: .8rem; font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
  color: rgba(255, 255, 255, .78);
}
.hm2-eyebrow-dot {
  flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: #f5d27a;
  box-shadow: 0 0 0 0 rgba(245, 210, 122, .6); animation: hm2-pulse 2s ease-out infinite;
}
@keyframes hm2-pulse { to { box-shadow: 0 0 0 10px rgba(245, 210, 122, 0); } }
@media (prefers-reduced-motion: reduce) { .hm2-eyebrow-dot { animation: none; } }
.hm .hm2-title {
  margin: 0 0 1.25rem;
  font-size: clamp(2.2rem, 4.6vw, 3.9rem);
  font-weight: 600 !important;
  line-height: 1.18;
  letter-spacing: -.01em;
  color: #fff !important;
  text-wrap: balance;
}
/* หัวข้อ hero 2 ระดับ: บรรทัดบนเล็ก-บาง, บรรทัดล่างใหญ่-หนา */
.hm2-title .hm2-title-top {
  display: block; margin-bottom: .2em;
  font-size: .5em; font-weight: 500; line-height: 1.3; letter-spacing: .01em; opacity: .85;
}
/* padding บน-ล่างให้สระบน/ล่าง (เช่น อุ ใต้ จ) อยู่ในกรอบ — สีตัวอักษรมาจาก background-clip:text ซึ่งลงสีได้แค่ในกรอบ
   margin ติดลบเท่ากันเพื่อไม่ให้ระยะบรรทัดเปลี่ยน */
.hm2-title .hm2-title-top, .hm2-title .hm2-title-main { padding: .15em 0 .3em; margin-top: -.15em; }
.hm2-title .hm2-title-main { display: block; font-size: 1.12em; font-weight: 700; line-height: 1.1; margin-bottom: -.05em; }
.hm2-title .hm2-title-top { margin-bottom: calc(.2em - .3em); }
@media (max-width: 575.98px) { .hm2-title .hm2-title-top { font-size: .58em; } .hm2-title .hm2-title-main { font-size: 1em; } }
.hm2-lead { max-width: 34em; margin: 0 0 2.25rem; font-size: clamp(1.02rem, 1.3vw, 1.18rem); line-height: 1.8; color: rgba(255, 255, 255, .78); text-wrap: pretty; }
.hm2-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.hm2-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 1.6rem;
  border-radius: 999px;
  font-family: "Bai Jamjuree", sans-serif; font-weight: 600; font-size: 1.02rem;
  transition: background-color .2s, color .2s, border-color .2s;
}
.hm2-btn { position: relative; overflow: hidden; translate: var(--bx, 0) var(--by, 0); transition: background-color .2s, color .2s, border-color .2s, translate .35s cubic-bezier(.16, 1, .3, 1); }
.hm2-btn::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%);
  transform: translateX(-120%);
}
.hm2-btn:hover::after { transform: translateX(120%); transition: transform .7s cubic-bezier(.16, 1, .3, 1); }
.hm2-btn-gold { background: var(--p-gold); color: var(--p-ink) !important; }
.hm2-btn-gold:hover { background: #dcbb68; }
.hm2-btn-line { border: 1px solid rgba(255, 255, 255, .35); color: #fff !important; }
.hm2-btn-line:hover { border-color: var(--p-cyan); color: var(--p-cyan) !important; }
.hm2-btn:focus-visible { outline: 2px solid var(--p-cyan); outline-offset: 3px; }


/* ---------- แผนที่ประเทศไทยแบบจุด + 18 โรงเรียน ---------- */
/* ลำดับตอนโหลด: จุดแผนที่ค่อยๆ ปรากฏจากเหนือลงใต้ 0–1.8s → จุดโรงเรียนเรืองแสงเหนือ→ใต้ 0.9s+ → เส้นโค้งพุ่งจากศูนย์ 1.9s+ → แสงวิ่ง (JS) */
.hm3-wrap { position: relative; }
.hm3-map { display: block; width: 100%; max-width: 440px; margin-inline: auto; overflow: visible; }
.hm3-rg { transition: opacity .3s; }
.hm3-tint { opacity: .36; } /* สีพื้นแต่ละภาคชัด (จุดยังโปร่งตามเดิม) */
.hm3-dots { opacity: .38; }
.hm3-reveal { transform: translateY(-760px); animation: hm3-reveal 1.8s cubic-bezier(.45, 0, .25, 1) .1s forwards; }
@keyframes hm3-reveal { to { transform: translateY(0); } }

.hm3-links { filter: drop-shadow(0 0 3px rgba(170, 205, 255, .8)); }
.hm3-links path {
  fill: none; stroke-width: 1.2; stroke-opacity: .7; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: hm2-draw 1.1s cubic-bezier(.45, 0, .2, 1) forwards; animation-delay: calc(1.9s + var(--d) * 60ms);
  transition: stroke-opacity .3s, stroke-width .3s;
}

.hm3-links path.is-mesh { stroke-width: .9; stroke-opacity: .4; stroke-dasharray: 1; }
.hm3-pin { cursor: pointer; outline: none; transition: opacity .3s; }
.hm3-dot, .hm3-ping, .hm3-halo { transform-box: fill-box; transform-origin: center; }
.hm3-dot { fill: var(--c, #fff); stroke: #fff; stroke-width: 1.2; opacity: 0; transform: scale(0); animation: hm2-pop .5s cubic-bezier(.3, 1.6, .5, 1) forwards; animation-delay: calc(.9s + var(--d) * 70ms); transition: transform .25s; }
.hm3-halo { opacity: 0; animation: hm2-fade .8s forwards, hm3-breathe 4s ease-in-out infinite; animation-delay: calc(1s + var(--d) * 70ms), calc(2s + var(--d) * 230ms); }
@keyframes hm3-breathe { 50% { transform: scale(.75); } }
.hm3-ping { fill: none; stroke: #dbe9ff; stroke-width: 1; opacity: 0; animation: hm3-ping 5s ease-out infinite; animation-delay: calc(2.6s + var(--d) * 280ms); }
@keyframes hm3-ping { 0% { opacity: .7; transform: scale(1); } 40%, 100% { opacity: 0; transform: scale(3.2); } }
.is-hub .hm3-ping { stroke-width: 1.4; animation-duration: 3s; animation-delay: 2.2s; }
.hm3-code {
  font-family: "Bai Jamjuree", sans-serif; font-size: 12.5px; font-weight: 600; letter-spacing: .05em; fill: rgba(255, 255, 255, .78);
  opacity: 0; animation: hm2-fade .5s forwards; animation-delay: calc(1.15s + var(--d) * 70ms);
  transition: fill .25s;
}
.hm3-prov { font-family: "IBM Plex Sans Thai", sans-serif; font-size: 13.5px; fill: var(--c, #ffe7a8); opacity: 0; transition: opacity .25s; }
.hm3-code, .hm3-prov { paint-order: stroke; stroke: rgba(13, 42, 96, .85); stroke-width: 3px; stroke-linejoin: round; }
/* ชี้โรงเรียน: โรงเรียนอื่นจาง เส้นของโรงเรียนนี้สว่าง */
.hm3-map:has(.hm3-pin:hover, .hm3-pin:focus-visible) .hm3-pin:not(:hover, :focus-visible) { opacity: .45; }
.hm3-map:has(.hm3-pin:hover, .hm3-pin:focus-visible) .hm3-links path { stroke-opacity: .15; }
.hm3-pin:hover .hm3-dot, .hm3-pin:focus-visible .hm3-dot { transform: scale(1.6); }
.hm3-pin:hover .hm3-code, .hm3-pin:focus-visible .hm3-code { fill: var(--c, #ffe7a8); }
.hm3-pin:hover .hm3-prov, .hm3-pin:focus-visible .hm3-prov { opacity: 1; }

/* แสงวิ่งตามเส้น (สร้างโดย home-hero.js) */
.hm2-pulse { fill: currentColor; filter: drop-shadow(0 0 5px currentColor); }
.hm2-pulse.is-gold { filter: drop-shadow(0 0 7px currentColor) brightness(1.25); }

/* ข้อความ hero ขึ้นทีละบรรทัด */
.hm2-title .hm-nb { opacity: 0; animation: hm3-line 1.1s cubic-bezier(.16, 1, .3, 1) .35s forwards, hm3-shine 1.6s ease-in-out 2.1s forwards; }
.hm2-title .hm-nb:nth-child(2) { animation-delay: .5s, 2.25s; }
.hm2-title .hm-nb:nth-child(3) { animation-delay: .65s, 2.4s; }
@supports (-webkit-background-clip: text) or (background-clip: text) {
  /* แสงทองวิ่งผ่านตัวอักษรหนึ่งครั้งหลังหัวข้อขึ้นครบ */
  .hm2-title .hm-nb {
    background: linear-gradient(100deg, #fff 42%, #ffe2a0 50%, #fff 58%) 100% 0 / 260% 100% no-repeat;
    -webkit-background-clip: text; background-clip: text; color: transparent;
  }
}
@keyframes hm3-line {
  from { opacity: 0; transform: translateY(70%) skewY(4deg); filter: blur(10px); clip-path: inset(0 0 100% 0); }
  to { opacity: 1; transform: none; filter: blur(0); clip-path: inset(-40% -5% -40% -5%); }
}
@keyframes hm3-shine { to { background-position: 0 0; } }
.hm2-intro, .hm2-lead, .hm2-actions { opacity: 0; animation: hm2-rise 1s cubic-bezier(.16, 1, .3, 1) forwards; }
.hm2-lead { animation-delay: .9s !important; }
.hm2-actions { animation-delay: 1.05s !important; }
.hm2-lead { animation-delay: .35s; }
.hm2-actions { animation-delay: .5s; }

@keyframes hm2-draw { to { stroke-dashoffset: 0; } }
@keyframes hm2-fade { to { opacity: 1; } }
@keyframes hm2-pop { to { opacity: 1; transform: scale(1); } }
@keyframes hm2-spin { to { rotate: 360deg; } }
@keyframes hm2-core-in { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
@keyframes hm2-breathe { 50% { transform: scale(1.12); opacity: .55; } }
@keyframes hm2-rise { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } to { opacity: 1; transform: none; filter: blur(0); } }

@media (prefers-reduced-motion: reduce) {
  .hm2-hero *, .hm2-hero *::before, .hm2-aurora::before, .hm2-aurora::after { animation: none !important; transition: none !important; }
  .hm3-reveal { transform: none; }
  .hm3-links path { stroke-dashoffset: 0; }
  .hm2-bgnet { opacity: 1; }
  .hm3-dot, .hm3-code, .hm3-halo, .hm2-intro, .hm2-lead, .hm2-actions, .hm2-title .hm-nb { opacity: 1; transform: none; }
}
@media (max-width: 575.98px) {
  .hm2-btn { flex: 1 1 100%; }
}

/* ---------- จอคอม: hero พอดีหนึ่งหน้าจอ (ลบความสูง header ที่ JS วัดให้ใน --hm2-hdr) ---------- */
@media (min-width: 992px) {
  .hm2-hero {
    min-height: calc(100svh - var(--hm2-hdr, 132px));
    display: flex; align-items: center;
    padding: clamp(1.25rem, 4vh, 4rem) 0;
  }
  .hm2-hero > .container { width: 100%; }
  .hm2-intro { margin-bottom: clamp(.6rem, 2.5vh, 1.5rem); }
  .hm .hm2-title { font-size: clamp(1.9rem, min(4.4vw, 7.4vh), 3.9rem); margin-bottom: clamp(.6rem, 2vh, 1.25rem); }
  .hm2-lead { margin-bottom: clamp(1rem, 3.5vh, 2.25rem); font-size: clamp(.98rem, min(1.3vw, 2.4vh), 1.18rem); }
  .hm2-btn { min-height: clamp(44px, 6.5vh, 52px); }
  /* แผนภาพ: กว้างเท่าความสูงที่เหลือ (หักระยะขอบ + คำอธิบายภาค) */
  /* แผนที่เป็นพื้นหลังฝั่งขวา สูงเต็ม hero (ไม่ติดระยะขอบของคอลัมน์) */
  .hm3-wrap { position: absolute; top: .75rem; bottom: .75rem; left: 50%; right: 1.5rem; display: flex; justify-content: center; pointer-events: none; }
  .hm3-map { height: 100%; width: auto; max-width: 100%; aspect-ratio: 396 / 610; pointer-events: auto; }
  .hm .hm2-title { font-size: clamp(1.9rem, min(3.6vw, 7vh), 3.5rem); }
}

/* ---------- จอเล็ก: แผนที่อยู่ด้านหลังข้อความ (ไม่ย้ายลงล่าง) ---------- */
@media (max-width: 991.98px) {
  .hm3-wrap {
    position: absolute; inset: 1rem 0; z-index: 0;
    display: flex; justify-content: flex-end; align-items: center;
    pointer-events: none; opacity: .3;
  }
  .hm3-map { height: 100%; width: auto; max-width: 92%; aspect-ratio: 396 / 610; margin: 0; }
  .hm3-code, .hm3-prov { display: none; } /* ป้ายรหัสรกหลังข้อความ — เหลือแค่จุดกับเส้น */
}

/* ---------- การ์ดกระจก: แผนที่ + ตัวเลขภูมิภาค (dashboard) ---------- */
.hm3-panel { display: none; }
.hm2-legend { display: grid; gap: .6rem; margin: 0; padding: 0; list-style: none; }
.hm2-legend li {
  position: relative; display: grid; grid-template-columns: 1fr auto; align-items: end; gap: .35rem .75rem;
  padding: .8rem .95rem .9rem; border-radius: 16px; cursor: default;
  background: linear-gradient(160deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .025));
  border: 1px solid rgba(255, 255, 255, .1);
  transition: border-color .2s, background-color .2s;
}
.hm2-legend li:hover { border-color: color-mix(in srgb, var(--c) 60%, transparent); background-color: color-mix(in srgb, var(--c) 10%, transparent); }
.hm2-legend-name { display: flex; align-items: center; gap: .45rem; font-size: .82rem; line-height: 1.3; color: rgba(255, 255, 255, .75); }
.hm2-legend b { font-family: "Bai Jamjuree", sans-serif; font-size: 1.65rem; font-weight: 600; line-height: 1; color: var(--c); }
.hm2-legend-bar { grid-column: 1 / -1; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.hm2-legend-bar::before { content: ""; display: block; width: var(--p); height: 100%; border-radius: inherit; background: var(--c); box-shadow: 0 0 8px var(--c); }
.hm2-legend-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.hm3-panel-hd { display: flex; align-items: center; gap: .5rem; margin: 0 0 .3rem; font-size: .72rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .55); }
.hm3-live { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, .2); }
.hm3-panel-total { margin: 0 0 1rem; padding-bottom: .9rem; border-bottom: 1px solid rgba(255, 255, 255, .1); font-size: .85rem; color: rgba(255, 255, 255, .7); }
.hm3-panel-total b { margin-right: .2rem; font-family: "Bai Jamjuree", sans-serif; font-size: 2.1rem; font-weight: 600; line-height: 1; color: #fff; }
@media (min-width: 992px) {
  /* แผงตัวเลขภูมิภาคอยู่ขวาของแผนที่ (ไม่มีกรอบการ์ดครอบ) */
  .hm3-wrap { align-items: stretch; gap: 1rem; }
  .hm3-map { margin: 0; flex: 0 1 auto; min-width: 0; max-width: calc(100% - 11.5rem); align-self: center; }
  .hm3-panel {
    display: flex; flex-direction: column; justify-content: center; flex: 0 0 10.5rem; align-self: flex-end; margin-bottom: 1.5rem; pointer-events: auto;
    padding: .75rem; border-radius: 16px; background: rgba(4, 14, 44, .3); border: 1px solid rgba(255, 255, 255, .07);
    opacity: 0; animation: hm2-fade .8s 1.6s forwards;
  }
}
@media (prefers-reduced-motion: reduce) { .hm3-panel { opacity: 1; animation: none; } }

/* ---------- แผนที่ 3D แบบภาพนิ่ง ---------- */
.hm3-wrap { perspective: 1100px; }
/* แผนที่เอียงเป็นพื้นราบ 3D อยู่นิ่ง — ค่อยๆ ปรากฏตอนเปิดหน้าเท่านั้น */
.hm3-map {
  transform-origin: 50% 92%; /* เอียงรอบขอบล่าง: ปลายด้ามขวานไม่ล้นจอ ส่วนบนถอยลึกเข้าไป */
  transform: translateY(-5%) rotateX(24deg) rotateZ(-5deg) scale(1.1);
  animation: hm3-appear 1s .15s backwards;
}
.hm3-shadow { fill: #020a1f; opacity: .7; }
.hm3-edge { fill: none; stroke: rgba(210, 230, 255, .28); stroke-width: .5; }
.hm3-beam { opacity: 0; animation: hm2-fade .6s forwards; animation-delay: calc(1.2s + var(--d) * 70ms); pointer-events: none; }
.hm3-pin:hover .hm3-beam, .hm3-pin:focus-visible .hm3-beam { fill: url(#hmBeam); opacity: 1; filter: drop-shadow(0 0 4px var(--c, #fff)); }
@keyframes hm3-appear { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .hm3-map { animation: none; }
  .hm3-beam { opacity: 1; animation: none; }
  .hm2-title .hm-nb { background-position: 100% 0; }
  .hm2-btn { translate: none; }
}

/* ---------- Navbar (ทุกหน้า): แถบบน + เมนู เต็มจอซ้าย-ขวา พื้นกระจกฝ้า ---------- */
.page-home { --topbar-h: 36px; --header-h: 72px; }
.page-home #headerSpacer { height: 0; }
.page-home .site-flash { position: fixed; z-index: 1000; left: 0; right: 0; bottom: 0; }
.page-home .site-header-wrap { inset: 0 0 auto; }
.page-home .topbar {
  background: rgba(4, 14, 44, .55) !important;
  backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.page-home .main-header {
  background: rgba(8, 24, 64, .74);
  backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5);
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 18px 50px rgba(2, 8, 30, .3);
}
.page-home .brand-logo-wrap { width: 48px; height: 48px; flex-basis: 48px; border-radius: 14px; }
.page-home .brand-logo-wrap img { width: 36px; height: 36px; }
.page-home .brand-title { color: #fff; }
.page-home .brand-subtitle { color: rgba(255, 255, 255, .6); }
.page-home .navbar-toggler .burger span { background: #fff; }
@media (min-width: 1200px) {
  .page-home .navbar .nav-link { color: rgba(255, 255, 255, .82); }
  .page-home .navbar .nav-link:hover, .page-home .navbar .nav-link:focus { color: #fff; }
  .page-home .navbar .nav-link.active { color: #fff; border-bottom-color: var(--p-gold, #c9a44c); }
}
/* hero เริ่มใต้แถบลอย: เว้นที่ด้านบนเท่าความสูงแถบ (JS วัดให้ใน --hm2-hdr) */
.page-home .hm2-hero { padding-top: calc(var(--hm2-hdr, 120px) + 10px + clamp(2rem, 5vw, 4rem)); }
@media (min-width: 992px) {
  .page-home .hm2-hero { min-height: 100svh; padding-top: calc(var(--hm2-hdr, 120px) + 10px + clamp(1rem, 3vh, 2.5rem)); }
  .page-home .hm3-wrap { top: calc(var(--hm2-hdr, 120px) + 10px + .25rem); bottom: .5rem; right: max(1.5rem, calc((100vw - 1320px) / 2 - 1rem)); }
}

/* แผนที่เด่นกว่าแผงภาพรวม: แผงด้านขวาเล็กและเบาลง */
@media (min-width: 992px) {
  .hm2-legend { gap: .4rem; }
  .hm2-legend li { padding: .5rem .65rem .6rem; border-radius: 12px; gap: .25rem .5rem; }
  .hm2-legend b { font-size: 1.2rem; }
  .hm2-legend-name { font-size: .72rem; }
  .hm3-panel-hd { font-size: .62rem; letter-spacing: .1em; }
  .hm3-panel-total { margin-bottom: .6rem; padding-bottom: .6rem; font-size: .7rem; white-space: nowrap; }
  .hm3-panel-total b { font-size: 1.5rem; }
}

/* ป๊อปอัปชื่อโรงเรียนเมื่อชี้จุดบนแผนที่ */
.hm3-tip {
  position: absolute; z-index: 5; pointer-events: none;
  transform: translate(-50%, calc(-100% - 14px));
  display: grid; gap: .15rem; width: max-content; max-width: 17rem;
  padding: .45rem .7rem .5rem; border-radius: 12px;
  background: rgba(6, 18, 52, .92);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid color-mix(in srgb, var(--c, #fff) 55%, transparent);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .45), 0 0 18px color-mix(in srgb, var(--c, #fff) 25%, transparent);
  color: #fff; text-align: left; line-height: 1.35;
}
.hm3-tip[hidden] { display: none; }
.hm3-tip::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 10px; height: 10px; translate: -50% 0; rotate: 45deg; background: rgba(6, 18, 52, .92); border: solid color-mix(in srgb, var(--c, #fff) 55%, transparent); border-width: 0 1px 1px 0; }
.hm3-tip-code { font-family: "Bai Jamjuree", sans-serif; font-size: .62rem; font-weight: 600; letter-spacing: .12em; color: var(--c, #fff); }
.hm3-tip-name { font-family: "Bai Jamjuree", sans-serif; font-size: .85rem; font-weight: 600; white-space: nowrap; }
/* ป๊อปอัปแสดงจังหวัดแล้ว: ไม่ต้องโชว์ชื่อจังหวัดบนแผนที่ซ้ำ */
.hm3-pin:hover .hm3-prov, .hm3-pin:focus-visible .hm3-prov { opacity: 0; }
.hm3-tip.is-below { transform: translate(-50%, 14px); }
.hm3-tip.is-below::after { bottom: auto; top: -6px; border-width: 1px 0 0 1px; }

/* ---------- แผนที่โต้ตอบ: กรองภูมิภาค + การ์ดโรงเรียน ---------- */
.hm2-legend li { cursor: pointer; }
.hm2-legend li:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }
.hm3-panel.is-detail .hm3-panel-hd, .hm3-panel.is-detail .hm3-panel-total, .hm3-panel.is-detail .hm2-legend { display: none; }
.hm3-detail[hidden], .hm3-card[hidden], .hm3-sch[hidden] { display: none; }
.hm3-back { display: inline-flex; align-items: center; gap: .2rem; margin: 0 0 .5rem; padding: .15rem .55rem; border: 1px solid rgba(255, 255, 255, .15); border-radius: 999px; background: transparent; color: rgba(255, 255, 255, .7); font-size: .7rem; }
.hm3-back:hover, .hm3-back:focus-visible { color: #fff; border-color: var(--c); }
.hm3-detail-hd { display: flex; align-items: center; gap: .4rem; margin: 0 0 .55rem; padding-bottom: .5rem; border-bottom: 1px solid rgba(255, 255, 255, .1); font-size: .78rem; font-weight: 600; line-height: 1.35; color: var(--c); }
.hm3-sch { display: grid; gap: .25rem; margin: 0; padding: 0; list-style: none; }
.hm3-sch button { width: 100%; display: flex; align-items: baseline; gap: .45rem; padding: .35rem .5rem; border: 1px solid transparent; border-radius: 9px; background: rgba(255, 255, 255, .04); color: #fff; text-align: left; font-size: .76rem; transition: border-color .2s, background-color .2s; }
.hm3-sch button span { font-family: "Bai Jamjuree", sans-serif; font-size: .62rem; font-weight: 600; letter-spacing: .1em; color: var(--c); }
.hm3-sch button b { font-weight: 500; white-space: nowrap; }
.hm3-sch button:hover, .hm3-sch button:focus-visible { border-color: color-mix(in srgb, var(--c) 60%, transparent); background: color-mix(in srgb, var(--c) 12%, transparent); outline: none; }
.hm3-card { display: grid; gap: .3rem; }
.hm3-card-code { font-family: "Bai Jamjuree", sans-serif; font-size: .66rem; font-weight: 600; letter-spacing: .12em; color: var(--c); }
.hm3-card-name { font-size: .84rem; font-weight: 600; line-height: 1.45; color: #fff; }
.hm3-card-prov { font-size: .74rem; color: rgba(255, 255, 255, .6); }
.hm3-card-link { margin-top: .35rem; padding: .4rem .6rem; border-radius: 9px; background: var(--c); color: #061743 !important; font-size: .74rem; font-weight: 600; text-align: center; text-decoration: none; }
.hm3-card-link:hover, .hm3-card-link:focus-visible { filter: brightness(1.1); }
/* หมุดที่เลือก: เด่น, หมุดอื่นจางลง */
.hm3-wrap:has(.hm3-pin.is-sel) .hm3-pin:not(.is-sel) { opacity: .35; }
.hm3-pin.is-sel .hm3-dot { transform: scale(1.8); }
.hm3-pin.is-sel .hm3-beam { fill: url(#hmBeam); opacity: 1; filter: drop-shadow(0 0 4px var(--c, #fff)); }
.hm3-pin.is-sel .hm3-code { fill: var(--c, #ffe7a8); }
.hm2-legend li[aria-pressed="true"] { border-color: var(--c); }

/* ---------- สลับเส้น: เครือข่าย 18 โรงเรียน ↔ เส้นในแต่ละภูมิภาค (JS ใส่ mode-rg / mode-all) ---------- */
.hm3-links path { transition: opacity .8s, stroke-opacity .3s, stroke-width .3s; }
.hm3-links path.is-rg { opacity: 0; stroke-width: 1.6; stroke-opacity: .9; }
.hm3-map.mode-rg .hm3-links path:not(.is-rg) { opacity: 0; }
.hm3-map.mode-rg .hm3-links path.is-rg { opacity: 1; animation: hm3-redraw 1.2s cubic-bezier(.45, 0, .2, 1) both; animation-delay: calc(var(--k) * 90ms); }
.hm3-map.mode-all .hm3-links path:not(.is-rg) { animation: hm3-redraw-b 1.1s cubic-bezier(.45, 0, .2, 1) both; animation-delay: calc(var(--d) * 40ms); }
@keyframes hm3-redraw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes hm3-redraw-b { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

/* ---------- กล่องข่าว Bento (แทนแผนที่ Leaflet ด้านล่าง): ข่าวเด่น 2×2 + ข่าวรอง 4 กล่อง ---------- */
.nb-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.nb-card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  border-radius: 20px; background: #fff; border: 1px solid rgba(12, 42, 82, .09);
  box-shadow: 0 8px 24px rgba(11, 42, 82, .06);
  transition: transform .3s, box-shadow .3s;
}
.nb-card:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(11, 42, 82, .12); }
.nb-img { aspect-ratio: 16 / 10; overflow: hidden; background: var(--p-mist, #eef2f7); }
.nb-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.nb-img img.is-logo { object-fit: contain; padding: 18%; opacity: .45; }
.nb-card:hover .nb-img img:not(.is-logo) { transform: scale(1.04); }
.nb-body { display: flex; flex-direction: column; gap: .4rem; padding: .9rem 1.05rem 1.1rem; }
.nb-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: .78rem; color: #64748b; }
.nb-type { padding: .1rem .55rem; border-radius: 999px; background: var(--p-gold, #c9a44c); color: #0a1a33; font-weight: 600; font-size: .72rem; }
.hm .nb-card h3 { margin: 0; font-size: .98rem; font-weight: 500 !important; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nb-card h3 a { color: var(--p-ink, #0a1a33); }
.nb-card h3 a::after { content: ""; position: absolute; inset: 0; } /* ทั้งกล่องคลิกได้ */
.nb-card:has(h3 a:focus-visible) { outline: 2px solid var(--p-gold, #c9a44c); outline-offset: 3px; }
/* ข่าวเด่น: รูปเต็มกล่อง ตัวอักษรขาวบนไล่เฉดน้ำเงิน */
.nb-lead { grid-column: span 2; grid-row: span 2; min-height: 26rem; justify-content: flex-end; border: 0; background: #0a1a33; }
.nb-lead .nb-img { position: absolute; inset: 0; aspect-ratio: auto; }
.nb-lead .nb-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(6, 23, 67, .6) 62%, rgba(6, 23, 67, .95)); }
.nb-lead .nb-body { position: relative; padding: 1.5rem 1.7rem 1.7rem; }
.nb-lead .nb-meta { color: rgba(255, 255, 255, .75); }
.hm .nb-lead h3 { font-size: clamp(1.2rem, 1.8vw, 1.55rem); line-height: 1.4; }
.nb-lead h3 a { color: #fff; }
.nb-lead p { margin: 0; color: rgba(255, 255, 255, .8); line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 991.98px) { .nb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .nb-lead { min-height: 20rem; } }
@media (max-width: 575.98px) { .nb-grid { grid-template-columns: 1fr; } .nb-lead { grid-column: auto; grid-row: auto; } }
@media (prefers-reduced-motion: reduce) { .nb-card, .nb-img img { transition: none; } .nb-card:hover { transform: none; } }

/* =====================================================================
   หน้าแรก: ส่วนเนื้อหาใต้ hero ให้เข้าชุดกับ hero (2026-12-04)
   การ์ดมุมโค้ง เงานุ่ม จุด/เส้นสีทองแบบเดียวกับ hero — เฉพาะหน้าแรก (ไฟล์นี้โหลดแค่หน้าแรก)
   ===================================================================== */
/* แถบเมนูตอนเลื่อนลง: ทึบขึ้น ไม่เป็นสีเทาหม่นเมื่ออยู่บนพื้นขาว */
.page-home .main-header { transition: background-color .3s ease, box-shadow .3s ease; }
html.is-scrolled .page-home .main-header { background: rgba(7, 22, 56, .96); box-shadow: 0 10px 30px rgba(2, 8, 30, .25); }

/* หัวข้อแต่ละส่วน: คำนำสีทอง + หัวข้อ + ขีดล่างสีทอง */
.page-home .hm-section { padding: 4.5rem 0; }
.page-home .hm-head { margin-bottom: 1.75rem; padding-bottom: 0; border-bottom: 0; align-items: flex-end; }
.page-home .hm-eyebrow { display: inline-flex; align-items: center; gap: .55rem; margin-bottom: .45rem; font-size: .78rem; letter-spacing: .18em; color: #b8913a; }
.page-home .hm-eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #e2bd62; box-shadow: 0 0 0 4px rgba(226, 189, 98, .18); }
.hm .page-home .hm-head h2, .page-home .hm .hm-head h2 { font-weight: 600 !important; color: #0b2545 !important; }
.page-home .hm-head h2::after {
  content: ""; display: block; width: 3.25rem; height: 3px; margin-top: .7rem; border-radius: 3px;
  background: #e2bd62;
}
.page-home .hm-sysbox .hm-head h2::after { display: none; }
.page-home .hm-more {
  display: inline-flex; align-items: center; gap: .4rem; padding: .5rem 1.05rem; border-radius: 999px;
  font-size: .9rem; border: 1px solid #dfe6f1; background: #fff; color: #13315c;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.page-home .hm-more:hover { background: #0b2545; border-color: #0b2545; color: #fff; }

/* ข่าวประชาสัมพันธ์ (ต่อจาก hero): พื้นขาวมีแสงฟ้า/ทองจาง ๆ การ์ดขอบนุ่ม ป้ายประเภทสีทอง */
.page-home .hm-newsbox {
  background:
    radial-gradient(35% 50% at 100% 10%, rgba(79, 141, 255, .07), transparent 70%),
    radial-gradient(30% 40% at 0% 100%, rgba(226, 189, 98, .08), transparent 70%),
    #fff;
}
.page-home .nb-card { border-radius: 20px; border: 1px solid #e6ebf3; box-shadow: 0 6px 18px rgba(11, 42, 82, .05); }
.page-home .nb-card:hover { border-color: #d9c48f; box-shadow: 0 18px 38px rgba(11, 42, 82, .12); }
.page-home .nb-card:not(.nb-lead) .nb-body { position: relative; }
.page-home .nb-card:not(.nb-lead) .nb-body::before {
  content: ""; position: absolute; left: 1rem; top: 0; width: 2rem; height: 3px; border-radius: 0 0 3px 3px;
  background: #e2bd62; opacity: 0; transition: opacity .3s ease;
}
.page-home .nb-card:not(.nb-lead):hover .nb-body::before { opacity: 1; }
.page-home .nb-type { color: #3d2800; background: linear-gradient(95deg, #fbe3a2, #e2bd62); }

/* ประกาศ + กิจกรรม: วางคู่กันบนพื้นฟ้าอ่อน ก่อนแผงระบบงานโทนเข้ม */
.page-home .hm-tint {
  border: 0;
  background:
    radial-gradient(40% 60% at 0% 0%, rgba(79, 141, 255, .1), transparent 70%),
    linear-gradient(180deg, #f2f6fc 0%, #eef3fa 100%);
}

/* ประกาศ: การ์ดเดียว แต่ละรายการ = ป้าย+วันที่ แล้วหัวเรื่อง */
.page-home .hm-announce-list {
  position: relative; margin: 0; padding: .35rem 1.5rem; list-style: none; border: 1px solid #e3e9f2; border-radius: 20px;
  background: #fff; box-shadow: 0 10px 28px rgba(11, 42, 82, .07); overflow: hidden;
}
.page-home .hm-announce-list li { display: block; padding: 0; border-bottom: 1px solid #eef2f7; }
.page-home .hm-announce-list li:last-child { border-bottom: 0; }
.page-home .hm-announce-list a { display: block; padding: 1rem 0; color: #0b2545; }
.page-home .hm-announce-list a:hover { text-decoration: none; }
.page-home .hm-announce-top { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .65rem; margin-bottom: .4rem; }
.page-home .hm-announce-tag {
  display: inline-flex; align-items: center; gap: .35rem; border: 0; border-radius: 999px; padding: .15rem .65rem;
  color: #3d2800; background: linear-gradient(95deg, #fbe3a2, #e2bd62); font-size: .76rem; font-weight: 600;
}
.page-home .hm-announce-meta { color: #64748b; font-size: .82rem; }
.page-home .hm-announce-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 500; line-height: 1.55; transition: color .2s ease; }
.page-home .hm-announce-list a:hover .hm-announce-title { color: #1d4f91; }

/* กิจกรรม: รายการแนวตั้ง กล่องวันที่น้ำเงินเลขทอง ไอคอนสีประจำแต่ละรายการ */
.page-home .hm-events { display: grid; grid-template-columns: 1fr; gap: .75rem; background: none; border: 0; }
.page-home .hm-board .col-12 .hm-events { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; } /* ไม่มีประกาศ = 2 คอลัมน์ */
.page-home .hm-event {
  --c: #4f8dff;
  position: relative; overflow: hidden; align-items: center; gap: 1.1rem; padding: .95rem 1.2rem;
  border: 1px solid #e3e9f2; border-radius: 18px; background: #fff; box-shadow: 0 6px 18px rgba(11, 42, 82, .05);
  transition: transform .3s cubic-bezier(.16, 1, .3, 1), box-shadow .3s ease, border-color .3s ease;
}
.page-home .hm-event:nth-child(4n + 2) { --c: #e2a93b; }
.page-home .hm-event:nth-child(4n + 3) { --c: #23b597; }
.page-home .hm-event:nth-child(4n + 4) { --c: #8a6cf0; }
.page-home .hm-event:hover { background: #fff; transform: translateX(4px); border-color: color-mix(in srgb, var(--c) 45%, #e3e9f2); box-shadow: 0 14px 32px rgba(11, 42, 82, .1); }
.page-home .hm-event-date {
  flex: 0 0 64px; padding: .5rem 0; border-radius: 14px; text-align: center;
  color: #fff; background: linear-gradient(150deg, #0d2a5c, #1a4a8f);
  box-shadow: 0 8px 18px rgba(13, 42, 92, .22), inset 0 0 0 1px rgba(255, 255, 255, .08);
}
.page-home .hm-event-date .d { font-size: 1.6rem; line-height: 1.1; color: #f5d27a; }
.page-home .hm-event-date .m { font-size: .8rem; opacity: .85; }
.page-home .hm-event-body { min-width: 0; }
.hm .page-home .hm-event h3, .page-home .hm .hm-event h3 { font-size: 1rem; line-height: 1.5; margin-bottom: .3rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.page-home .hm-event:hover h3 { color: #1d4f91; }
.page-home .hm-event .hm-meta { font-size: .84rem; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-home .hm-event .hm-meta i { color: var(--c); }

.page-home .site-footer { margin-top: 0; }

@media (max-width: 991.98px) {
  .page-home .hm-board .hm-head { min-height: 0; }
}
@media (max-width: 767.98px) {
  .page-home .hm-section { padding: 3.25rem 0; }
  .page-home .hm-announce-list { padding: .25rem 1.1rem; }
  .page-home .hm-board .col-12 .hm-events { grid-template-columns: 1fr; }
  .page-home .hm-event .hm-meta { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  .page-home .hm-event { transition: none; }
  .page-home .hm-event:hover { transform: none; }
}

/* ---------- ระบบงาน: แผงโทนเข้ม ต่อจากข่าว ไล่สีลงไปชนพื้นแผนที่ ---------- */
.hm-sysbox {
  color: #fff;
  background:
    radial-gradient(50% 55% at 12% 0%, rgba(40, 110, 255, .38), transparent 75%),
    radial-gradient(45% 55% at 100% 55%, rgba(255, 120, 30, .16), transparent 75%),
    linear-gradient(180deg, #061743, var(--hm-navy));
}
.hm-section.hm-sysbox { padding: 3.25rem 0; }
.hm-sysbox .hm-head { border: 0; padding: 0; margin-bottom: 1.5rem; }
.hm .hm-sysbox .hm-head h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 600 !important; color: #fff !important; }
.hm-sysbox .hm-head p { max-width: 38em; margin: .35rem 0 0; color: rgba(255, 255, 255, .72); line-height: 1.6; text-wrap: pretty; }
.hm-sysbox .hm-more { color: #fff; background: transparent; border-color: rgba(255, 255, 255, .3); }
.hm-sysbox .hm-more:hover { color: var(--hm-gold-2); }
.hm-systems { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .75rem; } /* 6 ระบบ = แถวเดียวบนจอคอม */
.hm-system {
  --c: #6ec1ff;
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; align-items: center; padding: .9rem .75rem 1rem; text-align: center;
  border-radius: 18px; color: #fff;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 5%, #11337a), #091c49 78%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), inset 0 1px 0 rgba(255, 255, 255, .16), 0 18px 40px rgba(2, 8, 30, .35);
  transition: transform .35s cubic-bezier(.16, 1, .3, 1), box-shadow .35s;
}
.hm-system:nth-child(6n + 2) { --c: #f3c969; }
.hm-system:nth-child(6n + 3) { --c: #b79cff; }
.hm-system:nth-child(6n + 4) { --c: #ff8fa3; }
.hm-system:nth-child(6n + 5) { --c: #ffa765; }
.hm-system:nth-child(6n) { --c: #8fd3e6; }
/* แสงตามเมาส์ (--mx/--my ตั้งใน home-hero.js) */
.hm-system::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .35s;
  background: radial-gradient(9rem circle at var(--mx, 50%) var(--my, 30%), color-mix(in srgb, var(--c) 34%, transparent), transparent 70%);
}
.hm-system-art { display: grid; place-items: center; width: 100%; height: 5.25rem; margin-bottom: .7rem; color: var(--c); font-size: 2.6rem; }
.hm-system-art svg { width: 100%; height: inherit; overflow: visible; filter: drop-shadow(0 4px 10px color-mix(in srgb, var(--c) 38%, transparent)); }
.hm-system-name { font-family: "Bai Jamjuree", sans-serif; font-size: .92rem; font-weight: 600; line-height: 1.45; text-wrap: balance; }
.hm-system-en { margin-top: auto; padding-top: .35rem; font-size: .82rem; font-weight: 500; color: var(--c); }
.hm-system-go { position: absolute; top: .45rem; right: .6rem; font-size: .75rem; line-height: 1; color: var(--c); }
.hm-system:is(:hover, :focus-visible) { color: #fff; transform: translateY(-3px); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 60%, transparent), 0 26px 54px rgba(2, 8, 30, .55); }
.hm-system:is(:hover, :focus-visible)::before { opacity: 1; }
.hm-system:active { transform: scale(.98); }
.hm-system:focus-visible { outline: 2px solid var(--c); outline-offset: 3px; }

/* ภาพประกอบ (partials/system_art.php) — ขยับเมื่อชี้การ์ด */
.hm-system-art svg :not([transform]) { transform-box: fill-box; transform-origin: center; transition: transform .5s cubic-bezier(.3, 1.4, .5, 1), opacity .4s, stroke-dashoffset .7s cubic-bezier(.16, 1, .3, 1); transition-delay: calc(var(--i, 0) * 45ms); }
.sa-fill, .sa-block, .sa-bar, .sa-bubble, .sa-radar circle { fill: var(--c); }
.sa-line { fill: none; stroke: var(--c); stroke-opacity: .32; stroke-width: 1.2; }
.sa-block { opacity: var(--o); }
.sa-radar path { fill: color-mix(in srgb, var(--c) 38%, transparent); stroke: var(--c); stroke-width: 2; stroke-linejoin: round; }
.sa-disc { fill: #15316f; stroke: var(--c); stroke-width: 1.5; }
.sa-links path { stroke-opacity: .6; stroke-width: 1.6; stroke-dasharray: 1; }
.sa-bar { opacity: .45; }
.sa-bar.is-top { opacity: 1; }
.hm-system-art svg .sa-bar { transform-origin: bottom; }
.sa-track, .sa-ring { fill: none; stroke: var(--c); stroke-width: 10; }
.sa-track { stroke-opacity: .13; }
.sa-ring { stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--v)); }
.sa-liquid { fill: var(--c); opacity: .5; }
.sa-glass { fill: none; stroke: var(--c); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.hm-system:is(:hover, :focus-visible) .sa-block { opacity: calc(1.1 - var(--o)); }
.hm-system:is(:hover, :focus-visible) .sa-radar { transform: scale(1.1) rotate(5deg); }
.hm-system:is(:hover, :focus-visible) .sa-node { transform: scale(1.16); }
.hm-system:is(:hover, :focus-visible) .sa-bar { transform: scaleY(1.12); opacity: .9; }
.hm-system:is(:hover, :focus-visible) .sa-ring { transform: rotate(1turn); }
.hm-system:is(:hover, :focus-visible) .sa-bubble { transform: translateY(-12px) scale(1.25); }

@media (max-width: 1199.98px) {
  .hm-systems { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
  .hm-systems { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .hm-system-art { height: 4.25rem; }
}
/* แอนิเมชัน: การ์ดโผล่ + ภาพก่อตัวเมื่อเลื่อนถึง (is-in) จากนั้นสัญญาณไฟวิ่งปลุกทีละระบบ วนทุก 7 วิ
   ใช้ translate/scale/fill เพื่อไม่ชนกับ transform ตอนชี้เมาส์ · พ้นจอแล้วหยุด (ไม่มี is-live) · ลดการเคลื่อนไหว = ไม่ใส่คลาสเลย */
@property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.hm-systems.is-wait .hm-system { opacity: 0; }
.hm-systems.is-in .hm-system { animation: sy-in .8s cubic-bezier(.16, 1, .3, 1) calc(var(--k) * 90ms) backwards; }
.hm-system::after {
  content: ""; position: absolute; inset: 0; padding: 2px; border-radius: inherit; pointer-events: none; opacity: 0;
  background: conic-gradient(from var(--ang), transparent 55%, var(--c) 85%, #fff 97%, transparent);
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.hm-systems.is-in .hm-system::after { animation: sy-beam 7s linear calc(3s + var(--k) * 1s) infinite; }
.sa-block { --an: sy-flash; }
.sa-radar, .sa-node, .hm-system-art > i { --an: sy-pop; }
.sa-links path { --an: sy-draw; }
.sa-bar { --an: sy-grow; }
.sa-ring { --an: sy-ring; }
.sa-liquid { --an: sy-fill; }
.hm-systems.is-in :is(.sa-block, .sa-radar, .sa-node, .sa-links path, .sa-bar, .sa-ring, .sa-liquid, .hm-system-art > i) {
  animation:
    var(--an) 7s cubic-bezier(.2, .9, .3, 1) calc(.3s + var(--k) * 110ms + var(--i, 0) * 70ms) 1 backwards,
    var(--an) 7s cubic-bezier(.2, .9, .3, 1) calc(3.1s + var(--k) * 1s + var(--i, 0) * 70ms) infinite;
}
.hm-systems.is-in .sa-bubble { animation: sy-bubble 2.6s ease-in calc(var(--i) * -.52s) infinite; }
.hm-systems:not(.is-live) *, .hm-systems:not(.is-live) .hm-system::after { animation-play-state: paused !important; }
@keyframes sy-in { from { opacity: 0; translate: 0 40px; scale: .9; } }
@keyframes sy-beam { 0% { --ang: 0deg; opacity: 0; } 3%, 18% { opacity: 1; } 24%, 100% { --ang: 360deg; opacity: 0; } }
@keyframes sy-flash { 0% { scale: .3; fill: #fff; } 9% { scale: 1.08; fill: #fff; } 18%, 100% { scale: 1; } }
@keyframes sy-pop { 0% { scale: .25; } 8% { scale: 1.16; } 14%, 100% { scale: 1; } }
@keyframes sy-draw { 0% { stroke-dashoffset: 1; } 14%, 100% { stroke-dashoffset: 0; } }
@keyframes sy-grow { 0% { scale: 1 .05; } 9% { scale: 1 1.12; } 15%, 100% { scale: 1 1; } }
@keyframes sy-ring { 0% { stroke-dashoffset: 1; } 20%, 100% { stroke-dashoffset: calc(1 - var(--v)); } }
@keyframes sy-fill { 0% { scale: 1 .1; } 12% { scale: 1 1.12; } 20%, 100% { scale: 1 1; } }
@keyframes sy-bubble { 0% { translate: 0 8px; opacity: 0; } 25% { opacity: 1; } 100% { translate: 0 -22px; opacity: 0; } }
.hm-system-art svg .sa-liquid { transform-origin: bottom; }

@media (prefers-reduced-motion: reduce) { .hm-system, .hm-system::before, .hm-system-art svg * { transition: none; } .hm-system:hover { transform: none; } }

/* ---------- ผลงานเด่น + ปฏิทิน: พื้นสว่างคั่นระบบงาน (เข้ม) กับ footer ---------- */
.page-home .hm-achieve {
  background:
    radial-gradient(40% 60% at 100% 0%, rgba(79, 141, 255, .08), transparent 70%),
    radial-gradient(35% 50% at 0% 100%, rgba(226, 189, 98, .1), transparent 70%),
    #f7f9fc;
}
.page-home .hm-achieve .hm-head { min-height: 5.6rem; }
.hm-cal { padding: 1.1rem 1.2rem 1.25rem; border: 1px solid #e3e9f2; border-radius: 20px; background: #fff; box-shadow: 0 10px 28px rgba(11, 42, 82, .07); }
.hm-cal-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; color: #0b2545; font-size: 1.05rem; }
.hm-cal-nav { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid #dfe6f1; color: #13315c; transition: background-color .2s ease, color .2s ease; }
.hm-cal-nav:hover { background: #0b2545; border-color: #0b2545; color: #fff; }
.hm-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: .3rem; text-align: center; }
.hm-cal-wd { padding: .25rem 0; font-size: .78rem; font-weight: 600; color: #94a3b8; }
.hm-cal-day { position: relative; display: grid; place-items: center; height: 2.6rem; border-radius: 12px; font-size: .92rem; color: #334155; }
.hm-cal-day.is-blank { visibility: hidden; }
.hm-cal-day.is-today { box-shadow: inset 0 0 0 1.5px #e2bd62; font-weight: 600; }
.hm-cal-day.has-ev { color: #fff; font-weight: 600; background: linear-gradient(150deg, #1a4a8f, #0d2a5c); box-shadow: 0 6px 14px rgba(13, 42, 92, .22); }
.hm-cal-day.has-ev:hover, .hm-cal-day.has-ev:focus-visible { color: #f5d27a; }
.hm-cal-dot { position: absolute; bottom: 6px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: #f5d27a; }
.hm-cal-tip {
  position: absolute; z-index: 5; bottom: calc(100% + 8px); left: 50%; width: max-content; max-width: 16rem; padding: .55rem .75rem;
  display: flex; flex-direction: column; gap: .3rem; border-radius: 12px; text-align: left;
  background: #0b2545; color: #fff; font-size: .8rem; font-weight: 400; line-height: 1.45; box-shadow: 0 12px 28px rgba(2, 8, 30, .3);
  opacity: 0; visibility: hidden; transform: translate(-50%, 4px); transition: opacity .18s ease, transform .18s ease, visibility .18s;
  pointer-events: none;
}
.hm-cal-tip span + span { padding-top: .3rem; border-top: 1px solid rgba(255, 255, 255, .15); }
.hm-cal-day.tip-left .hm-cal-tip { left: auto; right: -4px; transform: translate(0, 4px); }
.hm-cal-day:is(:hover, :focus-visible) .hm-cal-tip { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.hm-cal-day.tip-left:is(:hover, :focus-visible) .hm-cal-tip { transform: translate(0, 0); }
.hm-cal-list { list-style: none; margin: 1rem 0 0; padding: .85rem 0 0; border-top: 1px solid #eef2f7; display: grid; gap: .55rem; }
.hm-cal-list li { min-width: 0; }
.hm-cal-list a { display: block; font-size: .88rem; line-height: 1.45; color: #0b2545; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hm-cal-list a:hover { color: #1d4f91; }
.hm-cal-when { display: inline-block; min-width: 7.5em; margin-right: .5rem; color: #b8913a; font-weight: 600; font-size: .8rem; }
.hm-cal-none { margin: .9rem 0 0; text-align: center; font-size: .88rem; color: #64748b; }
@media (max-width: 991.98px) { .page-home .hm-achieve .hm-head { min-height: 0; } }
@media (prefers-reduced-motion: reduce) { .hm-cal-tip { transition: none; } }

/* ประกาศสำคัญ (ก่อนข่าว): ทีละแถว ป้าย | หัวเรื่อง (โรงเรียน·วันที่ใต้หัวเรื่อง) */
.page-home .hm-board .hm-announce-list a { display: flex; align-items: flex-start; gap: .9rem; padding: 1rem .25rem; }
.page-home .hm-board .hm-announce-tag { flex: 0 0 auto; margin-top: .15rem; }
.page-home .hm-announce-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .2rem; }
.page-home .hm-board .hm-announce-title { -webkit-line-clamp: 2; }
.page-home .hm-board .hm-announce-meta .hm-award-demo { margin-left: .35rem; }
@media (max-width: 575.98px) {
  .page-home .hm-board .hm-announce-list a { flex-direction: column; gap: .45rem; }
  .page-home .hm-board .hm-announce-tag { margin-top: 0; }
}

/* สถิติผู้เข้าชม (ใต้ปฏิทิน) */
.hm-visits {
  margin-top: 1.25rem; padding: 1.1rem 1.25rem 1rem; border-radius: 20px; color: #fff;
  background: radial-gradient(80% 120% at 100% 0%, rgba(226, 189, 98, .22), transparent 60%), linear-gradient(135deg, #0b2a52 0%, #123d75 100%);
  box-shadow: 0 14px 32px rgba(11, 42, 82, .18);
}
.hm-visits-head { font-weight: 600; font-size: .95rem; margin-bottom: .75rem; }
.hm-visits-head i { color: #e2bd62; margin-right: .3rem; }
.hm-visits-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin: 0; }
.hm-visit { padding: .55rem .4rem; border-radius: 12px; background: rgba(255, 255, 255, .07); text-align: center; }
.hm-visit dt { font-weight: 400; font-size: .74rem; color: rgba(255, 255, 255, .72); }
.hm-visit dd { margin: .1rem 0 0; font-family: Kanit, sans-serif; font-size: 1.3rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.hm-visit.is-total { background: rgba(226, 189, 98, .18); }
.hm-visit.is-total dd { color: #f3d58a; }
.hm-visits-foot { margin-top: .7rem; font-size: .76rem; color: rgba(255, 255, 255, .6); }
@media (max-width: 380px) { .hm-visits-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ประกาศสำคัญ: ไม่มีพื้นการ์ดสีขาว — วางบนพื้นของส่วน มีเส้นคั่นแต่ละรายการ */
.page-home .hm-board .hm-announce-list { padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; border-top: 1px solid #dbe3ee; }
.page-home .hm-board .hm-announce-list li { border-bottom: 1px solid #dbe3ee; }
.page-home .hm-board .hm-announce-list li:last-child { border-bottom: 1px solid #dbe3ee; }
.page-home .hm-board .hm-announce-list a { padding: 1.05rem .25rem; }

/* เกี่ยวกับ PCSHS (ต่อจาก hero): ภาพซ้อน 2 ภาพ + ป้าย 18 โรงเรียน | ข้อความ + 3 จุดเด่น */
.hm-about { padding: 5rem 0 4.5rem; background: #fff; overflow: hidden; }
.hm-about-media { position: relative; }
.hm-about-img { display: block; width: 100%; aspect-ratio: 5 / 4; object-fit: cover; border-radius: 28px; box-shadow: 0 24px 50px rgba(11, 42, 82, .14); }
.hm-about .hm-eyebrow { margin-bottom: .35rem; }
.hm-about-title { font-size: clamp(1.6rem, 2.6vw, 2.15rem); line-height: 1.3; color: #0b2545; margin: 0 0 1rem; }
.hm-about-title::after { content: ""; display: block; width: 3.2rem; height: 3px; margin-top: .8rem; border-radius: 3px; background: #e2bd62; }
.hm-about-lead { color: #334155; font-size: 1.02rem; line-height: 1.85; margin: 0 0 1.5rem; }
.hm-about-points { margin: 0 0 1.75rem; padding: 0; list-style: none; display: grid; gap: 1rem; }
.hm-about-points li { display: flex; align-items: flex-start; gap: .9rem; }
.hm-about-ic { flex: 0 0 2.6rem; height: 2.6rem; display: grid; place-items: center; border-radius: 13px; background: #fcf3dc; color: #b7791f; font-size: 1.15rem; }
.hm-about-points li > span:last-child { color: #64748b; font-size: .9rem; line-height: 1.6; }
.hm-about .hm-about-points b { display: block; font-family: inherit; letter-spacing: normal; font-weight: 600; font-size: 1rem; color: #0b2545; }
.hm-about-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.hm-about-btn {
  display: inline-flex; align-items: center; gap: .45rem; padding: .65rem 1.3rem; border-radius: 999px; font-weight: 600;
  color: #fff; background: linear-gradient(135deg, #0b2a52, #1d4f91); box-shadow: 0 10px 22px rgba(11, 42, 82, .2); text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease;
}
.hm-about-btn:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 14px 28px rgba(11, 42, 82, .26); }
@media (max-width: 575.98px) {
  .hm-about { padding: 3rem 0 2.75rem; }
  .hm-about-img { border-radius: 20px; }
}

/* ผลงานและรางวัลเด่น (หน้าแรก): ไม่มีพื้นการ์ดสีขาว — วางบนพื้นของส่วน มีเส้นคั่นแต่ละรายการ */
.hm-achieve .hm-awards { padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; border-top: 1px solid #dbe3ee; }
.hm-achieve .hm-award { border-bottom: 1px solid #dbe3ee; }
.hm-achieve .hm-award:last-child { border-bottom: 1px solid #dbe3ee; }

/* ---------- ความเคลื่อนไหวเบา ๆ (home-life.js ใส่ .rv / .is-in) ---------- */
.rv { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .85s cubic-bezier(.16, 1, .3, 1); transition-delay: var(--rv-d, 0ms); }
.rv.is-in { opacity: 1; transform: none; }
.hm-about-media.rv { transform: translateY(22px) scale(.985); }
.hm-about-media.rv.is-in { transform: none; }

/* เกี่ยวกับ PCSHS: พื้นอ่อนแยกจากข่าว */
.hm-about {
  background:
    radial-gradient(40% 60% at 0% 0%, rgba(226, 189, 98, .1), transparent 70%),
    radial-gradient(45% 60% at 100% 100%, rgba(79, 141, 255, .08), transparent 70%),
    #f8fafd;
}
.hm-about-points li { transition: transform .25s ease; }
.hm-about-points li:hover { transform: translateX(4px); }
.hm-about-ic { transition: background-color .25s ease, color .25s ease, transform .25s ease; }
.hm-about-points li:hover .hm-about-ic { background: #e2bd62; color: #fff; transform: rotate(-6deg); }

/* รางวัล: ชี้แล้วขยับ + เหรียญเอียงนิด */
.hm-achieve .hm-award { transition: transform .25s ease; }
.hm-achieve .hm-award:hover { transform: translateX(4px); }
.hm-award-medal { transition: transform .3s cubic-bezier(.16, 1, .3, 1); }
.hm-award:hover .hm-award-medal { transform: rotate(-8deg) scale(1.06); }

/* ปฏิทิน: วันนี้มีวงทองกระเพื่อมช้า ๆ */
@media (prefers-reduced-motion: no-preference) {
  .hm-cal-day.is-today::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    box-shadow: 0 0 0 0 rgba(226, 189, 98, .55); animation: hmTodayPulse 2.6s ease-out infinite;
  }
  @keyframes hmTodayPulse { 0% { box-shadow: 0 0 0 0 rgba(226, 189, 98, .55); } 70%, 100% { box-shadow: 0 0 0 9px rgba(226, 189, 98, 0); } }
}

/* เกี่ยวกับ PCSHS: รูปขอบมน ไม่มีของตกแต่งหลังรูป — ชี้แล้วลอยขึ้นนิดเดียว */
.hm-about-img { transition: transform .9s cubic-bezier(.16, 1, .3, 1), box-shadow .6s ease; }
.hm-about-media:hover .hm-about-img { transform: translateY(-4px); box-shadow: 0 30px 60px rgba(11, 42, 82, .2); }
