/* ============================================================
   Legal page — supplemental stylesheet (loaded alongside
   spectrum.css only on template-legal.php and template-guide.php)

   All selectors are namespaced .spc-legal* or .spc-phero*.
   This file adds no global overrides.
   ============================================================ */

/* ============================================================
   Compact dark hero — .spc-phero
   No WebGL canvas, no floating chips, no ZIP form.
   Just a kicker, h1, and meta line over the signature gradient.
   ============================================================ */
.spc-phero {
    position: relative;
    background:
        radial-gradient(80% 120% at 60% -20%, #07335f 0%, transparent 55%),
        radial-gradient(60% 80% at 10% 120%, #04263f 0%, transparent 55%),
        var(--navy-950);
    color: var(--dk-fg);
    overflow: hidden;
    padding-top: calc(var(--nav-h) + var(--offer-h));
}

.spc-phero__aurora {
    position: absolute;
    inset: -30% -10%;
    pointer-events: none;
    opacity: .55;
    background:
        radial-gradient(38% 46% at 70% 30%, rgba(0, 97, 255, .30), transparent 70%),
        radial-gradient(28% 38% at 20% 70%, rgba(0, 181, 255, .18), transparent 72%),
        radial-gradient(22% 28% at 85% 80%, rgba(10, 195, 79, .14), transparent 72%);
    filter: blur(12px);
}

.spc-phero__inner {
    position: relative;
    z-index: 2;
    padding: clamp(48px, 7vw, 80px) 0 clamp(44px, 6vw, 72px);
}

.spc-phero__kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--cyan);
    margin: 0 0 16px;
}

.spc-phero__kicker::before {
    content: "";
    width: 22px;
    height: 3px;
    border-radius: 2px;
    background: var(--grad);
}

.spc-phero__title {
    font-size: clamp(2rem, 4.5vw, 3.2rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
    margin: 0 0 14px;
    line-height: 1.1;
}

.spc-phero__meta {
    font-size: .85rem;
    color: var(--dk-muted);
    margin: 0;
}

/* ============================================================
   Two-column grid — .spc-legal__grid
   Desktop: sticky 260px sidebar + fluid body (max 760px prose).
   Collapses to single column below 1024px.
   ============================================================ */
.spc-legal__grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: clamp(36px, 5vw, 64px);
    align-items: start;
    padding-top: clamp(48px, 7vw, 72px);
    padding-bottom: clamp(64px, 9vw, 110px);
}

