/* Thai Phrases — Guides system styles.
   ==========================================================================
   This file defines layout only. Every colour, radius, shadow and font is a
   token from styles.css, so the OS dark fallback and the explicit dark choice
   repoint this stylesheet automatically. Do not add hard-coded colours here:
   scripts/css_check.py rejects undefined var() and the site's dark-mode
   parity check would then drift.
   ========================================================================== */

.guide-main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 16px 64px;
}
.guide-article { min-width: 0; }
.guide-skip { color: var(--accent-text); }

/* --- masthead ----------------------------------------------------------- */
.guide-hero { padding: 12px 0 20px; }
.guide-eyebrow {
  margin: 0 0 10px;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--accent-text);
}
.guide-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4.5vw, 2.65rem);
  line-height: 1.22;
  margin: 0 0 12px;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.guide-lead {
  margin: 0;
  max-width: 760px;
  font-size: 1.08rem;
  line-height: 1.72;
  color: var(--ink-soft);
}
.guide-dates {
  margin: 14px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: .84rem;
  color: var(--ink-faint);
}
.guide-dates b { color: var(--ink-soft); font-weight: 700; }
.guide-placeholder-note {
  margin: 18px 0 0;
  padding: 12px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--gold-light);
  color: var(--ink-soft);
  font-size: .92rem;
  line-height: 1.65;
}

/* --- fact check strip --------------------------------------------------- */
.guide-factcheck {
  margin: 8px 0 28px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal-text);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.guide-factcheck h2 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-family: var(--font-display);
  color: var(--ink);
}
.guide-factcheck dl {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  font-size: .9rem;
}
.guide-factcheck dt {
  font-weight: 700;
  color: var(--ink-soft);
}
.guide-factcheck dd { margin: 0; color: var(--ink); }
.guide-sources {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: .88rem;
}
.guide-sources a { color: var(--accent-text); text-decoration: underline; }
.guide-factcheck-note {
  margin: 10px 0 0;
  font-size: .84rem;
  color: var(--ink-faint);
}

/* --- body grid + auto table of contents --------------------------------- */
.guide-body-grid {
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}
.guide-toc {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.guide-toc h2 {
  margin: 0 0 10px;
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.guide-toc ol { margin: 0; padding-left: 1.15rem; }
.guide-toc li { margin: 6px 0; line-height: 1.45; }
.guide-toc a {
  color: var(--ink-soft);
  font-size: .9rem;
  text-decoration: none;
}
.guide-toc a:hover,
.guide-toc a:focus-visible,
.guide-toc a.is-active { color: var(--accent-text); text-decoration: underline; }
.guide-content { min-width: 0; }
.guide-section { margin: 0 0 38px; scroll-margin-top: calc(var(--header-h) + 16px); }
.guide-section > h2 {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.6vw, 1.6rem);
  line-height: 1.3;
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
  overflow-wrap: anywhere;
}

/* --- the four block types ---------------------------------------------- */
.guide-p {
  margin: 0 0 14px;
  line-height: 1.78;
  color: var(--ink);
}
.guide-list { margin: 0 0 16px; padding-left: 1.4rem; line-height: 1.75; }
.guide-list li { margin: 6px 0; }
.guide-table-wrap { width: 100%; overflow-x: auto; margin: 0 0 18px; }
.guide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .94rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.guide-table caption {
  caption-side: top;
  text-align: left;
  padding: 0 0 8px;
  font-size: .85rem;
  color: var(--ink-faint);
}
.guide-table th,
.guide-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
  line-height: 1.6;
}
.guide-table thead th {
  background: var(--accent-light);
  color: var(--ink);
  font-weight: 800;
  font-size: .84rem;
}
.guide-table tbody tr:last-child td { border-bottom: 0; }
.guide-callout {
  margin: 0 0 16px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--card);
}
.guide-callout h3 {
  margin: 0 0 6px;
  font-size: .98rem;
  font-family: var(--font-display);
  color: var(--ink);
}
.guide-callout p { margin: 0; font-size: .94rem; line-height: 1.7; color: var(--ink-soft); }
.guide-callout--note { border-left-color: var(--teal-text); }
.guide-callout--tip { border-left-color: var(--good-text); }
.guide-callout--warning { border-left-color: var(--bad-text); }

