/* ระบบบัญชี Zento — เอกสารสเปก | 1DAY·1DEAW */

:root {
  --paper: #FBFAF7;
  --paper-2: #F3F1EC;
  --card: #FFFFFF;
  --ink: #15191C;
  --ink-2: #4A5257;
  --ink-3: #7C858B;
  --line: #E2DFD8;
  --green: #0F3D33;
  --green-2: #17594B;
  --gold: #9C7526;
  --gold-soft: #F4EBD8;
  --p1: #0F3D33;
  --p2: #1F5B86;
  --p3: #7A5A2E;
  --r: 14px;
  --wrap: 1120px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Sans Thai", "Noto Sans Thai", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { line-height: 1.34; margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
ul { margin: 0; padding: 0 0 0 1.15em; }

a { color: inherit; }

.wrap { width: min(100% - 40px, var(--wrap)); margin-inline: auto; }

.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 60;
  background: var(--green); color: #fff; padding: 12px 18px; border-radius: 0 0 var(--r) 0;
  text-decoration: none;
}
.skip:focus { left: 0; }

.ic { width: 24px; height: 24px; flex: none; }
.ic.sm { width: 19px; height: 19px; }

/* ---------- แถบเมนู ---------- */

.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 250, 247, .88);
  backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav-in {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; min-height: 64px;
}

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; }

.bmark {
  width: 30px; height: 30px; border-radius: 8px; background: var(--green); color: var(--gold-soft);
  display: grid; place-items: center; font-family: Georgia, "Times New Roman", serif;
  font-weight: 700; font-size: 17px; flex: none;
}

.btxt { font-size: 16px; }

.nav nav { display: flex; gap: 4px; }

.nav nav a {
  text-decoration: none; color: var(--ink-2); font-size: 15px;
  padding: 8px 12px; border-radius: 9px; transition: background .2s var(--ease), color .2s var(--ease);
}
.nav nav a:hover { background: var(--paper-2); color: var(--ink); }

/* ---------- หัวเรื่องหน้า ---------- */

.hero {
  background: var(--green);
  color: #F2F5F3;
  padding: 76px 0 68px;
}

.eyebrow {
  font-size: 14px; letter-spacing: .08em; text-transform: uppercase;
  color: #A9C4BB; font-weight: 500; margin-bottom: 18px;
}

.hero h1 { font-size: clamp(32px, 6vw, 58px); font-weight: 700; letter-spacing: -0.02em; }

.lead {
  max-width: 62ch; margin-top: 20px; font-size: clamp(17px, 2.1vw, 19px);
  color: #CFDDD8; line-height: 1.75;
}

.stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
  margin-top: 40px; max-width: 720px;
}
.stats > div {
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--r); padding: 18px 20px;
}
.stats b { display: block; font-size: 34px; font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
.stats span { font-size: 14px; color: #A9C4BB; }

.note {
  margin-top: 28px; max-width: 66ch; font-size: 14.5px; line-height: 1.7;
  color: #93AFA6; padding-left: 14px; border-left: 2px solid rgba(255, 255, 255, .18);
}

/* ---------- ส่วนเนื้อหา ---------- */

.sec { padding: 74px 0; }
.sec.alt { background: var(--paper-2); }

.sec h2 { font-size: clamp(25px, 3.6vw, 34px); font-weight: 700; }

.sublead { max-width: 68ch; margin-top: 14px; color: var(--ink-2); }

/* จุดต่าง 4 ข้อ */

.hgrid { display: grid; gap: 16px; margin-top: 36px; grid-template-columns: 1fr; }

.hcard {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 26px 24px;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.hcard:hover { transform: translateY(-3px); box-shadow: 0 8px 22px -14px rgba(21, 25, 28, .35); }
.hcard .ic { color: var(--green-2); }
.hcard h3 { font-size: 19px; margin: 14px 0 8px; }
.hcard p { color: var(--ink-2); font-size: 16px; }

/* เฟส */

.pgrid { display: grid; gap: 16px; margin-top: 36px; grid-template-columns: 1fr; }

.pcard {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 26px 24px; border-top: 3px solid var(--p1);
}
.pcard.p2 { border-top-color: var(--p2); }
.pcard.p3 { border-top-color: var(--p3); }

.pnum {
  font-family: Georgia, "Times New Roman", serif; font-size: 40px; line-height: 1;
  color: var(--line); font-weight: 700;
}
.pcard h3 { font-size: 20px; margin-top: 6px; }
.pdesc { color: var(--ink-2); font-size: 16px; margin-top: 10px; }

.pstats { display: flex; gap: 28px; margin: 20px 0 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.pstats b { display: block; font-size: 26px; font-weight: 700; line-height: 1.2; }
.pstats span { font-size: 13.5px; color: var(--ink-3); }

.plist { list-style: none; padding: 0; display: grid; gap: 9px; }
.plist li { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; color: var(--ink-2); }
.plist .gkey.xs { margin-top: 3px; }
.gsec-head .gkey.sm { margin-top: 2px; }
.plist .c { margin-left: auto; color: var(--ink-3); font-size: 13.5px; white-space: nowrap; }

/* กลุ่มงาน */

.ggrid { display: grid; gap: 14px; margin-top: 36px; grid-template-columns: 1fr; }

.gcard {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 22px; text-decoration: none; display: block;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.gcard:hover { transform: translateY(-3px); border-color: #CFCABF; box-shadow: 0 8px 22px -14px rgba(21, 25, 28, .35); }
.gcard h3 { font-size: 18px; margin: 12px 0 8px; }
.gcard p {
  color: var(--ink-2); font-size: 15px; line-height: 1.65;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.gkey {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  background: var(--green); color: var(--gold-soft);
  font-family: Georgia, "Times New Roman", serif; font-weight: 700; font-size: 19px; flex: none;
}
.gkey.sm { width: 34px; height: 34px; font-size: 17px; }
.gkey.xs { width: 24px; height: 24px; font-size: 13px; border-radius: 7px; }

.gmeta { display: flex; gap: 16px; margin-top: 14px; font-size: 13.5px; color: var(--ink-3); }

.tags { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }

.tag {
  font-size: 12.5px; padding: 2px 9px; border-radius: 999px; white-space: nowrap;
  background: var(--gold-soft); color: var(--p3); font-weight: 500;
}
.tag.p1 { background: #E4EEEA; color: var(--p1); }
.tag.p2 { background: #E3EDF5; color: var(--p2); }
.tag.p3 { background: var(--gold-soft); color: var(--p3); }

/* ---------- เครื่องมือค้นหา ---------- */

.tools { margin: 32px 0 12px; display: grid; gap: 12px; }

.searchbox { position: relative; display: flex; align-items: center; }
.searchbox .ic { position: absolute; left: 14px; color: var(--ink-3); pointer-events: none; }

.searchbox input {
  width: 100%; font: inherit; font-size: 16px; padding: 13px 16px 13px 44px;
  border: 1px solid var(--line); border-radius: 11px; background: var(--card); color: var(--ink);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.searchbox input:focus {
  outline: none; border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(23, 89, 75, .13);
}

.chips { display: flex; gap: 7px; flex-wrap: wrap; }

.chip {
  font: inherit; font-size: 14.5px; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2); cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.chip:hover { border-color: #C9C4B8; }
.chip.on { background: var(--green); border-color: var(--green); color: #fff; }
.chip:focus-visible { outline: 2px solid var(--green-2); outline-offset: 2px; }

.count { font-size: 14.5px; color: var(--ink-3); }

/* ---------- รายการฟังก์ชัน ---------- */

.gsec { margin-top: 40px; scroll-margin-top: 84px; }

.gsec-head { display: flex; align-items: flex-start; gap: 13px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.gsec-head h3 { font-size: 19px; }
.gsec-meta { font-size: 13.5px; color: var(--ink-3); }

.fns { display: grid; gap: 8px; margin-top: 14px; }

.fn {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.fn[hidden] { display: none; }

.fn summary {
  display: flex; align-items: center; gap: 13px; padding: 15px 18px;
  cursor: pointer; list-style: none;
}
.fn summary::-webkit-details-marker { display: none; }
.fn summary:hover { background: #FAF9F6; }
.fn summary:focus-visible { outline: 2px solid var(--green-2); outline-offset: -2px; }

.fid {
  font-family: Georgia, "Times New Roman", serif; font-size: 14px; font-weight: 700;
  color: var(--gold); letter-spacing: .03em; flex: none; width: 38px;
}

.fname { flex: 1; font-weight: 500; font-size: 16.5px; }

.fmeta { display: flex; align-items: center; gap: 10px; flex: none; }
.fmeta .days { font-size: 13.5px; color: var(--ink-3); white-space: nowrap; }

.chev { width: 18px; height: 18px; color: var(--ink-3); flex: none; transition: transform .2s var(--ease); }
.fn details[open] .chev, details[open] > summary .chev { transform: rotate(180deg); }

.fbody {
  padding: 4px 18px 20px 69px; display: grid; gap: 16px;
  border-top: 1px solid var(--paper-2);
}
.fblock h4 { font-size: 13px; letter-spacing: .05em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.fblock p, .fblock li { color: var(--ink-2); font-size: 16px; margin-top: 5px; }
.fblock li { margin-top: 3px; }

.empty { margin-top: 32px; color: var(--ink-2); }

/* ---------- ปิดท้าย ---------- */

.cta { background: var(--green); color: #F2F5F3; }
.cta .sublead { color: #CFDDD8; }
.cta-sign { margin-top: 26px; font-size: 15px; color: #A9C4BB; }

.foot { padding: 34px 0; border-top: 1px solid var(--line); font-size: 14.5px; color: var(--ink-2); }
.foot .dim { color: var(--ink-3); margin-top: 4px; }

/* ---------- อนิเมชัน ---------- */

.reveal { opacity: 0; transform: translateY(18px); }
.reveal.in {
  opacity: 1; transform: none;
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}

/* ---------- จอกว้างขึ้น ---------- */

@media (min-width: 600px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
  .hgrid, .ggrid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .hgrid { grid-template-columns: repeat(4, 1fr); }
  .pgrid { grid-template-columns: repeat(3, 1fr); }
  .ggrid { grid-template-columns: repeat(3, 1fr); }
  .tools { grid-template-columns: minmax(280px, 1fr) auto; align-items: center; }
  .tools .chips:nth-of-type(2) { grid-column: 1 / -1; }
  .count { grid-column: 1 / -1; }
}

@media (max-width: 599px) {
  body { font-size: 16px; }
  .hero { padding: 54px 0 48px; }
  .nav nav a { padding: 8px 9px; font-size: 14px; }
  .btxt { display: none; }
  .fn summary { padding: 13px 14px; gap: 10px; flex-wrap: wrap; }
  .fname { flex-basis: calc(100% - 110px); }
  .fmeta { margin-left: auto; }
  .fbody { padding: 4px 14px 18px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .nav, .tools, .skip, .cta { display: none; }
  body { background: #fff; font-size: 12pt; }
  .hero { background: #fff; color: #000; padding: 0 0 24px; }
  .lead, .note, .eyebrow, .stats span { color: #333; }
  .stats > div { border: 1px solid #ccc; }
  .sec { padding: 18px 0; break-inside: avoid; }
  .fn, .gcard, .pcard, .hcard { break-inside: avoid; border: 1px solid #ddd; }
  .fbody { display: block !important; }
  .reveal { opacity: 1; transform: none; }
}
