/* comp.css — Editorial Minimal · RYT Song 2569
 * พื้นขาว · หมึกเกือบดำ · ม่วงเป็นสีเน้นสีเดียว · ตัวอักษรไทยไม่มีหัวตัวใหญ่แบบนิตยสาร · เส้นบาง
 * ไม่มี inline style ใน HTML (เตรียม CSP) — ค่าที่เปลี่ยนตามเวลาตั้งผ่าน CSSOM ใน app.js
 */
:root {
  --paper: #ffffff;
  --paper-2: #f6f5f9;
  --ink: #15131a;
  --ink-2: #4a4653;
  --ink-3: #85808f;
  --accent: #6231c6;
  --accent-soft: #a78bfa;
  --rule: rgba(21, 19, 26, 0.12);
  --rule-strong: rgba(21, 19, 26, 0.5);
  --serif: 'Manrope', 'Noto Sans Thai', system-ui, sans-serif;
  --latin: 'Manrope', 'Noto Sans Thai', system-ui, sans-serif;
  --serif-th: 'Noto Sans Thai', 'Manrope', system-ui, sans-serif;
  --sans: 'Noto Sans Thai', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --gutter: clamp(20px, 4.4vw, 72px);
  --max: 1440px;
  --ease: cubic-bezier(0.19, 1, 0.22, 1);
  /* สีที่เปลี่ยนตามธีม — ห้ามเขียนสีตายตัวในกฎอื่น ให้อ้างตัวแปรเหล่านี้ */
  --tint: #f5f1fe;                            /* พื้นม่วงอ่อน: การ์ดที่เลือก · hover */
  --glass: rgba(255, 255, 255, 0.82);         /* แถบหัวโปร่งเบลอ */
  --haze-1: rgba(255, 255, 255, 0.9);         /* หมอกพื้นหลัง */
  --haze-2: rgba(237, 233, 254, 0.55);
  --mark: rgba(167, 139, 250, 0.32);          /* ขีดเน้นใต้คำ */
  --on-accent: #ffffff;
  --danger: #c2410c; --danger-bg: #fff7ed; --danger-ink: #7c2d12; --danger-title: #9a3412;
  --ok: #15803d; --ok-bg: #f6fbf7; --ok-rule: #bbe5c7; --ok-flash: #dcfce7;
  --btn-arrow: #a78bfa;   /* ลูกศรในปุ่มหลัก (พื้นปุ่ม = หมึก) */
  --warn: #b45309;
  color-scheme: light;
}

/* ---------- ธีมมืด ----------
 * ตั้งด้วย data-theme บน <html> (สคริปต์ใน <head> อ่าน localStorage "theme" ก่อนวาดหน้า — ใช้คีย์เดียวกับ
 * หลังบ้าน Filament เลือกธีมที่ไหนก็ตามกันทั้งเว็บ) · ม่วงสว่างขึ้นให้อ่านออกบนพื้นเข้ม (contrast ≥ 4.5:1) */
:root[data-theme="dark"] {
  --paper: #0e0d12;
  --paper-2: #17151e;
  --ink: #f2f0f7;
  --ink-2: #c7c3d2;
  --ink-3: #8f8a9c;
  --accent: #a78bfa;
  --accent-soft: #c4b5fd;
  --rule: rgba(255, 255, 255, 0.1);
  --rule-strong: rgba(255, 255, 255, 0.42);
  --tint: rgba(167, 139, 250, 0.12);
  --glass: rgba(14, 13, 18, 0.78);
  --haze-1: rgba(98, 49, 198, 0.16);
  --haze-2: rgba(98, 49, 198, 0.12);
  --mark: rgba(167, 139, 250, 0.3);
  --on-accent: #0e0d12;
  --danger: #fb923c; --danger-bg: rgba(251, 146, 60, 0.1); --danger-ink: #fed7aa; --danger-title: #fdba74;
  --ok: #4ade80; --ok-bg: rgba(74, 222, 128, 0.07); --ok-rule: rgba(74, 222, 128, 0.3); --ok-flash: rgba(74, 222, 128, 0.26);
  --btn-arrow: #6231c6;   /* ธีมมืดพื้นปุ่มเกือบขาว → ม่วงเข้มถึงอ่านออก */
  --logo-filter: invert(1) brightness(1.08);   /* ตราสหกรณ์เป็นลายเส้นหมึก → กลับสีให้เห็นบนพื้นมืด */
  --warn: #fbbf24;
  color-scheme: dark;
}

