/* ============================================================
   Typographie pages legales/politiques uniquement
   Reduit les tailles trop grosses des titres sur les pages
   contenant .mil-legal-content (privacy, terms, charte-ia,
   accessibilite, cookies, sources, gouvernance-rp,
   droit-explication-ia, mentions-legales).
   N'affecte PAS les autres pages (homepage, blog, services).
   Ratios 2026 best practice : h1 36px / h2 24px / h3 20px / p 16px
   ============================================================ */

/* --- H1 banner page legale (cible via :has() pour scope au body) --- */
body:has(.mil-legal-content) .mil-banner h1,
body:has(.mil-legal-content) .mil-banner .mil-h1,
body:has(.mil-legal-content) .mil-inner-banner h1,
body:has(.mil-legal-content) .mil-inner-banner .mil-h1 {
    font-size: 2.25rem !important;       /* 36px desktop */
    line-height: 1.2 !important;
    font-weight: 500 !important;
}

/* --- H2 contenu legal --- */
.mil-legal-content h2 {
    font-size: 1.5rem !important;        /* 24px desktop */
    line-height: 1.3 !important;
    font-weight: 500 !important;
    margin-top: 2rem !important;
    margin-bottom: 1rem !important;
}

/* --- H3 contenu legal --- */
.mil-legal-content h3 {
    font-size: 1.25rem !important;       /* 20px desktop */
    line-height: 1.4 !important;
    font-weight: 500 !important;
    margin-top: 1.5rem !important;
    margin-bottom: 0.75rem !important;
}

/* --- H4 contenu legal (rarement utilise mais coherent) --- */
.mil-legal-content h4 {
    font-size: 1.125rem !important;      /* 18px desktop */
    line-height: 1.4 !important;
    font-weight: 600 !important;
    margin-top: 1.25rem !important;
    margin-bottom: 0.5rem !important;
}

/* --- Paragraphes contenu legal --- */
.mil-legal-content p {
    font-size: 1rem !important;          /* 16px */
    line-height: 1.6 !important;
}

/* --- Listes contenu legal --- */
.mil-legal-content ul,
.mil-legal-content ol {
    font-size: 1rem !important;
    line-height: 1.6 !important;
}

.mil-legal-content li {
    font-size: 1rem !important;
    line-height: 1.6 !important;
}

/* ============================================================
   Mobile (max-width: 768px) : reduction supplementaire ~10-15%
   ============================================================ */
@media (max-width: 768px) {
    body:has(.mil-legal-content) .mil-banner h1,
    body:has(.mil-legal-content) .mil-banner .mil-h1,
    body:has(.mil-legal-content) .mil-inner-banner h1,
    body:has(.mil-legal-content) .mil-inner-banner .mil-h1 {
        font-size: 1.875rem !important;  /* 30px mobile */
        line-height: 1.2 !important;
    }

    .mil-legal-content h2 {
        font-size: 1.375rem !important;  /* 22px mobile */
    }

    .mil-legal-content h3 {
        font-size: 1.125rem !important;  /* 18px mobile */
    }

    .mil-legal-content h4 {
        font-size: 1rem !important;      /* 16px mobile */
    }
}

/* ============================================================
   Fallback navigateurs sans :has() (Firefox <121, vieux Safari)
   On retombe sur des selecteurs directs : si la page contient
   .mil-legal-content (donc page legale), on suppose que le
   .mil-banner ou .mil-inner-banner precede. On cible alors
   les sections sœurs via combinator general.
   ============================================================ */
@supports not selector(:has(*)) {
    /* Si :has() pas supporte, on applique directement aux h1 dans
       toute section banner sur les pages dont la page legale a
       deja .mil-legal-content. On utilise un selecteur de class
       sur main pour scope mais comme fallback minimal, on cible
       toute page contenant legal-content via une class wrapper.
       Solution : ajouter manuellement la class .legal-page-active
       sur body ou laisser le rendu natif (titres restent gros sur
       Firefox <121). En 2026 les browsers majeurs supportent :has()
       (Chrome 105+, Safari 15.4+, Firefox 121+). */
    .mil-legal-content h2 { font-size: 1.5rem !important; }
    .mil-legal-content h3 { font-size: 1.25rem !important; }
}
