/* ════════════════════════════════
   PAGES LÉGALES - Identité Aperitiu
   Sections : Hero orange / Body cream avec TOC sticky + carte contenu
════════════════════════════════ */

.legal-page {
    --lg-cream:     #f3e9d7;
    --lg-cream-2:   #fbf4e9;
    --lg-cream-3:   #f1ead8;
    --lg-white:     #fffdf8;
    --lg-orange:    #ffa200;
    --lg-orange-2:  #f3a63c;
    --lg-red:       #e85a28;
    --lg-red-dark:  #b22222;
    --lg-dark:      #242323;
    --lg-grey:      #dbdbdb;
    --lg-muted:     #7a6b58;

    --lg-font-display: 'Erica One', 'Anton', Impact, sans-serif;
    --lg-font-script:  'Darumadrop One', 'Caveat', cursive;
    --lg-font-body:    'DM Sans', 'Poppins', system-ui, sans-serif;

    --lg-max: 1440px;
    --lg-pad: 100px;

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

.legal-page main { padding-top: 0; padding-bottom: 0; }
body.legal-page > .blob { display: none !important; }

.legal-page h1,
.legal-page h2,
.legal-page h3,
.legal-page h4 { margin: 0; }

.legal-page ul,
.legal-page ol { margin: 0; padding: 0; list-style: none; }

.legal-page img { display: block; max-width: 100%; }

/* ════════════════════════════════
   1. HERO
════════════════════════════════ */
.lg-hero {
    position: relative;
    min-height: 460px;
    background-color: var(--lg-red);
    background-image: url('/images/home/union3.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 140px 0 110px;
}

.lg-hero-mascot {
    position: absolute;
    top: 100px;
    left: 26px;
    width: 100px;
    height: 88px;
    pointer-events: none;
    z-index: 2;
    transform: rotate(-5.5deg);
}
.lg-hero-mascot img {
    width: 100%; height: 100%;
    object-fit: contain;
    opacity: .92;
}

.lg-hero-inner {
    max-width: var(--lg-max);
    margin: 0 auto;
    padding: 0 var(--lg-pad);
    position: relative;
    z-index: 3;
    color: #fff;
}

.lg-hero-eyebrow {
    font-family: var(--lg-font-body);
    font-size: 14px;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: rgba(255,255,255,.82);
    margin: 0 0 16px;
    font-weight: 500;
}

.lg-hero-title {
    font-family: var(--lg-font-script);
    font-size: clamp(52px, 7.2vw, 96px);
    line-height: 1.02;
    letter-spacing: 0;
    color: #fff;
    margin: 0 0 20px;
}
.lg-hero-title-line { display: block; }

.lg-hero-tagline {
    font-family: var(--lg-font-body);
    font-size: clamp(15px, 1.2vw, 17px);
    color: rgba(255,255,255,.92);
    margin: 0;
    font-weight: 400;
}

/* ════════════════════════════════
   2. BODY - layout TOC + carte contenu
════════════════════════════════ */
.lg-body {
    position: relative;
    background: var(--lg-cream);
    padding: 90px 0 100px;
}

.lg-body-inner {
    max-width: 1480px;
    margin: 0 auto;
    padding: 0 var(--lg-pad);
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 60px;
    align-items: start;
}

/* ── Table des matières sticky ── */
.lg-toc {
    position: sticky;
    top: 110px;
    align-self: start;
}

.lg-toc-heading {
    font-family: var(--lg-font-script);
    font-size: 28px;
    line-height: 1;
    letter-spacing: 0;
    color: var(--lg-dark);
    margin: 0 0 18px;
}

.lg-toc-list {
    counter-reset: lg-toc;
    border-left: 2px solid rgba(36, 35, 35, .12);
    margin: 0 0 30px;
}
.lg-toc-list li {
    counter-increment: lg-toc;
    position: relative;
    margin: 0;
}
.lg-toc-list a {
    display: block;
    padding: 9px 0 9px 18px;
    margin-left: -2px;
    border-left: 2px solid transparent;
    font-family: var(--lg-font-body);
    font-size: 14px;
    line-height: 1.4;
    color: var(--lg-muted);
    text-decoration: none;
    transition: color .18s, border-color .18s;
}
.lg-toc-list a::before {
    content: counter(lg-toc, decimal-leading-zero);
    display: inline-block;
    width: 28px;
    font-family: var(--lg-font-display);
    font-size: 13px;
    color: var(--lg-orange);
    letter-spacing: .04em;
}
.lg-toc-list a:hover { color: var(--lg-dark); }
.lg-toc-list a.is-active {
    color: var(--lg-red);
    border-left-color: var(--lg-red);
    font-weight: 600;
}
.lg-toc-list a.is-active::before { color: var(--lg-red); }

.lg-toc-other {
    border-top: 1px solid rgba(36, 35, 35, .12);
    padding-top: 22px;
}
.lg-toc-other-title {
    font-family: var(--lg-font-body);
    font-size: 11px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--lg-muted);
    margin: 0 0 12px;
    font-weight: 600;
}
.lg-toc-other-list { display: flex; flex-direction: column; gap: 6px; }
.lg-toc-other-list a {
    font-family: var(--lg-font-body);
    font-size: 13px;
    color: var(--lg-dark);
    text-decoration: none;
    transition: color .15s;
}
.lg-toc-other-list a:hover { color: var(--lg-red); }

/* ── Carte contenu ── */
.lg-card {
    background: var(--lg-white);
    border: 1px solid rgba(36, 35, 35, .08);
    border-radius: 18px;
    padding: 64px 80px 68px;
    box-shadow:
        0 30px 50px -25px rgba(36, 35, 35, .14),
        0 1px 0 rgba(255, 255, 255, .9) inset;
    position: relative;
}

/* WYSIWYG output rules */
.lg-card h2 {
    font-family: var(--lg-font-script);
    font-size: clamp(30px, 2.6vw, 42px);
    line-height: 1.15;
    letter-spacing: 0;
    color: var(--lg-dark);
    margin: 50px 0 18px;
    scroll-margin-top: 90px;
    padding-top: 16px;
    position: relative;
}
.lg-card h2:first-child { margin-top: 0; padding-top: 0; }
.lg-card h2::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 48px;
    height: 4px;
    background: var(--lg-red);
    border-radius: 2px;
}
.lg-card h2:first-child::before { display: none; }

