/* ===== Tokens ======================================================= */
:root {
  --ngoen: #16308f;      /* น้ำเงินโรงเรียน */
  --luek: #0a1648;       /* น้ำลึก: footer และข้อความเข้ม */
  --sai: #a9d2f6;        /* สายน้ำที่ไหลตามการเลื่อนหน้า */
  --fong: #d9ebfb;       /* สายน้ำพื้นหลัง */
  --mok: #f2f8fe;        /* พื้นอ่อนของช่องรูปและแผง */
  --kwao: #ff8a3d;       /* ทองกวาว: ปุ่มหลักเท่านั้น */
  --ink: #141d45;
  --hin: #56608a;
  --line: #dde5f2;
  --white: #fff;

  --display: "Trirong", "Noto Serif Thai", serif;
  --body: "IBM Plex Sans Thai Looped", "Noto Sans Thai Looped", system-ui, sans-serif;

  --wrap: 1200px;
  --gut: clamp(16px, 4vw, 40px);
  --radius: 14px;
  --gap-section: clamp(64px, 9vw, 120px);
  --shadow: 0 1px 2px rgb(10 22 72 / .05), 0 14px 34px -18px rgb(10 22 72 / .28);
}

/* ===== Base ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font: 400 1.0625rem/1.75 var(--body);
  overflow-wrap: break-word;
}
h1, h2, h3, h4, p, ul, ol, figure, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; width: 100%; height: auto; object-fit: cover; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--kwao); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3, .display { font-family: var(--display); font-weight: 700; color: var(--ngoen); line-height: 1.32; }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.3rem; line-height: 1.45; }

.wrap { width: min(100% - var(--gut) * 2, var(--wrap)); margin-inline: auto; }
.section { padding-block: var(--gap-section) 0; }
.eyebrow { color: var(--hin); font-size: .95rem; font-weight: 500; margin-bottom: 4px; }
.muted { color: var(--hin); }
.skip {
  position: fixed; left: 16px; top: -80px; z-index: 100;
  background: var(--luek); color: #fff; padding: 10px 18px; border-radius: 8px;
}
.skip:focus { top: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 24px;
  border: 1.5px solid transparent; border-radius: 12px;
  font-weight: 600; line-height: 1.3; text-align: center;
  transition: background-color .18s, color .18s, border-color .18s, transform .18s;
}
.btn:hover { transform: translateY(-1px); }
.btn-main { background: var(--kwao); color: var(--luek); }
.btn-main:hover { background: #ff9a55; }
.btn-line { background: var(--white); border-color: var(--ngoen); color: var(--ngoen); }
.btn-line:hover { background: var(--ngoen); color: var(--white); }
.more { display: inline-flex; align-items: center; gap: 8px; color: var(--ngoen); font-weight: 600; }
.more svg { transition: transform .18s; }
.more:hover svg { transform: translateX(4px); }
.icon { width: 1.15em; height: 1.15em; flex: none; }

.sample {
  display: inline-block; vertical-align: .12em; margin-inline-start: 6px; padding: 0 8px;
  background: #fff1e6; color: #8a3d05; border-radius: 99px;
  font: 500 .72rem/1.65 var(--body); white-space: nowrap;
}

/* ===== Image slots ================================================== */
.ph {
  position: relative; display: grid; place-items: center; overflow: hidden;
  aspect-ratio: var(--r, 3 / 2); padding: 14px; text-align: center;
  background: var(--mok);
}
.ph::before {
  content: ""; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='44'%3E%3Cpath d='M0 22c27-20 83-20 110 0s83 20 110 0' fill='none' stroke='%23a9d2f6' stroke-width='1.5'/%3E%3C/svg%3E");
  background-size: 220px 44px;
  opacity: .5;
}
.ph-1 { background: #e4f0fb; }
.ph-1::before { background-size: 300px 60px; }
.ph-2 { background: #e8f2fc; }
.ph-2::before { background-size: 160px 32px; }
.ph span {
  position: relative; max-width: 92%; padding: 2px 12px;
  background: rgb(255 255 255 / .86); color: var(--ngoen);
  border-radius: 8px; font-size: .84rem; line-height: 1.55;
}

/* ===== Header ======================================================= */
.topbar { background: var(--luek); color: #dfe8fb; font-size: .875rem; }
.topbar .wrap { display: flex; justify-content: space-between; gap: 16px; padding-block: 5px; }
.topbar a { display: inline-flex; align-items: center; gap: 6px; }
.topbar a:hover { color: #fff; text-decoration: underline; }
.topbar-links { display: flex; gap: 20px; }

.header { position: sticky; top: 0; z-index: 50; background: rgb(255 255 255 / .96); border-bottom: 1px solid var(--line); }
.header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 76px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { flex: none; display: block; width: 52px; height: 52px; border-radius: 50%; }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand-name { display: block; font: 700 1.2rem/1.3 var(--display); color: var(--ngoen); white-space: nowrap; }
.brand-sub { display: block; font-size: .78rem; line-height: 1.4; color: var(--hin); white-space: nowrap; }

.nav { display: flex; align-items: center; gap: 2px; }
.nav > ul { display: flex; align-items: center; gap: 2px; }
.nav-link, .nav summary {
  display: flex; align-items: center; gap: 5px; padding: 10px 12px; border-radius: 10px;
  font-weight: 500; font-size: 1rem; cursor: pointer; white-space: nowrap; list-style: none;
}
.nav summary::-webkit-details-marker { display: none; }
.nav-link:hover, .nav summary:hover, .nav details[open] summary { background: var(--mok); color: var(--ngoen); }
.nav-link[aria-current="page"] { color: var(--ngoen); box-shadow: inset 0 -2px 0 var(--ngoen); border-radius: 10px 10px 0 0; }
.nav details { position: relative; }
.nav summary svg { width: .8em; height: .8em; transition: transform .18s; }
.nav details[open] summary svg { transform: rotate(180deg); }
.nav .menu {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 260px; padding: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.nav .menu a { display: block; padding: 8px 12px; border-radius: 8px; line-height: 1.5; }
.nav .menu a:hover { background: var(--mok); color: var(--ngoen); }
.nav-cta { margin-inline-start: 10px; white-space: nowrap; }
.nav-toggle {
  display: none; width: 48px; height: 48px; border: 1.5px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ngoen); place-items: center;
}

/* ===== River ======================================================== */
.page { position: relative; isolation: isolate; overflow: clip; }
#river { position: absolute; inset: 0 0 auto 0; width: 100%; z-index: -1; pointer-events: none; }
.river-line { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-dasharray: 70 340; opacity: .6; animation: flow 46s linear infinite; }
.river-line.alt { stroke-dasharray: 34 280; animation-duration: 62s; opacity: .55; }
@keyframes flow { to { stroke-dashoffset: -2200; } }
.delta { height: clamp(150px, 20vw, 260px); }

/* ===== Home: hero =================================================== */
.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(24px, 5vw, 72px); align-items: end; padding-block: clamp(40px, 6vw, 84px) 0; }
.hero-school { font: 600 1.05rem/1.5 var(--body); color: var(--ink); margin-bottom: 14px; }
.hero-school span { color: var(--hin); font-weight: 400; }
.hero-school span::before { content: "·"; margin-inline: 8px; }
.hero-motto { font: 700 clamp(2.7rem, 6.2vw, 5.1rem)/1.28 var(--display); color: var(--ngoen); letter-spacing: -.005em; }
.hero-motto span { display: block; }
.hero-lead { max-width: 34em; margin-block: 22px 28px; font-size: clamp(1.06rem, 1.5vw, 1.2rem); }
.hero-aff { display: block; color: var(--hin); font-size: .95rem; margin-top: 4px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-arch { position: relative; border-radius: 999px 999px var(--radius) var(--radius); overflow: hidden; box-shadow: var(--shadow); background: #fff; padding: 8px; }
.hero-arch .ph, .hero-arch img { border-radius: 999px 999px 8px 8px; }

/* ===== Home: tasks ================================================== */
.tasks { margin-top: clamp(32px, 5vw, 56px); display: grid; grid-template-columns: repeat(5, 1fr); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.tasks a { display: block; padding: 18px 20px; border-inline-start: 1px solid var(--line); transition: background-color .18s; }
.tasks li:first-child a { border-inline-start: 0; border-radius: var(--radius) 0 0 var(--radius); }
.tasks li:last-child a { border-radius: 0 var(--radius) var(--radius) 0; }
.tasks a:hover { background: var(--mok); }
.tasks b { display: flex; align-items: center; justify-content: space-between; gap: 6px; font: 600 1.06rem/1.5 var(--body); color: var(--ngoen); }
.tasks small { display: block; font-size: .875rem; line-height: 1.5; color: var(--hin); }

/* ===== Home: board ================================================== */
.board { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); }
.sec-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; margin-bottom: 22px; }
.rail { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: var(--radius); }
.rail::-webkit-scrollbar { display: none; }
.rail > a { flex: 0 0 100%; scroll-snap-align: start; position: relative; border-radius: var(--radius); overflow: hidden; background: #fff; box-shadow: var(--shadow); }
.rail .sample { position: absolute; top: 12px; right: 12px; }
.rail-ctrl { display: flex; align-items: center; gap: 8px; }
.rail-ctrl button { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; color: var(--ngoen); }
.rail-ctrl button:hover { border-color: var(--ngoen); }
.rail-ctrl output { min-width: 3em; text-align: center; font-size: .9rem; color: var(--hin); }

.datechip { flex: none; display: grid; width: 60px; text-align: center; border-radius: 10px; overflow: hidden; background: #fff; border: 1px solid var(--line); line-height: 1.2; }
.datechip b { font: 700 1.45rem/1.5 var(--display); color: var(--ngoen); }
.datechip small { background: var(--ngoen); color: #fff; font-size: .75rem; padding: 2px 0; }
.events li { display: flex; gap: 14px; padding-block: 12px; border-top: 1px solid var(--line); }
.events li:first-child { border-top: 0; padding-top: 0; }
.events p { font-weight: 500; line-height: 1.5; }
.events small { color: var(--hin); font-size: .875rem; }
.panel { background: rgb(255 255 255 / .92); border-radius: var(--radius); }

/* ===== Home: news =================================================== */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs button, .tabs a { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 16px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; font-weight: 500; font-size: .95rem; transition: background-color .18s, color .18s; }
.tabs button:hover, .tabs a:hover { border-color: var(--ngoen); }
.tabs button[aria-pressed="true"], .tabs a[aria-current] { background: var(--ngoen); border-color: var(--ngoen); color: #fff; }
.news-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 36px); }
.feature { display: block; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.feature-body { padding: 20px 24px 24px; }
.feature h3 { font-size: clamp(1.3rem, 2.2vw, 1.65rem); margin-top: 4px; }
.feature:hover h3, .row:hover h3, .card:hover h3 { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
.meta { font-size: .875rem; color: var(--hin); }
.meta i { font-style: normal; color: var(--ngoen); font-weight: 500; }
.meta i::after { content: "·"; margin-inline: 6px; color: var(--hin); font-weight: 400; }
.rows { display: grid; align-content: start; background: rgb(255 255 255 / .92); border-radius: var(--radius); }
.row { display: flex; gap: 14px; padding-block: 15px; border-top: 1px solid var(--line); }
.rows li:first-child .row { border-top: 0; padding-top: 0; }
.row h3 { font: 500 1.03rem/1.55 var(--body); color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row-foot { padding-top: 14px; border-top: 1px solid var(--line); }
.empty { padding: 32px 0; color: var(--hin); }

/* ===== Home: levels ================================================= */
.levels-head { max-width: 40em; }
.stops { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 28px clamp(56px, 13vw, 180px); margin-top: 40px; }
.stop { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.stop:nth-child(1) { grid-area: 1 / 1; }
.stop:nth-child(2) { grid-area: 1 / 2 / 3 / 2; align-self: center; }
.stop:nth-child(3) { grid-area: 2 / 1; }
.stop-body { padding: 18px 24px 24px; }
.stop-range { display: block; font-size: .95rem; color: var(--hin); }
.stop p { margin-block: 8px 12px; }

/* ===== Home: identity band ========================================== */
.band { margin: var(--gap-section) clamp(8px, 2vw, 24px) 0; padding-block: clamp(48px, 7vw, 92px); background: var(--ngoen); color: #eaf1ff; border-radius: 28px; }
.band h2, .band h3 { color: #fff; }
.band-top { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 72px); align-items: end; }
.band-title { font-size: clamp(2.5rem, 6.4vw, 5rem); line-height: 1.28; }
.traits { display: flex; flex-wrap: wrap; gap: 4px 22px; margin-top: 10px; font: 600 clamp(1.1rem, 1.9vw, 1.4rem)/1.6 var(--display); color: #ffc79f; }
.band .more { color: #fff; margin-top: 12px; }
.timeline { display: grid; grid-template-columns: repeat(5, 1fr); gap: 24px; margin-top: clamp(36px, 5vw, 60px); padding-top: 22px; border-top: 1px solid rgb(255 255 255 / .28); }
.timeline b { display: block; font: 700 clamp(1.5rem, 2.4vw, 2rem)/1.4 var(--display); color: #fff; }
.timeline p { font-size: .95rem; line-height: 1.65; }

/* ===== Home: gallery ================================================ */
.mosaic { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: minmax(150px, 15vw); gap: 12px; }
.mosaic a { position: relative; display: block; overflow: hidden; border-radius: var(--radius); background: var(--mok); }
.mosaic a:first-child { grid-column: span 2; grid-row: span 2; }
.mosaic a:nth-child(n+4) { grid-column: span 2; }
.mosaic .ph, .mosaic img { position: absolute; inset: 0; aspect-ratio: auto; height: 100%; }
.mosaic .ph span { display: none; }
.mosaic figcaption, .mosaic-cap { position: absolute; inset: auto 0 0 0; padding: 26px 14px 10px; background: linear-gradient(transparent, rgb(10 22 72 / .78)); color: #fff; font-weight: 500; font-size: .95rem; line-height: 1.45; }

/* ===== Home: closing ================================================ */
.closing { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; }
.closing > div { padding: clamp(24px, 4vw, 44px); border-radius: 20px; }
.closing-apply { background: var(--kwao); color: var(--luek); }
.closing-apply h2 { color: var(--luek); }
.closing-apply .btn { background: var(--luek); color: #fff; margin-top: 20px; }
.closing-apply .btn:hover { background: var(--ngoen); }
.closing-visit { background: #fff; box-shadow: var(--shadow); }
.contact-list { display: grid; gap: 12px; margin-top: 14px; }
.contact-list li { display: flex; gap: 10px; }
.contact-list svg { margin-top: .32em; color: var(--ngoen); }
.contact-list a:hover { text-decoration: underline; }

/* ===== Footer ======================================================= */
.footer { position: relative; background: var(--luek); color: #cdd9f5; font-size: .96rem; padding-block: 36px 24px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 32px; }
.footer h3 { color: #fff; font: 600 1rem/1.5 var(--body); margin-bottom: 8px; }
.footer li { padding-block: 3px; }
.footer a:hover { color: #fff; text-decoration: underline; }
.footer .brand-name { color: #fff; white-space: normal; }
.footer .brand-sub { color: #cdd9f5; white-space: normal; }
.footer .brand-mark { background: #fff; padding: 2px; }
.footer-note { margin-top: 14px; }
.footer-end { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 30px; padding-top: 16px; border-top: 1px solid rgb(255 255 255 / .18); font-size: .875rem; }

/* ===== Inner pages ================================================== */
.page-head { padding-block: clamp(36px, 5vw, 68px) clamp(8px, 2vw, 20px); }
.crumbs { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: .9rem; color: var(--hin); margin-bottom: 8px; }
.crumbs a:hover { color: var(--ngoen); text-decoration: underline; }
.crumbs li + li::before { content: "/"; margin-inline-end: 8px; color: #a5aeca; }
.page-title { font-size: clamp(2.1rem, 5vw, 3.6rem); }
.page-lead { max-width: 38em; margin-top: 8px; font-size: 1.1rem; }
.page-body { padding-block: clamp(24px, 4vw, 44px) 0; }
.stack > * + * { margin-top: clamp(48px, 7vw, 76px); }

.with-side { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.side { position: sticky; top: 100px; background: rgb(255 255 255 / .94); border-radius: var(--radius); }
.side a { display: block; padding: 8px 14px; border-inline-start: 2px solid var(--line); line-height: 1.5; color: var(--hin); }
.side a:hover, .side a.on { color: var(--ngoen); border-color: var(--ngoen); font-weight: 500; }
.prose { max-width: 42em; }
.prose p + p { margin-top: 14px; }
.prose h2 { margin-bottom: 12px; }
.note { padding: 12px 16px; border-radius: 10px; background: var(--mok); color: var(--hin); font-size: .94rem; line-height: 1.65; }
.prose .note, .page-body > .note { margin-top: 18px; }
.page-body.stack > .note:first-child { margin-top: 0; }
.with-aside { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(28px, 5vw, 64px); align-items: start; }

.vtimeline { margin-top: 20px; }
.vtimeline li { display: grid; grid-template-columns: 96px 1fr; gap: 16px; padding-block: 14px; border-top: 1px solid var(--line); }
.vtimeline b { font: 700 1.4rem/1.45 var(--display); color: var(--ngoen); }
.num-list { counter-reset: n; display: grid; gap: 10px; margin-top: 12px; }
.mission li { display: flex; gap: 12px; padding: 12px 16px; background: var(--mok); border-radius: 10px; }
.quote-big { font: 700 clamp(1.7rem, 3.4vw, 2.5rem)/1.35 var(--display); color: var(--ngoen); }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 16px; }
.three > div { padding: 18px; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.three small { display: block; color: var(--hin); }
.three b { font: 700 1.2rem/1.5 var(--display); color: var(--ngoen); }
.emblem { display: grid; grid-template-columns: 200px 1fr; gap: 24px; align-items: center; margin-top: 12px; }
.emblem .ph { border-radius: 50%; }
.songs { display: grid; gap: 12px; margin-top: 14px; }
.song { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.song summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; cursor: pointer; font-weight: 600; color: var(--ngoen); list-style: none; }
.song summary::-webkit-details-marker { display: none; }
.song summary svg { transition: transform .18s; }
.song[open] summary svg { transform: rotate(180deg); }
.song-body { padding: 0 18px 18px; }
.lyrics { margin-top: 12px; }
.lyrics p { white-space: pre-line; line-height: 1.85; }
.lyrics p + p { margin-top: 12px; }
.slot-box { padding: 14px 16px; border: 1.5px dashed #b9c8e4; border-radius: 10px; color: var(--hin); font-size: .94rem; background: #fff; }
.slot-box + .slot-box { margin-top: 8px; }

/* Levels page */
.level-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 56px); align-items: center; }
.level-row:nth-child(even) > figure { order: 2; }
.level-row figure { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.level-text { background: rgb(255 255 255 / .92); border-radius: var(--radius); }
.level-text h2 { margin-bottom: 2px; }
.ticks { display: grid; gap: 6px; margin-block: 14px 18px; }
.ticks li { display: flex; gap: 10px; }
.ticks svg { margin-top: .36em; color: var(--ngoen); }

/* News list */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.field { display: grid; gap: 4px; }
.field label { font-weight: 500; font-size: .94rem; }
.input { width: 100%; min-height: 48px; padding: 8px 14px; background: #fff; border: 1.5px solid #c7d3e8; border-radius: 10px; }
.input:focus { border-color: var(--ngoen); outline: 3px solid var(--fong); outline-offset: 0; }
.toolbar .input { width: min(100%, 280px); }
.search { display: contents; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { display: flex; flex-direction: column; height: 100%; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.card-body { padding: 14px 18px 18px; }
.card h3 { font: 600 1.06rem/1.55 var(--body); color: var(--ink); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pager { display: flex; justify-content: center; gap: 6px; margin-top: 32px; }
.pager a { display: grid; place-items: center; min-width: 44px; height: 44px; padding-inline: 10px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; }
.pager a:hover { border-color: var(--ngoen); }
.pager a[aria-current] { background: var(--ngoen); border-color: var(--ngoen); color: #fff; }

/* Article */
.article { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(28px, 5vw, 64px); align-items: start; }
.article-main { background: rgb(255 255 255 / .94); border-radius: var(--radius); }
.article-fig { margin-block: 20px; border-radius: var(--radius); overflow: hidden; }
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.thumbs button { padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: none; }
.thumbs button:hover { opacity: .82; }
.thumbs .ph span { font-size: .75rem; padding-inline: 8px; }
.lightbox { width: min(92vw, 1000px); padding: 0; border: 0; border-radius: var(--radius); background: #fff; }
.lightbox::backdrop { background: rgb(10 22 72 / .86); }
.lb-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 12px; }
.lb-bar button { min-width: 44px; min-height: 44px; border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding-inline: 10px; }

/* Staff */
.leaders { display: grid; grid-template-columns: repeat(2, minmax(0, 300px)); gap: 20px; margin-top: 14px; }
.person { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.person-body { padding: 12px 16px 16px; line-height: 1.5; }
.person b { display: block; color: var(--ink); font-weight: 600; }
.person small { font-size: .9rem; color: var(--hin); }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; margin-top: 14px; }

/* Tables */
.table-wrap { overflow-x: auto; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: start; border-bottom: 1px solid var(--line); line-height: 1.55; }
thead th { background: var(--mok); color: var(--ngoen); font-weight: 600; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.doc-name { color: var(--ink); font-weight: 500; }
.doc-name:hover { color: var(--ngoen); text-decoration: underline; }

/* Admissions */
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 16px; }
.steps li { counter-increment: step; padding: 18px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.steps li::before { content: counter(step); display: block; font: 700 2rem/1.35 var(--display); color: var(--ngoen); }
.steps h3 { font: 600 1.05rem/1.5 var(--body); color: var(--ink); }
.steps p { font-size: .95rem; line-height: 1.6; color: var(--hin); margin-top: 4px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.card-flat { padding: clamp(20px, 3vw, 30px); background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }

/* Calendar */
.cal-month + .cal-month { margin-top: 28px; }
.cal-month h2 { font-size: 1.4rem; margin-bottom: 8px; }
.cal-list li { display: flex; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.cal-list p { font-weight: 500; line-height: 1.5; }
.cal-list small { color: var(--hin); font-size: .875rem; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.form { display: grid; gap: 14px; margin-top: 12px; }
textarea.input { min-height: 130px; resize: vertical; }
.map-slot { border-radius: var(--radius); overflow: hidden; margin-top: 16px; }
.form-status { font-size: .95rem; color: var(--ngoen); }

/* ===== Real photos in slots ========================================= */
.rail img { object-fit: contain; background: var(--mok); }
.lightbox img { object-fit: contain; background: var(--luek); max-height: 80vh; }
.emblem img { border-radius: 50%; }
.just-added { outline: 3px solid var(--kwao); outline-offset: 6px; border-radius: var(--radius); animation: added 2.6s ease-out forwards; }
@keyframes added { 70% { outline-color: var(--kwao); } 100% { outline-color: transparent; } }

/* ===== Responsive =================================================== */
@media (max-width: 1100px) {
  .brand-sub { display: none; }
  .nav-link, .nav summary { padding-inline: 9px; font-size: .96rem; }
}
@media (max-width: 1080px) {
  .nav-toggle { display: grid; }
  .nav {
    position: fixed; inset: 0 0 0 auto; z-index: 70; width: min(100%, 400px); padding: 76px 20px 24px;
    display: none; flex-direction: column; align-items: stretch; background: #fff; overflow-y: auto; box-shadow: -18px 0 50px rgb(10 22 72 / .25);
  }
  .nav.open { display: flex; }
  .nav > ul { flex-direction: column; align-items: stretch; }
  .nav-link, .nav summary { justify-content: space-between; padding: 12px; font-size: 1.05rem; min-height: 48px; }
  .nav .menu { position: static; border: 0; box-shadow: none; padding: 0 0 6px 10px; }
  .nav-cta { margin: 14px 0 0; }
  .nav-close { position: absolute; top: 14px; right: 16px; }
  .tasks { grid-template-columns: repeat(2, 1fr); }
  .tasks a { border-inline-start: 0; border-top: 1px solid var(--line); height: 100%; }
  .tasks li:nth-child(even) a { border-inline-start: 1px solid var(--line); }
  .tasks li:first-child a { border-top: 0; border-radius: var(--radius) 0 0 0; }
  .tasks li:nth-child(2) a { border-top: 0; border-radius: 0 var(--radius) 0 0; }
  .tasks li:last-child { grid-column: 1 / -1; }
  .tasks li:last-child a { border-inline-start: 0; border-radius: 0 0 var(--radius) var(--radius); }
  .board, .news-grid, .band-top, .closing, .article, .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .timeline { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .with-side, .with-aside { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--gut) * -1); padding-inline: var(--gut); border-radius: 0; background: none; }
  .side a { flex: none; padding: 7px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; }
}
@media (max-width: 720px) {
  body { font-size: 1rem; }
  .topbar-hide { display: none; }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-arch { width: min(78%, 330px); margin-inline: auto; }
  .stops { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .stop:nth-child(n) { grid-area: auto; align-self: auto; }
  .mosaic { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 38vw; }
  .mosaic a:nth-child(n+5) { grid-column: span 1; }
  .level-row, .two, .three, .emblem { grid-template-columns: minmax(0, 1fr); }
  .level-row:nth-child(even) > figure { order: 0; }
  .emblem .ph { width: 170px; }
  .vtimeline li { grid-template-columns: 72px 1fr; }
  .docs thead { display: none; }
  .docs tr { display: block; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .docs tr:last-child { border-bottom: 0; }
  .docs td { display: block; padding: 2px 0; border: 0; }
  .docs td:nth-child(n+2) { font-size: .9rem; color: var(--hin); }
  .tasks a { padding: 14px 16px; }
  .tasks b { font-size: 1rem; }
  .brand-name { font-size: 1.08rem; }
  .brand-mark { width: 46px; height: 46px; }
  .header .wrap { min-height: 66px; }
  .thumbs { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 520px) {
  .cards, .steps, .timeline, .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .actions .btn { flex: 1 1 100%; }
  .toolbar .input { width: 100%; }
  .leaders { grid-template-columns: minmax(0, 1fr); }
  .people { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  #river, .topbar, .header, .footer { display: none !important; }
}
