/*
 * Stylesheet for the static guide pages.
 *
 * These pages are plain HTML in public/, not React routes, so that crawlers
 * which don't execute JavaScript — including most AI answer-engine crawlers —
 * receive the full text. That means Tailwind is unavailable here: the content
 * globs in tailwind.config.ts are `.{ts,tsx}` only, so any utility classes used
 * in an .html file would be purged and the page would render unstyled.
 *
 * The HSL values below are copied from the `:root` block in src/index.css.
 *
 * THIS IS A REAL SYNC OBLIGATION, not a theoretical one. It has already drifted
 * once: an accessibility pass darkened --accent from 45% to 42% and
 * --muted-foreground from 45% to 40% to clear WCAG AA, and these pages kept the
 * old, failing values until someone noticed. If you change a token in
 * src/index.css, change it here in the same commit.
 *
 * Why the duplication exists at all: these are static .html files, and
 * tailwind.config.ts only scans .{ts,tsx}, so Tailwind classes used here would
 * be purged and the pages would render unstyled. That trade-off is also the
 * reason to keep the guide set small.
 */

:root {
  /* Locks the palette, same as src/index.css. Without it, Chrome-on-Android
     auto-dark can force-invert this warm light palette into something we never
     designed or measured. */
  color-scheme: light;

  --background: hsl(30 20% 97%);
  --foreground: hsl(25 20% 15%);
  --card: hsl(30 20% 99%);
  --primary: hsl(25 15% 22%);
  --primary-foreground: hsl(30 20% 97%);
  --muted: hsl(30 15% 93%);
  /* 40%, not 45% — 45% failed AA against --background. */
  --muted-foreground: hsl(25 10% 40%);
  /* 42%, not 45% — white text on 45% measured 4.27:1, below the 4.5:1 AA
     threshold for normal text. At 42% it clears it. */
  --accent: hsl(25 55% 42%);
  --accent-foreground: hsl(0 0% 100%);
  /* Accent as *text* on a dark surface. --accent is far too dark to read there,
     and darkening it further makes it worse, so this is a genuinely separate
     token rather than a reuse. Mirrors --accent-on-dark in src/index.css. */
  --accent-on-dark: hsl(25 55% 65%);
  --border: hsl(30 12% 86%);
  --radius: 0.5rem;
  --shadow-card: 0 2px 12px -2px hsl(25 20% 20% / 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: "Playfair Display", Georgia, serif;
  line-height: 1.2;
  color: var(--foreground);
}

h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  margin: 0 0 0.5rem;
}
h2 {
  font-size: clamp(1.4rem, 3.5vw, 1.85rem);
  margin: 3rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
h3 {
  font-size: 1.2rem;
  margin: 2rem 0 0.5rem;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a:hover {
  text-decoration-thickness: 2px;
}

/* --- Layout ------------------------------------------------------------- */

.site-header {
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 1rem 0;
}
.site-header a {
  color: var(--primary-foreground);
  text-decoration: none;
}
.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  font-size: 0.9rem;
}
.site-header .brand {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  display: inline-block;
}

.wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

main.wrap {
  padding-top: 2.5rem;
  padding-bottom: 3rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.7rem;
  color: var(--muted-foreground);
  margin: 0 0 0.5rem;
}

/* The one-sentence answer at the top of every guide. Answer engines extract
   early, specific sentences — this element exists to be that sentence. */
.answer {
  font-size: 1.15rem;
  font-weight: 500;
  background: var(--muted);
  border-left: 4px solid var(--accent);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.5rem 0 2rem;
}

.note {
  background: var(--muted);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-size: 0.95rem;
  color: var(--muted-foreground);
}

/* --- Tables ------------------------------------------------------------- */
/* Real <table> markup throughout: AI crawlers parse tables reliably and
   styled <div> grids poorly. */

.table-scroll {
  overflow-x: auto;
  margin: 1.5rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  background: var(--card);
  box-shadow: var(--shadow-card);
  border-radius: var(--radius);
  overflow: hidden;
}

caption {
  caption-side: bottom;
  font-size: 0.85rem;
  color: var(--muted-foreground);
  text-align: left;
  padding-top: 0.6rem;
}

th,
td {
  text-align: left;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border);
}

thead th {
  background: var(--primary);
  color: var(--primary-foreground);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

tbody tr:last-child td {
  border-bottom: none;
}

td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

tfoot td {
  font-weight: 700;
  background: var(--muted);
}

/* --- CTA ---------------------------------------------------------------- */

.cta {
  background: var(--primary);
  color: var(--primary-foreground);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin: 3rem 0 0;
  text-align: center;
}
.cta h2 {
  border: none;
  padding: 0;
  margin: 0 0 0.5rem;
  color: var(--primary-foreground);
}
.cta p {
  margin: 0 0 1.25rem;
  opacity: 0.85;
}
.button {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-foreground);
  text-decoration: none;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
}
.button:hover {
  filter: brightness(1.08);
}

/* --- Footer ------------------------------------------------------------- */

.site-footer {
  background: var(--primary);
  color: var(--primary-foreground);
  margin-top: 3rem;
  padding: 2rem 0;
  font-size: 0.9rem;
}
.site-footer a {
  color: var(--primary-foreground);
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  margin-bottom: 1.25rem;
}
.site-footer .fine {
  opacity: 0.6;
  font-size: 0.8rem;
  margin: 0;
}

ul.tight li {
  margin-bottom: 0.4rem;
}
