/* ==========================================================================
   Meekhao — Design System 2026
   Mobile-first. Noto Sans Thai (headings) + Sarabun (body).
   No framework: fast paint = better Core Web Vitals = better ad revenue.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* Type */
  --font-head: "Noto Sans Thai", "Noto Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: "Sarabun", "Noto Sans Thai", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;

  /* Neutrals — pastel blush paper */
  --paper: #ffffff;
  --canvas: #fdf8fa;
  --surface: #ffffff;
  --surface-2: #f8f0f5;
  --surface-3: #f0e6ee;
  --border: #eddfe8;
  --border-strong: #dcc8d6;
  --ink: #2f2a35;
  --ink-2: #4e4759;
  --muted: #6e6779;
  --muted-2: #7d768a;

  /* Brand — dusty rose. Fill tones carry white text at AA, washes stay pastel. */
  --brand: #c0405f;
  --brand-hover: #a83050;
  --brand-ink: #ad3553;
  --brand-wash: #fdeef3;
  --brand-ring: rgba(228, 87, 122, .30);
  --brand-pastel: #f6c9d5;
  --brand-pastel-2: #ffd9c9;

  /* Support */
  --teal: #2b7a86;
  --teal-wash: #e8f5f5;
  --gold: #9d5c18;
  --gold-wash: #fdf1e3;

  /* Category hues — pastel family, dark enough to sit on paper as text */
  --c-news: #b84a63;
  --c-animals: #26755a;
  --c-foods: #9d5c18;
  --c-travel: #3a6ea8;
  --c-history: #8a6440;
  --c-it: #6a5ec4;
  --c-education: #2b7a86;
  --c-art: #a84f8c;

  /* Shape */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* Elevation — subtle, modern */
  --sh-1: 0 1px 2px rgba(22, 21, 15, .05);
  --sh-2: 0 2px 8px rgba(22, 21, 15, .06), 0 1px 2px rgba(22, 21, 15, .04);
  --sh-3: 0 12px 32px rgba(22, 21, 15, .10), 0 2px 8px rgba(22, 21, 15, .05);

  /* Layout */
  --measure: 43rem;      /* article text column */
  --wide: 76rem;         /* page shell */
  --gutter: 1.125rem;
  --header-h: 56px;

  --ease: cubic-bezier(.22, .61, .36, 1);
}

@media (min-width: 768px) {
  :root { --gutter: 1.75rem; --header-h: 68px; }
}

/* ---------- Dark theme ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --paper: #17141b;
  --canvas: #110f15;
  --surface: #1d1a23;
  --surface-2: #26222d;
  --surface-3: #302b39;
  --border: #332e3d;
  --border-strong: #47404f;
  --ink: #f4eff3;
  --ink-2: #d8d1da;
  --muted: #a9a1b0;
  --muted-2: #8d8698;

  --brand: #e8829b;
  --brand-hover: #f3a0b4;
  --brand-ink: #f3a0b4;
  --brand-wash: #2c1b23;
  --brand-ring: rgba(232, 130, 155, .34);
  --brand-pastel: #7a4358;
  --brand-pastel-2: #7d4b40;

  --teal: #7fcbd4;
  --teal-wash: #142a2e;
  --gold: #e0b072;
  --gold-wash: #2b2317;

  --c-news: #f0a2b2;
  --c-animals: #8ad3b0;
  --c-foods: #e8b681;
  --c-travel: #9dc2ec;
  --c-history: #d3b291;
  --c-it: #b8aef2;
  --c-education: #8fcdd6;
  --c-art: #e6a6d2;

    --sh-1: 0 1px 2px rgba(0, 0, 0, .4);
    --sh-2: 0 2px 10px rgba(0, 0, 0, .45);
    --sh-3: 0 14px 36px rgba(0, 0, 0, .55);
  }
}

:root[data-theme="dark"] {
  --paper: #17141b;
  --canvas: #110f15;
  --surface: #1d1a23;
  --surface-2: #26222d;
  --surface-3: #302b39;
  --border: #332e3d;
  --border-strong: #47404f;
  --ink: #f4eff3;
  --ink-2: #d8d1da;
  --muted: #a9a1b0;
  --muted-2: #8d8698;

  --brand: #e8829b;
  --brand-hover: #f3a0b4;
  --brand-ink: #f3a0b4;
  --brand-wash: #2c1b23;
  --brand-ring: rgba(232, 130, 155, .34);
  --brand-pastel: #7a4358;
  --brand-pastel-2: #7d4b40;

  --teal: #7fcbd4;
  --teal-wash: #142a2e;
  --gold: #e0b072;
  --gold-wash: #2b2317;

  --c-news: #f0a2b2;
  --c-animals: #8ad3b0;
  --c-foods: #e8b681;
  --c-travel: #9dc2ec;
  --c-history: #d3b291;
  --c-it: #b8aef2;
  --c-education: #8fcdd6;
  --c-art: #e6a6d2;

  --sh-1: 0 1px 2px rgba(0, 0, 0, .4);
  --sh-2: 0 2px 10px rgba(0, 0, 0, .45);
  --sh-3: 0 14px 36px rgba(0, 0, 0, .55);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.85;              /* Thai needs air */
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
  word-break: break-word;
}
@media (min-width: 768px) { body { font-size: 1.125rem; } }