/* เปลี่ยนธีมแบบนุ่ม — ใส่คลาสนี้ชั่วคราวตอนกดสลับเท่านั้น (ไม่ให้สีวิ่งตอนโหลดหน้า) */
.theme-anim, .theme-anim *, .theme-anim *::before, .theme-anim *::after {
  transition: background-color 0.45s var(--ease), color 0.45s var(--ease), border-color 0.45s var(--ease), box-shadow 0.45s var(--ease) !important;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* เกรนกระดาษจาง ๆ ให้พื้นไม่แบนเป็นสีดิจิทัล */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(1200px 700px at 72% 18%, var(--haze-1), transparent 70%),
    radial-gradient(900px 600px at 10% 90%, var(--haze-2), transparent 70%);
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, p, ol, ul, dl, dd, figure, blockquote { margin: 0; padding: 0; }
ol, ul { list-style: none; }
mark { background: none; color: var(--ink); box-shadow: inset 0 -0.42em 0 var(--mark); padding: 0 0.1em; }
.num { font-family: var(--latin); font-feature-settings: 'lnum' 1, 'pnum' 1; font-weight: 500; letter-spacing: -0.01em; }
.nw { white-space: nowrap; }
.mono { font-family: var(--sans); font-weight: 500; letter-spacing: 0.02em; white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- ตัวโน้ตลอยขึ้นจาง ๆ (หน้าแรก) — ชั้นเดียวกับหมอกพื้นหลัง อยู่หลังโมเดล 3D และเนื้อหา ---------- */
.notes-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.notes-bg__n {
  position: absolute; left: var(--x); bottom: -64px;
  width: var(--s); height: calc(var(--s) * 1.35);
  color: var(--accent); opacity: 0;
  animation: note-rise var(--d) linear var(--dl) infinite;
  will-change: transform, opacity;
}
.notes-bg__n svg { display: block; width: 100%; height: 100%; fill: currentColor; animation: note-sway 6s ease-in-out var(--dl) infinite alternate; }
@keyframes note-rise {
  0% { transform: translateY(0); opacity: 0; }
  12% { opacity: var(--o); }
  80% { opacity: var(--o); }
  100% { transform: translateY(calc(-100vh - 140px)); opacity: 0; }
}
@keyframes note-sway {
  from { transform: translateX(calc(var(--sw) * -1)) rotate(-9deg); }
  to { transform: translateX(var(--sw)) rotate(9deg); }
}
@media (max-width: 700px) { .notes-bg__n:nth-of-type(even) { display: none; } }
@media (prefers-reduced-motion: reduce) { .notes-bg { display: none; } }

/* ---------- เวที 3D: canvas เดียวตรึงหลังเนื้อหา ---------- */
.stage-canvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 1;
  pointer-events: none;
}
main, .footer, .masthead { position: relative; z-index: 2; }
.stage-slot {
  position: relative;
  cursor: grab;
  touch-action: pan-y;            /* มือถือ: ลากแนวตั้งยังเลื่อนหน้าได้ แนวนอนหมุนโมเดล */
  user-select: none;
  -webkit-user-select: none;
}
.stage-slot.is-grabbing { cursor: grabbing; }
.slot-caption {
  position: absolute; left: 0; bottom: 0;
  font-size: 12px; letter-spacing: 0.08em;
  color: var(--ink-3);
  pointer-events: none;
}
.slot-status {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  display: grid; justify-items: center; gap: 2px;
  font-size: 13px; color: var(--ink-3); letter-spacing: 0.04em;
  text-align: center;
  transition: opacity 0.6s var(--ease);
  pointer-events: none;
}
.slot-status__nums { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.slot-status.is-done { opacity: 0; }

/* แถบโหลดเส้นผม — ทองบนสุดของจอ */
.loadbar {
  position: fixed; left: 0; right: 0; top: 0;
  height: 2px; z-index: 30;
  transition: opacity 0.8s var(--ease) 0.3s;
}
.loadbar__fill {
  display: block; height: 100%;
  background: var(--accent);
  transform-origin: 0 50%;
  transform: scaleX(0);
  transition: transform 0.35s var(--ease);
}
.loadbar.is-done { opacity: 0; }

/* ---------- หัวหน้า ---------- */
.masthead {
  position: sticky; top: 0;
  z-index: 20;
  display: flex; align-items: center; gap: 32px;
  padding: 16px var(--gutter);
  background: var(--glass);
  -webkit-backdrop-filter: saturate(1.2) blur(14px);
  backdrop-filter: saturate(1.2) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s;
}
.masthead.is-scrolled { border-bottom-color: var(--rule); }
.masthead__brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.masthead__brand img { width: 44px; height: 44px; }
.masthead__brand img, .footer img { filter: var(--logo-filter, none); }
.masthead__org { font-family: var(--serif-th); font-size: 15px; line-height: 1.35; font-weight: 500; }
.masthead__org small { display: block; font-family: var(--latin); font-size: 12.5px; font-style: normal; color: var(--ink-3); letter-spacing: 0.02em; }
.masthead__nav { margin-left: auto; display: flex; gap: 30px; font-size: 14.5px; }
.masthead__nav a { text-decoration: none; color: var(--ink-2); position: relative; padding: 4px 0; }
.masthead__nav a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--ink); transform: scaleX(0); transform-origin: 0 50%; transition: transform 0.5s var(--ease);
}
.masthead__nav a:hover { color: var(--ink); }
.masthead__nav a:hover::after { transform: scaleX(1); }

