/* ============================================================
   Numérotation stylée pour pages légales longues
   ============================================================
   Pages concernées : /confidentialite, et éventuelles futures
   pages légales longues (CGU, CGV…).

   Style "magazine cuisine" : chiffre serif élégant en couleur
   primaire avec filet horizontal sous le titre. Le compteur CSS
   s'auto-incrémente : pas besoin de gérer les numéros à la main.

   Inclut également :
   - Sommaire cliquable en haut de page (.legal-toc)
   - Sous-titres avec barre verticale colorée

   Usage :
     <nav class="legal-toc">
       <h2>Sommaire</h2>
       <ol>
         <li><a href="#section-1">Introduction</a></li>
         ...
       </ol>
     </nav>

     <div class="legal-content">
       <section id="section-1" class="legal-section">
         <h2 class="legal-section-title">
           <span class="legal-section-number"></span>
           <span class="legal-section-text">📝 Titre</span>
         </h2>
         <h3 class="legal-subtitle">Sous-titre</h3>
         <p>...</p>
       </section>
     </div>
*/

/* ============================================================
   Sommaire cliquable
   ============================================================ */
.legal-toc {
    background-color: rgba(0, 0, 0, 0.03);
    border-left: 4px solid var(--color-primary);
    border-radius: 0.375rem;
    padding: 1.5rem 1.75rem;
    margin-bottom: 3rem;
}

.dark .legal-toc {
    background-color: rgba(255, 255, 255, 0.04);
}

.legal-toc-title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.legal-toc ol {
    list-style: none;
    padding-left: 0;
    margin: 0;
    counter-reset: legal-toc;
    columns: 2;
    column-gap: 2rem;
}

@media (max-width: 640px) {
    .legal-toc ol {
        columns: 1;
    }
}

.legal-toc li {
    counter-increment: legal-toc;
    margin-bottom: 0.5rem;
    break-inside: avoid;
}

.legal-toc li::before {
    content: counter(legal-toc, decimal-leading-zero);
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 700;
    color: var(--color-primary);
    margin-right: 0.5rem;
    opacity: 0.7;
}

.legal-toc a {
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.2s;
}

.legal-toc a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

/* ============================================================
   Sections numérotées (compteur CSS auto)
   ============================================================ */
.legal-content {
    counter-reset: legal-section;
}

.legal-section {
    counter-increment: legal-section;
    margin-bottom: 3rem;
    /* Offset pour que les ancres ne soient pas masquées par le header fixed */
    scroll-margin-top: 5rem;
}

/* Titre de section */
.legal-section-title {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 700;
}

/* Numéro serif décoratif (auto-incrémenté) */
.legal-section-title::before {
    content: counter(legal-section, decimal-leading-zero);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
    opacity: 0.9;
    flex-shrink: 0;
}

/* ============================================================
   Sous-titres
   ============================================================ */
.legal-subtitle {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--color-primary);
    margin: 1.5rem 0 0.5rem;
    padding-left: 0.5rem;
    border-left: 3px solid var(--color-primary);
}