/* Shared layout for the legal pages (terms.html, privacy.html).
   Colours, topbar, theme toggle, footer and cookie banner all come from style.css, so these
   pages follow the same dark/light theme as the editor. Only theme tokens are used here. */

/* "Back to editor" sits in the topbar next to the theme toggle. */
.legal-page .topbar-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--white);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}

.legal-page .topbar-link:hover { border-color: var(--accent-strong); background: var(--accent-wash); }
.legal-page .topbar-link:active { transform: scale(.98); }

/* ---- Hero ------------------------------------------------------------- */
.legal-hero { border-bottom: 1px solid var(--line); }

.legal-hero-inner,
.legal-body {
  width: min(100%, 920px);
  margin: 0 auto;
  padding-left: clamp(16px, 4vw, 40px);
  padding-right: clamp(16px, 4vw, 40px);
}

.legal-hero-inner { padding-top: clamp(40px, 7vw, 72px); padding-bottom: clamp(32px, 5vw, 56px); }

.legal-kicker {
  display: inline-block;
  margin-bottom: 14px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-wash);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.legal-hero h1 {
  font-family: var(--display);
  font-size: clamp(34px, 6vw, 60px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -.02em;
}

.legal-updated { margin-top: 14px; color: var(--muted); font-size: 14px; font-weight: 600; }

/* ---- Body ------------------------------------------------------------- */
.legal-main { flex: 1; }

.legal-body { padding-top: clamp(28px, 5vw, 48px); padding-bottom: clamp(40px, 7vw, 80px); }

.legal-summary {
  margin-bottom: 8px;
  padding: 18px 20px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--accent-wash);
  font-size: 16px;
  line-height: 1.6;
}

.legal-section {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 4px 16px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}

.legal-section:last-child { border-bottom: 0; }

.legal-section > :not(.legal-number) { grid-column: 2; }

.legal-number {
  grid-row: 1;
  color: var(--subtle);
  font-family: var(--display);
  font-size: 22px;
  line-height: 1.3;
}

.legal-section h2 { font-family: var(--display); font-size: 20px; font-weight: 400; line-height: 1.3; }

.legal-section p,
.legal-section li { color: var(--muted); font-size: 15px; line-height: 1.7; }

.legal-section p { margin-top: 8px; max-width: 68ch; }
.legal-section ul { margin: 8px 0 0; padding-left: 20px; max-width: 68ch; }
.legal-section li + li { margin-top: 6px; }
.legal-section a { color: var(--text); font-weight: 600; }
.legal-section a:hover { color: var(--accent-strong); }
.legal-section code { padding: 1px 6px; border-radius: 4px; background: var(--accent-wash); color: var(--text); font-size: 13px; }
.legal-section strong { color: var(--text); }

/* ---- Cookie settings button (same look as the editor's primary buttons) --- */
.legal-actions { margin-top: 16px; }

.legal-actions .cookie-settings-button {
  min-height: 42px;
  margin: 0;
  padding: 0 20px;
  border: 2px solid var(--navy);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 14px;
  font-weight: 700;
  transition: background-color .15s ease, color .15s ease, transform .15s ease;
}

.legal-actions .cookie-settings-button:hover { background: var(--navy); color: #fff; }
.legal-actions .cookie-settings-button:active { transform: scale(.98); }

@media (max-width: 599px) {
  /* The brand already links home; drop the Beta pill so the header fits a phone. */
  .legal-page .topbar-status { display: none; }
  .legal-page .topbar-link { padding: 0 12px; }
  .legal-section { grid-template-columns: 1fr; }
  .legal-number { font-size: 16px; }
  .legal-section > :not(.legal-number) { grid-column: 1; }
}
