/* ============================================================================
   hb-consent.css — Bandeau de consentement aux traceurs, Hélène B
   ----------------------------------------------------------------------------
   Mécanisme UNIQUE du site vitrine. Remplace le bandeau Finsweet (fs-cc) et le
   bandeau maison inline qui coexistaient auparavant.

   Palette imposée : navy #2A2A41, navy profond #1F1F30, or #CDAF76,
   or clair #E0C896, blanc #FFFFFF, crème #FAF7F1. Aucune autre teinte.

   Exigences CNIL couvertes ici, côté visuel :
     - « Tout accepter » et « Tout refuser » ont EXACTEMENT le même style,
       la même taille, le même contraste et le même niveau de clic.
       Aucun bouton grisé, aucun bouton secondaire pour le refus.
     - Cibles tactiles de 44 px minimum.
     - Contrastes : blanc sur navy 13,9:1, navy sur or 6,6:1, or sur navy 6,6:1.
   ========================================================================== */

.hb-cc,
.hb-cc__manager {
    --hb-cc-navy: #2a2a41;
    --hb-cc-navy-deep: #1f1f30;
    --hb-cc-gold: #cdaf76;
    --hb-cc-gold-light: #e0c896;
    --hb-cc-white: #ffffff;
    --hb-cc-paper: #faf7f1;
    --hb-cc-body: 'Inter', 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --hb-cc-title: 'Lora', Georgia, 'Times New Roman', serif;
}

/* --------------------------------------------------------------------------
   Conteneur. Position fixe en bas, sur toute la largeur.
   Le fond de page reste visible, lisible et défilable : le bandeau ne bloque
   jamais la consultation du site.
   -------------------------------------------------------------------------- */
.hb-cc {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 2147483000;
    display: flex;
    justify-content: center;
    padding: 0 16px calc(16px + env(safe-area-inset-bottom, 0px));
    pointer-events: none;
    font-family: var(--hb-cc-body);
}

.hb-cc[hidden] {
    display: none;
}

/* Le panneau ne défile jamais lui même : seule la liste des catégories défile.
   Les deux boutons « Tout accepter » et « Tout refuser » restent donc toujours
   visibles ensemble, y compris sur un petit écran avec le détail ouvert. Sans
   cela, refuser demanderait un défilement que accepter n'exige pas, ce qui est
   exactement le déséquilibre que la CNIL sanctionne. */
