/* --------------------------------------------------------------------------
   Legal pages (Privacy Policy, Terms & Conditions)

   A centred container with a sticky section index on the left and prose on
   the right, collapsing to one column below 960px. Reuses the site's page
   padding, grid background, --line dividers and amber accent; the only new
   values are a prose type scale, because the global h2 is a display size
   far too large for body copy.
   -------------------------------------------------------------------------- */

.legal {
    position: relative;
    overflow: hidden;
    padding: clamp(118px, 14vh, 168px)
        clamp(22px, calc(var(--public-layout-vw, 1vw) * 5), 72px)
        clamp(72px, calc(var(--public-layout-vw, 1vw) * 8), 116px);
    border-bottom: 1px solid var(--line);
    background:
        linear-gradient(rgba(116, 184, 215, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(116, 184, 215, 0.035) 1px, transparent 1px),
        var(--bg);
    background-size: 88px 88px;
    color: var(--text);
}

/* Centred measure, in the same spirit as .site-footer__inner. */
.legal__inner {
    position: relative;
    z-index: 1;
    width: min(1180px, 100%);
    margin: 0 auto;
}

/* ---- Heading block ---- */

.legal__header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 10px clamp(24px, calc(var(--public-layout-vw, 1vw) * 4), 56px);
    margin-bottom: clamp(44px, calc(var(--public-layout-vw, 1vw) * 5), 72px);
    padding-bottom: clamp(26px, calc(var(--public-layout-vw, 1vw) * 3), 38px);
    border-bottom: 1px solid var(--line);
}

.legal__eyebrow {
    margin-bottom: 12px;
}

/* Deliberately below --section-heading-size: this is a document, not a
   landing section, so the title sets tone without shouting. */
.legal__title {
    max-width: none;
    margin: 0;
    /* A step below --section-heading-size: a document, not a landing
       section. Sized for the 62.5% root milligram sets (1rem = 10px). */
    font-size: clamp(3rem, calc(var(--public-layout-vw, 1vw) * 3.6), 4.6rem);
    font-weight: 950;
    letter-spacing: 0.01em;
    line-height: 1;
    text-transform: uppercase;
}

.legal__meta {
    margin: 0;
    text-align: right;
}

.legal__meta dt {
    margin: 0 0 4px;
    color: rgba(167, 189, 196, 0.72);
    font-size: 1.1rem;
    font-weight: 900;
    letter-spacing: 0.26em;
    text-transform: uppercase;
}

.legal__meta dd {
    margin: 0;
    color: var(--amber);
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    white-space: nowrap;
}

.legal__intro {
    grid-column: 1 / -1;
    max-width: 70ch;
    margin: clamp(14px, calc(var(--public-layout-vw, 1vw) * 1.6), 20px) 0 0;
    color: rgba(244, 241, 232, 0.82);
    /* !important only to outrank the blanket p rule in global.css. */
    font-size: clamp(
        1.8rem,
        calc(var(--public-layout-vw, 1vw) * 1.45),
        2.3rem
    ) !important;
    line-height: 1.6;
}

/* ---- Two-column layout ---- */

.legal__layout {
    display: grid;
    grid-template-columns: minmax(200px, 260px) minmax(0, 1fr);
    gap: clamp(32px, calc(var(--public-layout-vw, 1vw) * 5), 88px);
    align-items: start;
}

/* ---- Section index ---- */

.legal__index {
    position: sticky;
    /* Clears the fixed header, matching section[id] scroll-margin-top. */
    top: 118px;
}

.legal__index-label {
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
    color: rgba(167, 189, 196, 0.72);
    font-size: 1.1rem;
    font-weight: 900;
    letter-spacing: 0.26em;
    text-transform: uppercase;
}

.legal__index-list {
    display: grid;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: none;
}

.legal__index-list a {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    padding: 7px 0;
    color: rgba(244, 241, 232, 0.64);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.35;
    transition: color 180ms ease;
}

.legal__index-number {
    color: rgba(199, 162, 83, 0.6);
    font-weight: 900;
    letter-spacing: 0.08em;
    transition: color 180ms ease;
}

.legal__index-list a:hover,
.legal__index-list a:focus-visible {
    color: var(--text);
}

.legal__index-list a:hover .legal__index-number,
.legal__index-list a:focus-visible .legal__index-number {
    color: var(--amber);
}

.legal__index-list a.is-current {
    color: var(--text);
}

