/* ============================================================
   Legal pages (Terms, Privacy, California Notice), also used by the
   integration guides: the live pages'
   own document, set to read calmly. A short dawn-sky hero with the
   title, the date and the switch between the three documents; then
   one reading column with a pinned contents list beside it on wide
   screens. Hairline rules, Newsreader headings, lavender links.
   ============================================================ */

/* ---- Hero: the page hero, shorter and quieter ---- */
.hero--page { min-height: 0; }
.hero--legal .hero-inner { padding-top: 184px; padding-bottom: 104px; }
.hero--legal h1 { max-width: 18ch; }
.doc-meta { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0 10px; margin-top: 28px; font-size: 0.9375rem; color: var(--ink-600); }
.doc-meta a { color: var(--lavender-700); border-bottom: 1px solid var(--lavender-200); transition: border-color .2s ease; }
.doc-meta a:hover { border-bottom-color: var(--lavender-700); }
.meta-divider { color: var(--ink-400); }
.doc-switch { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 32px; margin-top: 40px; }
.doc-switch a { padding-bottom: 4px; border-bottom: 1px solid transparent; font-size: 0.9375rem; font-weight: 500; color: var(--ink-600); transition: color .2s ease, border-color .2s ease; }
.doc-switch a:hover { color: var(--ink-900); }
.doc-switch a[aria-current="page"] { color: var(--ink-900); border-bottom-color: var(--lavender-600); }
@media (max-width: 900px) { .hero--legal .hero-inner { padding-top: 136px; padding-bottom: 72px; } }
@media (max-width: 480px) { .doc-switch { gap: 6px 20px; } .doc-switch a { font-size: 0.875rem; } }

/* ---- The document ---- */
.legal { padding: 104px 0 144px; }
.legal-layout { display: grid; grid-template-columns: minmax(0, 68ch); justify-content: center; }
.legal-content { min-width: 0; }

/* Contents: pinned beside the column on wide screens, following your place */
.legal-index { display: none; }
@media (min-width: 1100px) {
    .legal-layout { grid-template-columns: 220px minmax(0, 68ch); gap: 96px; align-items: start; }
    .legal-index { position: sticky; top: 112px; display: flex; flex-direction: column; }
    .legal-index:empty { display: none; }
}
/* "On this page": short one-line labels on a thin rail; the current section
   gets a lavender segment. Long lists scroll without a visible scrollbar
   and fade at their edges. */