.hb-cc__panel {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1080px;
    max-height: min(82vh, 720px);
    overflow: hidden;
    box-sizing: border-box;
    padding: 26px 30px 24px;
    background: var(--hb-cc-navy);
    color: var(--hb-cc-white);
    border: 1px solid rgba(205, 175, 118, 0.32);
    border-radius: 18px;
    box-shadow: 0 24px 48px rgba(31, 31, 48, 0.42);
    animation: hb-cc-rise 420ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes hb-cc-rise {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --------------------------------------------------------------------------
   Typographie
   -------------------------------------------------------------------------- */
.hb-cc__title {
    margin: 0 0 10px;
    font-family: var(--hb-cc-title);
    font-style: italic;
    font-weight: 500;
    font-size: 1.35rem;
    line-height: 1.25;
    color: var(--hb-cc-gold);
}

.hb-cc__text {
    margin: 0 0 18px;
    font-size: 0.94rem;
    line-height: 1.62;
    color: var(--hb-cc-white);
    max-width: 74ch;
}

.hb-cc__link {
    color: var(--hb-cc-gold);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.hb-cc__link:hover,
.hb-cc__link:focus-visible {
    color: var(--hb-cc-gold-light);
}

/* --------------------------------------------------------------------------
   Panneau de catégories. Cases NON cochées par défaut, sauf la catégorie
   strictement nécessaire qui est cochée et désactivée.
   -------------------------------------------------------------------------- */
.hb-cc__prefs {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    margin: 0 0 20px;
    border-top: 1px solid rgba(205, 175, 118, 0.22);
    padding-top: 18px;
}

.hb-cc__prefs[hidden] {
    display: none;
}

.hb-cc__group {
    margin: 0;
    padding: 0;
    border: 0;
}

.hb-cc__legend {
    padding: 0;
    margin: 0 0 12px;
    font-family: var(--hb-cc-title);
    font-style: italic;
    font-size: 1.02rem;
    color: var(--hb-cc-gold);
}

.hb-cc__cat {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    min-height: 44px;
}

.hb-cc__cat:last-child {
    border-bottom: 0;
}

.hb-cc__cat input[type='checkbox'] {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    margin: 2px 0 0;
    accent-color: var(--hb-cc-gold);
    cursor: pointer;
}

.hb-cc__cat input[type='checkbox']:disabled {
    cursor: default;
}

.hb-cc__cat-body {
    flex: 1 1 auto;
    min-width: 0;
}

.hb-cc__cat-name {
    display: block;
    font-size: 0.94rem;
    font-weight: 600;
    color: var(--hb-cc-white);
    margin-bottom: 3px;
}

.hb-cc__cat-desc {
    display: block;
    font-size: 0.83rem;
    line-height: 1.55;
    color: var(--hb-cc-paper);
    opacity: 0.86;
}

/* --------------------------------------------------------------------------
   Boutons. « Tout accepter » et « Tout refuser » partagent la classe
   .hb-cc__btn sans aucun modificateur : leur apparence est identique, à la
   couleur près du bord jamais. C'est la contrainte CNIL centrale.
   -------------------------------------------------------------------------- */
.hb-cc__title,
.hb-cc__text,
.hb-cc__actions,
.hb-cc__more {
    flex: 0 0 auto;
}

.hb-cc__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.hb-cc__btn {
    flex: 1 1 200px;
    min-height: 48px;
    padding: 13px 26px;
    border: 1px solid var(--hb-cc-gold);
    border-radius: 999px;
    background: var(--hb-cc-gold);
    color: var(--hb-cc-navy-deep);
    font-family: var(--hb-cc-body);
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    transition:
        background 200ms cubic-bezier(0.34, 1.56, 0.64, 1),
        transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hb-cc__btn:hover {
    background: var(--hb-cc-gold-light);
    border-color: var(--hb-cc-gold-light);
    transform: translateY(-1px);
}

.hb-cc__btn[hidden] {
    display: none;
}

.hb-cc__more {
    display: inline-block;
    margin-top: 14px;
    min-height: 44px;
    padding: 11px 4px;
    border: 0;
    background: none;
    color: var(--hb-cc-gold);
    font-family: var(--hb-cc-body);
    font-size: 0.88rem;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.hb-cc__more:hover,
.hb-cc__more:focus-visible {
    color: var(--hb-cc-gold-light);
}

.hb-cc :focus-visible {
    outline: 2px solid var(--hb-cc-gold-light);
    outline-offset: 3px;
    border-radius: 6px;
}

/* --------------------------------------------------------------------------
   Point d'entrée permanent, injecté en fin de page quand aucun déclencheur
   n'existe déjà dans le pied de page.
   -------------------------------------------------------------------------- */
.hb-cc__manager {
    display: block;
    width: 100%;
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
    border: 0;
    background: var(--hb-cc-navy-deep);
    color: var(--hb-cc-gold);
    font-family: var(--hb-cc-body);
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    text-align: center;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    min-height: 44px;
}

.hb-cc__manager:hover,
.hb-cc__manager:focus-visible {
    color: var(--hb-cc-gold-light);
}

.hb-cc__manager--inline {
    display: inline-block;
    width: auto;
    padding: 11px 0;
    background: none;
}

/* --------------------------------------------------------------------------
   Sens de lecture droite vers gauche (arabe)
   -------------------------------------------------------------------------- */
.hb-cc--rtl .hb-cc__panel {
    direction: rtl;
    text-align: right;
}

.hb-cc--rtl .hb-cc__cat {
    text-align: right;
}

/* --------------------------------------------------------------------------
   Mobile. Boutons pleine largeur, empilés, cibles tactiles généreuses.
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
    .hb-cc {
        padding: 0 10px calc(10px + env(safe-area-inset-bottom, 0px));
    }

    .hb-cc__panel {
        padding: 22px 20px 20px;
        border-radius: 16px;
        max-height: 86vh;
    }

    .hb-cc__title {
        font-size: 1.2rem;
    }

    .hb-cc__text {
        font-size: 0.9rem;
        margin-bottom: 16px;
    }

    .hb-cc__btn {
        flex: 1 1 100%;
        min-height: 50px;
    }
}

/* --------------------------------------------------------------------------
   Anciens bandeaux neutralisés. Le markup Finsweet subsiste sur quelques pages
   et sa bibliothèque n'est plus chargée : on garantit qu'il reste invisible.
   -------------------------------------------------------------------------- */
[fs-cc='banner'],
.fs-cc-banner_component,
#hb-cookie-banner {
    display: none !important;
}

/* --------------------------------------------------------------------------
   Mouvement réduit
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .hb-cc__panel {
        animation: none;
    }

    .hb-cc__btn {
        transition: none;
    }

    .hb-cc__btn:hover {
        transform: none;
    }
}