img, picture, video, svg, canvas { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand-ink); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--brand-hover); }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-wrap: balance;
}

h1 { font-size: clamp(1.7rem, 6vw, 2.85rem); line-height: 1.28; font-weight: 800; }
h2 { font-size: clamp(1.35rem, 4.2vw, 1.9rem); }
h3 { font-size: clamp(1.15rem, 3.4vw, 1.4rem); }

::selection { background: var(--brand); color: #fff; }

/* ---------- Utilities ---------- */
.shell { width: 100%; max-width: var(--wide); margin-inline: auto; padding-inline: var(--gutter); }
.stack > * + * { margin-top: var(--gap, 1rem); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 200;
  background: var(--brand); color: #fff; padding: .6rem 1rem;
  border-radius: var(--r-sm); font-weight: 600; text-decoration: none;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 8px; color: #fff; }

.eyebrow {
  font-family: var(--font-head);
  font-size: .75rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
@supports not (backdrop-filter: blur(1px)) { .site-header { background: var(--paper); } }

.header-bar {
  display: flex; align-items: center; gap: .5rem;
  height: var(--header-h);
}

.brand {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-head); font-weight: 800;
  font-size: 1.35rem; letter-spacing: -.02em;
  color: var(--ink); text-decoration: none; margin-inline-end: auto;
}
.brand:hover { color: var(--ink); }
.brand-mark {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), #e0805f);
  color: #fff; font-size: .95rem; font-weight: 800;
  box-shadow: 0 2px 8px var(--brand-ring);
  flex: none;
}
.brand-name-th { font-size: 1.3rem; }
.brand-name-en {
  font-family: var(--font-head); font-size: .62rem; font-weight: 700;
  letter-spacing: .22em; text-transform: uppercase; color: var(--muted);
  display: none;
}
@media (min-width: 480px) { .brand-name-en { display: inline; } }

.icon-btn {
  display: grid; place-items: center;
  width: 40px; height: 40px; flex: none;
  border: 1px solid transparent; border-radius: var(--r-md);
  background: transparent; color: var(--ink-2); cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn svg { width: 21px; height: 21px; }

/* Category rail — horizontal scroll on mobile, the 2026 pattern */
.cat-rail {
  display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none;
  padding: 0 var(--gutter) .6rem;
  margin-inline: calc(var(--gutter) * -1);
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.cat-rail::-webkit-scrollbar { display: none; }
.cat-chip {
  flex: none; scroll-snap-align: start;
  padding: .34rem .8rem;
  border: 1px solid var(--border); border-radius: var(--r-pill);
  background: var(--surface);
  font-family: var(--font-head); font-size: .82rem; font-weight: 600;
  color: var(--ink-2); text-decoration: none; white-space: nowrap;
  transition: all .15s var(--ease);
}
.cat-chip:hover { border-color: var(--border-strong); color: var(--ink); }
.cat-chip[aria-current="page"] {
  background: var(--ink); border-color: var(--ink); color: var(--paper);
}

/* Mobile drawer */
.drawer {
  position: fixed; inset: 0; z-index: 150;
  visibility: hidden; opacity: 0;
  transition: opacity .22s var(--ease), visibility .22s var(--ease);
}
.drawer[data-open="true"] { visibility: visible; opacity: 1; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(10, 10, 12, .5); }
.drawer-panel {
  position: absolute; inset-block: 0; inset-inline-end: 0;
  width: min(20rem, 86vw); background: var(--paper);
  border-inline-start: 1px solid var(--border);
  padding: 1rem var(--gutter) 2rem;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform .26s var(--ease);
  display: flex; flex-direction: column; gap: .25rem;
}
.drawer[data-open="true"] .drawer-panel { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); margin-bottom: .5rem; }
.drawer-link {
  display: flex; align-items: center; gap: .7rem;
  padding: .7rem .6rem; border-radius: var(--r-md);
  font-family: var(--font-head); font-weight: 600; font-size: 1rem;
  color: var(--ink); text-decoration: none;
}
.drawer-link:hover { background: var(--surface-2); color: var(--ink); }
.drawer-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--dot, var(--brand)); }
.drawer-sep { height: 1px; background: var(--border); margin: .75rem 0; }

