/* Long-form legal pages (Privacy Policy, Terms of Service).
   Uses the tokens already defined in pages.css, so light/dark themes follow the
   rest of the site automatically. Loaded only by legal pages. */

/* pages.css sizes .page-hero at min-height:770px for pages with a large visual.
   A text-only legal header does not need that, so it is tightened here. */
.legal-hero {
  min-height: 0;
  padding: 150px 0 56px;
}

.legal-doc {
  padding: 8px 0 96px;
}

.legal-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

/* ── Contents sidebar ── */
.legal-toc {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  max-height: calc(100vh - var(--nav-h) - 48px);
  overflow-y: auto;
  padding-right: 8px;
}

.legal-toc h2 {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}

.legal-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--line);
}

.legal-toc a {
  display: block;
  padding: 7px 0 7px 16px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--muted);
  text-decoration: none;
  transition: color .18s ease, border-color .18s ease;
}

.legal-toc a:hover,
.legal-toc a.is-active {
  color: var(--green);
  border-left-color: var(--green);
}

/* ── Document body ── */
.legal-body {
  max-width: 74ch;
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink-2);
}

.legal-body h2 {
  font-family: Sora, Inter, sans-serif;
  font-size: clamp(20px, 2.4vw, 25px);
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  margin: 52px 0 16px;
  scroll-margin-top: calc(var(--nav-h) + 28px);
}

.legal-body h2:first-child { margin-top: 0; }

.legal-body p { margin: 0 0 18px; }

.legal-body ul {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.legal-body li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 11px;
}

.legal-body li::before {
  content: "";
  position: absolute;
  left: 6px;
  top: .62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green-2);
}

/* ── Retention schedule table ──
   The wrapper scrolls on its own so the page body never scrolls sideways. */
.legal-table {
  margin: 0 0 24px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.legal-table table {
  width: 100%;
  min-width: 460px;
  border-collapse: collapse;
  font-size: 14.5px;
}

.legal-table th {
  text-align: left;
  padding: 12px 18px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--green-pale);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.legal-table td {
  padding: 12px 18px;
  vertical-align: top;
  line-height: 1.55;
  border-bottom: 1px solid var(--line);
}

.legal-table tr:last-child td { border-bottom: 0; }

.legal-table td:last-child {
  font-weight: 600;
  color: var(--ink);
}

.legal-body strong { color: var(--ink); font-weight: 600; }

.legal-body a {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-body a:hover { color: var(--green-2); }

.legal-body hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 44px 0;
}

/* Address blocks and other tight groups */
.legal-body .addr { line-height: 1.6; }

/* ── Unfilled legal placeholder ──
   Deliberately loud: these must be resolved before the page goes live. */
.legal-todo {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 5px;
  background: rgba(226, 76, 79, .12);
  border: 1px dashed var(--danger);
  color: var(--danger);
  font-family: "JetBrains Mono", monospace;
  font-size: 12.5px;
  font-weight: 600;
}

/* ── Header meta ── */
.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  margin-top: 18px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12.5px;
  color: var(--muted);
}

.legal-meta .pill {
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.legal-intro {
  max-width: 74ch;
  margin: 20px 0 0;
  font-size: 17px;
  line-height: 1.65;
  color: var(--muted);
}

@media (max-width: 920px) {
  .legal-layout { grid-template-columns: 1fr; gap: 32px; }
  .legal-toc {
    position: static;
    max-height: none;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
  }
  .legal-body { font-size: 15.5px; }
}
