/* ============================================================
   LEGAL DOCUMENTS — legal.css

   Privacy Policy, Terms of Service and anything else of that shape.
   A dark hero, then a sticky contents nav beside the document.

   The body is editor output, so every rule below has to cope with
   whatever a client pastes in — headings, lists, tables, links.

   Palette is the magenta / deep-purple set used by the service,
   careers, trends and about pages. Declared per-page because the
   global tokens in base/_variables.css are still the old azure brand.
   ============================================================ */

.page-legal {
    /* ---- Brand ---------------------------------------------- */
    --color-primary:      #C62052;
    --color-primary-rgb:  198, 32, 82;
    --color-accent:       #9234F7;
    --color-accent-rgb:   146, 52, 247;

    --gradient-bright: linear-gradient(120deg, #C62052 0%, #7B23DB 100%);

    /* ---- Neutrals ------------------------------------------- */
    --lg-white:  #FFFFFF;
    --lg-wash:   #F8F5FB;
    --lg-line:   #EAE3F3;
    --lg-ink:    #280071;
    --lg-body:   #4A4363;
    --lg-muted:  #64607A;

    --lg-deep:   #0C0020;
    --lg-dtext:  rgba(255, 255, 255, .74);

    background: var(--lg-white);
    overflow-x: clip;
}

/* ── Hero ─────────────────────────────────────────────────── */
.legal-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding-block: clamp(3.5rem, 8vw, 6rem) clamp(3rem, 6vw, 4.5rem);
    background: linear-gradient(160deg, var(--lg-deep) 0%, #1A0338 55%, #2C0752 100%);
    color: #fff;
}

.legal-hero__bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

.legal-hero__glow {
    position: absolute;
    top: -40%;
    right: -8%;
    width: min(50vw, 520px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--color-primary-rgb), .36) 0%, transparent 70%);
    filter: blur(90px);
}

.legal-hero__eyebrow {
    display: inline-block;
    margin-bottom: .9rem;
    padding: .35rem .9rem;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 999px;
    background: rgba(255, 255, 255, .07);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.legal-hero__title {
    margin: 0;
    font-size: clamp(1.9rem, 4.6vw, 3.1rem);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -.025em;
    color: #fff;
}

.legal-hero__intro {
    max-width: 62ch;
    margin: 1.1rem 0 0;
    font-size: clamp(.98rem, 1.5vw, 1.09rem);
    line-height: 1.75;
    color: var(--lg-dtext);
}

.legal-hero__updated {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    margin: 1.6rem 0 0;
    padding: .45rem .9rem;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 999px;
    background: rgba(255, 255, 255, .06);
    font-size: .84rem;
    color: rgba(255, 255, 255, .82);
}
.legal-hero__updated svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ── Body layout ──────────────────────────────────────────── */
.legal-body {
    padding-block: clamp(2.5rem, 6vw, 4.5rem);
    background: var(--lg-white);
}

.legal-body__grid {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: clamp(2rem, 5vw, 4rem);
    align-items: start;
}

/* A document with no H2s has no contents nav, so the prose takes the row. */
.legal-body__grid--solo { grid-template-columns: minmax(0, 1fr); }

/* ── Contents nav ─────────────────────────────────────────── */
.legal-toc__inner {
    position: sticky;
    /* Clears the fixed site header. */
    top: 100px;
    padding: 1.35rem 1.25rem;
    border: 1px solid var(--lg-line);
    border-radius: 16px;
    background: var(--lg-wash);
}

.legal-toc__title {
    margin: 0 0 .9rem;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: var(--lg-muted);
}

.legal-toc__list {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: toc;
}

.legal-toc__list li {
    counter-increment: toc;
}

.legal-toc__list a {
    display: flex;
    gap: .55rem;
    padding: .42rem 0;
    font-size: .87rem;
    line-height: 1.5;
    color: var(--lg-body);
    text-decoration: none;
    transition: color .2s ease;
}

/* Numbered from the counter, not typed into the heading — so renumbering
   is automatic when a section is added or removed. */
.legal-toc__list a::before {
    content: counter(toc) ".";
    flex-shrink: 0;
    font-weight: 700;
    color: var(--color-primary);
}

.legal-toc__list a:hover { color: var(--color-primary); }

/* ── Prose ────────────────────────────────────────────────── */
.legal-prose {
    max-width: 72ch;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--lg-body);
}