/* ---------- Search ---------- */
.search-wrap { position: relative; }
.search-panel {
  position: fixed; inset-block-start: 0; inset-inline: 0; z-index: 160;
  background: var(--paper); border-bottom: 1px solid var(--border);
  padding: .75rem 0 1rem; box-shadow: var(--sh-3);
  display: none;
}
.search-panel[data-open="true"] { display: block; }
.search-field {
  display: flex; align-items: center; gap: .6rem;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-pill); padding: .55rem .95rem;
}
.search-field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.search-field input {
  flex: 1; border: 0; background: transparent; outline: none;
  font-size: 1rem; min-width: 0;
}
.search-results { margin-top: .75rem; max-height: 60vh; overflow-y: auto; }
.search-hit {
  display: block; padding: .65rem .5rem; border-radius: var(--r-sm);
  text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--border);
}
.search-hit:hover { background: var(--surface-2); color: var(--ink); }
.search-hit strong { font-family: var(--font-head); font-weight: 600; display: block; font-size: .98rem; line-height: 1.5; }
.search-hit span { font-size: .8rem; color: var(--muted); }

/* ---------- Cards ---------- */
.card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
@media (hover: hover) {
  .card:hover { transform: translateY(-3px); box-shadow: var(--sh-3); border-color: var(--border-strong); }
}
.card-media { position: relative; aspect-ratio: 16 / 10; background: var(--surface-2); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: .9rem 1rem 1.1rem; display: flex; flex-direction: column; gap: .45rem; flex: 1; }
.card-title {
  font-family: var(--font-head); font-weight: 700;
  font-size: 1.02rem; line-height: 1.45; letter-spacing: -.005em;
}
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a:hover { color: var(--brand-ink); }
.card-excerpt { font-size: .9rem; line-height: 1.7; color: var(--muted); }
.card-meta {
  margin-top: auto; padding-top: .35rem;
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  font-size: .76rem; color: var(--muted-2);
}
.card-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }

.tag {
  display: inline-flex; align-items: center; gap: .35rem;
  font-family: var(--font-head); font-size: .72rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--cat, var(--brand-ink)); text-decoration: none;
}
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
a.tag:hover { color: var(--cat, var(--brand-ink)); text-decoration: underline; }

/* Card grid */
.grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 1.15rem; } }
@media (min-width: 1000px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } }

/* Compact list row (mobile-friendly, dense) */
.row-list { display: flex; flex-direction: column; }
.row {
  display: grid; grid-template-columns: 1fr 92px; gap: .9rem; align-items: start;
  padding: .95rem 0; border-bottom: 1px solid var(--border);
  text-decoration: none;
}
.row:last-child { border-bottom: 0; }
.row-thumb { aspect-ratio: 1 / 1; border-radius: var(--r-md); overflow: hidden; background: var(--surface-2); }
.row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.row h3 { font-size: .98rem; line-height: 1.5; color: var(--ink); font-weight: 600; }
.row:hover h3 { color: var(--brand-ink); }
.row .card-meta { margin-top: .35rem; }
@media (min-width: 560px) { .row { grid-template-columns: 1fr 120px; } }