/* ---------- ปุ่ม ---------- */
.btn {
  /* gap: 0 — ตัวกันฉีกคำห่อคำไทยเป็น <span class="nw"> หลายชิ้น ถ้ามี gap ของ flex จะกลายเป็นช่องโหว่กลางข้อความ
     ("ส่งผลงาน   อีกประเภท") · ระยะไอคอน/ลูกศรใส่เป็น margin ที่ตัวไอคอนแทน (span[aria-hidden]) */
  display: inline-flex; align-items: center; gap: 0;
  font-family: var(--sans); font-size: 15px; font-weight: 500;
  text-decoration: none; white-space: nowrap;
  padding: 12px 22px;
  border-radius: 999px;
  transition: background 0.4s var(--ease), color 0.4s var(--ease), border-color 0.4s var(--ease);
}
.btn--ink { border: 1px solid var(--ink); color: var(--ink); }
.btn--ink:hover { background: var(--ink); color: var(--paper); }
.btn--accent { background: var(--ink); color: var(--paper); border: 1px solid var(--ink); }
.btn > span[aria-hidden="true"] { margin-inline-start: 12px; }
/* ย้อมสีเฉพาะลูกศร/ไอคอน (aria-hidden) — ไม่ใช่ทุก span: ข้อความปุ่มก็เป็น span (.nw / __label) */
.btn--accent > span[aria-hidden="true"] { color: var(--btn-arrow); transition: transform 0.5s var(--ease); }
.btn--accent:hover { background: var(--accent); border-color: var(--accent); }
.btn--accent:hover > span[aria-hidden="true"] { color: var(--paper); transform: translateX(4px); }
.btn--lg { font-size: 17px; padding: 18px 34px; }