.legal-prose > *:first-child { margin-top: 0; }

.legal-prose h2 {
    margin: 2.6rem 0 .9rem;
    font-size: clamp(1.25rem, 2.4vw, 1.5rem);
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -.015em;
    color: var(--lg-ink);
    /* Anchor jumps must clear the fixed header. */
    scroll-margin-top: 96px;
}

.legal-prose h3 {
    margin: 1.9rem 0 .6rem;
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--lg-ink);
    scroll-margin-top: 96px;
}

.legal-prose p { margin: 0 0 1.1rem; }

.legal-prose a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
    /* A pasted policy often carries long unbroken URLs. */
    overflow-wrap: anywhere;
}
.legal-prose a:hover { color: var(--color-accent); }

.legal-prose strong { font-weight: 600; color: var(--lg-ink); }

/* The global reset strips list markers site-wide, which is right for nav
   lists and wrong for a document — a numbered clause that renders unnumbered
   changes what it means. Put back here only. */
.legal-prose ul,
.legal-prose ol {
    margin: 0 0 1.2rem;
    padding-left: 1.35rem;
}
.legal-prose ul { list-style: disc; }
.legal-prose ol { list-style: decimal; }
.legal-prose ul ul { list-style: circle; }
.legal-prose ol ol { list-style: lower-alpha; }
.legal-prose li { margin-bottom: .5rem; }
.legal-prose li::marker { color: var(--color-primary); }

.legal-prose blockquote {
    margin: 1.5rem 0;
    padding: .9rem 1.2rem;
    border-left: 3px solid var(--color-primary);
    border-radius: 0 10px 10px 0;
    background: var(--lg-wash);
    font-style: normal;
    color: var(--lg-body);
}
.legal-prose blockquote p:last-child { margin-bottom: 0; }

.legal-prose hr {
    margin: 2.2rem 0;
    border: 0;
    border-top: 1px solid var(--lg-line);
}

/* Tables are common in policies (cookie lists, retention periods) and are
   the most likely thing to widen the page, so they scroll on their own. */
.legal-prose figure.wp-block-table,
.legal-prose .wp-block-table {
    margin: 1.5rem 0;
    overflow-x: auto;
}
.legal-prose table {
    width: 100%;
    border-collapse: collapse;
    font-size: .93rem;
}
.legal-prose th,
.legal-prose td {
    padding: .7rem .85rem;
    border: 1px solid var(--lg-line);
    text-align: left;
    vertical-align: top;
}
.legal-prose th {
    background: var(--lg-wash);
    font-weight: 700;
    color: var(--lg-ink);
}

.legal-prose img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

/* ── Closing contact block ────────────────────────────────── */
.legal-contact {
    margin-top: 2.8rem;
    padding: 1.6rem 1.5rem;
    border: 1px solid var(--lg-line);
    border-radius: 16px;
    background: var(--lg-wash);
}
.legal-contact h2 {
    margin: 0 0 .6rem;
    font-size: 1.15rem;
    scroll-margin-top: 96px;
}
.legal-contact p {
    margin: 0 0 .9rem;
    color: var(--lg-muted);
}
.legal-contact__link {
    display: inline-flex;
    align-items: center;
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
    border-bottom: 2px solid rgba(var(--color-primary-rgb), .28);
    transition: border-color .2s ease;
}
.legal-contact__link:hover { border-bottom-color: var(--color-primary); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
    .legal-body__grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 2rem;
    }

    /* Above the document rather than beside it, and no longer sticky —
       a pinned box would eat a third of a phone screen. */
    .legal-toc__inner {
        position: static;
        top: auto;
    }

    .legal-toc__list {
        columns: 2;
        column-gap: 1.5rem;
    }
    .legal-toc__list li { break-inside: avoid; }

    .legal-prose { max-width: none; }
}

@media (max-width: 560px) {
    .legal-toc__list { columns: 1; }

    .legal-contact { padding: 1.3rem 1.15rem; }
}

@media (prefers-reduced-motion: reduce) {
    .legal-toc__list a,
    .legal-contact__link { transition: none; }
}