/* ---------- Hero ---------- */
.hero { padding: 1.5rem 0 .5rem; }
.hero-card {
  position: relative; display: block; border-radius: var(--r-xl);
  overflow: hidden; text-decoration: none; background: var(--surface-3);
  aspect-ratio: 4 / 3;
}
@media (min-width: 720px) { .hero-card { aspect-ratio: 21 / 9; } }
.hero-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-veil {
  position: absolute; inset: 0;
  /* plum-tinted rather than black: a neutral scrim turns the pastel cover
     muddy, this one reads as a deeper shade of the same palette */
  background: linear-gradient(180deg, rgba(47,42,53,0) 34%, rgba(47,42,53,.58) 68%, rgba(47,42,53,.92) 100%);
}
.hero-text { position: absolute; inset-inline: 0; inset-block-end: 0; padding: 1.25rem; }
@media (min-width: 720px) { .hero-text { padding: 2rem 2.25rem; max-width: 42rem; } }
.hero-text h2 {
  color: #fff; font-size: clamp(1.3rem, 4.6vw, 2.15rem);
  line-height: 1.32; margin-top: .5rem; font-weight: 800;
}
.hero-text .tag { color: #f6c9d5; }
.hero-text p { color: rgba(255,255,255,.82); font-size: .92rem; margin-top: .5rem; display: none; }
@media (min-width: 720px) { .hero-text p { display: block; } }

/* ---------- Sections ---------- */
.section { padding: 2rem 0; }
@media (min-width: 768px) { .section { padding: 2.75rem 0; } }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.15rem;
}
.section-head h2 { font-size: clamp(1.25rem, 3.6vw, 1.6rem); }
.section-head a { font-family: var(--font-head); font-size: .85rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.section-head a:hover { text-decoration: underline; }
.rule { height: 1px; background: var(--border); border: 0; }

/* ---------- Article ---------- */
.article-shell { max-width: var(--wide); margin-inline: auto; padding-inline: var(--gutter); }
@media (min-width: 1080px) {
  .article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 3rem; align-items: start; }
}

.article-head { padding: 1.5rem 0 1rem; max-width: var(--measure); }
.article-head h1 { margin: .6rem 0 .75rem; }
.article-dek { font-size: 1.05rem; line-height: 1.8; color: var(--muted); }
.article-meta {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border);
  font-size: .82rem; color: var(--muted);
}
.byline { display: flex; align-items: center; gap: .55rem; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--brand), #e0805f);
  display: grid; place-items: center; color: #fff;
  font-family: var(--font-head); font-weight: 800; font-size: .8rem;
}
.byline b { font-family: var(--font-head); font-weight: 600; color: var(--ink-2); font-size: .85rem; }

.figure-hero { margin: 1.25rem 0 1.5rem; }
.figure-hero img {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: var(--r-lg); background: var(--surface-2);
}
.figure img { width: 100%; border-radius: var(--r-lg); background: var(--surface-2); }
.figure { margin: 1.75rem 0; }
figcaption {
  margin-top: .55rem; font-size: .8rem; line-height: 1.65;
  color: var(--muted-2); text-align: center;
}