.lg-card h3 {
    font-family: var(--lg-font-script);
    font-size: clamp(22px, 2vw, 30px);
    color: var(--lg-dark);
    letter-spacing: 0;
    line-height: 1.2;
    margin: 30px 0 12px;
}

.lg-card p {
    font-family: var(--lg-font-body);
    font-size: 16px;
    line-height: 1.7;
    color: var(--lg-dark);
    margin: 0 0 14px;
    font-weight: 400;
}

.lg-card ul,
.lg-card ol {
    margin: 12px 0 18px;
    padding-left: 26px;
    font-family: var(--lg-font-body);
    font-size: 16px;
    line-height: 1.7;
    color: var(--lg-dark);
}
.lg-card ul { list-style: none; }
.lg-card ul li {
    position: relative;
    padding-left: 6px;
    margin-bottom: 8px;
}
.lg-card ul li::before {
    content: '';
    position: absolute;
    left: -18px;
    top: 12px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--lg-orange);
}
.lg-card ol { list-style: decimal-leading-zero; }
.lg-card ol li { margin-bottom: 8px; }
.lg-card ol li::marker { color: var(--lg-orange); font-weight: 600; }
.lg-card li p { margin: 0; }
.lg-card li p + p { margin-top: 4px; }

.lg-card a {
    color: var(--lg-red);
    text-decoration: none;
    border-bottom: 1px solid rgba(232, 90, 40, .35);
    transition: border-color .15s, color .15s;
}
.lg-card a:hover {
    color: var(--lg-red-dark);
    border-bottom-color: var(--lg-red-dark);
}

.lg-card strong { font-weight: 600; color: var(--lg-dark); }
.lg-card em { color: var(--lg-muted); }

.lg-card hr {
    border: none;
    border-top: 1px solid rgba(36, 35, 35, .12);
    margin: 36px 0;
}

.lg-card blockquote {
    border-left: 3px solid var(--lg-orange);
    padding: 8px 0 8px 20px;
    margin: 18px 0;
    color: var(--lg-muted);
    font-style: italic;
    background: var(--lg-cream-2);
    border-radius: 0 8px 8px 0;
}

.lg-card table {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0;
    font-size: 15px;
    font-family: var(--lg-font-body);
}
.lg-card th,
.lg-card td {
    border-bottom: 1px solid rgba(36, 35, 35, .12);
    padding: 12px 14px;
    text-align: left;
}
.lg-card th {
    background: var(--lg-cream-2);
    color: var(--lg-dark);
    font-weight: 600;
}

.lg-card code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    color: var(--lg-red);
    background: rgba(232, 90, 40, .08);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 14px;
}

/* ── Lien retour ── */
.lg-back-wrap {
    max-width: 1480px;
    margin: 50px auto 0;
    padding: 0 var(--lg-pad);
    text-align: center;
}
.lg-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--lg-font-body);
    font-size: 14px;
    font-weight: 500;
    color: var(--lg-dark);
    text-decoration: none;
    padding: 12px 22px;
    border-radius: 999px;
    border: 1.5px solid var(--lg-dark);
    background: transparent;
    transition: background .18s, color .18s, border-color .18s;
}
.lg-back-link svg {
    width: 14px; height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}
.lg-back-link:hover {
    background: var(--lg-dark);
    color: var(--lg-cream-2);
}

/* ════════════════════════════════
   RESPONSIVE
════════════════════════════════ */
@media (max-width: 1100px) {
    .legal-page { --lg-pad: 56px; }
    .lg-body-inner { grid-template-columns: 220px 1fr; gap: 50px; }
    .lg-card { padding: 44px 44px 50px; }
}

@media (max-width: 880px) {
    .legal-page { --lg-pad: 32px; }
    .lg-hero { min-height: 380px; padding: 110px 0 90px; }
    .lg-hero-mascot { top: 80px; width: 76px; height: 68px; }

    .lg-body { padding: 60px 0 80px; }
    .lg-body-inner {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .lg-toc {
        position: static;
        background: var(--lg-white);
        border-radius: 16px;
        padding: 22px 24px;
        border: 1px solid rgba(36, 35, 35, .08);
    }
    .lg-toc-heading { font-size: 22px; margin-bottom: 12px; }
    .lg-toc-list { margin-bottom: 18px; }
    .lg-toc-list a { padding: 6px 0 6px 14px; font-size: 13.5px; }

    .lg-card {
        padding: 32px 26px 36px;
        border-radius: 14px;
    }
    .lg-card h2 { margin-top: 36px; font-size: 30px; }
}

@media (max-width: 480px) {
    .legal-page { --lg-pad: 18px; }
    .lg-card { padding: 26px 20px 30px; }
    .lg-card p, .lg-card ul, .lg-card ol { font-size: 15px; }
}
