/* ============================================================
   Header — pilule flottante, se condense au scroll
   + bottom navbar mobile à icônes
   ============================================================
   Éprouvé sur team-maohi (vert) et chez-vallau (bordeaux).

   AVANT d'utiliser ce fichier, définis ces 5 variables dans ton
   :root (et leurs équivalents dans :root[data-theme="dark"] si le
   site a un mode sombre) :

     --header-primary        couleur de marque (boutons, liens actifs)
     --header-primary-dark   nuance plus sombre (hover, condensé au scroll)
     --header-text           couleur de texte par défaut (bascule en dark)
     --header-glass          fond translucide de la pilule au repos
                              (ex: rgba(255,255,255,.80) en clair,
                                   rgba(20,16,15,.72) en sombre)
     --header-border         liseré discret de la pilule au repos
     --header-solid          fond plein de la pilule condensée au scroll.
                              ⚠️ NE PAS réutiliser --header-primary-dark ici :
                              si ta variable primary-dark est éclaircie en
                              dark mode (pour la lisibilité des titres), la
                              pilule condensée devient rose/délavée au lieu
                              de rester une couleur de marque profonde.
                              --header-solid doit être une couleur FIXE,
                              indépendante du thème (ou presque).

   Classes neutres — renomme au besoin mais garde la cohérence
   avec header.js et le HTML de référence (voir ../references/header.md).
   ============================================================ */

.site-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    padding: 16px min(4vw, 32px) 10px;
    transition: padding .35s cubic-bezier(.16,.8,.3,1);
}
.site-header.is-scrolled { padding: 10px min(4vw, 32px) 10px; }

.site-header-inner {
    width: min(1180px, 100%); margin: 0 auto; min-height: 68px;
    display: flex; align-items: center; gap: 18px;
    padding: 8px 14px; border-radius: 999px;
    background: var(--header-glass);
    border: 1px solid var(--header-border);
    box-shadow: 0 10px 30px rgba(0,0,0,.08);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    color: var(--header-text);
    transition: background .35s cubic-bezier(.16,.8,.3,1), box-shadow .35s ease,
                min-height .35s ease, color .35s ease;
}
.site-header.is-scrolled .site-header-inner {
    min-height: 58px; background: var(--header-solid);
    border-color: transparent; color: #fff;
    box-shadow: 0 16px 40px rgba(0,0,0,.28);
}

/* Marque */
.site-brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.site-brand-badge {
    width: 46px; height: 46px; display: grid; place-items: center; flex-shrink: 0;
    border-radius: 999px; background: var(--header-primary); color: #fff; font-size: 1.15rem;
    box-shadow: 0 8px 20px rgba(0,0,0,.20); transition: transform .35s ease;
    overflow: hidden;
}
.site-brand-badge img { width: 100%; height: 100%; object-fit: contain; }
.site-header.is-scrolled .site-brand-badge { transform: scale(.92); }
.site-brand-name { font-size: 1.25rem; font-weight: 700; letter-spacing: .3px; color: inherit; white-space: nowrap; }
.site-brand-name strong { color: var(--header-primary); }
.site-header.is-scrolled .site-brand-name strong { color: #fff; }

/* Navigation desktop */
.site-nav { display: flex; align-items: center; gap: 26px; margin: 0 auto; }
.site-nav a { position: relative; padding: 4px 0; font-weight: 600; font-size: .95rem; color: inherit; }
.site-nav a::after {
    content: ""; position: absolute; left: 0; right: 100%; bottom: -3px;
    height: 2px; border-radius: 99px; background: var(--header-primary);
    transition: right .26s cubic-bezier(.16,.8,.3,1);
}
.site-nav a:hover::after, .site-nav a[aria-current="page"]::after { right: 0; }
.site-nav a[aria-current="page"] { color: var(--header-primary); }
.site-header.is-scrolled .site-nav a::after { background: #fff; }
.site-header.is-scrolled .site-nav a[aria-current="page"] { color: #fff; }

/* Actions : thème + CTA */
.site-header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.site-theme-toggle {
    width: 42px; height: 42px; display: grid; place-items: center; flex-shrink: 0;
    border-radius: 999px; border: 1.5px solid var(--header-border);
    background: transparent; color: inherit; cursor: pointer; font-size: 1rem;
    transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.site-theme-toggle:hover { background: rgba(0,0,0,.06); border-color: var(--header-primary); color: var(--header-primary); }
.site-header.is-scrolled .site-theme-toggle { border-color: rgba(255,255,255,.35); color: #fff; }
.site-header.is-scrolled .site-theme-toggle:hover { background: rgba(255,255,255,.15); color: #fff; }

.site-cta {
    display: inline-flex; align-items: center; min-height: 42px; padding: 0 22px;
    border-radius: 999px; background: var(--header-primary); color: #fff;
    font-weight: 700; font-size: .9rem; letter-spacing: .3px; flex-shrink: 0;
    box-shadow: 0 8px 18px rgba(0,0,0,.18);
}
.site-cta:hover { background: var(--header-primary-dark); color: #fff; }
.site-header.is-scrolled .site-cta { background: #fff; color: var(--header-solid); }
.site-header.is-scrolled .site-cta:hover { background: rgba(255,255,255,.9); }

/* Bottom navbar mobile — masquée sur desktop, activée ≤900px (voir bas de fichier) */
.site-bottomnav { display: none; }

/* ============================================================
   Sous 900px : nav + CTA disparaissent, bottom navbar apparaît
   ============================================================ */
@media (max-width: 900px) {
    .site-header { padding: 10px 12px 8px; }
    .site-header-inner { min-height: 58px; gap: 12px; padding: 6px 12px; }
    .site-nav, .site-cta { display: none; }
    .site-header-actions { margin-left: auto; }
    .site-brand-name { font-size: 1.1rem; }

    .site-bottomnav {
        display: flex; align-items: stretch; justify-content: space-around;
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
        background: var(--header-glass);
        -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
        border-top: 1px solid var(--header-border);
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
        box-shadow: 0 -8px 24px rgba(0,0,0,.10);
    }
    .site-tab {
        flex: 1; min-width: 0; display: flex; flex-direction: column;
        align-items: center; gap: 3px; padding: 4px 2px;
        color: inherit; opacity: .65; font-size: .62rem; font-weight: 700; text-align: center;
        transition: color .18s ease, opacity .18s ease;
    }
    .site-tab i, .site-tab svg { font-size: 1.15rem; width: 1.15em; height: 1.15em; transition: transform .2s ease; }
    .site-tab span {
        max-width: 100%; overflow: hidden; text-overflow: ellipsis;
        white-space: nowrap; letter-spacing: .2px;
    }
    .site-tab:hover, .site-tab[aria-current="page"] { color: var(--header-primary); opacity: 1; }
    .site-tab[aria-current="page"] i, .site-tab[aria-current="page"] svg { transform: translateY(-2px); }

    /* Réserve la place pour la bottom navbar : évite qu'elle recouvre le pied de page */
    body { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
}
