/* =========================================================================
   Legal Trio + Accessibility + AI Policy — shared layout for legal pages.
   Additive only — does not modify any existing stylesheet.

   Theme: NAVY, matched to the rest of the site (tokens.css):
     - Navy background #0A1A3F, light-slate body, gold #E8B400 accent
     - Anybody (display) for titles/headings, Inter (body) for copy
     - Two-column desktop (≥1024px), single-column mobile
     - Sidebar: 240px, sticky top: 96px, translucent hairline border-right
     - Body: max-width 720px
     - Questions? block: gold-tinted surface, gold left-border 4px
   ========================================================================= */

:root {
  --legal-navy:      #0A1A3F;  /* page background */
  --legal-head:      #F4F6FB;  /* headings / off-white */
  --legal-ink:       #C7CFDD;  /* body copy on navy (AA on navy) */
  --legal-muted:     #8E98AC;  /* secondary / muted */
  --legal-hairline:  rgba(255,255,255,0.10);
  --legal-surface:   rgba(255,255,255,0.04);
  --legal-surface-2: rgba(255,255,255,0.06);
  --legal-accent:    #E8B400;  /* gold — H3, links, accents */
  --legal-accent-hi: #F4C01C;  /* gold hover */
  --legal-lime:      #E8B400;  /* legacy alias kept for existing rules */
  --legal-white:     #FFFFFF;
}

/* Navy page, Inter body — matches the rest of the site. */
body.legal-body {
  background: var(--legal-navy);
  color: var(--legal-ink);
  /* Nav is sticky (in flow) — no body offset needed; .legal has its own top padding. */
  font-family: var(--font-body, "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.legal {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 32px 96px;
}

.legal__crumb {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--legal-muted);
  margin: 0 0 12px;
}
.legal__crumb a {
  color: var(--legal-muted);
  text-decoration: none;
  border-bottom: 1px dotted var(--legal-hairline);
}
.legal__crumb a:hover { color: var(--legal-head); }

.legal__title {
  font-family: var(--font-display, "Anybody", "Inter", sans-serif);
  font-size: 40px;
  line-height: 1.15;
  font-weight: 800;
  color: var(--legal-head);
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}

.legal__dates {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 14px;
  font-style: italic;
  color: var(--legal-muted);
  margin: 0 0 32px;
}

.legal__layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 48px;
  margin-top: 24px;
}

@media (max-width: 1023px) {
  .legal__layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* ---- Sidebar TOC ---- */
.legal__toc {
  position: sticky;
  top: 96px;
  align-self: start;
  padding-right: 24px;
  border-right: 1px solid var(--legal-hairline);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}
@media (max-width: 1023px) {
  .legal__toc {
    position: static;
    padding: 16px 16px;
    border: 1px solid var(--legal-hairline);
    border-radius: 8px;
    max-height: none;
  }
}

.legal__toc-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--legal-muted);
  margin: 0 0 14px;
  font-weight: 600;
}
.legal__toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.legal__toc-list a {
  display: block;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--legal-muted);
  text-decoration: none;
  padding: 6px 0;
  border-left: 2px solid transparent;
  padding-left: 10px;
  margin-left: -10px;
  transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease;
}
.legal__toc-list a:hover,
.legal__toc-list a:focus-visible {
  color: var(--legal-head);
  border-left-color: var(--legal-lime);
  background: rgba(232, 180, 0, 0.10);
}

/* ---- Body ---- */
.legal__body {
  max-width: 720px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--legal-ink);
}
.legal__body > section + section { margin-top: 40px; }

.legal__body h2 {
  font-family: var(--font-display, "Anybody", "Inter", sans-serif);
  font-size: 24px;
  line-height: 1.25;
  font-weight: 800;
  color: var(--legal-head);
  margin: 0 0 16px;
  scroll-margin-top: 96px;
  letter-spacing: -0.005em;
}
.legal__body h3 {
  font-size: 18px;
  line-height: 1.35;
  font-weight: 700;
  color: var(--legal-accent);
  margin: 28px 0 10px;
}
.legal__body p { margin: 0 0 14px; }
.legal__body ul,
.legal__body ol {
  margin: 0 0 14px;
  padding-left: 22px;
}
.legal__body li { margin-bottom: 6px; }
.legal__body li::marker { color: var(--legal-accent); }

.legal__body strong { color: var(--legal-head); }
.legal__body a {
  color: var(--legal-accent);
  text-decoration: underline;
  text-decoration-color: rgba(232, 180, 0, 0.45);
  text-underline-offset: 3px;
}
.legal__body a:hover { color: var(--legal-accent-hi); text-decoration-color: var(--legal-accent-hi); }

.legal__body code,
.legal__placeholder {
  background: var(--legal-surface-2);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'SFMono-Regular', 'Menlo', 'Consolas', monospace;
  font-size: 13px;
  color: var(--legal-accent);
}

/* ---- Tables (used for retention, cookie duration, etc.) ---- */
.legal__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 4px 0 14px;
}
.legal__table th,
.legal__table td {
  border: 1px solid var(--legal-hairline);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}
.legal__table thead th {
  background: var(--legal-surface-2);
  color: var(--legal-head);
  font-weight: 700;
}
.legal__table tbody tr:nth-child(even) td { background: rgba(255,255,255,0.02); }

/* ---- Questions? block ---- */
.legal__questions {
  margin-top: 56px;
  background: rgba(232, 180, 0, 0.08);
  border-left: 4px solid var(--legal-lime);
  padding: 24px 28px;
  border-radius: 4px;
}
.legal__questions h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--legal-head);
  margin: 0 0 6px;
}
.legal__questions p {
  margin: 0;
  font-size: 15px;
  color: var(--legal-ink);
  line-height: 1.6;
}
.legal__questions a {
  color: var(--legal-accent);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(232, 180, 0, 0.45);
  text-underline-offset: 3px;
}
.legal__questions a:hover { color: var(--legal-accent-hi); }

/* ---- Placeholder badge ---- */
.legal__placeholder {
  white-space: nowrap;
}
