/* ==========================================================================
   dm66.world — design system v1 (เขียนใหม่ทั้งหมด 100%)
   โทเคนอ้างอิงรูปแบบเว็บตัวอย่าง: dark theme, Sarabun, primary+accent
   ========================================================================== */

/* ---- Sarabun font (local, woff2, Thai+Latin) ---- */
@font-face {
  font-family: 'Sarabun';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/sarabun-thai-300.woff2') format('woff2'),
       url('../fonts/sarabun-latin-300.woff2') format('woff2');
}
@font-face {
  font-family: 'Sarabun';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/sarabun-thai-400.woff2') format('woff2'),
       url('../fonts/sarabun-latin-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Sarabun';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/sarabun-thai-600.woff2') format('woff2'),
       url('../fonts/sarabun-latin-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Sarabun';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/sarabun-thai-600.woff2') format('woff2'),
       url('../fonts/sarabun-latin-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Sarabun';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/sarabun-thai-700.woff2') format('woff2'),
       url('../fonts/sarabun-latin-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Sarabun';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/sarabun-thai-800.woff2') format('woff2'),
       url('../fonts/sarabun-latin-800.woff2') format('woff2');
}

/* ---- tokens ---- */
:root {
  --bg:            #070A12;
  --bg-2:          #0B1220;
  --bg-3:          #101A2E;
  --surface:       #111C30;
  --surface-2:     #16233C;
  --line:          #1E2C48;
  --line-2:        #2A3B5E;

  --text:          #F2F5FA;
  --text-2:        #C6D0E0;
  --text-3:        #8E9BB3;

  --primary:       #FF7A1A;
  --primary-dark:  #D85F0B;
  --primary-soft:  rgba(255, 122, 26, .12);
  --accent:        #61CE70;
  --accent-dark:   #3FA84B;
  --accent-soft:   rgba(97, 206, 112, .12);
  --gold:          #F7B733;

  --radius:        14px;
  --radius-sm:     10px;
  --radius-lg:     22px;
  --shadow:        0 10px 30px rgba(0, 0, 0, .45);
  --shadow-glow:   0 0 0 1px rgba(255, 122, 26, .25), 0 12px 34px rgba(255, 122, 26, .18);
  --maxw:          1160px;
  --head-h:        64px;
  --foot-h:        64px;
  --ease:          cubic-bezier(.2, .7, .3, 1);
}

/* ---- reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Sarabun', system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
  background:
    radial-gradient(1100px 620px at 82% -8%,  rgba(255, 122, 26, .10), transparent 62%),
    radial-gradient(900px 560px at 6% 4%,    rgba(97, 206, 112, .08),  transparent 60%),
    var(--bg);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--gold); }
h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 .6em; font-weight: 700; }
h1 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.85rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); }
p { margin: 0 0 1em; color: var(--text-2); }
ul, ol { color: var(--text-2); padding-left: 1.35em; }
li { margin-bottom: .45em; }
strong { color: var(--text); font-weight: 600; }
::selection { background: var(--primary); color: #0A0A0A; }

/* ---- layout ---- */
.wrap { width: min(var(--maxw), 92vw); margin-inline: auto; }
.section { padding: 3.2rem 0; }
.section--tight { padding: 2rem 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .5em;
  font-size: .8rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid rgba(255, 122, 26, .3);
  padding: .35em .9em; border-radius: 999px;
  margin-bottom: 1rem;
}

/* ---- header ---- */
.head {
  position: sticky; top: 0; z-index: 60;
  height: var(--head-h);
  display: flex; align-items: center;
  background: rgba(7, 10, 18, .86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.head .wrap { display: flex; align-items: center; gap: 1.2rem; width: min(var(--maxw), 94vw); }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.15rem; color: var(--text); letter-spacing: .02em; }
.brand img { height: 38px; width: auto; }
.brand span { color: var(--primary); }
.nav { display: flex; gap: .35rem; margin-left: auto; flex-wrap: wrap; }
.nav a {
  color: var(--text-2); font-size: .95rem; font-weight: 500;
  padding: .4rem .7rem; border-radius: var(--radius-sm);
  transition: background .2s var(--ease), color .2s var(--ease);
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--surface); }
.head-cta {
  background: linear-gradient(135deg, var(--primary), var(--gold));
  color: #100800 !important; font-weight: 700;
  padding: .5rem 1.1rem; border-radius: 999px;
  box-shadow: var(--shadow-glow);
  white-space: nowrap;
}
.head-cta:hover { filter: brightness(1.08); color: #100800 !important; background: linear-gradient(135deg, var(--primary), var(--gold)); }
.burger { display: none; margin-left: auto; background: none; border: 1px solid var(--line-2); border-radius: var(--radius-sm); color: var(--text); width: 42px; height: 42px; font-size: 1.2rem; cursor: pointer; }

/* ---- hero ---- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; opacity: .42; }
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(7,10,18,.35) 0%, rgba(7,10,18,.88) 62%, var(--bg) 100%);
}
.hero-inner { position: relative; z-index: 1; padding: 4.2rem 0 3.6rem; }
.hero h1 { max-width: 22ch; }
.hero-sub { font-size: 1.08rem; color: var(--text-2); max-width: 56ch; margin-bottom: 1.6rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 1.4rem; margin-top: 1.8rem; }
.hero-meta div { display: flex; flex-direction: column; }
.hero-meta b { font-size: 1.35rem; color: var(--gold); line-height: 1.2; }
.hero-meta span { font-size: .82rem; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font-family: inherit; font-size: 1rem; font-weight: 700;
  padding: .8em 1.6em; border-radius: 999px; border: 0; cursor: pointer;
  transition: transform .18s var(--ease), box-shadow .2s var(--ease), filter .2s var(--ease);
  text-align: center;
}
.btn:hover { transform: translateY(-2px); color: inherit; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--gold)); color: #100800; box-shadow: var(--shadow-glow); }
.btn-primary:hover { color: #100800; filter: brightness(1.08); }
.btn-ghost { background: rgba(255,255,255,.04); color: var(--text); border: 1px solid var(--line-2); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-green { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #04140A; box-shadow: 0 0 0 1px rgba(97,206,112,.25), 0 12px 34px rgba(97,206,112,.16); }
.btn-green:hover { color: #04140A; filter: brightness(1.06); }
.btn-sm { font-size: .9rem; padding: .55em 1.15em; }

/* ---- cards ---- */
.grid { display: grid; gap: 1.2rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem;
  transition: transform .22s var(--ease), border-color .22s var(--ease), box-shadow .22s var(--ease);
}
.card:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: var(--shadow); }
.card h3 { margin-bottom: .5em; }
.card p { font-size: .96rem; margin-bottom: 0; }
.card-ico {
  width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center; font-size: 1.3rem;
  background: var(--primary-soft); border: 1px solid rgba(255,122,26,.3);
  margin-bottom: .9rem;
}

/* ---- article body ---- */
.article { font-size: 1.05rem; }
.article > h2 { margin-top: 2.2em; padding-top: .4em; border-top: 1px solid var(--line); }
.article > h2:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.article > h3 { margin-top: 1.6em; color: var(--text); }
.article figure { margin: 1.8rem 0; }
.article figure img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); }
.article figcaption { font-size: .88rem; color: var(--text-3); text-align: center; margin-top: .6rem; }
.article a:not(.btn) { text-decoration: underline; text-decoration-color: rgba(255,122,26,.4); text-underline-offset: 3px; }
.article blockquote {
  margin: 1.6rem 0; padding: 1.1rem 1.3rem;
  background: var(--accent-soft); border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.article blockquote p { margin: 0; color: var(--text); }

/* ---- tables ---- */
.tbl { width: 100%; border-collapse: collapse; margin: 1.6rem 0; font-size: .98rem; display: block; overflow-x: auto; }
.tbl th, .tbl td { border: 1px solid var(--line); padding: .7rem .9rem; text-align: left; vertical-align: top; }
.tbl thead th { background: var(--surface-2); color: var(--gold); font-weight: 600; white-space: nowrap; }
.tbl tbody tr:nth-child(odd) { background: rgba(255,255,255,.02); }
.tbl td b { color: var(--text); }

/* ---- misc blocks ---- */
.note {
  background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-sm); padding: 1rem 1.2rem; margin: 1.4rem 0;
  font-size: .98rem;
}
.note p:last-child { margin-bottom: 0; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 1.4rem 0; }
.steps li {
  counter-increment: step; position: relative;
  padding: 1rem 1rem 1rem 3.4rem; margin-bottom: .8rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.steps li::before {
  content: counter(step);
  position: absolute; left: .9rem; top: 1rem;
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--gold));
  color: #100800; font-weight: 700; font-size: .95rem;
  display: grid; place-items: center;
}
.steps li b { display: block; color: var(--text); margin-bottom: .2em; }
.steps li p { margin: 0; font-size: .96rem; }
.faq { margin: 1.4rem 0; }
.faq details {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); margin-bottom: .7rem; overflow: hidden;
}
.faq summary {
  cursor: pointer; padding: .95rem 1.1rem; font-weight: 600; color: var(--text);
  list-style: none; display: flex; align-items: center; gap: .6em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "◆"; color: var(--primary); font-size: .8rem; }