.legal-index-label { font-size: 0.75rem; font-weight: 500; letter-spacing: 0.02em; color: var(--ink-500); margin-bottom: 12px; }
.legal-index-list { position: relative; display: flex; flex-direction: column; max-height: calc(100vh - 200px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; padding: 4px 0;
    border-left: 1px solid var(--ink-200);
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 16px, #000 calc(100% - 24px), transparent 100%);
            mask-image: linear-gradient(180deg, transparent 0, #000 16px, #000 calc(100% - 24px), transparent 100%); }
.legal-index-list::-webkit-scrollbar { display: none; }
.legal-index-list a { display: block; flex: none; margin-left: -1px; padding: 5px 0 5px 16px; border-left: 2px solid transparent; font-size: 0.8125rem; line-height: 1.35; color: var(--ink-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .2s ease, border-color .2s ease; }
.legal-index-list a:hover { color: var(--ink-900); }
.legal-index-list a.is-current { color: var(--ink-900); font-weight: 500; border-left-color: var(--lavender-600); }

/* Sections, split by hairlines */
.legal-section { padding: 56px 0; border-top: 1px solid var(--line); scroll-margin-top: 88px; }
.legal-section:first-child { padding-top: 0; border-top: 0; }
.legal-section:last-child { padding-bottom: 0; }
.legal-content h2 { margin-bottom: 22px; font-weight: 450; font-size: clamp(1.5rem, 1.95vw, 1.75rem); line-height: 1.15; letter-spacing: -0.015em; }
.legal-content h3 { margin: 36px 0 12px; scroll-margin-top: 104px; }
.hlink { margin-left: 0.35em; font-family: var(--font); font-size: 0.6em; font-weight: 500; color: var(--lavender-500); opacity: 0; transition: opacity .2s ease, color .2s ease; }
.legal-content h2:hover .hlink, .hlink:focus-visible { opacity: 1; }
.hlink:hover { color: var(--lavender-700); }

.legal-content p, .legal-content li { font-size: 1.0625rem; line-height: 1.7; color: var(--ink-700); }
.legal-content p { margin-bottom: 18px; }
.legal-content p:last-child { margin-bottom: 0; }
.legal-content strong { font-weight: 600; color: var(--ink-900); }
.legal-content p.caps { font-size: 0.9375rem; letter-spacing: 0.01em; color: var(--ink-800); }
.legal-content p.clause { padding-left: 24px; }
.legal-content ul { display: flex; flex-direction: column; gap: 10px; margin: 0 0 18px; }
.legal-content ul:last-child { margin-bottom: 0; }
.legal-content ul li { position: relative; padding-left: 22px; }
.legal-content ul li::before { content: ""; position: absolute; left: 2px; top: 0.72em; width: 5px; height: 5px; border-radius: 50%; background: var(--lavender-500); }
/* Numbered steps (integration guides): the number in lavender where the bullet sits */
.legal-content ol { display: flex; flex-direction: column; gap: 10px; margin: 0 0 18px; padding: 0; list-style: none; counter-reset: step; }
.legal-content ol:last-child { margin-bottom: 0; }
.legal-content ol li { position: relative; padding-left: 28px; counter-increment: step; }
.legal-content ol li::before { content: counter(step) "."; position: absolute; left: 0; font-weight: 500; color: var(--lavender-700); }

.legal-content a.inline-link, .legal-content a.xref { color: var(--lavender-700); border-bottom: 1px solid var(--lavender-200); transition: border-color .2s ease; }
.legal-content a.inline-link { overflow-wrap: anywhere; }
.legal-content a.inline-link:hover, .legal-content a.xref:hover { border-bottom-color: var(--lavender-700); }

/* Tables: hairline rows, the first column as the row's name */
.table-wrap { margin: 8px 0 24px; overflow-x: auto; }
.table-wrap:last-child { margin-bottom: 0; }
.legal-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 0.9375rem; line-height: 1.55; }
.legal-table th { padding: 0 20px 12px 0; border-bottom: 1px solid var(--ink-900); font-size: 0.8125rem; font-weight: 500; color: var(--ink-500); vertical-align: bottom; }
.legal-table td { padding: 16px 20px 16px 0; border-bottom: 1px solid var(--line); color: var(--ink-700); vertical-align: top; }
.legal-table th:last-child, .legal-table td:last-child { padding-right: 0; }
.legal-table td:first-child { font-weight: 500; color: var(--ink-900); }
.legal-table tbody tr:last-child td { border-bottom: 0; }

@media (max-width: 900px) { .legal { padding: 72px 0 104px; } .legal-section { padding: 44px 0; } }
/* Small screens: each row becomes a short stack, labelled from the header */
@media (max-width: 640px) {
    .legal-content p, .legal-content li { font-size: 1rem; }
    .legal-content p.clause { padding-left: 16px; }
    .legal-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .legal-table, .legal-table tbody, .legal-table tr, .legal-table td { display: block; }
    .legal-table tr { padding: 16px 0; border-bottom: 1px solid var(--line); }
    .legal-table tr:first-child { border-top: 1px solid var(--ink-900); }
    .legal-table td { padding: 0; border: 0; }
    .legal-table td + td { margin-top: 6px; }
    .legal-table td + td[data-label]::before { content: attr(data-label) ": "; color: var(--ink-500); }
}

/* ---- Print: just the document ---- */
@media print {
    .site-header, .nav-sheet, .site-footer, .hero-bg, .doc-switch, .legal-index, .hlink { display: none !important; }
    .hero { min-height: 0; background: none; }
    .hero::after { display: none; }
    .hero--legal .hero-inner { padding: 0 0 24px; transform: none !important; opacity: 1 !important; }
    html.js .hero .rv { opacity: 1; filter: none; transform: none; }
    .legal { padding: 0; }
    .legal-layout { display: block; }
    .legal-section { padding: 12px 0; break-inside: auto; }
    .legal-section h2 { break-after: avoid-page; }
    .legal-content a, .doc-meta a { color: #000; border-bottom: 0; text-decoration: underline; }
    /* The printed copy is the PDF, so drop the link to itself */
    .doc-meta .meta-divider, .doc-meta a[href$=".pdf"] { display: none !important; }
    html, body, .legal { background: #fff !important; }
    .legal-content p, .legal-content li { font-size: 10.5pt; line-height: 1.5; }
    .legal-content p { margin-bottom: 10px; }
    .legal-content p.caps { font-size: 9.5pt; }
    .legal-content h2 { margin-bottom: 12px; font-size: 15pt; }
    @page { margin: 16mm 16mm 18mm; @bottom-center { content: "Page " counter(page) " of " counter(pages); font-size: 9pt; color: #666; } }
}

/* 18) Sections are separated by space, not rules (tables keep theirs) */
.legal-section { border-top: 0; padding: 36px 0; }
.legal-section:first-child { padding-top: 0; }
@media (max-width: 900px) { .legal-section { padding: 30px 0; } }
