/* ==========================================================================
   Privacy policy / terms of use — the two legal pages.
   Link AFTER site.css, which owns the tokens and the shared chrome.
   ========================================================================== */

.legal-meta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: .6rem;
    margin-top: 1.25rem;
}

.legal-chip {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .4rem 1rem;
    border-radius: 999px;
    font-size: .85rem;
    font-weight: 700;
    color: var(--brand);
    background: color-mix(in srgb, var(--brand) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--brand) 26%, transparent);
}

.legal-chip i { font-size: .8rem; }

/* --------------------------------------------------------------------------
   Layout: sticky table of contents beside the article.
   -------------------------------------------------------------------------- */
.legal-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 2.5rem;
    align-items: start;
    padding-block: clamp(2rem, 5vw, 3.5rem) clamp(3rem, 7vw, 5rem);
}

.legal-toc {
    position: sticky;
    /* Clears the sticky topbar; without this the first entry hides under it. */
    inset-block-start: calc(var(--header-h) + 16px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    max-height: calc(100vh - var(--header-h) - 48px);
    overflow-y: auto;
}

.legal-toc h2 {
    font-size: .95rem;
    font-weight: 900;
    color: var(--text-muted);
    letter-spacing: .02em;
    margin-bottom: .85rem;
}

.legal-toc ol {
    list-style: none;
    counter-reset: toc;
    display: grid;
    gap: .15rem;
}

.legal-toc a {
    counter-increment: toc;
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    padding: .5rem .6rem;
    border-radius: 10px;
    font-size: .92rem;
    color: var(--text-muted);
    transition: var(--transition);
    line-height: 1.5;
}

.legal-toc a::before {
    content: counter(toc);
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    font-size: .72rem;
    font-weight: 900;
    background: var(--surface-2);
    color: var(--text-muted);
    transition: var(--transition);
}

.legal-toc a:hover,
.legal-toc a.is-active { background: color-mix(in srgb, var(--brand) 10%, transparent); color: var(--brand); }

.legal-toc a:hover::before,
.legal-toc a.is-active::before { background: var(--brand); color: #fff; }

/* --------------------------------------------------------------------------
   The article itself
   -------------------------------------------------------------------------- */
.legal-intro {
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--brand) 8%, var(--surface)),
        var(--surface));
    border: 1px solid var(--border);
    border-inline-start: 4px solid var(--brand);
    border-radius: var(--radius);
    padding: clamp(1.25rem, 3vw, 2rem);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.legal-intro p { color: var(--text-muted); font-size: 1.03rem; }
.legal-intro p + p { margin-top: .9rem; }

.legal-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: clamp(1.25rem, 3vw, 2rem);
    box-shadow: var(--shadow-sm);
    /* Anchored jumps must not land under the sticky topbar. */
    scroll-margin-top: calc(var(--header-h) + 20px);
    transition: var(--transition);
}

.legal-section + .legal-section { margin-top: 1.25rem; }
.legal-section:hover { box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--brand) 35%, var(--border)); }

.legal-section-head {
    display: flex;
    align-items: center;
    gap: .9rem;
    margin-bottom: 1rem;
}

.legal-section-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    font-size: 1.1rem;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-600));
    box-shadow: 0 6px 16px color-mix(in srgb, var(--brand) 32%, transparent);
}

.legal-section h3 {
    font-size: clamp(1.05rem, 2.4vw, 1.3rem);
    font-weight: 900;
    color: var(--text);
    line-height: 1.4;
}

.legal-num {
    font-size: .78rem;
    font-weight: 900;
    color: var(--lime-600);
    display: block;
    margin-bottom: .1rem;
}

.legal-body p { color: var(--text-muted); }
.legal-body p + p { margin-top: .85rem; }

.legal-body ul {
    list-style: none;
    display: grid;
    gap: .55rem;
    margin-top: .85rem;
}

.legal-body ul + p { margin-top: .85rem; }

.legal-body li {
    position: relative;
    padding-inline-start: 1.6rem;
    color: var(--text-muted);
}

.legal-body li::before {
    content: '\f058'; /* fa-circle-check */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    inset-inline-start: 0;
    inset-block-start: .18em;
    font-size: .85rem;
    color: var(--lime-600);
}

/* --------------------------------------------------------------------------
   Closing contact card
   -------------------------------------------------------------------------- */
.legal-contact {
    margin-top: 2rem;
    text-align: center;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    border-radius: var(--radius-lg);
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-700));
    box-shadow: var(--shadow-lg);
}

.legal-contact i { font-size: 1.8rem; margin-bottom: .7rem; opacity: .9; }
.legal-contact h3 { font-size: 1.25rem; font-weight: 900; margin-bottom: .5rem; }
.legal-contact p { opacity: .9; max-width: 55ch; margin-inline: auto; }

.legal-contact .btn-ghost {
    margin-top: 1.25rem;
    background: rgba(255, 255, 255, .14);
    border-color: rgba(255, 255, 255, .4);
    color: #fff;
}

.legal-contact .btn-ghost:hover { background: #fff; color: var(--brand); border-color: #fff; }

/* `.legal-siblings` (the cross-links between these pages) lives in site.css:
   contact.html uses it too and does not load this file. */

@media (max-width: 900px) {
    .legal-layout { grid-template-columns: 1fr; gap: 1.5rem; }
    /* Un-stick it: a sticky box above the article would cover the article. */
    .legal-toc { position: static; max-height: none; }
}
