/* legal.css — shared stylesheet for /privacy.html and /terms.html
   Design tokens mirror PRD-001 US-002; no import chain required.          */

/* ── Design tokens ──────────────────────────────────────────────────────── */
:root {
  --color-ink-strong:   #051125;
  --color-ink-muted:    #4a5568;
  --color-surface:      #ffffff;
  --color-accent:       #C5A059;
  --color-accent-hover: #b8904a;
  --color-border:       #e2e8f0;
  --color-callout-bg:   #fffbf0;
  --color-future-bg:    #f0f4ff;

  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;

  --radius: 4px;
}

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

/* ── Skip link (visible on focus) ───────────────────────────────────────── */
.skip {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  font-size: 0.875rem;
  font-weight: 600;
  background: var(--color-ink-strong);
  color: var(--color-surface);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  z-index: 9999;
}

.skip:focus {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  outline: 2px solid var(--color-ink-strong);
  outline-offset: 2px;
}

/* ── Body ────────────────────────────────────────────────────────────────── */
body {
  font-family: var(--font-body);
  font-size: 1rem;           /* 16px — WCAG comprehension baseline */
  line-height: 1.75;
  color: var(--color-ink-strong);
  background: var(--color-surface);
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
}

/* ── Page header ─────────────────────────────────────────────────────────── */
.legal-header {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--color-border);
}

.back-link {
  display: inline-block;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  color: var(--color-ink-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.back-link:hover { color: var(--color-accent-hover); }

.page-meta {
  font-size: 0.875rem;
  color: var(--color-ink-muted);
  margin-top: 0.375rem;
}

/* ── Headings ────────────────────────────────────────────────────────────── */
h1 {
  font-size: 2.25rem;        /* 36px — well above 32px minimum */
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-ink-strong);
  margin-bottom: 0.25rem;
}

h2 {
  font-size: 1.375rem;       /* 22px — above 20px minimum */
  font-weight: 700;
  color: var(--color-ink-strong);
  margin: 2.5rem 0 0.75rem;
  padding-bottom: 0.375rem;
  border-bottom: 2px solid var(--color-accent);
}

h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-ink-strong);
  margin: 1.5rem 0 0.5rem;
}

h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-ink-muted);
  margin: 1.25rem 0 0.375rem;
}

/* ── Body text ───────────────────────────────────────────────────────────── */
p { margin-bottom: 1rem; }

ul, ol {
  margin: 0.5rem 0 1rem 1.75rem;
}

li { margin-bottom: 0.375rem; }

a {
  color: var(--color-ink-strong);
  text-underline-offset: 2px;
}

a:hover { color: var(--color-accent-hover); }

address {
  font-style: normal;
  line-height: 1.8;
  margin-bottom: 1rem;
}

/* ── Focus rings (WCAG 2.2 SC 2.4.11) ──────────────────────────────────── */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-ink-strong);
  outline-offset: 2px;
  border-radius: var(--radius);
}

/* ── Table of Contents ───────────────────────────────────────────────────── */
.toc {
  background: var(--color-future-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0 2.5rem;
}

.toc-title {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-ink-muted);
  margin-bottom: 0.75rem;
}

.toc ol {
  margin: 0 0 0 1.25rem;
  padding: 0;
}

.toc li {
  margin-bottom: 0.25rem;
  font-size: 0.9375rem;
}

.toc a {
  text-decoration: none;
  color: var(--color-ink-strong);
}

.toc a:hover { text-decoration: underline; }

/* ── Sections ────────────────────────────────────────────────────────────── */
section { margin-bottom: 0.5rem; }

/* ── Callout (general) ───────────────────────────────────────────────────── */
.callout {
  background: var(--color-callout-bg);
  border-left: 4px solid var(--color-accent);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0 1.5rem;
  font-size: 0.9375rem;
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* Future-note callout variant */
.future-note {
  background: var(--color-future-bg);
  border-left: 4px solid var(--color-ink-strong);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0 1.5rem;
  font-size: 0.9375rem;
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* ── Blockquote — estimator disclaimer (Section 3) ──────────────────────── */
blockquote {
  border-left: 4px solid var(--color-accent-hover);
  background: var(--color-callout-bg);
  margin: 1.25rem 0 1.5rem;
  padding: 1rem 1.25rem;
  line-height: 1.85;
  font-size: 0.9375rem;
  border-radius: 0 var(--radius) var(--radius) 0;
}

blockquote p:last-child { margin-bottom: 0; }

/* ── Tables ──────────────────────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 1rem 0 1.75rem;
}

th {
  background: var(--color-ink-strong);
  color: var(--color-surface);
  padding: 0.625rem 0.875rem;
  text-align: left;
  font-size: 0.875rem;
  font-weight: 600;
}

td {
  padding: 0.5rem 0.875rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

tr:nth-child(even) td { background: #f8f9fa; }

/* ── Footer nav ──────────────────────────────────────────────────────────── */
.legal-footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.875rem;
  color: var(--color-ink-muted);
}

.legal-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-top: 0.75rem;
}

.legal-footer a { color: var(--color-ink-strong); }

/* ── @media: reduced motion ─────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── @media print ────────────────────────────────────────────────────────── */
@media print {
  .skip, .legal-header .back-link, .toc { display: none; }

  body {
    font-size: 11pt;
    max-width: none;
    padding: 0;
    color: #000;
    background: #fff;
  }

  h1 { font-size: 20pt; }
  h2 { font-size: 13pt; page-break-after: avoid; }

  section { page-break-inside: avoid; }

  a { color: #000; text-decoration: none; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 0.8em; }

  blockquote, .callout, .future-note {
    border-left: 2pt solid #000;
    background: none;
    padding-left: 0.75rem;
  }

  a:focus-visible, button:focus-visible { outline: none; }
}
