/* ==========================================================================
   legal.css — privacy.html and terms.html

   A legal page has one job: be read. So this is a single measured column,
   generous leading, real heading hierarchy, and tables that survive a phone.
   All tokens come from style.css, so light/dark is automatic.
   ========================================================================== */

.legal-hero { padding-bottom: 48px; }

.legal-body {
  padding: 0 0 96px;
  background: var(--surface-canvas);
}

.legal-doc {
  max-width: 720px;              /* ~75 characters at 17px — the readable measure */
  margin-inline: auto;
  padding-top: 48px;
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.65;
  color: var(--ink);
  text-align: left;
}

/* --- headings --- */

.legal-doc h2 {
  margin: 48px 0 14px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: var(--text-heading-sm);
  line-height: var(--leading-heading-sm);
  letter-spacing: var(--tracking-heading-sm);
  font-weight: var(--font-weight-semibold);
  scroll-margin-top: 96px;       /* so #anchors clear the sticky nav */
}

.legal-doc h2:first-of-type { border-top: none; padding-top: 0; margin-top: 24px; }

.legal-doc h3 {
  margin: 30px 0 10px;
  font-family: var(--font-display);
  font-size: var(--text-subheading);
  line-height: var(--leading-subheading);
  letter-spacing: var(--tracking-subheading);
  font-weight: var(--font-weight-semibold);
}

.legal-doc p { margin: 0 0 16px; }

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

.legal-doc a:hover { opacity: 0.78; }

.legal-doc strong { font-weight: var(--font-weight-semibold); color: var(--ink); }

.legal-doc ul { margin: 0 0 18px; padding-left: 22px; }
.legal-doc li { margin-bottom: 9px; }

.legal-doc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  padding: 2px 6px;
  background: var(--fill-subtle);
  border-radius: 5px;
  word-break: break-word;
}

/* --- the dateline --- */

.legal-meta {
  margin-bottom: 28px;
  padding: 14px 18px;
  background: var(--fill-subtle);
  border-radius: var(--radius);
  font-size: var(--text-body-sm);
  color: var(--mist);
}

.legal-meta p { margin: 0; line-height: 1.6; }

/* --- callouts ---

   The plain-language summary at the top of each document. People read the
   box and skip the rest, which is exactly why the box has to be true. --- */

.legal-callout {
  margin: 0 0 32px;
  padding: 18px 20px;
  background: var(--accent-tint);
  border-left: 3px solid var(--accent-fill);
  border-radius: var(--radius);
}

.legal-callout p { margin: 0; font-size: var(--text-body-sm); line-height: 1.6; }

/* The "you must edit this before publishing" marker. Deliberately loud —
   it should be uncomfortable to leave in. */
.legal-callout-warn {
  background: rgba(255, 159, 10, 0.12);
  border-left-color: #ff9f0a;
}

/* --- tables ---

   Wrapped in their own scroll context rather than squashed. A four-column
   table at 390px is unreadable if you force it to fit. --- */

.legal-table {
  width: 100%;
  margin: 0 0 22px;
  border-collapse: collapse;
  font-size: var(--text-body-sm);
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.legal-table thead { background: var(--fill-subtle); }

.legal-table th,
.legal-table td {
  padding: 11px 14px;
  text-align: left;
  border: 1px solid var(--line);
  vertical-align: top;
  min-width: 110px;
}

.legal-table th {
  font-weight: var(--font-weight-semibold);
  color: var(--ink);
  white-space: nowrap;
}

.legal-table td { color: var(--mist); }
.legal-table td strong { color: var(--ink); }

/* --- the consent button --- */

.legal-action {
  margin: 22px 0 18px;
  padding: 18px 20px;
  background: var(--surface-white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.legal-consent-btn { flex: 0 0 auto; }

.legal-action-note {
  flex: 1 1 260px;
  font-size: var(--text-caption);
  line-height: 1.5;
  color: var(--mist);
}

/* --- phones --- */

@media (max-width: 640px) {
  .legal-doc { padding-top: 32px; font-size: 16px; }
  .legal-doc h2 { margin-top: 36px; font-size: 23px; }
  .legal-doc h3 { font-size: 18px; }
  .legal-body { padding-bottom: 64px; }
  .legal-action { flex-direction: column; align-items: stretch; }
  .legal-consent-btn { width: 100%; }
}

/* Long URLs and email addresses must not push the page sideways. */
.legal-doc a { word-break: break-word; }