.faq details[open] summary { border-bottom: 1px solid var(--line); }
.faq details > div { padding: 1rem 1.1rem; color: var(--text-2); }
.faq details > div p:last-child { margin-bottom: 0; }

/* ---- CTA band ---- */
.cta-band {
  position: relative; overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,122,26,.35);
  background:
    radial-gradient(700px 300px at 88% 10%, rgba(255,122,26,.22), transparent 60%),
    linear-gradient(135deg, var(--surface-2), var(--bg-3));
  padding: 2.2rem; margin: 2.4rem 0; text-align: center;
}
.cta-band h2 { margin-bottom: .5rem; }
.cta-band p { max-width: 60ch; margin-inline: auto; }
.cta-band .btn { margin-top: .8rem; }

/* ---- breadcrumb ---- */
.crumb { display: flex; flex-wrap: wrap; gap: .45em; font-size: .88rem; color: var(--text-3); padding-top: 1.2rem; }
.crumb a { color: var(--text-3); }
.crumb a:hover { color: var(--primary); }
.crumb span { color: var(--text-3); }

/* ---- footer ---- */
.foot { border-top: 1px solid var(--line); background: var(--bg-2); margin-top: 3rem; padding-bottom: calc(var(--foot-h) + 1.5rem); }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 1.6rem; padding: 2.6rem 0 1.6rem; }
.foot h4 { font-size: .95rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); margin-bottom: .9rem; }
.foot-links { list-style: none; padding: 0; margin: 0; }
.foot-links li { margin-bottom: .5rem; }
.foot-links a { color: var(--text-2); font-size: .95rem; }
.foot-links a:hover { color: var(--primary); }
.foot-about p { font-size: .94rem; color: var(--text-3); max-width: 40ch; }
.foot-brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.1rem; color: var(--text); margin-bottom: .8rem; }
.foot-brand img { height: 36px; width: auto; }
.foot-bottom { border-top: 1px solid var(--line); padding: 1.2rem 0; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; font-size: .88rem; color: var(--text-3); }
.age-badge {
  display: inline-flex; align-items: center; gap: .5em;
  border: 1px solid rgba(255,122,26,.4); color: var(--primary);
  background: var(--primary-soft);
  border-radius: 999px; padding: .25em .8em; font-weight: 600; font-size: .85rem;
}