/* --- affiliate slot ----------------------------------------------------- */
.guide-affiliate {
  margin: 12px 0 30px;
  padding: 18px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--card);
}
.guide-affiliate h2 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-family: var(--font-display);
  color: var(--ink);
}
.guide-affiliate-link {
  display: inline-block;
  font-weight: 700;
  color: var(--accent-text);
  text-decoration: underline;
}
.guide-affiliate-note {
  margin: 10px 0 0;
  font-size: .85rem;
  color: var(--ink-faint);
  line-height: 1.65;
}

/* --- fixed "Say it in Thai" module -------------------------------------- */
.guide-sayit {
  margin: 0 0 30px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow);
}
.guide-sayit h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--ink);
}
.guide-sayit > p {
  margin: 0 0 16px;
  color: var(--ink-soft);
  line-height: 1.7;
}
.guide-sayit-label {
  margin: 16px 0 8px;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.guide-sayit-links { display: flex; flex-wrap: wrap; gap: 10px; }
.guide-sayit-links a {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-panel);
  color: var(--ink);
  font-size: .92rem;
  text-decoration: none;
}
.guide-sayit-links a:hover,
.guide-sayit-links a:focus-visible {
  border-color: var(--accent);
  color: var(--accent-text);
}
.guide-sayit-links a.is-primary {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent-text);
  font-weight: 700;
}

/* --- same-cluster pager ------------------------------------------------- */
.guide-pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 22px;
}
.guide-pager-slot {
  display: block;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  text-decoration: none;
  min-width: 0;
}
a.guide-pager-slot:hover,
a.guide-pager-slot:focus-visible { border-color: var(--accent); }
.guide-pager-slot.is-empty { opacity: .78; }
.guide-pager-kicker {
  display: block;
  font-size: .76rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 4px;
}
.guide-pager-title {
  display: block;
  font-size: .95rem;
  line-height: 1.5;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.guide-pager-empty { color: var(--ink-faint); font-size: .88rem; }
.guide-pager-back { font-size: .9rem; color: var(--accent-text); }

/* --- hub ---------------------------------------------------------------- */
.guide-hub-lead { max-width: 760px; }
.guide-cluster { margin: 26px 0 34px; }
.guide-cluster > h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin: 0 0 14px;
  color: var(--ink);
}
.guide-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.guide-card {
  display: block;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}
.guide-card:hover,
.guide-card:focus-visible { border-color: var(--accent); box-shadow: var(--shadow-md); }
.guide-card h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.08rem;
  line-height: 1.4;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.guide-card p {
  margin: 0 0 10px;
  font-size: .92rem;
  line-height: 1.65;
  color: var(--ink-soft);
}
.guide-card-cta { font-size: .86rem; font-weight: 700; color: var(--accent-text); }

/* --- shared chrome ------------------------------------------------------ */
.guide-nav { display: flex; gap: 14px; flex-wrap: wrap; font-size: .94rem; }
.guide-nav a { color: var(--ink); text-decoration: none; }
.guide-nav a:hover,
.guide-nav a:focus-visible { color: var(--accent-text); text-decoration: underline; }
.guide-footer {
  border-top: 1px solid var(--line);
  background: var(--card);
}
.guide-footer-inner { max-width: 1040px; margin: 0 auto; padding: 20px 16px; }
.guide-footer-small { margin: 0 0 8px; font-size: .84rem; color: var(--ink-faint); }
.guide-footer-legal { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: .84rem; }
.guide-footer-legal a { color: var(--accent-text); }

@media (max-width: 860px) {
  .guide-body-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .guide-toc { position: static; }
}
@media (max-width: 560px) {
  .guide-pager { grid-template-columns: minmax(0, 1fr); }
  .guide-sayit { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .guide-card, .guide-sayit-links a, .guide-pager-slot { transition: none; }
}

/* Guide images (brief 08): never overflow narrow screens; caption sits quiet. */
.guide-figure { margin: 20px 0; }
.guide-figure img { display: block; max-width: 100%; height: auto; border-radius: 12px; }
.guide-figcaption { margin-top: 6px; opacity: .75; }
