/* ═══════════════════════════════════════════════════════
   LEGAL — Editorial content page  ·  Light theme
   S'intègre au fond blanc natif du site (--bg: #fff)
   ═══════════════════════════════════════════════════════ */

/* ── Tokens locaux calqués sur la palette site ── */
:root {
    --l-text: #1c1c1c;
    --l-muted: rgba(28, 28, 28, 0.55);
    --l-faint: rgba(28, 28, 28, 0.32);
    --l-border: rgba(28, 28, 28, 0.10);
    --l-surface: rgba(28, 28, 28, 0.03);
    --l-accent: #BC171F;
    --l-accent-bg: rgba(188, 23, 31, 0.05);
    --l-f-sans: 'Space Grotesk', system-ui, sans-serif;
    --l-f-serif: 'Instrument Serif', Georgia, serif;

    color: var(--l-text);
    font-family: var(--l-f-sans);
}

/* ── Reading progress bar ── */
.legal-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background: var(--l-accent);
    z-index: 9999;
    transition: width 80ms linear;
    pointer-events: none;
}

/* ── Page wrapper ── */
.legal-page {
    padding-top: 0rem;
    padding-bottom: 2rem;
    min-height: 100vh;
}

/* ── Document header ── */
.legal-header {
    max-width: 900px;
    margin: 0 auto 5rem;
    padding: 0 2rem 3.5rem;
    border-bottom: 1px solid var(--l-border);
}

.legal-header__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--l-accent);
    margin-bottom: 1.75rem;
}

.legal-header__eyebrow::before {
    content: '';
    display: block;
    width: 1.5rem;
    height: 1px;
    background: var(--l-accent);
    flex-shrink: 0;
}

.legal-header__title {
    font-family: var(--l-f-serif);
    font-size: clamp(2.4rem, 5vw, 4rem);
    font-weight: 400;
    font-style: italic;
    line-height: 1.15;
    color: var(--l-text);
    margin: 0 0 0.5rem;
}

.legal-header__entity {
    font-size: 1rem;
    font-weight: 600;
    color: var(--l-muted);
    margin: 0 0 2rem;
    letter-spacing: 0.02em;
}

.legal-header__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem 3rem;
}

.legal-header__meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.legal-header__meta-label {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--l-faint);
}

.legal-header__meta-value {
    font-size: 0.88rem;
    color: var(--l-muted);
}

/* ── Layout grid ── */
.legal-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 0 5rem;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
    align-items: start;
}

/* ── Sidebar / TOC ── */
.legal-sidebar {
    position: sticky;
    top: 7rem;
    max-height: calc(100vh - 9rem);
    overflow-y: auto;
    scrollbar-width: none;
    padding-bottom: 2rem;
}

.legal-sidebar::-webkit-scrollbar {
    display: none;
}

.legal-toc__label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--l-faint);
    margin-bottom: 1.25rem;
    padding-left: 1rem;
}

.legal-toc__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.legal-toc__item a {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.55rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    color: var(--l-faint);
    font-size: 0.82rem;
    line-height: 1.3;
    transition: color 0.2s, background 0.2s;
}

.legal-toc__item a:hover {
    color: var(--l-text);
    background: var(--l-surface);
}

.legal-toc__item a.is-active {
    color: var(--l-accent);
    background: var(--l-accent-bg);
}

.legal-toc__num {
    font-size: 0.68rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: inherit;
    opacity: 0.6;
    min-width: 1.4rem;
    flex-shrink: 0;
}

.legal-toc__intro {
    margin-top: 2rem;
    padding: 1rem;
    font-size: 0.78rem;
    line-height: 1.6;
    color: var(--l-faint);
    border-top: 1px solid var(--l-border);
}

/* ── Main content ── */
.legal-body {
    min-width: 0;
}

/* ── Intro block ── */
.legal-intro {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--l-muted);
    padding: 2rem;
    background: var(--l-surface);
    border-left: 2px solid var(--l-border);
    border-radius: 0 8px 8px 0;
    margin-bottom: 4rem;
}

