/* ============================================================
   Macrovore — Legal pages (privacy, cookie, terms, return)
   ------------------------------------------------------------
   Shared brand treatment for the four policy pages so they read
   as part of the site, not raw Termly boilerplate.

   Styles BOTH content shapes:
     • hand-written semantic markup  → return-policy (h1/h2/p/ul/a)
     • Termly `data-custom-class` exports → privacy / cookie / terms

   Termly bakes inline `style="color/font"` onto its spans and
   ships its own `!important` class rules. To win, the rules below
   are scoped under `.legal` (adds a class to the specificity) and
   marked `!important` — `.legal [data-custom-class="x"]` (0,2,0)
   beats Termly's bare `[data-custom-class="x"]` (0,1,0), and
   `!important` beats the non-important inline styles.

   Depends on the tokens in /colors_and_type.css (linked first).
   ============================================================ */

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

html { color-scheme: only light; }

body {
  background: var(--mv-cream);
  color: var(--mv-fg);
  color-scheme: light;
  font-family: var(--mv-font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; height: auto; }

/* Reading column — centered, comfortable measure, grows to push the
   footer to the bottom on short pages (return-policy). */
.legal {
  flex: 1 0 auto;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.5rem) 1.5rem clamp(3rem, 6vw, 4.5rem);
}

/* ── Headings ─────────────────────────────────────────────── */
.legal h1,
.legal [data-custom-class="title"],
.legal [data-custom-class="title"] * {
  font-family: var(--mv-font-body) !important;
  font-weight: var(--mv-w-bold) !important;
  font-size: clamp(1.9rem, 4.5vw, 2.6rem) !important;
  line-height: var(--mv-lh-tight) !important;
  letter-spacing: var(--mv-ls-tight) !important;
  color: var(--mv-fg) !important;
}
.legal h1 { margin: 0 0 0.5rem; }

.legal [data-custom-class="subtitle"],
.legal [data-custom-class="subtitle"] * {
  font-family: var(--mv-font-body) !important;
  font-weight: var(--mv-w-medium) !important;
  font-size: var(--mv-fs-body-sm) !important;
  color: var(--mv-fg-2) !important;
}

.legal h2,
.legal [data-custom-class="heading_1"],
.legal [data-custom-class="heading_1"] * {
  font-family: var(--mv-font-body) !important;
  font-weight: var(--mv-w-semi) !important;
  font-size: clamp(1.3rem, 2.6vw, 1.6rem) !important;
  line-height: var(--mv-lh-snug) !important;
  color: var(--mv-fg) !important;
}
.legal h2 { margin: 2.25rem 0 0.75rem; }

.legal h3,
.legal [data-custom-class="heading_2"],
.legal [data-custom-class="heading_2"] * {
  font-family: var(--mv-font-body) !important;
  font-weight: var(--mv-w-semi) !important;
  font-size: clamp(1.05rem, 2vw, 1.2rem) !important;
  line-height: var(--mv-lh-snug) !important;
  color: var(--mv-fg) !important;
}
.legal h3 { margin: 1.5rem 0 0.5rem; }

/* Termly nests the real <h1>/<h2>/<h3> inside the class span, so zero out the
   nested heading's default margins and inline it — then give the WRAPPER span
   (styled above) block display + its own top margin, so section headings get
   real breathing room above them. Excludes [data-custom-class="title"], which
   must sit tight under the nav. */
.legal [data-custom-class] h1,
.legal [data-custom-class] h2,
.legal [data-custom-class] h3 { margin: 0 !important; display: inline; }
.legal [data-custom-class="heading_1"] { display: block; margin: 2.25rem 0 0.6rem; }
.legal [data-custom-class="heading_2"] { display: block; margin: 1.6rem 0 0.4rem; }

/* Termly already inserts an empty <br> spacer div above most main sections, so
   the margin-top above would DOUBLE the gap there. Where a br spacer sits
   immediately before a heading, drop the added top margin and let the existing
   br provide the space; headings with NO br (the subheadings, a few sections)
   keep the margin. Covers both Termly shapes: data-custom-class on the heading
   div itself, and nested one level in on a span. */
.legal div:has(> br:only-child) + [data-custom-class="heading_1"],
.legal div:has(> br:only-child) + [data-custom-class="heading_2"],
.legal div:has(> br:only-child) + div [data-custom-class="heading_1"],
.legal div:has(> br:only-child) + div [data-custom-class="heading_2"] {
  margin-top: 0 !important;
}

/* ── Body copy ────────────────────────────────────────────── */
.legal p,
.legal [data-custom-class="body_text"],
.legal [data-custom-class="body_text"] * {
  font-family: var(--mv-font-body) !important;
  font-size: var(--mv-fs-body) !important;
  line-height: var(--mv-lh-relaxed) !important;
  color: var(--mv-fg-2) !important;
}
.legal p { margin: 0 0 1rem; }
.legal strong, .legal b { font-weight: var(--mv-w-semi) !important; color: var(--mv-fg) !important; }

/* ── Links ────────────────────────────────────────────────── */
.legal a,
.legal [data-custom-class="link"],
.legal [data-custom-class="link"] * {
  color: var(--mv-link-on-light) !important;  /* ~5:1 on cream; base --mv-accent purple failed AA at ~2.4:1 */
  text-decoration: underline !important;
  text-underline-offset: 2px;
  word-break: break-word;
}
.legal a:hover,
.legal [data-custom-class="link"]:hover { color: var(--mv-accent-hover) !important; }

/* ── Lists ────────────────────────────────────────────────── */
.legal ul, .legal ol { margin: 0 0 1rem 1.5rem; }
.legal li { margin: 0.35rem 0; line-height: var(--mv-lh-relaxed); }

/* ── Tables (e.g. the US-state data table in the privacy policy) ── */
.legal table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1rem;
  font-size: var(--mv-fs-body-sm);
}
.legal th, .legal td {
  border: 1px solid var(--mv-warm-gray);
  padding: 0.6rem 0.75rem;
  text-align: left;
  vertical-align: top;
  color: var(--mv-fg-2);
  line-height: var(--mv-lh-snug);
}
.legal thead th { font-weight: var(--mv-w-semi); color: var(--mv-fg); }
.legal td.legal-yn { text-align: center; white-space: nowrap; font-weight: var(--mv-w-semi); }

/* Termly ships a hidden DSAR anchor + stray empty helpers — keep hidden. */
.legal [style*="display: none"] { display: none !important; }

/* ── Footer ───────────────────────────────────────────────── */
.legal-footer {
  flex-shrink: 0;
  background: var(--mv-black);
  color: var(--mv-cream);
  padding: 1.5rem;
  font-size: var(--mv-fs-body-sm);
}
.legal-footer__inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  text-align: center;
}
.legal-footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.25rem;
}
.legal-footer a { color: var(--mv-cream); text-decoration: none; transition: color 0.2s; }
.legal-footer a:hover { color: var(--mv-purple); }
.legal-footer__copy { color: var(--mv-warm-gray); font-size: var(--mv-fs-caption); }