/* Prose */
.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1.15rem; }
.prose p { line-height: 1.92; color: var(--ink-2); }
.prose h2 {
  margin-top: 2.5rem; padding-top: .25rem;
  font-size: clamp(1.28rem, 4vw, 1.6rem);
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.prose h3 { margin-top: 1.9rem; font-size: clamp(1.08rem, 3.2vw, 1.28rem); }
.prose h2 + p, .prose h3 + p { margin-top: .7rem; }
.prose ul, .prose ol { padding-inline-start: 1.35rem; }
.prose li { margin-top: .55rem; line-height: 1.85; color: var(--ink-2); }
.prose li::marker { color: var(--brand); font-weight: 700; }
.prose strong { font-weight: 600; color: var(--ink); }
.prose blockquote {
  margin: 1.75rem 0; padding: 1rem 1.15rem;
  border-inline-start: 3px solid var(--brand);
  background: var(--brand-wash); border-radius: 0 var(--r-md) var(--r-md) 0;
  font-size: 1.02rem; color: var(--ink-2);
}
.prose blockquote p { margin: 0; }
.prose hr { margin: 2.25rem 0; height: 1px; background: var(--border); border: 0; }
.prose a { font-weight: 500; }
.prose code {
  font-family: var(--font-mono); font-size: .88em;
  background: var(--surface-2); border: 1px solid var(--border);
  padding: .12em .38em; border-radius: 6px;
}
.prose table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table-scroll { overflow-x: auto; margin: 1.5rem 0; -webkit-overflow-scrolling: touch; }
.prose th, .prose td { padding: .7rem .8rem; border-bottom: 1px solid var(--border); text-align: start; }
.prose th { font-family: var(--font-head); font-weight: 700; font-size: .85rem; background: var(--surface-2); white-space: nowrap; }

/* Key takeaways */
.keypoints {
  margin: 1.75rem 0; padding: 1.1rem 1.2rem;
  background: var(--teal-wash); border: 1px solid color-mix(in srgb, var(--teal) 22%, transparent);
  border-radius: var(--r-lg);
}
.keypoints h3 {
  font-size: .82rem; letter-spacing: .09em; text-transform: uppercase;
  color: var(--teal); margin: 0 0 .6rem;
}
.keypoints ul { margin: 0; padding-inline-start: 1.15rem; }
.keypoints li { font-size: .95rem; line-height: 1.75; }
.keypoints li::marker { color: var(--teal); }

/* Callout */
.callout {
  margin: 1.75rem 0; padding: 1rem 1.15rem;
  background: var(--gold-wash); border: 1px solid color-mix(in srgb, var(--gold) 25%, transparent);
  border-radius: var(--r-lg); font-size: .96rem; line-height: 1.8;
}
.callout b { font-family: var(--font-head); color: var(--gold); }

/* Table of contents */
.toc {
  margin: 1.5rem 0; border: 1px solid var(--border);
  border-radius: var(--r-lg); background: var(--surface); overflow: hidden;
}
.toc > summary {
  padding: .85rem 1.1rem; cursor: pointer; list-style: none;
  font-family: var(--font-head); font-weight: 700; font-size: .95rem;
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
}
.toc > summary::-webkit-details-marker { display: none; }
.toc > summary::after {
  content: ""; width: 8px; height: 8px; flex: none;
  border-inline-end: 2px solid var(--muted); border-block-end: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-2px); transition: transform .2s var(--ease);
}
.toc[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
/* Headings often start with their own number ("## 1. ..."), so the list must
   not add a second one. */
.toc ol { margin: 0; padding: 0 1.1rem 1rem; list-style: none; }
.toc li { margin-top: .4rem; font-size: .92rem; line-height: 1.6; }
.toc li a { display: block; padding-inline-start: .9rem; text-indent: -.9rem; }
.toc li a::before { content: "›"; color: var(--brand); margin-inline-end: .45rem; font-weight: 700; }
.toc a { color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--brand-ink); text-decoration: underline; }

/* Share row */
.share { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: 1.25rem 0; }
.share-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .48rem .85rem; border-radius: var(--r-pill);
  border: 1px solid var(--border); background: var(--surface);
  font-family: var(--font-head); font-size: .82rem; font-weight: 600;
  color: var(--ink-2); text-decoration: none; cursor: pointer;
  transition: all .15s var(--ease);
}
.share-btn:hover { background: var(--surface-2); color: var(--ink); border-color: var(--border-strong); }
.share-btn svg { width: 16px; height: 16px; }
.share-label { font-size: .78rem; color: var(--muted); margin-inline-end: .15rem; }