.legal__index-list a.is-current .legal__index-number {
    color: var(--amber);
}

/* ---- Prose ---- */

.legal__body {
    display: grid;
    min-width: 0;
    gap: 0;
}

/* A rule between sections gives each a clear start and end without boxing
   them in cards, which the rest of the site does not use for text. */
.legal__section {
    padding: clamp(26px, calc(var(--public-layout-vw, 1vw) * 3), 38px) 0;
    border-top: 1px solid var(--line);
}

.legal__section:first-child {
    padding-top: 0;
    border-top: 0;
}

.legal__section:last-child {
    padding-bottom: 0;
}

.legal__heading {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: baseline;
    margin: 0 0 clamp(14px, calc(var(--public-layout-vw, 1vw) * 1.6), 20px);
    gap: 16px;
    color: var(--text);
    font-size: clamp(1.9rem, calc(var(--public-layout-vw, 1vw) * 2), 2.6rem);
    font-weight: 950;
    letter-spacing: 0.03em;
    line-height: 1.22;
    text-transform: uppercase;
}

.legal__number {
    color: var(--amber);
    font-size: 0.78em;
    letter-spacing: 0.12em;
}

/* Indented to the heading text, so numbers form a clean column down the page. */
.legal__prose {
    display: grid;
    gap: clamp(12px, calc(var(--public-layout-vw, 1vw) * 1.3), 16px);
    padding-left: calc(0.78em + 16px);
}

.legal__prose p {
    max-width: 74ch;
    margin: 0;
    color: rgba(244, 241, 232, 0.8);
    /* Size comes from the global p rule in global.css, which is
       !important; only the line-height is raised, for long-form reading. */
    font-weight: 500;
    line-height: 1.75;
}

.legal__list {
    display: grid;
    max-width: 74ch;
    gap: 12px;
    margin: 4px 0 0;
    padding: 0;
    list-style: none;
}

.legal__list li {
    position: relative;
    padding-left: 32px;
    color: rgba(244, 241, 232, 0.78);
    /* Mirrors the global p scale so list and prose sit at one size. */
    font-size: clamp(1rem, calc(var(--public-layout-vw, 1vw) * 1.2), 2.5rem);
    font-weight: 500;
    line-height: 1.75;
}

/* Amber diamond, matching .audience-fit-panel__topics - sized up so it holds
   its own against the larger body text. */
.legal__list li::before {
    position: absolute;
    top: 0.86em;
    left: 0;
    width: 14px;
    height: 14px;
    border: 2px solid var(--amber);
    content: "";
    transform: translateY(-50%) rotate(45deg);
}

@media (max-width: 960px) {
    .legal {
        padding-top: clamp(104px, 13vh, 140px);
    }

    /* One column: the index becomes a static list above the content. */
    .legal__layout {
        grid-template-columns: 1fr;
        gap: clamp(28px, 4vw, 40px);
    }

    .legal__index {
        position: static;
        padding-bottom: clamp(20px, 3vw, 28px);
        border-bottom: 1px solid var(--line);
    }

    .legal__index-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 2px clamp(20px, 4vw, 40px);
    }

    /* Below this width the global p clamp (1.2vw) resolves under 11.5px,
       which is unreadable for long-form text. !important is required to
       outrank that rule in global.css. */
    .legal__prose p {
        font-size: 1.6rem !important;
    }

    .legal__intro {
        font-size: 1.85rem !important;
    }

    .legal__list li {
        font-size: 1.6rem;
    }
}

@media (max-width: 620px) {
    .legal {
        padding-right: 18px;
        padding-left: 18px;
    }

    .legal__header {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .legal__meta {
        margin-top: 14px;
        text-align: left;
    }

    .legal__index-list {
        grid-template-columns: 1fr;
    }

    .legal__heading {
        font-size: clamp(1.7rem, 5.2vw, 2.1rem);
        gap: 12px;
    }

    /* Drop the hanging indent so prose uses the full width. */
    .legal__prose {
        padding-left: 0;
    }

    .legal__intro,
    .legal__prose p,
    .legal__list {
        max-width: none;
    }

    .legal__prose p {
        font-size: 1.55rem !important;
    }

    .legal__intro {
        font-size: 1.72rem !important;
    }

    .legal__list li {
        font-size: 1.55rem;
    }

    .legal__list li {
        padding-left: 28px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .legal__index-list a,
    .legal__index-number {
        transition: none;
    }
}
