/* ══════════════════════════════════════════
   GUIDES — /guides and /guides/<slug>
   Loaded after site.css; tokens, nav, buttons and footer come from there.
   A reading surface: one measured column on chalk, oxblood headings, tables that hold up.
   ══════════════════════════════════════════ */

:root {
  --measure: 42rem;
}

.guide-main a:focus-visible,
.guide-main [tabindex]:focus-visible {
  outline: 2px solid var(--ox);
  outline-offset: 3px;
  border-radius: 3px;
}

.guide-main {
  padding: 72px var(--pad) 128px;
}

.guide-column {
  max-width: var(--measure);
  margin: 0 auto;
}

/* ── Breadcrumb ── */
.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 28px;
}
.crumbs li { display: inline; }
.crumbs li + li::before {
  content: "/";
  margin: 0 0.6rem;
  color: var(--coral);
}
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ox); text-decoration: underline; }
.crumbs [aria-current] {
  color: var(--ox);
  max-width: 28ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Header ── */
.guide-header h1,
.guide-index-title {
  font-size: clamp(36px, 4.6vw, 58px);
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: var(--ox);
  margin-bottom: 28px;
}

/* The direct answer: the paragraph an AI engine or a skimming reader quotes. */
.answer {
  font-size: clamp(20px, 2vw, 24px);
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-wrap: pretty;
}

.byline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  margin-top: 32px;
  padding: 16px 0;
  border-top: 3px solid var(--ox);
  border-bottom: 1px solid var(--rule-light);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-soft);
}
.byline .author-name { color: var(--ox); font-weight: 500; }
.byline time { font-variant-numeric: tabular-nums; }
.byline .byline-ai-note { flex-basis: 100%; }
.byline [hidden] { display: none; }

.disclosure,
.meta-line {
  margin-top: 16px;
  font-size: 15px;
  color: var(--ink-soft);
}

/* ── Body ── */
.guide-body {
  font-size: 18px;
  line-height: 1.7;
}

.guide-body h2 {
  font-size: clamp(26px, 2.6vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin: 64px 0 16px;
  scroll-margin-top: 24px;
}

.guide-body h3 {
  font-size: 20px;
  margin: 32px 0 8px;
}

.guide-body p,
.guide-body ul,
.guide-body ol { margin-bottom: 20px; }
.guide-body ul { padding-left: 1.3rem; list-style: square; }
.guide-body ol { padding-left: 1.5rem; list-style: decimal; }
.guide-body li { margin-bottom: 8px; }
.guide-body li::marker { color: var(--coral); }
.guide-body strong { color: var(--ox); font-weight: 600; }

.guide-body a {
  color: var(--ox);
  text-decoration: underline;
  text-decoration-color: var(--coral);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.guide-body a:hover { text-decoration-thickness: 2px; }

.guide-body code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: rgba(84, 44, 48, 0.07);
  color: var(--ox);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

/* Inline citation: a superscript that jumps to the Sources list. */
.guide-body sup.cite {
  font-size: 0.7em;
  line-height: 0;
  margin-left: 0.1em;
}
.guide-body sup.cite a {
  font-family: var(--mono);
  color: #9C5A53;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  padding: 0 0.1em;
}
.guide-body sup.cite a::before { content: "["; }
.guide-body sup.cite a::after { content: "]"; }
.guide-body sup.cite a:hover { color: var(--ox); text-decoration: underline; }

/* ── Original analysis ── */
.original {
  margin: 48px 0;
  padding: 28px 28px 8px;
  background: var(--peach);
  border-radius: 8px;
}
.guide-body .original h2 {
  margin-top: 0;
  font-size: 22px;
}
.original-method {
  font-size: 15px;
  color: var(--ink-soft);
}

/* ── Tables ── */
.table-wrap {
  margin: 28px 0 32px;
  overflow-x: auto;
  border-top: 3px solid var(--ox);
  border-bottom: 1px solid var(--rule-light);
}

.guide-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
.guide-body caption {
  caption-side: top;
  text-align: left;
  padding: 12px 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--rule-light);
}
.guide-body th,
.guide-body td {
  padding: 12px 16px 12px 0;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--rule-light);
  min-width: 9rem;
}
.guide-body thead th {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--ox);
  white-space: nowrap;
}
.guide-body tbody th {
  color: var(--ox);
  font-weight: 500;
  position: sticky;
  left: 0;
  background: var(--chalk);
}
.guide-body tbody tr:last-child th,
.guide-body tbody tr:last-child td { border-bottom: none; }