/* ---- footer bar (sticky mobile/desktop CTA) ---- */
.footbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  height: var(--foot-h);
  display: flex; align-items: center; gap: .7rem;
  padding: 0 clamp(.8rem, 3vw, 1.6rem);
  background: rgba(9, 13, 24, .95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255,122,26,.28);
  box-shadow: 0 -8px 28px rgba(0,0,0,.5);
}
.footbar .wrap { display: flex; gap: .7rem; width: 100%; align-items: center; }
.footbar-brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: .95rem; margin-right: auto; }
.footbar-brand img { height: 30px; width: auto; }
.footbar .btn { flex: 0 1 auto; padding-inline: clamp(1rem, 4vw, 2rem); }
.footbar .btn-primary { flex: 1 1 auto; max-width: 260px; }

/* ---- post list ---- */
.post-item { display: grid; grid-template-columns: 200px 1fr; gap: 1.1rem; align-items: start; }
.post-item img { width: 200px; height: 118px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.post-item h3 { margin: 0 0 .3em; font-size: 1.1rem; }
.post-item p { font-size: .94rem; margin: 0; }
.tag {
  display: inline-block; font-size: .78rem; font-weight: 600; letter-spacing: .06em;
  color: var(--accent); background: var(--accent-soft);
  border: 1px solid rgba(97,206,112,.3); border-radius: 999px;
  padding: .2em .7em; margin-bottom: .5em;
}

/* ---- TOC ---- */
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.3rem; margin: 1.6rem 0; }
.toc-title { font-weight: 700; color: var(--text); margin-bottom: .6rem; font-size: .95rem; }
.toc ol { margin: 0; padding-left: 1.2em; }
.toc li { margin-bottom: .3em; font-size: .95rem; }
.toc a { color: var(--text-2); }
.toc a:hover { color: var(--primary); }