/* FAQ */
.faq { margin: 2rem 0; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item > summary {
  padding: .95rem 0; cursor: pointer; list-style: none;
  font-family: var(--font-head); font-weight: 600; font-size: 1rem; line-height: 1.6;
  display: flex; gap: .75rem; align-items: flex-start; justify-content: space-between;
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::after {
  content: "+"; flex: none; font-size: 1.2rem; color: var(--brand);
  line-height: 1.4; transition: transform .2s var(--ease);
}
.faq-item[open] > summary::after { transform: rotate(45deg); }
.faq-item p { padding-bottom: 1rem; font-size: .96rem; color: var(--muted); line-height: 1.85; }

/* ---------- Affiliate product card ---------- */
.pcard {
  margin: 1.85rem 0; border: 1px solid var(--border);
  border-radius: var(--r-lg); background: var(--surface);
  overflow: hidden; box-shadow: var(--sh-1);
}
.pcard-flag {
  display: flex; align-items: center; gap: .4rem;
  padding: .45rem .95rem; background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-head); font-size: .68rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.pcard-body { padding: 1rem; display: grid; gap: .9rem; grid-template-columns: 84px 1fr; align-items: start; }
@media (min-width: 560px) { .pcard-body { grid-template-columns: 116px 1fr; padding: 1.15rem; } }
.pcard-img {
  aspect-ratio: 1/1; border-radius: var(--r-md); overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--border);
}
.pcard-img img { width: 100%; height: 100%; object-fit: cover; }
.pcard h4 { font-family: var(--font-head); font-size: 1rem; line-height: 1.5; font-weight: 700; }
.pcard p { font-size: .89rem; line-height: 1.7; color: var(--muted); margin-top: .35rem; }
.pcard-why { font-size: .85rem; margin-top: .5rem; color: var(--ink-2); }
.pcard-why b { font-family: var(--font-head); color: var(--teal); }
.pcard-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .85rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .62rem 1.05rem; border-radius: var(--r-pill);
  font-family: var(--font-head); font-weight: 700; font-size: .87rem;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: all .16s var(--ease); white-space: nowrap;
}
.btn-shopee { background: #c9421f; color: #fff; }
.btn-shopee:hover { background: #ad3517; color: #fff; transform: translateY(-1px); }
.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-brand { background: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-hover); color: #fff; }
.btn-lg { padding: .8rem 1.5rem; font-size: .95rem; }
.btn-block { width: 100%; }

/* Comparison / pick list */
.picks { margin: 1.85rem 0; display: grid; gap: .75rem; }
.pick {
  display: grid; grid-template-columns: auto 1fr auto; gap: .8rem; align-items: center;
  padding: .85rem 1rem; border: 1px solid var(--border);
  border-radius: var(--r-md); background: var(--surface); text-decoration: none;
}
.pick:hover { border-color: var(--brand); background: var(--brand-wash); }
.pick-rank {
  width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--ink); color: var(--paper);
  font-family: var(--font-head); font-weight: 800; font-size: .78rem;
}
.pick b { display: block; font-family: var(--font-head); font-size: .95rem; color: var(--ink); line-height: 1.5; }
.pick span { font-size: .81rem; color: var(--muted); }
.pick-go { font-size: .8rem; font-weight: 700; color: var(--brand-ink); font-family: var(--font-head); }

/* ---------- Ad slots (CLS-safe: height reserved) ---------- */
.ad {
  margin: 2rem auto; display: flex; flex-direction: column; align-items: center;
  gap: .3rem; max-width: 100%; overflow: hidden;
}
.ad::before {
  content: "โฆษณา";
  font-family: var(--font-head); font-size: .62rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--muted-2);
}
.ad-inner {
  width: 100%; display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border-radius: var(--r-md);
  overflow: hidden;
}
.ad-inarticle .ad-inner { min-height: 280px; }
.ad-top .ad-inner { min-height: 100px; }
.ad-feed .ad-inner { min-height: 250px; }
.ad-side .ad-inner { min-height: 600px; }
.ad ins { display: block; width: 100%; }
/* When ads are not yet approved / blocked, the grey box is invisible rather than ugly */
.ad-inner:empty, .ad-inner:has(ins[data-ad-status="unfilled"]) { background: transparent; min-height: 0 !important; }
.ad:has(.ad-inner:empty)::before { content: none; }

