/* ============================================================
   legal.css — page styles for privacy.html and terms.html.
   Page-specific (offers.css / video.css pattern): loads after the
   ds cascade and leans on tokens.css + base.css.

   These are the site's only long-form prose documents. Everything
   here is the reading furniture that grammar needs and the marketing
   pages never did: a sticky contents rail, a measured text column,
   and rules between sections.
   ============================================================ */

/* ---------- layout: contents rail + prose column ---------- */
.legal {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    align-items: start;
}
@media (min-width: 960px) {
    .legal { grid-template-columns: 240px minmax(0, 1fr); gap: 64px; }
}

/* Contents. On mobile it is a plain list above the document; from 960px
   it becomes the rail and sticks past the navbar (110px, same offset
   base.css gives section[id] scroll-margin). */
.legal__toc { font-size: 14px; }
@media (min-width: 960px) {
    .legal__toc { position: sticky; top: 110px; }
}
.legal__toc-title {
    margin: 0 0 14px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--text-soft);
}
.legal__toc ol {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: toc;
}
.legal__toc li { counter-increment: toc; margin-bottom: 9px; line-height: 1.5; }
.legal__toc a { color: var(--text-slate); }
.legal__toc a::before {
    content: counter(toc) ".";
    display: inline-block;
    min-width: 1.6em;
    color: var(--text-soft);
    font-variant-numeric: tabular-nums;
}
.legal__toc a:hover { color: var(--secondary); }

/* ---------- the document ---------- */
.legal__body { max-width: 680px; counter-reset: legal; }

.legal-section { counter-increment: legal; }
.legal-section + .legal-section {
    margin-top: 44px;
    padding-top: 44px;
    border-top: 1px solid var(--hairline);
}
/* section[id] already carries scroll-margin-top in base.css; these are
   plain <section>s inside an id'd wrapper, so state it here too. */
.legal-section[id] { scroll-margin-top: 110px; }

.legal-section > h2 {
    display: flex;
    gap: 14px;
    font-size: 21.6px;
    line-height: 1.4;
    color: var(--primary);
    margin-bottom: 16px;
}
.legal-section > h2::before {
    content: counter(legal);
    flex: none;
    font-size: 14px;
    line-height: 2.2;
    font-weight: 600;
    color: var(--secondary);
    font-variant-numeric: tabular-nums;
}
.legal-section h3 {
    font-size: 16px;
    color: var(--primary);
    margin: 26px 0 8px;
}

.legal__body p,
.legal__body li {
    font-size: 15.5px;
    line-height: 1.75;
    color: var(--body-text);
}
.legal__body ul,
.legal__body ol { margin: 0 0 20px; padding-left: 22px; }
.legal__body li { margin-bottom: 8px; }
.legal__body li > ul { margin-top: 8px; margin-bottom: 0; }
.legal__body a { color: var(--secondary); text-decoration: underline; }
.legal__body a:hover { color: var(--primary); }
.legal__body strong { color: var(--primary); font-weight: 600; }

/* Lead-in line under a heading that introduces a list. */
.legal__body p:last-child { margin-bottom: 0; }

/* ---------- data tables (cookies, processors) ----------
   Narrow columns wrap badly on a phone, so the table scrolls inside
   its own wrapper rather than pushing the page sideways. */
.legal-table-wrap {
    overflow-x: auto;
    margin: 0 0 20px;
    -webkit-overflow-scrolling: touch;
}
.legal-table {
    width: 100%;
    min-width: 520px;
    border-collapse: collapse;
    font-size: 14.5px;
}
.legal-table th,
.legal-table td {
    text-align: left;
    vertical-align: top;
    padding: 11px 16px 11px 0;
    border-bottom: 1px solid var(--hairline);
    line-height: 1.6;
    color: var(--body-text);
}
.legal-table th {
    font-weight: 600;
    color: var(--primary);
    font-size: 12.5px;
    letter-spacing: .07em;
    text-transform: uppercase;
    border-bottom-color: var(--text-soft);
}
.legal-table td:first-child { color: var(--primary); font-weight: 500; }

/* ---------- the "how to reach us" tail ---------- */
.legal-contact {
    margin-top: 44px;
    padding: 28px 32px;
    background-color: var(--muted);
    border-radius: var(--radius);
}
.legal-contact p { margin-bottom: 0; }
.legal-contact p + p { margin-top: 10px; }

/* ---------- effective date under the page head ---------- */
.legal__meta {
    margin: 0;
    font-size: 13.5px;
    color: var(--text-soft);
}
.legal__meta strong { color: var(--text-slate); font-weight: 600; }

/* ---------- dark mode ----------
   --primary and --secondary are NOT remapped by tokens.css's dark block (navy
   and mid-blue stay themselves), so every use of them above would land dark-on-
   dark. Same swap motion.css makes for the marketing headings: --heading for
   ink, --emphasis for the blue. This file loads after motion.css, so these win.
   .page-head h1 / .hero__accent are already handled there. */
html.mode-dark .legal-section > h2,
html.mode-dark .legal-section h3,
html.mode-dark .legal__body strong,
html.mode-dark .legal-table th,
html.mode-dark .legal-table td:first-child { color: var(--heading); }

html.mode-dark .legal-section > h2::before,
html.mode-dark .legal__body a,
html.mode-dark .legal__toc a:hover { color: var(--emphasis); }

html.mode-dark .legal__body a:hover { color: var(--heading); }