/* ---------- โครงร่วม ---------- */
.hero, .section { max-width: var(--max); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.section { padding-top: clamp(96px, 13vw, 190px); }
.section__head {
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; align-items: baseline;
  border-top: 1px solid var(--rule-strong);
  padding-top: 18px;
  margin-bottom: clamp(48px, 7vw, 104px);
}
.section__no { grid-column: 1 / 2; font-family: var(--latin); font-size: 15px; letter-spacing: 0.12em; color: var(--accent); font-feature-settings: 'lnum' 1; }
.section__label { grid-column: 2 / 7; font-family: var(--serif-th); font-weight: 500; font-size: 17px; letter-spacing: 0.02em; }
.section__intro { grid-column: 8 / 13; color: var(--ink-2); font-size: 15px; }

/* ---------- HERO ---------- */
.hero {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: auto auto 1fr auto;
  column-gap: 24px;
  min-height: calc(100svh - 77px);
  padding-top: clamp(28px, 5vh, 64px);
  padding-bottom: 28px;
}
.kicker { grid-column: 1 / 8; grid-row: 1; font-size: 14px; letter-spacing: 0.06em; color: var(--ink-2); }
.kicker__dot { color: var(--accent); padding: 0 6px; }
.hero__title {
  grid-column: 1 / 8; grid-row: 2;
  font-family: var(--serif-th);
  font-weight: 300;
  font-size: clamp(64px, 10.2vw, 172px);
  line-height: 1.22;
  letter-spacing: -0.015em;
  margin-top: clamp(12px, 3vh, 40px);
}
.hero__line { display: block; }
/* ชื่องานเป็นภาษาอังกฤษ — ใช้ Manrope ทั้งบรรทัด บางลงและชิดขึ้นให้ดูเป็นโลโก้ */
.hero__title--latin { font-family: var(--latin); font-weight: 300; letter-spacing: -0.035em; line-height: 1.02; }
.hero__line--indent { padding-left: 0.9em; color: var(--ink); }
.hero__line--indent::after { content: '.'; color: var(--accent); }
/* ชื่อสหกรณ์ภาษาไทยใต้ชื่องาน — เล็กลงเป็นบรรทัดรอง จัดแนวตรงกับ Awards (0.9em ของหัวเรื่อง ÷ 0.34) */
.hero__line--th {
  font-family: var(--serif-th); font-weight: 300;
  font-size: 0.34em; line-height: 1.5; letter-spacing: 0.01em;
  padding-left: calc(0.9em / 0.34); margin-top: 0.3em;
  color: var(--accent);
}
.hero__slot { grid-column: 8 / 13; grid-row: 1 / 4; min-height: 440px; }
.hero__lede {
  grid-column: 1 / 6; grid-row: 3; align-self: end;
  font-family: var(--serif-th); font-weight: 300;
  font-size: clamp(18px, 1.5vw, 22px); line-height: 1.8; color: var(--ink-2);
  padding-bottom: 36px;
  max-width: 30em;
}
.hero__facts {
  grid-column: 1 / 13; grid-row: 4;
  display: grid; grid-template-columns: repeat(4, 1fr); column-gap: 24px;
  border-top: 1px solid var(--rule-strong);
  padding-top: 18px;
}
.fact dt { font-size: 12.5px; letter-spacing: 0.08em; color: var(--ink-3); margin-bottom: 4px; }
.fact dd { font-family: var(--serif-th); font-size: 19px; line-height: 1.5; }
.fact__note { display: block; font-family: var(--sans); font-size: 12.5px; color: var(--ink-3); letter-spacing: 0.02em; }
.fact dd .num { font-size: 30px; padding-right: 4px; }
.fact--cta { display: flex; align-items: center; justify-content: flex-end; }
.count { display: flex; gap: 18px; }
.count span:not(.nw) { display: grid; line-height: 1.1; }
.count b { font-family: var(--latin); font-feature-settings: 'lnum' 1, 'tnum' 1; font-weight: 500; font-size: 30px; }
.count i { font-style: normal; font-family: var(--sans); font-size: 12.5px; color: var(--ink-3); letter-spacing: 0.04em; }

/* ---------- 01 แนวคิด ---------- */
.quote { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; }
.quote blockquote { grid-column: 2 / 13; }
.quote p {
  font-family: var(--serif-th); font-weight: 300;
  font-size: clamp(40px, 6.1vw, 100px); line-height: 1.32; letter-spacing: -0.01em;
}
.quote em { font-style: normal; color: var(--accent); }
.quote figcaption { grid-column: 2 / 9; margin-top: 36px; color: var(--ink-3); font-size: 15px; }
/* หัวใจของเนื้อหา (ประกาศข้อ 4) — รายการยาวกว่าวิสัยทัศน์เดิม จึงเล็กลงหนึ่งขั้น · ประโยคนำอยู่บนรายการ */
.quote--values p { font-size: clamp(30px, 4.3vw, 68px); line-height: 1.38; }
.quote--values .quote__lead { margin: 0 0 28px; color: var(--ink-2); font-size: clamp(16px, 1.5vw, 19px); grid-column: 2 / 12; }
.quote--values figcaption:last-child { font-size: clamp(16px, 1.5vw, 19px); color: var(--ink-2); grid-column: 2 / 12; }
/* คำบังคับตามประกาศข้อ 4 — ผู้ใช้สั่ง "ต้องเน้นตัวหนา · ตัวใหญ่ด้วย" (30 ก.ย. 2569)
   ขึ้นบรรทัดของตัวเองกลางประโยค ให้เป็นจุดที่สายตาหยุด · ขีดเน้นม่วงเดิมหนาตามขนาด */
.quote__phrase {
  display: table; margin: 14px 0 12px;
  font-family: var(--serif-th); font-weight: 700; color: var(--ink);
  font-size: clamp(22px, 7vw, 50px); line-height: 1.35; letter-spacing: -0.005em;   /* 7vw: จอ 320–360px ยังไม่ชนขอบ (คำนี้ห้ามตัดบรรทัด) */
  box-shadow: inset 0 -0.34em 0 var(--mark); padding: 0 0.08em;
}
.idea__cols {
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px;
  margin-top: clamp(72px, 9vw, 140px);
}
.col { border-top: 1px solid var(--rule); padding-top: 22px; }
.col:nth-child(1) { grid-column: 2 / 5; }
.col:nth-child(2) { grid-column: 6 / 10; }
.col:nth-child(3) { grid-column: 11 / 13; }
.col h3 { font-family: var(--serif-th); font-weight: 500; font-size: 20px; margin-bottom: 10px; }
.col p { color: var(--ink-2); font-size: 15.5px; }

/* ---------- 02 ประเภท ---------- */
.genre {
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; align-items: center;
  padding: clamp(28px, 4vw, 56px) 0;
  border-bottom: 1px solid var(--rule);
}
.genre:first-of-type { border-top: 1px solid var(--rule); }
.genre__slot { grid-column: 1 / 7; grid-row: 1; height: clamp(360px, 40vw, 580px); }
.genre__text { grid-column: 8 / 13; grid-row: 1; }
.genre--flip .genre__slot { grid-column: 7 / 13; }
.genre--flip .genre__text { grid-column: 1 / 6; }
.genre__no { font-family: var(--latin); font-size: 18px; letter-spacing: 0.2em; color: var(--accent); display: block; margin-bottom: 10px; }
.genre__name {
  font-family: var(--serif-th); font-weight: 300;
  font-size: clamp(56px, 7.4vw, 124px); line-height: 1.2; letter-spacing: -0.015em;
  display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 0.28em;
}
.genre__name em { font-family: var(--latin); font-style: normal; font-weight: 400; font-size: 0.3em; color: var(--ink-3); letter-spacing: 0.01em; }
.genre__title {
  margin-top: 22px; padding: 14px 0;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  font-family: var(--serif-th); font-size: 19px;
}
.genre__title span:not(.nw) { font-family: var(--sans); font-size: 12.5px; letter-spacing: 0.08em; color: var(--ink-3); margin-right: 14px; }
.genre__desc { margin-top: 20px; color: var(--ink-2); max-width: 26em; }

/* ---------- 03 รางวัล ---------- */
.prize__grid { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; align-items: center; }
.prize__slot { grid-column: 1 / 8; height: clamp(420px, 46vw, 660px); }
.prize__text { grid-column: 8 / 13; }
.prize__amount { display: flex; align-items: baseline; gap: 16px; line-height: 1; }
.prize__amount .num { font-size: clamp(96px, 11vw, 184px); font-weight: 300; letter-spacing: -0.03em; }
.prize__unit { font-family: var(--serif-th); font-size: 24px; color: var(--accent); }
.prize__sub { margin-top: 18px; font-family: var(--serif-th); font-size: 20px; line-height: 1.6; }
.prize__list { margin-top: 36px; border-top: 1px solid var(--rule-strong); }
.prize__list li { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: 15.5px; color: var(--ink-2); }
.prize__list .num { font-size: 22px; color: var(--ink); }
.prize__list .prize__total { border-bottom: 1px solid var(--rule-strong); color: var(--ink); font-weight: 500; }
.prize__list .prize__total .num { color: var(--accent); font-size: 26px; }
.prize__note { margin-top: 26px; font-size: 14.5px; color: var(--ink-3); line-height: 1.7; }

/* ---------- 04 เกณฑ์ ---------- */
.criteria__list { border-top: 1px solid var(--rule-strong); }
.criteria__list li {
  display: grid; grid-template-columns: 1fr 5fr 6fr 1.3fr; column-gap: 24px; align-items: center;
  padding: clamp(18px, 2.4vw, 30px) 0;
  border-bottom: 1px solid var(--rule);
}
.criteria__list li > div { grid-column: 2 / 4; display: grid; grid-template-columns: 5fr 6fr; column-gap: 24px; align-items: baseline; }
.criteria__i { font-family: var(--latin); font-style: normal; font-size: 22px; color: var(--accent); }
.criteria__list h3 { font-family: var(--serif-th); font-weight: 400; font-size: clamp(24px, 2.6vw, 38px); line-height: 1.35; }
.criteria__list p { color: var(--ink-2); font-size: 15.5px; }
.criteria__pts { justify-self: end; font-size: clamp(48px, 5.4vw, 84px); line-height: 1; font-weight: 400; }
.criteria__foot { margin-top: 22px; font-size: 14px; color: var(--ink-3); text-align: right; }

/* ---------- 05 กำหนดการ ---------- */
.timeline { display: grid; grid-template-columns: repeat(3, 1fr); column-gap: 24px; }
.timeline li { border-top: 1px solid var(--rule-strong); padding-top: 22px; position: relative; }
.timeline li::before { content: ''; position: absolute; top: -4px; left: 0; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.timeline__date { font-family: var(--serif-th); font-size: 22px; margin-bottom: 6px; }
.timeline__date .num { font-size: clamp(48px, 5vw, 76px); line-height: 1.05; padding-right: 8px; }
.timeline li p:last-child { color: var(--ink-2); font-size: 15.5px; }
.submit { display: grid; grid-template-columns: repeat(3, 1fr); column-gap: 24px; margin-top: clamp(72px, 8vw, 120px); }
.submit article { border-top: 1px solid var(--rule); padding-top: 22px; }
.submit h3 { font-family: var(--serif-th); font-weight: 500; font-size: 20px; margin-bottom: 12px; }
.submit p, .submit li { color: var(--ink-2); font-size: 15.5px; }
.submit__list { counter-reset: s; }
.submit__list li { counter-increment: s; padding-left: 28px; position: relative; margin-bottom: 10px; }
.submit__list li::before { content: counter(s); position: absolute; left: 0; top: -1px; font-family: var(--latin); font-size: 19px; color: var(--accent); }
.submit__list--plain li::before { content: '—'; font-family: var(--sans); font-size: 14px; top: 2px; }
.submit small { display: block; color: var(--ink-3); font-size: 13.5px; line-height: 1.6; margin-top: 4px; }
.closing {
  margin-top: clamp(120px, 14vw, 200px);
  padding: clamp(56px, 7vw, 96px) 0 clamp(96px, 10vw, 150px);
  border-top: 1px solid var(--rule-strong);
  display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; flex-wrap: wrap;
}
.closing__line { font-family: var(--serif-th); font-weight: 300; font-size: clamp(44px, 6.4vw, 104px); line-height: 1.28; letter-spacing: -0.01em; }
.closing__line em { font-style: normal; color: var(--accent); }

/* ---------- ท้ายหน้า ---------- */
.footer {
  max-width: var(--max); margin: 0 auto;
  padding: 36px var(--gutter) 48px;
  display: flex; align-items: center; gap: 22px;
  border-top: 1px solid var(--rule);
  font-size: 13.5px; color: var(--ink-3);
}
.footer img { width: 56px; height: 56px; }
.footer__org { font-family: var(--serif-th); font-size: 16px; color: var(--ink); }
.footer__stamp { margin-left: auto; }
/* ลิงก์ในบรรทัดท้ายเว็บ: ขยายพื้นที่กดเป็น ~44px บนมือถือ โดยไม่ดันบรรทัด */
.footer p a { display: inline-block; padding: 12px 4px; margin: -12px -4px; }
.noscript { text-align: center; padding: 20px; color: var(--ink-3); }

/* ---------- ภาพเคลื่อนไหวตอนเข้า (มีเฉพาะเมื่อ JS ทำงาน และผู้ใช้ไม่ได้ปิด motion) ---------- */
/* (scripting: enabled) แทนคลาส .js — ไม่ต้องมี inline script และไม่กะพริบตอนโหลด */
@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(22px); transition: opacity 1.1s var(--ease), transform 1.3s var(--ease); }
  .reveal.is-in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- จอกลาง ---------- */
@media (max-width: 1100px) {
  .masthead__nav { gap: 20px; }
  .hero__facts { grid-template-columns: repeat(2, 1fr); row-gap: 20px; }
  .fact--cta { justify-content: flex-start; }
  .col:nth-child(1) { grid-column: 1 / 5; }
  .col:nth-child(2) { grid-column: 5 / 9; }
  .col:nth-child(3) { grid-column: 9 / 13; }
}

/* ---------- มือถือ/แท็บเล็ตแนวตั้ง ---------- */
@media (max-width: 820px) {
  body { font-size: 16px; }
  .masthead { gap: 12px; padding-top: 12px; padding-bottom: 12px; }
  .masthead__cta { margin-left: auto; padding: 9px 18px; font-size: 14px; }
  .masthead__brand img { width: 42px; height: 42px; }
  .masthead__org { font-size: 13.5px; line-height: 1.35; }
  .masthead__brand { gap: 10px; min-width: 0; min-height: 44px; margin-inline-end: 6px; }
  .masthead__org small { display: none; }

  .hero { display: block; min-height: 0; padding-top: 28px; }
  .hero__title { font-size: clamp(58px, 17vw, 96px); margin-top: 12px; }
  .hero__slot { height: 58svh; min-height: 340px; max-height: 520px; margin: 8px 0 16px; }
  .hero__lede { padding-bottom: 30px; font-size: 18px; }
  .hero__facts { grid-template-columns: 1fr 1fr; row-gap: 22px; }
  .fact--count, .fact--cta { grid-column: 1 / 3; }
  .fact--cta .btn { width: 100%; justify-content: center; padding: 15px 22px; }
  .count { gap: 22px; }

  .section__head { grid-template-columns: auto 1fr; column-gap: 16px; row-gap: 6px; }
  .section__no { grid-column: 1; }
  .section__label { grid-column: 2; }
  .section__intro { grid-column: 1 / 3; }

  .quote blockquote, .quote figcaption { grid-column: 1 / 13; }
  .idea__cols { display: block; }
  .col { margin-bottom: 28px; }

  .genre, .prize__grid { display: block; }
  .genre__slot, .genre--flip .genre__slot { height: 78vw; max-height: 460px; margin-bottom: 18px; }
  .genre__name { font-size: clamp(52px, 15vw, 84px); }
  .prize__slot { height: 92vw; max-height: 520px; margin-bottom: 20px; }
  .prize__amount .num { font-size: clamp(64px, 21vw, 120px); }

  .criteria__list li { grid-template-columns: 28px 1fr auto; column-gap: 14px; }
  .criteria__list li > div { grid-column: 2; display: block; }
  .criteria__list p { margin-top: 4px; }
  .criteria__pts { font-size: 52px; }

  .timeline, .submit { grid-template-columns: 1fr; row-gap: 34px; }
  .closing { flex-direction: column; align-items: flex-start; }
  .closing .btn { width: 100%; justify-content: center; }
  .footer { flex-wrap: wrap; row-gap: 14px; }
  .footer__stamp { margin-left: 0; width: 100%; }
}

/* ---------- GSAP: ข้อความโผล่จากเส้น (motion.js) ----------
 * mask ขยายกรอบตัดขึ้นบน/ลงล่างด้วย padding แล้วหักคืนด้วย margin ติดลบ
 * — สระบน วรรณยุกต์ และสระล่างของภาษาไทยจะไม่ถูกตัดขาด ขณะที่ตำแหน่งตัวอักษรไม่ขยับ */
.split-m { display: inline-block; overflow: hidden; vertical-align: bottom; padding: 0.3em 0.03em 0.08em; margin: -0.3em -0.03em -0.08em; }
.split-u { display: inline-block; will-change: transform; }
.hero__line--indent::after { transition: opacity 0.8s var(--ease) 0.2s; }
.hero__title.is-splitting .hero__line--indent::after { opacity: 0; }
.is-counting { font-variant-numeric: tabular-nums; }

@media (max-width: 820px) {
  .quote--values .quote__lead, .quote--values figcaption:last-child { grid-column: 1 / 13; }
}

/* ---------- ตัวอักษรไทย: จัดบรรทัด ----------
 * balance = หัวข้อแบ่งบรรทัดให้ยาวใกล้กัน · pretty = ไม่ให้คำเดียวค้างบรรทัดสุดท้าย
 * ตัวใหญ่ภาษาไทยต้องมีระยะบรรทัด ≥ 1.4 ไม่งั้นสระบน/ล่างของสองบรรทัดชนกัน
 * การกันตัดกลางคำทำฝั่ง server (App\Support\ThaiText) — CSS ทำเรื่องนี้กับภาษาไทยไม่ได้ */
/* ใช้ text-wrap-style (longhand) เท่านั้น — shorthand text-wrap จะรีเซ็ต text-wrap-mode เป็น wrap
   แล้วลบล้าง white-space: nowrap ของ .nw ที่ selector ไปโดนพอดี (เจอจริงใน .fp-check span) */
h1, h2, h3, .section__label, .genre__name, .closing__line, .quote p, .prize__sub, .criteria__list h3 { text-wrap-style: balance; }
p, li, dd, figcaption, small, label { text-wrap-style: pretty; }
.nw { white-space: nowrap; text-wrap-mode: nowrap; }
.closing__line { line-height: 1.42; }
.quote--values p { line-height: 1.46; }
.criteria__list h3 { line-height: 1.5; }
.hero__lede, .col p, .submit p, .submit li { max-width: 36em; }

/* ---------- ปุ่มสลับธีม ---------- */
.theme-toggle {
  position: relative; flex: none; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; padding: 0; cursor: pointer;
  background: transparent; color: var(--ink); border: 1px solid var(--rule-strong);
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease);
}
.theme-toggle:hover { background: var(--tint); border-color: var(--accent); color: var(--accent); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.theme-toggle__icon { position: absolute; transition: transform 0.6s var(--ease), opacity 0.35s var(--ease); }
/* สว่าง: เห็นพระจันทร์ · มืด: เห็นดวงอาทิตย์ — สลับด้วยการหมุนและย่อ */
.theme-toggle__sun { opacity: 0; transform: rotate(-90deg) scale(0.4); }
:root[data-theme="dark"] .theme-toggle__moon { opacity: 0; transform: rotate(90deg) scale(0.4); }
:root[data-theme="dark"] .theme-toggle__sun { opacity: 1; transform: none; }
.masthead .theme-toggle { margin-inline-start: auto; }
.masthead__nav + .theme-toggle { margin-inline-start: 0; }
@media (prefers-reduced-motion: reduce) { .theme-toggle__icon { transition: none; } }

/* ---------- เมนูมือถือ (≤820px) ----------
 * หัวเว็บเหลือ ตรา | ส่งผลงาน | ☰ — ปุ่มธีมย้ายเข้าแผงเมนู (จอ 320px วางสี่อย่างในแถวเดียวไม่พอ)
 * แผงคือ .masthead__nav ตัวเดิม (ลิงก์ชุดเดียวกับจอกว้าง) วางแบบ absolute ใต้หัวเว็บ
 * (หัวเว็บมี backdrop-filter → fixed จะอิงหัวเว็บอยู่ดี ใช้ absolute ตรง ๆ ชัดกว่า) */
.menu-toggle, .masthead__nav-theme { display: none; }
/* เมนู ☰ ใช้ถึงจอ 1279px — แถวเดียววางลิงก์ 6 ตัว + ปุ่มประกาศ + ธีม + ส่งผลงาน ไม่พอบนแท็บเล็ต/โน้ตบุ๊กจอเล็ก */
@media (max-width: 1279px) {
  .masthead > .theme-toggle { display: none; }
  .masthead__cta { margin-left: auto; }
  .menu-toggle {
    display: grid; place-content: center; gap: 6px; flex: none; width: 44px; height: 44px; padding: 0;
    border-radius: 50%; border: 1px solid var(--rule-strong); background: transparent; color: var(--ink); cursor: pointer;
  }
  .menu-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
  .menu-toggle__bar { display: block; width: 18px; height: 1.5px; border-radius: 1px; background: currentColor; transition: transform 0.4s var(--ease); }
  .masthead.is-menu-open .menu-toggle__bar:first-child { transform: translateY(3.75px) rotate(45deg); }
  .masthead.is-menu-open .menu-toggle__bar:last-child { transform: translateY(-3.75px) rotate(-45deg); }

  .masthead__nav {
    position: absolute; top: 100%; left: 0; right: 0; margin: 0;
    display: flex; flex-direction: column; gap: 0;
    padding: 4px var(--gutter) 24px; font-size: 19px;
    background: var(--paper); border-bottom: 1px solid var(--rule);
    box-shadow: 0 24px 40px -28px rgba(21, 19, 26, 0.35);
    max-height: calc(100svh - 70px); overflow-y: auto; overscroll-behavior: contain;
    opacity: 0; visibility: hidden; transform: translateY(-10px);
    transition: opacity 0.3s var(--ease), transform 0.45s var(--ease), visibility 0s linear 0.45s;
  }
  .masthead.is-menu-open .masthead__nav {
    opacity: 1; visibility: visible; transform: none;
    transition: opacity 0.3s var(--ease), transform 0.45s var(--ease);
  }
  .masthead__nav a { padding: 15px 0; color: var(--ink); border-bottom: 1px solid var(--rule); }
  .masthead__nav a::after { display: none; }
  .masthead__nav a.is-current { color: var(--accent); }
  .masthead__nav-theme { display: flex; align-items: center; justify-content: space-between; padding-top: 18px; font-size: 15px; color: var(--ink-2); }
  .masthead__nav-theme .theme-toggle { width: 44px; height: 44px; }
  .menu-lock, .menu-lock body { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  .masthead__nav, .masthead.is-menu-open .masthead__nav, .menu-toggle__bar { transition: none; }
}
/* ลิงก์ในหน้าเดียวกัน (#criteria ฯลฯ) — เลื่อนแล้วหัวข้อไม่จมใต้หัวเว็บที่ติดอยู่ด้านบน */
section[id], [id].section { scroll-margin-top: 84px; }

/* จอ ≤400px: ชื่อ "สหกรณ์ออมทรัพย์ครูระยอง" ห้ามตัดคำ (.nw) กว้าง ~150px แต่เหลือที่ ~130px ข้างปุ่มส่งผลงาน+เมนู
   → เหลือแค่ตรา (alt ของตราคือชื่อเต็ม · ชื่อยังอยู่ใต้หัวเว็บและท้ายหน้า) — ไม่งั้นตัวหนังสือทับปุ่ม */
@media (max-width: 400px) {
  .masthead__org { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* ---------- หน้าต่างประกาศลอย (หน้าแรก · ข้อความจากหลังบ้าน) ---------- */
.announce { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px var(--gutter); }
.announce[hidden] { display: none; }
.announce__backdrop { position: absolute; inset: 0; background: rgba(14, 13, 18, 0.46); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.announce__panel {
  position: relative; width: min(560px, 100%); max-height: calc(100svh - 48px); overflow-y: auto;
  background: var(--paper); color: var(--ink); border: 1px solid var(--rule); border-radius: 22px;
  padding: clamp(28px, 4vw, 44px); box-shadow: 0 40px 90px -40px rgba(98, 49, 198, 0.55);
  outline: none;
}
.announce__x {
  position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; padding: 0; border: 1px solid var(--rule); background: transparent;
  color: var(--ink-2); cursor: pointer; transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.announce__x:hover { background: var(--tint); color: var(--accent); }
.announce__kicker { font-size: 13px; letter-spacing: 0.1em; color: var(--accent); margin: 0 52px 10px 0; }
.announce__title { font-family: var(--serif-th); font-weight: 400; font-size: clamp(26px, 3.4vw, 36px); line-height: 1.35; margin: 0 40px 0 0; text-wrap-style: balance; }
.announce__body { margin-top: 16px; font-size: 16.5px; line-height: 1.85; color: var(--ink-2); text-wrap-style: pretty; }
.announce__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 28px; }
.announce__dismiss {
  font: inherit; font-size: 15px; background: none; border: 0; padding: 12px 6px; min-height: 44px;
  color: var(--ink-3); cursor: pointer; text-decoration: underline; text-underline-offset: 4px;
}
.announce__dismiss:hover { color: var(--ink); }
.announce-open, .announce-open body { overflow: hidden; }
/* มือถือ: เป็นแผ่นเลื่อนขึ้นจากขอบล่าง ปุ่มเต็มความกว้าง */
@media (max-width: 560px) {
  .announce { align-items: end; padding: 0; }
  .announce__panel { width: 100%; border-radius: 22px 22px 0 0; max-height: 88svh; padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
  .announce__actions .btn { flex: 1 1 100%; justify-content: center; }
  .announce__dismiss { flex: 1 1 100%; }
}

/* ---------- ปุ่ม "อ่านรายละเอียดประกาศ" บนเมนู (ตั้งในหลังบ้าน) ---------- */
.masthead__nav a.masthead__notice {
  display: inline-flex; align-items: center; gap: 8px; color: var(--accent); font-weight: 500; white-space: nowrap;
  padding: 6px 14px; border-radius: 999px; background: var(--tint);
}
.masthead__nav a.masthead__notice::after { display: none; }
.masthead__nav a.masthead__notice:hover { color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.masthead__notice-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; animation: notice-pulse 2.2s ease-in-out infinite; }
@keyframes notice-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); } 50% { box-shadow: 0 0 0 6px transparent; } }
@media (prefers-reduced-motion: reduce) { .masthead__notice-dot { animation: none; } }
@media (max-width: 1279px) {
  .masthead__nav a.masthead__notice { padding: 15px 16px; margin: 10px 0 4px; border-radius: 14px; border-bottom: 0; justify-content: flex-start; }
}

/* จอแคบมาก (320–360) — คะแนน 52px ดันเลข "25" ล้นขอบขวา 7px (ตรวจ responsive 30 ก.ย. 2569) */
@media (max-width: 360px) {
  .criteria__list li { column-gap: 10px; }
  .criteria__pts { font-size: 40px; }
}
