/* inner.css — ธีมของหน้าด้านในทุกหน้า ให้เข้าชุดกับหน้าแรก (layouts/site.php ใส่ให้เอง ใช้คู่กับ home-formal / home-premium)
   !important เฉพาะจุดที่ต้องชนะ accents.css ซึ่งโหลดทีหลัง */

/* ---------- หัวหน้าเพจ: พื้นน้ำเงิน + แสงส้มมุมขวาล่างแบบ hero หน้าแรก ---------- */
.hm-inner :is(.page-hero, .login-wrap, .error-page) {
  padding: calc(var(--topbar-h) + var(--header-h) + 10px + clamp(2rem, 4vw, 3.25rem)) 0 clamp(2.5rem, 5vw, 4rem); /* เว้นที่ให้แถบเมนูลอย */
  border: 0;
  background:
    radial-gradient(45% 130% at 100% 100%, rgba(255, 120, 30, .42), rgba(255, 120, 30, .16) 40%, transparent 75%),
    radial-gradient(70% 90% at 45% 0%, rgba(40, 100, 220, .45), transparent 75%),
    linear-gradient(180deg, #0b2a6e, #061743) !important;
}
.page-hero-net { position: absolute; right: 0; top: 0; width: 62%; height: 100%; pointer-events: none; -webkit-mask: linear-gradient(90deg, transparent, #000 50%); mask: linear-gradient(90deg, transparent, #000 50%); }
@media (max-width: 767.98px) { .page-hero-net { width: 85%; opacity: .5; } }
.hm-inner .page-hero::before, .hm-inner .page-hero::after, .hm-inner .page-hero h1::before { content: none; }
.hm-inner .page-hero h1 {
  max-width: 24em;
  font-family: "Bai Jamjuree", Kanit, sans-serif !important;
  font-size: clamp(1.6rem, 3.2vw, 2.6rem);
  line-height: 1.35; letter-spacing: 0;
  color: #fff !important;
  text-wrap: balance;
}
.hm-inner .page-hero .breadcrumb-item, .hm-inner .page-hero .breadcrumb-item a, .hm-inner .page-hero .breadcrumb-item + .breadcrumb-item::before { color: rgba(255, 255, 255, .75) !important; }
.hm-inner .page-hero .breadcrumb-item a:hover { color: #fff !important; }
.hm-inner .page-hero .lead { color: rgba(255, 255, 255, .8) !important; }
.hm-inner .page-hero + .page-section { padding: 2.5rem 0 4rem; }

/* ---------- ตัวกรอง + แบ่งหน้า ---------- */
.hm-inner .filter-bar .form-select, .hm-inner .filter-bar .form-control { min-height: 46px; border-radius: 999px; padding-left: 1.1rem; border-color: rgba(12, 42, 82, .18); }
.hm-inner .filter-bar .form-control { max-width: none; }
.hm-inner .filter-bar :focus { border-color: var(--p-gold); box-shadow: 0 0 0 3px rgba(201, 164, 76, .3); }
.hm-inner .btn { border-radius: 999px; padding-inline: 1.4rem; }
.hm-inner .btn.btn-primary { border-radius: 999px; background: var(--p-navy); border-color: var(--p-navy); }
.hm-inner .btn.btn-primary:hover { background: var(--p-ink); border-color: var(--p-ink); }
.hm-inner .btn-outline-primary { color: var(--p-navy); border-color: var(--p-navy); }
.hm-inner .btn-outline-primary:hover { color: #fff; background: var(--p-navy); }

/* ---------- หน้าอ่านข่าว ---------- */
.hm-inner .post-meta .badge { background: var(--p-gold) !important; color: var(--p-ink) !important; border-radius: 999px; }
.hm-inner .post-cover { border-radius: 20px; }
.hm-inner .prose h2::before { background: var(--p-gold); }
.hm-inner .prose a { color: #0b4fb3; text-decoration: underline; text-underline-offset: 3px; }
.hm-inner .prose blockquote { border-left-color: var(--p-gold); background: var(--p-mist); }

/* ---------- การ์ดและหัวข้อ ---------- */
.hm-inner :is(.school-card, .info-card, .person-card, .year-card, .content-card, .sys-card) {
  border: 1px solid #e6ebf3 !important; border-radius: 20px !important; box-shadow: 0 6px 18px rgba(11, 42, 82, .05) !important;
}
.hm-inner :is(.school-card, .year-card):hover { transform: translateY(-3px); border-color: #d9c48f !important; box-shadow: 0 18px 38px rgba(11, 42, 82, .12) !important; }
.hm-inner .page-section :is(h2, h3):is(.h4, .h5, .h6), .hm-inner .series-head h2 { color: #0b2545; font-weight: 600; }
.hm-inner .page-section h2:is(.h4, .h5)::after, .hm-inner .series-head h2::after {
  content: ""; display: block; width: 2.75rem; height: 3px; margin-top: .55rem; border-radius: 3px; background: #e2bd62;
}
.hm-inner .series-head h2::before { content: none; }
.hm-inner .page-section :is(h1, h2, h3, h4, .school-card-name, .sys-name, .year) { font-family: "Bai Jamjuree", Kanit, sans-serif !important; }
.hm-inner .page-section :is(.info-card, .table) a:not(.btn) { color: var(--p-navy); }
.hm-inner .page-section :is(.info-card, .table) a:not(.btn):hover { color: #8a6a1f; }

/* โรงเรียน · กิจกรรม · เนื้อหา */
.hm-inner .school-code { color: #3d2800 !important; background: linear-gradient(95deg, #fbe3a2, #e2bd62) !important; }
.hm-inner .school-card-img img { transition: transform .5s; }
.hm-inner .school-card:hover img { transform: scale(1.04); }
.hm-inner :is(.school-card-name, .year-title) { color: var(--p-ink); font-weight: 500; }
.hm-inner :is(.school-card-prov, .year-meta) i { color: #b8913a; }
.hm-inner .year-card .year { color: var(--p-navy); }
.hm-inner .content-card-icon { color: #e2bd62; background: #0b2a6e; }
.hm-inner .timeline .tl-item::before { background: #e2bd62 !important; box-shadow: 0 0 0 3px rgba(226, 189, 98, .3) !important; }
.hm-inner .tl-year { color: #8a6a1f !important; }
.hm-inner .prose h1, .hm-inner .prose h2 { font-size: clamp(1.35rem, 2.2vw, 1.7rem); font-weight: 600; }
.hm-inner .prose :is(h3, h4) { font-size: 1.18rem; font-weight: 600; color: #0b2545; }
.hm-inner .prose h2::before { vertical-align: -2px; }

/* ดาวน์โหลด / รายการของฉัน */
.hm-inner .list-group { border-radius: 20px; border: 1px solid #e6ebf3; box-shadow: 0 6px 18px rgba(11, 42, 82, .05); overflow: hidden; }
.hm-inner .list-group-item { padding: 1rem 1.25rem; border-width: 0 0 1px; border-color: #eef2f7; }
.hm-inner .list-group-item:last-child { border-bottom: 0; }
.hm-inner .list-group-item:hover { background: #f6f8fc; }
.hm-inner .list-group-item > i { color: #b8913a !important; }

/* ระบบงาน: แถบภาพชุดเดียวกับการ์ดระบบบนหน้าแรก */
.hm-inner .sys-card { padding-top: 0; }
.hm-inner .row > :nth-child(6n + 1) .sys-card { --c: #6ec1ff; }
.hm-inner .row > :nth-child(6n + 2) .sys-card { --c: #f3c969; }
.hm-inner .row > :nth-child(6n + 3) .sys-card { --c: #b79cff; }
.hm-inner .row > :nth-child(6n + 4) .sys-card { --c: #ff8fa3; }
.hm-inner .row > :nth-child(6n + 5) .sys-card { --c: #ffa765; }
.hm-inner .row > :nth-child(6n) .sys-card { --c: #8fd3e6; }
.hm-inner .sys-card::before { content: none; }
.hm-inner .sys-art { box-sizing: content-box; width: auto; margin: 0 -1.3rem .3rem; padding: 1.1rem 0; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 5%, #11337a), #091c49); }
.hm-inner .sys-name { color: #0b2545; font-weight: 600; }
.hm-inner .chip { padding: .45rem 1.1rem; border-radius: 999px; }
.hm-inner .chip:hover { color: var(--p-navy); border-color: #d9c48f; }
.hm-inner .chip.on { color: #fff; background: var(--p-navy); }

/* ---------- เข้าสู่ระบบ + หน้าแจ้งข้อผิดพลาด: ไม่มีหัวหน้าเพจ ใช้พื้น hero ทั้งหน้า ---------- */
.hm-inner :is(.login-wrap, .error-page) { display: grid; align-items: center; min-height: 78svh; }
.hm-inner .login-card { border: 0; border-radius: 24px; box-shadow: 0 30px 70px rgba(2, 8, 30, .45); }
.hm-inner .error-page :is(h1, .error-code) { color: #fff; }
.hm-inner .error-page .text-muted { color: rgba(255, 255, 255, .8) !important; }
.hm-inner .error-page .btn.btn-primary { color: var(--p-ink); background: #e2bd62; border-color: #e2bd62; }

/* ---------- หน้าเกี่ยวกับ PCSHS (โครงจาก page_body() ใน sanitize.php) ---------- */
.hm-inner .pg-body :is(p, li) { margin-bottom: 0; color: #35425a; font-size: 1.03rem; line-height: 1.85; text-wrap: pretty; }
.hm-inner .pg-body p + p { margin-top: 1rem; }
.hm-inner .pg-body > p:first-child { font-size: 1.2rem; color: #0b2545; }
.hm-inner .pg-body h2 { margin: 3.25rem 0 .9rem; }
.hm-inner .pg-body h2:first-child { margin-top: 0; }
.pg-media { display: grid; gap: 1.5rem; margin-top: 3.25rem; }
.pg-media:first-child { margin-top: 0; }
@media (min-width: 992px) { .pg-media { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 3rem; align-items: center; } }
.hm-inner .pg-media img { display: block; width: 100%; aspect-ratio: 16 / 9; margin: 0; border-radius: 20px; object-fit: cover; }
.hm-inner .pg-body ul { margin: .9rem 0; padding-left: 1.2rem; }
.hm-inner .pg-body li + li { margin-top: .4rem; }
.hm-inner .pg-body li::marker { color: #c9a44c; }
.hm-inner .pg-body h4 { margin: 0 0 .35rem; }
.pg-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.pg-num > .pg-item, .pg-card > .pg-item { padding: 1.35rem 1.5rem; border: 1px solid #e6ebf3; border-radius: 20px; background: #fff; box-shadow: 0 6px 18px rgba(11, 42, 82, .05); }
.pg-item:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (min-width: 1200px) { /* จำนวนหาร 3 ลงตัว = 3 คอลัมน์ */
  .pg-items:not(.pg-step):has(> :last-child:nth-child(3n)) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pg-item:last-child:nth-child(3n) { grid-column: auto; }
}
.pg-num > .pg-item { display: flex; gap: 1.1rem; align-items: flex-start; }
.pg-num .pg-label {
  flex: 0 0 2.9rem; height: 2.9rem; display: grid; place-items: center; border-radius: 14px;
  font: 600 1.25rem/1 "Bai Jamjuree", sans-serif; color: #f3d27a; background: linear-gradient(160deg, #123a86, #0a2050);
}
/* ช่วงเวลา: เส้นเดียวต่อเนื่องจากบนลงล่าง */
.pg-step { grid-template-columns: 1fr; gap: 0; margin-left: .5rem; }
.pg-step > .pg-item { position: relative; padding: 0 0 1.75rem 2rem; border-left: 2px solid #e6d9b3; }
.pg-step > .pg-item:last-child { padding-bottom: 0; }
.pg-step > .pg-item::before { content: ""; position: absolute; left: -9px; top: .35rem; width: 16px; height: 16px; border-radius: 50%; border: 4px solid #e2bd62; background: #fff; }
.pg-step .pg-label { display: inline-block; margin-bottom: .5rem; padding: .1rem .8rem; border-radius: 999px; font-size: .85rem; font-weight: 600; color: #3d2800; background: linear-gradient(95deg, #fbe3a2, #e2bd62); }
@media (max-width: 767.98px) { .pg-items { grid-template-columns: 1fr; } .pg-num > .pg-item { padding: 1.1rem; gap: .9rem; } }

/* โทนกรมท่า-ทอง: เหรียญไอคอนขอบทอง เลขทอง และแสงทองกวาดเมื่อชี้ */
.pg-body { --gold: linear-gradient(115deg, #8f6516 0%, #c99a3a 30%, #f0d489 48%, #b98525 66%, #8f6516 100%); }
.pg-card > .pg-item { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 1.25rem; align-content: start; }
.pg-card > .pg-item > :not(i) { grid-column: 2; }
.pg-card > .pg-item > i { grid-row: 1 / span 2; }
:is(.pg-card > .pg-item, .pg-aims > li) > i {
  flex: 0 0 3.5rem; width: 3.5rem; height: 3.5rem; display: grid; place-items: center; border-radius: 50%;
  font-size: 1.4rem; color: #f3d992; background: radial-gradient(circle at 32% 25%, #1d4690, #071a40 72%);
  box-shadow: 0 0 0 3px #fff, 0 0 0 4.5px #c99a3a, 0 10px 22px rgba(7, 26, 64, .28); transition: box-shadow .4s, rotate .7s cubic-bezier(.2, .8, .2, 1);
}
.pg-card > .pg-item > i.bi-palette { color: #fff; background: linear-gradient(135deg, #0c2a66 50%, #f07f1c 50%); } /* สีประจำโรงเรียน */
:is(.pg-item, .pg-aims > li):hover > i { rotate: 1turn; box-shadow: 0 0 0 3px #fff, 0 0 0 5.5px #e2bd62, 0 10px 30px rgba(201, 154, 58, .5); }
.pg-num .pg-label {
  flex: 0 0 3.5rem; width: 3.5rem; height: auto; border-radius: 0; font: 600 2.9rem/1 "Bai Jamjuree", sans-serif; letter-spacing: -.04em;
  color: transparent; background: var(--gold) 0 0 / 250% 100%; -webkit-background-clip: text; background-clip: text; transition: background-position .9s cubic-bezier(.2, .8, .2, 1);
}
.pg-num > .pg-item:hover .pg-label { background-position: 100% 0; }
:is(.pg-num, .pg-card) > .pg-item {
  position: relative; overflow: hidden; padding: 1.7rem 1.75rem; border-color: #e9dfc6; border-radius: 6px 28px 6px 28px;
  background: linear-gradient(160deg, #fff 55%, #fbf6e9); transition: translate .45s cubic-bezier(.2, .8, .2, 1), border-color .45s, box-shadow .45s;
}
:is(.pg-num, .pg-card) > .pg-item::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; translate: -110% 0; transition: translate 0s;
  background: linear-gradient(105deg, transparent 35%, rgba(240, 212, 137, .38) 50%, transparent 65%);
}
:is(.pg-num, .pg-card) > .pg-item:hover { translate: 0 -5px; border-color: #c99a3a; box-shadow: 0 22px 44px rgba(7, 26, 64, .14); }
:is(.pg-num, .pg-card) > .pg-item:hover::after { translate: 110% 0; transition: translate .95s ease; }
.hm-inner .pg-body .pg-aims { display: grid; gap: 1.4rem; margin: 1.6rem 0; padding: 0 0 0 5px; list-style: none; }
.hm-inner .pg-body .pg-aims > li { display: flex; gap: 1.25rem; align-items: flex-start; margin: 0; line-height: 1.7; }
.pg-aims b { display: block; color: #0b2545; font-size: 1.15rem; }
/* ประโยควิสัยทัศน์: ข้อความเดียวใต้หัวข้อข้างรูป */
.hm-inner .pg-media > div > h2 + p:last-child { font: 600 clamp(1.4rem, 2.5vw, 2.1rem)/1.55 "Bai Jamjuree", sans-serif; color: #0b2a66; text-wrap: balance; }
/* รูป: กรอบทองเส้นบางเยื้องจากภาพ */
.hm-inner .pg-media img { border-radius: 6px 44px 6px 44px; outline: 1.5px solid #c99a3a; outline-offset: 9px; box-shadow: 0 30px 60px rgba(7, 26, 64, .26); }
@media (min-width: 992px) { .hm-inner .pg-media img { width: calc(100% - 11px); } }
@media (max-width: 991.98px) { .hm-inner .pg-media img { width: calc(100% - 16px); margin: 12px auto; outline-offset: 6px; } }

/* ไทม์ไลน์: แผงงาช้าง-ฟ้าอ่อน เส้นทองวิ่งตามตำแหน่งที่อ่าน */
.pg-step {
  margin: 2rem 0 0; padding: clamp(1.75rem, 4vw, 3.5rem); border-radius: 6px 44px 6px 44px; border: 1px solid #e3cf9c;
  background: radial-gradient(60rem 26rem at 100% 0, rgba(240, 212, 137, .34), transparent 65%), radial-gradient(50rem 30rem at 0 100%, rgba(150, 188, 245, .3), transparent 65%), #fbfaf6;
  box-shadow: 0 24px 54px rgba(7, 26, 64, .1);
}
.pg-step > .pg-item { padding: 0 0 2.75rem clamp(1.6rem, 3vw, 2.75rem); border-left: 2px solid #eadfc4; }
.pg-step > .pg-item::before { z-index: 1; left: -10px; width: 18px; height: 18px; border: 4px solid #c99a3a; background: #fff; box-shadow: 0 0 0 5px rgba(226, 189, 98, .25), 0 0 18px rgba(226, 189, 98, .7); }
.pg-step > .pg-item::after { content: ""; position: absolute; left: -3px; top: .35rem; bottom: -.35rem; width: 3px; border-radius: 3px; background: linear-gradient(#c99a3a, #e8c56c); filter: drop-shadow(0 0 5px rgba(226, 189, 98, .6)); transform-origin: top; }
.pg-step > .pg-item:last-child::after { bottom: 0; }
.pg-step .pg-label { padding: 0; margin: 0 0 .1rem; color: #86600f; background: none; font-size: 1rem; }
.hm-inner .pg-step h4 { margin-bottom: 1rem; color: #0b2a66; font-size: clamp(1.25rem, 2vw, 1.6rem); }
.hm-inner .pg-body .pg-step ul { margin: 0; padding: 0; list-style: none; }
.hm-inner .pg-body .pg-step li { position: relative; margin: 0; padding: .7rem 0 .7rem 15.5rem; border-top: 1px solid rgba(11, 42, 102, .1); color: #35425a; transition: background .4s, color .4s; }
.hm-inner .pg-body .pg-step li:hover { color: #0b2545; background: linear-gradient(90deg, rgba(226, 189, 98, .24), transparent 80%); }
.pg-step li b { position: absolute; left: .75rem; color: #86600f; font: 600 1.1rem/1.75 "Bai Jamjuree", sans-serif; }
@media (max-width: 767.98px) {
  .hm-inner .pg-body .pg-step li { padding-left: 0; }
  .pg-step li b { position: static; display: block; }
  .pg-num .pg-label { flex-basis: 2.8rem; width: 2.8rem; font-size: 2.3rem; }
}
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    @keyframes pg-draw { from { transform: scaleY(0); } }
    @keyframes pg-lit { from { border-color: #d9d3c4; box-shadow: none; } }
    .pg-step > .pg-item::after { animation: pg-draw linear both; animation-timeline: view(); animation-range: cover 35vh cover calc(100% - 65vh); }
    .pg-step > .pg-item::before { animation: pg-lit linear both; animation-timeline: view(); animation-range: cover 32vh cover 37vh; }
  }
}
@media (prefers-reduced-motion: reduce) { .pg-body *, .pg-body *::after { transition: none !important; } }

/* ---------- ผังโครงสร้างการบริหารงาน (partials/org_chart.php) ---------- */
.oc { margin: 0; }
.hm-inner .oc h2 { margin: 0 0 1.25rem; font-size: clamp(1.25rem, 2.2vw, 1.7rem); font-weight: 600; color: #0b2545; text-wrap: balance; }
.oc-panel {
  padding: clamp(.75rem, 2.5vw, 2.25rem); border-radius: 24px;
  border: 1px solid #e3cf9c;
  background: radial-gradient(50% 55% at 100% 0, rgba(240, 212, 137, .32), transparent 75%), radial-gradient(55% 60% at 0 100%, rgba(150, 188, 245, .3), transparent 75%), #fbfaf6;
}
.oc svg { width: 100%; height: auto; font-family: "IBM Plex Sans Thai", Prompt, sans-serif; }
.oc-line { fill: none; stroke: #6d95d6; stroke-width: 2.5; stroke-linejoin: round; }
.oc-dash { stroke: #8696b3; stroke-width: 2; stroke-dasharray: 7 6; }
.oc-box rect { fill: #e4eefc; stroke: #8fb2e6; stroke-width: 1.5; }
.oc-box text { fill: #0b2a66; font-size: 20px; font-weight: 500; }
.oc-box.is-top rect { fill: #f5dfa6; stroke: #d9b45c; }
.oc-box.is-top text { fill: #0a1a33; font-weight: 600; }
.oc-box.is-dash rect { fill: #fff; stroke: #8696b3; stroke-dasharray: 7 6; }
.oc-box.is-key rect { stroke: #f08a35; stroke-width: 3; }
.oc-box.is-small text { font-size: 17px; }
.oc-note text { fill: #86600f; font-size: 15px; }
.oc-band { fill: rgba(255, 255, 255, .75); stroke: #d5e0f1; }
.oc-band-title { fill: #0b2a66; font-size: 21px; font-weight: 600; }
/* จอเล็ก: ผังแนวตั้ง */
.oc-sm { display: block; max-width: 560px; margin: 0 auto; }
.oc-sm .oc-line { stroke-width: 2; }
.oc-sm .oc-dash { stroke-width: 1.6; stroke-dasharray: 5 4; }
.oc-sm .oc-box text { font-size: 17px; }
.oc-sm .oc-box.is-small text { font-size: 14.5px; }
.oc-sm .oc-note text { font-size: 13.5px; }
.oc-sm .oc-band-title { font-size: 15.5px; }

/* ---------- แผนภูมิโครงสร้างโรงเรียน (partials/school_chart.php) ---------- */
.sc { --gap: .9rem; --line: #d8bd7c; margin-top: 3.5rem; }
.sc-panel { padding: clamp(.75rem, 2vw, 1.75rem); border-radius: 24px; border: 1px solid #e3cf9c; background: radial-gradient(50% 30rem at 0 0, rgba(240, 212, 137, .3), transparent 75%), radial-gradient(60% 34rem at 100% 100%, rgba(150, 188, 245, .3), transparent 75%), #fbfaf6; }
.sc-root {
  width: fit-content; max-width: 100%; margin: 0 auto; padding: .85rem clamp(.9rem, 3vw, 1.75rem); border-radius: 14px; text-align: center; font-weight: 600; font-size: clamp(.95rem, 4vw, 1.1rem);
  color: #0a1a33; border: 1px solid #cfa449; box-shadow: 0 0 0 4px #fff, 0 0 0 5px #e3cf9c, 0 14px 30px rgba(201, 154, 58, .28);
  background: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, .85) 50%, transparent 58%) 130% 0 / 300% 100% no-repeat, linear-gradient(115deg, #ecc979, #f9e8b9 50%, #e9c471);
}
.hm-inner .sc h3 {
  position: relative; display: flex; align-items: center; gap: .9rem; margin: 0; padding: .8rem 1rem; border: 1px solid #e3cf9c; border-radius: 6px 20px 6px 20px;
  font-size: 1.06rem; font-weight: 600; line-height: 1.4; color: #0b2a66; background: linear-gradient(160deg, #fff 30%, color-mix(in srgb, var(--c) 20%, #fff)); transition: border-color .4s, box-shadow .4s;
}
.sc h3 i {
  flex: none; width: 3.1rem; height: 3.1rem; display: grid; place-items: center; border-radius: 50%; font-size: 1.3rem; color: #f3d992;
  background: radial-gradient(circle at 32% 25%, #2a59ad, #0d2a63 75%); box-shadow: 0 0 0 3px #fff, 0 0 0 4.5px #c99a3a, 0 8px 18px rgba(7, 26, 64, .22); transition: rotate .7s cubic-bezier(.2, .8, .2, 1), box-shadow .4s;
}
.sc-groups > .sc-node:hover > h3 { border-color: #c99a3a; box-shadow: 0 12px 26px rgba(201, 154, 58, .22); }
.sc-groups > .sc-node:hover > h3 i { rotate: 1turn; box-shadow: 0 0 0 3px #fff, 0 0 0 5.5px #e2bd62, 0 8px 26px rgba(201, 154, 58, .5); }
.hm-inner .sc h4 { display: flex; align-items: center; letter-spacing: 0; margin: -1.1rem -1.1rem .8rem; padding: .7rem 1.1rem; border-bottom: 2px solid #d8bd7c; font-size: 1rem; font-weight: 600; line-height: 1.4; color: #0b2545; background: linear-gradient(100deg, color-mix(in srgb, var(--c) 42%, #fff), color-mix(in srgb, var(--c) 16%, #fff)); }
.sc-list { position: relative; overflow: hidden; height: 100%; padding: 1.1rem 1.1rem 1.4rem; border: 1px solid #eee3c8; border-radius: 6px 24px 6px 24px; background: linear-gradient(170deg, #fff 60%, #fbf5e6); box-shadow: 0 10px 26px rgba(11, 42, 82, .06); transition: translate .45s cubic-bezier(.2, .8, .2, 1), border-color .45s, box-shadow .45s; }
.sc-list:hover { translate: 0 -5px; border-color: #c99a3a; box-shadow: 0 22px 44px rgba(7, 26, 64, .13); }
.sc-mark { position: absolute; right: -1rem; bottom: -1.5rem; font-size: 8rem; line-height: 1; color: #c99a3a; opacity: .1; pointer-events: none; transition: scale .8s, opacity .8s; }
.sc-list:hover .sc-mark { scale: 1.12; opacity: .2; }
.sc-list li { transition: color .3s, translate .3s; }
.sc-list > ol > li:hover { color: #0b2a66; translate: 4px 0; }
.sc-list :is(ol, li, p) { margin: 0; color: #35425a; font-size: .95rem; line-height: 1.55; }
.sc-list ol { padding: 0; list-style: none; counter-reset: n; }
.sc-list li { position: relative; padding: .22rem 0 .22rem 2rem; counter-increment: n; }
.sc-list li::before { content: counter(n) ")"; position: absolute; left: 0; color: #86600f; font-weight: 600; }
.sc-list li li { padding-left: 2rem; font-size: .9rem; }
.sc-list li li::before { content: "1." counter(n); }
.sc-list p { padding-top: .35rem; text-align: center; }
@media (min-width: 1200px) {
  /* ผังต้นไม้: ทุก .sc-row มีเส้นแนวนอนเชื่อมกลางกล่องแรกถึงกล่องสุดท้าย */
  .sc-row { display: flex; align-items: stretch; margin: 0 calc(var(--gap) / -2); }
  .sc-groups { position: relative; padding-top: 1.5rem; }
  .sc-groups::before { content: ""; position: absolute; left: 50%; top: 0; height: 1.5rem; border-left: 2px solid var(--line); }
  .sc-node { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; padding: 1.5rem calc(var(--gap) / 2) 0; }
  .sc-groups > .sc-node { flex: 0 0 calc(var(--n) * 20%); }
  .hm-inner .sc h3 { display: grid; place-items: center; min-height: 6.2rem; padding-top: 2.1rem; text-align: center; text-wrap: balance; }
  .hm-inner .sc h4 { min-height: 4.3rem; }
  .sc h3 i { position: absolute; top: -1.55rem; left: calc(50% - 1.55rem); }
  .sc-groups > .sc-node { padding-top: 3.2rem; }
  .sc-node > .sc-row { flex: 1; position: relative; padding-top: 1.25rem; }
  .sc-node > .sc-row::before { content: ""; position: absolute; left: 50%; top: 0; height: 1.25rem; border-left: 2px solid var(--line); }
  .sc-node::before { content: ""; position: absolute; left: 50%; top: 0; height: 1.5rem; border-left: 2px solid var(--line); }
  .sc-node::after { content: ""; position: absolute; left: 0; right: 0; top: 0; border-top: 2px solid var(--line); }
  .sc-node:first-child::after { left: 50%; }
  .sc-node:last-child::after { right: 50%; }
  .sc-node .sc-node:only-child { padding-top: 0; }
  .sc-node .sc-node:only-child::before, .sc-node .sc-node:only-child::after { content: none; }
}
@media (prefers-reduced-motion: no-preference) {
  /* แสงวิ่งบนแผ่นทอง แล้วประกายไหลลงตามเส้นเชื่อมทีละชั้น */
  @keyframes sc-sheen { 0%, 12% { background-position: 130% 0, 0 0; } 45%, 100% { background-position: -30% 0, 0 0; } }
  @keyframes sc-flow { 0% { background-position: 0 -1.2rem, 1px 0; } 25%, 100% { background-position: 0 3rem, 1px 0; } }
  .sc-root { animation: sc-sheen 5s ease-in-out infinite; }
  @media (min-width: 1200px) {
    :is(.sc-groups, .sc-node, .sc-node > .sc-row)::before { width: 4px; margin-left: -1px; border: 0; background: linear-gradient(transparent, #b06f00 70%, transparent) 0 -1.2rem / 4px 1.2rem no-repeat, linear-gradient(var(--line), var(--line)) 1px 0 / 2px 100% no-repeat; animation: sc-flow 5s linear 1.4s infinite; }
    .sc-groups > .sc-node::before { animation-delay: 1.9s; }
    .sc-node > .sc-row::before { animation-delay: 2.5s; }
    .sc-node .sc-node::before { animation-delay: 2.9s; }
  }
}
@media (prefers-reduced-motion: reduce) { .sc * { transition: none !important; } }
@media (max-width: 1199.98px) {
  /* จอเล็ก: เรียงลงมา มีเส้นข้างซ้ายเชื่อมจากโรงเรียนไปแต่ละกลุ่ม */
  .sc-groups { margin-top: 1rem; }
  .sc-groups > .sc-node { position: relative; padding: 0 0 1.5rem 1.4rem; border-left: 2px solid var(--line); }
  .sc-groups > .sc-node:last-child { padding-bottom: 0; border-color: transparent; }
  .sc-groups > .sc-node::before { content: ""; position: absolute; left: -2px; top: 0; width: 1.4rem; height: 1.4rem; border: solid var(--line); border-width: 0 0 2px 2px; border-radius: 0 0 0 10px; }
  .sc-node:only-child ol { columns: 17rem; column-gap: 1.5rem; }
  .sc-node:only-child li { break-inside: avoid; }
  .sc-node .sc-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: .75rem; margin-top: .75rem; }
}