/* ---- responsive ---- */
@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav { display: none; }
  .burger { display: block; }
  .nav.open {
    display: flex; flex-direction: column;
    position: absolute; top: var(--head-h); left: 0; right: 0;
    background: var(--bg-2); border-bottom: 1px solid var(--line);
    padding: .8rem 4vw 1.2rem; gap: .2rem;
  }
  .nav.open a { padding: .7rem .6rem; font-size: 1rem; }
  .head-cta { display: none; }
  .hero-inner { padding: 3rem 0 2.6rem; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .post-item { grid-template-columns: 1fr; }
  .post-item img { width: 100%; height: 170px; }
  .foot-grid { grid-template-columns: 1fr; gap: 1.2rem; }
  .footbar { height: 58px; }
  .footbar-brand { display: none; }
  .footbar .btn { flex: 1; max-width: none; padding-block: .7em; }
  :root { --foot-h: 58px; }
  .section { padding: 2.4rem 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ── callout + CTA (content blocks) ── */
.callout{margin:18px 0;padding:14px 16px;border-left:4px solid var(--accent,#F7F218);border-radius:8px;background:rgba(247,242,24,.07)}
.callout-info{border-left-color:#38bdf8;background:rgba(56,189,248,.08)}
.callout-tip{border-left-color:#61CE70;background:rgba(97,206,112,.08)}
.callout-warn{border-left-color:#FF4500;background:rgba(255,69,0,.10)}
.callout p{margin:0}
.cta-box{margin:24px 0;padding:20px;border-radius:12px;text-align:center;background:linear-gradient(135deg,rgba(255,69,0,.14),rgba(247,242,24,.10));border:1px solid rgba(255,69,0,.35)}
.cta-box strong{display:block;font-size:1.05rem;margin-bottom:4px;color:#fff}
.cta-sub{display:block;font-size:.9rem;color:#cbd5e1;margin-bottom:12px}
.btn-cta{display:inline-block;padding:12px 28px;border-radius:999px;font-weight:700;color:#111;text-decoration:none;background:linear-gradient(90deg,#FF4500,#F7F218);box-shadow:0 4px 18px rgba(255,69,0,.4)}
.btn-cta:hover{filter:brightness(1.08)}