@media (max-width: 1023px) {
    .spc-legal__grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* ============================================================
   Sidebar — .spc-legal__side
   ============================================================ */
.spc-legal__side {
    position: sticky;
    top: 120px; /* clears fixed nav (~76px) + 44px breathing room */
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

@media (max-width: 1023px) {
    .spc-legal__side {
        position: static;
        max-height: none;
        overflow-y: visible;
        border-bottom: 1px solid var(--border);
        margin-bottom: 36px;
        padding-bottom: 24px;
    }
}

/* ============================================================
   Table of contents nav — .spc-legal__toc
   interactions.js auto-builds <a> links from h2 headings
   and toggles .is-active on the link matching the scrolled section.
   ============================================================ */
.spc-legal__toc {
    /* Minor title above the links */
}

.spc-legal__toc::before {
    content: "On this page";
    display: block;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted-fg);
    margin-bottom: 14px;
}

.spc-legal__toc a {
    display: block;
    font-size: .88rem;
    font-weight: 500;
    color: var(--muted-fg);
    padding: 7px 14px 7px 16px;
    border-left: 2px solid var(--border);
    border-radius: 0 6px 6px 0;
    line-height: 1.35;
    transition:
        color var(--t-fast) var(--ease-out),
        border-color var(--t-fast) var(--ease-out),
        background var(--t-fast) var(--ease-out);
    text-decoration: none;
}

.spc-legal__toc a:hover {
    color: var(--navy);
    border-left-color: var(--blue-bright);
    background: var(--sky);
}

.spc-legal__toc a.is-active {
    color: var(--blue);
    font-weight: 700;
    border-left-color: var(--blue);
    background: linear-gradient(90deg, rgba(0, 97, 255, .08) 0%, transparent 100%);
}

@media (max-width: 1023px) {
    /* Horizontal scrollable pill-row on mobile */
    .spc-legal__toc::before {
        display: none;
    }

    .spc-legal__toc {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .spc-legal__toc a {
        border-left: none;
        border: 1.5px solid var(--border);
        border-radius: var(--radius-pill);
        padding: 6px 14px;
        background: var(--muted);
        font-size: .82rem;
        white-space: nowrap;
    }

    .spc-legal__toc a.is-active {
        border-color: var(--blue);
        background: var(--sky);
        color: var(--blue);
    }
}

/* ============================================================
   Article body — .spc-legal__body
   ============================================================ */
.spc-legal__body {
    max-width: 760px;
    min-width: 0; /* grid overflow guard */
}

/* Intro block — displayed above the first h2 */
.spc-legal__intro {
    margin-bottom: 36px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border);
}

.spc-legal__intro p {
    font-size: 1.06rem;
    color: var(--muted-fg);
    line-height: 1.7;
    margin: 0;
}

/* Section headings */
.spc-legal__body h2 {
    font-size: clamp(1.15rem, 2vw, 1.38rem);
    font-weight: 800;
    color: var(--navy);
    letter-spacing: -0.01em;
    margin: 0 0 14px;
    padding-top: 8px;
    /* Offset anchored scroll for the fixed nav + sticky TOC label */
    scroll-margin-top: 120px;
}

/* Section separator between h2 blocks */
.spc-legal__body h2 + p,
.spc-legal__body h2 + ul,
.spc-legal__body h2 + div {
    margin-top: 0;
}

/* Space between sections */
.spc-legal__body h2:not(:first-child) {
    margin-top: clamp(36px, 5vw, 52px);
    padding-top: clamp(30px, 4vw, 44px);
    border-top: 1px solid var(--border);
}

/* Body text */
.spc-legal__body p {
    font-size: 1rem;
    color: var(--fg);
    line-height: 1.75;
    margin: 0 0 1em;
}

/* Lists */
.spc-legal__body ul,
.spc-legal__body ol {
    margin: 0 0 1.1em 0;
    padding-left: 1.5em;
}

.spc-legal__body li {
    font-size: 1rem;
    color: var(--fg);
    line-height: 1.7;
    margin-bottom: .45em;
}

/* Inline code (storage key names) */
.spc-legal__body code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: .88em;
    background: var(--muted-2);
    color: var(--navy);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

/* Links inside prose */
.spc-legal__body a {
    color: var(--blue);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(0, 97, 255, .35);
    transition: color var(--t-fast), text-decoration-color var(--t-fast);
}

.spc-legal__body a:hover {
    color: var(--blue-dark);
    text-decoration-color: var(--blue-dark);
}

/* Strong emphasis */
.spc-legal__body strong {
    font-weight: 700;
    color: var(--navy);
}

/* Table wrapper (cookie table) */
.spc-legal__body table {
    width: 100%;
    border-collapse: collapse;
    font-size: .93rem;
    line-height: 1.55;
    margin-bottom: 1.1em;
}

.spc-legal__body th {
    font-weight: 700;
    color: var(--navy);
    background: var(--muted);
    text-align: left;
    padding: 10px 14px;
    border: 1px solid var(--border);
}

.spc-legal__body td {
    padding: 10px 14px;
    border: 1px solid var(--border);
    vertical-align: top;
    color: var(--fg);
}

.spc-legal__body tr:nth-child(even) td {
    background: var(--muted);
}

/* ============================================================
   Soft CTA card — sits at the foot of the article
   ============================================================ */
.spc-legal__cta-card {
    margin-top: clamp(52px, 7vw, 80px);
    padding: clamp(28px, 4vw, 40px);
    background: var(--sky);
    border: 1px solid rgba(0, 97, 255, .18);
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
}

.spc-legal__cta-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--grad);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.spc-legal__cta-head {
    font-size: clamp(1.15rem, 2vw, 1.4rem);
    font-weight: 800;
    color: var(--navy);
    margin: 0 0 10px;
    line-height: 1.2;
}

.spc-legal__cta-sub {
    font-size: .97rem;
    color: var(--muted-fg);
    line-height: 1.65;
    margin: 0 0 22px;
    max-width: 560px;
}

.spc-legal__cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

@media (max-width: 540px) {
    .spc-legal__cta-row .spc-btn {
        width: 100%;
        justify-content: center;
    }
}