/* ── Sections ── */
.legal-section {
    padding: 3.5rem 0;
    border-bottom: 1px solid var(--l-border);
    scroll-margin-top: 8rem;
}

.legal-section:last-child {
    border-bottom: none;
}

.legal-section__header {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.legal-section__num {
    font-family: var(--l-f-serif);
    font-size: 5rem;
    font-style: italic;
    font-weight: 400;
    line-height: 1;
    color: rgba(28, 28, 28, 0.06);
    flex-shrink: 0;
    user-select: none;
    pointer-events: none;
    margin-top: -0.5rem;
}

.legal-section__title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--l-text);
    line-height: 1.3;
    letter-spacing: -0.01em;
    padding-top: 0.5rem;
}

/* ── Body text ── */
.legal-section__body {
    padding-left: calc(4rem + 1.5rem);
}

.legal-section__body p {
    font-size: 0.93rem;
    line-height: 1.85;
    color: var(--l-muted);
    margin: 0 0 1.2em;
}

.legal-section__body p:last-child {
    margin-bottom: 0;
}

.legal-section__body strong {
    color: var(--l-text);
    font-weight: 600;
}

.legal-section__body ul {
    margin: 0.5rem 0 1.2rem;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.legal-section__body li {
    font-size: 0.93rem;
    line-height: 1.7;
    color: var(--l-muted);
    padding-left: 1.5rem;
    position: relative;
}

.legal-section__body li::before {
    content: '—';
    position: absolute;
    left: 0;
    color: var(--l-accent);
    font-size: 0.8em;
    top: 0.1em;
}

/* ── Highlight callout ── */
.legal-callout {
    margin-top: 1.5rem;
    padding: 1.1rem 1.4rem;
    background: var(--l-accent-bg);
    border-left: 2px solid var(--l-accent);
    border-radius: 0 6px 6px 0;
    font-size: 0.86rem;
    line-height: 1.7;
    color: var(--l-muted);
    font-style: italic;
}

/* ── Mobile TOC toggle ── */
.legal-toc-mobile {
    display: none;
    margin-bottom: 2.5rem;
}

.legal-toc-mobile__btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.9rem 1.2rem;
    background: var(--l-surface);
    border: 1px solid var(--l-border);
    border-radius: 8px;
    color: var(--l-muted);
    font-family: var(--l-f-sans);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.legal-toc-mobile__btn:hover {
    background: rgba(28, 28, 28, 0.06);
}

.legal-toc-mobile__btn svg {
    transition: transform 0.25s;
}

.legal-toc-mobile.is-open .legal-toc-mobile__btn svg {
    transform: rotate(180deg);
}

.legal-toc-mobile__panel {
    display: none;
    padding: 0.75rem;
    background: var(--l-surface);
    border: 1px solid var(--l-border);
    border-top: none;
    border-radius: 0 0 8px 8px;
}

.legal-toc-mobile.is-open .legal-toc-mobile__panel {
    display: block;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .legal-layout {
        grid-template-columns: 1fr;
    }

    .legal-sidebar {
        display: none;
    }

    .legal-toc-mobile {
        position: fixed;
        top: 100px;
        background: #fff;
        width: 100%;
        left: 0;
        padding: 0 10px;
        z-index: 9999;
        display: block;
    }
}

@media (max-width: 640px) {
    .legal-page {
        padding-top: .5rem;
    }

    .legal-header {
        padding: 0 1.25rem 2.5rem;
        margin-bottom: 3rem;
    }

    .legal-header__title {
        font-size: clamp(2rem, 8vw, 2.8rem);
    }

    .legal-layout {
        padding: 0 1.25rem;
    }

    .legal-section__num {
        font-size: 3.5rem;
    }

    .legal-section__body {
        padding-left: 0;
    }

    .legal-section__header {
        gap: 1rem;
    }

    .legal-intro {
        padding: 1.25rem;
        font-size: 0.95rem;
    }
}