/* Opt-in for tables with 4+ columns: on wide screens they step out of the reading
   measure so every column shows without sideways scrolling. Below 1024px they scroll. */
@media (min-width: 1024px) {
  .table-wrap--wide {
    position: relative;
    left: 50%;
    width: min(60rem, calc(100vw - 4rem));
    transform: translateX(-50%);
  }
}

/* ── Steps (optional HowTo) ── */
.guide-body ol.steps {
  list-style: none;
  padding: 0;
  counter-reset: step;
}
.guide-body ol.steps > li {
  counter-increment: step;
  position: relative;
  padding: 16px 0 0 56px;
  margin-bottom: 24px;
  border-top: 1px solid var(--rule-light);
}
.guide-body ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 12px;
  font: 500 32px/1 var(--sans);
  letter-spacing: -0.04em;
  color: var(--ox);
}
.guide-body ol.steps h3 { margin-top: 0; }

/* ── FAQ: always visible, never collapsed ── */
.guide-faq .faq-entry {
  padding: 20px 0;
  border-top: 1px solid var(--rule-light);
}
.guide-faq .faq-entry:first-of-type { border-top: 3px solid var(--ox); }
.guide-faq .faq-entry:last-child { border-bottom: 1px solid var(--rule-light); }
.guide-faq h3 { margin: 0 0 6px; font-size: 19px; }
.guide-faq .faq-a p { margin-bottom: 8px; }
.guide-faq .faq-a p:last-child { margin-bottom: 0; }

/* ── CTA: a small oxblood plate ── */
.guide-cta {
  margin: 56px 0;
  padding: 32px;
  background: var(--ox);
  color: var(--chalk);
  border-radius: 8px;
}
.guide-body .guide-cta h2 { margin-top: 0; font-size: 26px; color: var(--chalk); }
.guide-cta p { color: var(--on-dark-soft); }
.guide-body .guide-cta .btn { color: var(--ink); text-decoration: none; }

/* ── Related + Sources ── */
.guide-body .related h2,
.guide-body .sources h2 { font-size: 20px; margin-top: 40px; }

.related ul { list-style: none; padding: 0; }
.related li { margin-bottom: 8px; }

.sources ol {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-soft);
  padding-left: 1.6rem;
}
.sources li {
  padding: 3px 6px;
  margin-left: -6px;
  border-radius: 4px;
  scroll-margin-top: 24px;
  transition: background-color 0.6s;
}
.sources li::marker { font-family: var(--mono); color: var(--ink-soft); }
.sources li:target { background: var(--peach); color: var(--ink); }
.guide-body .sources a { color: var(--ink); }
.sources time { font-variant-numeric: tabular-nums; }

/* ══════════════════════════════════════════
   INDEX — /guides
   ══════════════════════════════════════════ */
.guide-list {
  margin-top: 48px;
  border-top: 3px solid var(--ox);
}
.guide-row {
  position: relative;
  padding: 28px 0;
  border-bottom: 1px solid var(--rule-light);
}
.guide-row h2 {
  font-size: clamp(22px, 2.2vw, 28px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.guide-row h2 a { text-decoration: none; }
/* The whole row is the link target. */
.guide-row h2 a::after { content: ""; position: absolute; inset: 0; }
.guide-row:hover h2 a { text-decoration: underline; text-decoration-color: var(--coral); }
.guide-row p { color: var(--ink-soft); }
.guide-row-date { margin-top: 10px; font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; }

.guide-empty {
  margin-top: 48px;
  padding: 28px;
  background: var(--peach);
  border-radius: 8px;
}
.guide-empty h2 { font-size: 22px; margin-bottom: 10px; }
.guide-empty-links { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 20px; }
.guide-empty-links a {
  color: var(--ox);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 820px) {
  .guide-main { padding: 48px 20px 96px; }
  .guide-body { font-size: 17px; }
  .original,
  .guide-cta { padding: 24px 20px 8px; }
  .guide-cta { padding-bottom: 24px; }
  .guide-cta .btn { width: 100%; }
  .guide-body th,
  .guide-body td { padding: 10px 12px 10px 0; min-width: 8rem; }
}

@media (prefers-reduced-motion: reduce) {
  .sources li { transition: none; }
}