/* ---------- Sidebar ---------- */
.sidebar { display: none; }
@media (min-width: 1080px) {
  .sidebar { display: block; position: sticky; top: calc(var(--header-h) + 1.5rem); }
}
.side-box {
  border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--surface); padding: 1.1rem; margin-bottom: 1.25rem;
}
.side-box h3 { font-size: .82rem; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin-bottom: .85rem; }
.side-list { display: flex; flex-direction: column; gap: .8rem; }
.side-item { display: grid; grid-template-columns: 26px 1fr; gap: .7rem; text-decoration: none; align-items: start; }
.side-item i {
  font-style: normal; font-family: var(--font-head); font-weight: 800;
  font-size: 1.1rem; color: var(--border-strong); line-height: 1.2;
}
.side-item b { font-family: var(--font-head); font-weight: 600; font-size: .89rem; line-height: 1.55; color: var(--ink); }
.side-item:hover b { color: var(--brand-ink); }

/* ---------- Newsletter / follow CTA ---------- */
.cta-band {
  margin: 2.5rem 0; padding: 1.5rem 1.25rem;
  border-radius: var(--r-xl); text-align: center;
  background: linear-gradient(135deg, var(--brand-wash), var(--surface-2));
  border: 1px solid var(--border);
}
.cta-band h3 { font-size: 1.15rem; margin-bottom: .4rem; }
.cta-band p { font-size: .92rem; color: var(--muted); margin-bottom: 1rem; }
.cta-actions { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }

/* ---------- Related ---------- */
.related { margin-top: 2.5rem; padding-top: 1.75rem; border-top: 1px solid var(--border); }


/* ---------- Disclosure strip ---------- */
.disclosure {
  margin: 1.5rem 0; padding: .7rem .95rem;
  background: var(--surface-2); border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
  font-size: .8rem; line-height: 1.7; color: var(--muted);
}
.disclosure b { color: var(--ink-2); font-family: var(--font-head); }

/* ---------- Reading progress ---------- */
.progress {
  position: fixed; inset-block-start: 0; inset-inline-start: 0; z-index: 110;
  height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--brand-pastel), var(--brand));
  transition: width .1s linear;
}

/* ---------- Pagination ---------- */
.pager { display: flex; gap: .5rem; justify-content: center; align-items: center; margin: 2.25rem 0 1rem; flex-wrap: wrap; }
.pager a, .pager span {
  min-width: 40px; padding: .5rem .8rem; text-align: center;
  border: 1px solid var(--border); border-radius: var(--r-md);
  font-family: var(--font-head); font-weight: 600; font-size: .88rem;
  text-decoration: none; color: var(--ink-2); background: var(--surface);
}
.pager a:hover { border-color: var(--brand); color: var(--brand-ink); }
.pager [aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* ---------- Category header ---------- */
.cat-hero { padding: 1.75rem 0 1.25rem; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.cat-hero h1 { display: flex; align-items: center; gap: .6rem; }
.cat-hero .cat-swatch { width: 12px; height: 34px; border-radius: 4px; background: var(--cat, var(--brand)); flex: none; }
.cat-hero p { margin-top: .75rem; color: var(--muted); max-width: var(--measure); font-size: .98rem; }

/* ---------- Legacy / notice page ---------- */
.notice-wrap { max-width: 34rem; margin: 3rem auto; text-align: center; padding-inline: var(--gutter); }
.notice-wrap h1 { font-size: clamp(1.4rem, 5vw, 2rem); margin-bottom: .8rem; }
.notice-wrap p { color: var(--muted); margin-bottom: 1.5rem; }
.notice-links { display: grid; gap: .6rem; text-align: start; margin-top: 1.5rem; }

/* ---------- Print ---------- */
@media print {
  .site-header, .ad, .share, .sidebar, .cta-band, .drawer, .progress { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
}

/* ---------- Drawer disclosure ---------- */
.drawer-note {
  margin-top: 1.1rem; padding-top: .9rem; border-top: 1px solid var(--border);
  font-size: .78rem; line-height: 1.7; color: var(--muted-2);
}

/* ---------- Product price line ---------- */
.pcard-price { font-size: .85rem; color: var(--muted); margin-top: .3rem; }
.pcard-asof { color: var(--muted-2); font-size: .78rem; }
