/* Navigation de BHK : barre collante, rubriques à grands panneaux, menu latéral à gauche (run 1185).
   Rendu : navigation-bhk.php ; comportement : navigation-bhk.js. Chargé seulement quand la navigation est servie.
   Jetons du thème (style.css, :root) ; aucune couleur en dur hors des ombres et du voile.
   Échelle des couches : page < bulle de retour en haut (10) < voile (99) < barre et ses panneaux (100) ; menu latéral
   ouvert dans la barre ; le consentement aux cookies reste au-dessus de tout. */

:root {
    --bhkn-h: 72px;
    --bhkn-bas: 76px;
    --bhkn-ombre: 0 14px 28px rgba(42, 6, 4, .18);
    /* Le cadre de l'en-tête : le contenu de la barre (du logo au rendez-vous) et, à l'ordinateur, les panneaux qui s'y
       alignent (largeur contrôlée, #33 de la séance bhk November). */
    --bhkn-cadre: 1320px;
    --bhkn-marge: 24px;
    --bhkn-titre: 'BebasNeuePro', 'Bebas Neue', Impact, sans-serif;
}

/* La barre colle en haut, sous la barre d'administration ; les ancres des sommaires ne passent pas dessous. */
.bhkn-active .site-header {
    position: sticky;
    top: var(--wp-admin--admin-bar--height, 0px);
    z-index: 100;
}
@media (max-width: 600px) {
    .admin-bar.bhkn-active .site-header { top: 0; }
}
html.bhkn-js { scroll-padding-top: calc(var(--bhkn-h) + var(--wp-admin--admin-bar--height, 0px) + 12px); }

/* La barre tient sur une rangée à toute largeur : GeneratePress empile l'en-tête en colonne, centrée, jusqu'à 768 px
   (main.min.css, `@media (max-width:768px) { .inside-header { flex-direction: column; text-align: center } }`), trois
   rangées et 140 px au téléphone (#56 de Monsieur, séance bhk Lima ; correction du run 1205). */
.bhkn-active .inside-header.grid-container {
    gap: 4px;
    max-width: var(--bhkn-cadre);
    min-height: var(--bhkn-h);
    padding: 0 var(--bhkn-marge);
    flex-direction: row;
    flex-wrap: nowrap;
    text-align: left;
}
.bhkn-active .site-logo { flex: none; margin-right: 12px; }
.bhkn-active .site-header .header-image.is-logo-image { max-height: 52px; width: auto; }

/* Boutons et liens de la barre : nos propres réglages, quels que soient ceux du thème. */
.site-header .bhkn button {
    font-family: inherit;
}
.site-header .bhkn-icone {
    display: grid;
    place-items: center;
    flex: none;
    width: 44px;
    height: 44px;
    padding: 0;
    margin: 0;
    color: var(--bhk-white);
    background: transparent;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}
.site-header .bhkn-icone:hover,
.site-header .bhkn-icone[aria-expanded="true"] { background: var(--bhk-hover); color: var(--bhk-white); }
.site-header .bhkn-icone:focus-visible,
.site-header .bhkn-rub:focus-visible,
.site-header .bhkn a:focus-visible,
.site-header .bhkn-actions a:focus-visible,
.site-header .bhkn-panneau a:focus-visible { outline: 2px solid var(--bhk-selection); outline-offset: 2px; }
.bhkn-svg { display: block; flex: none; }

.bhkn-menu { display: none !important; }
.bhkn-tiroir-haut,
.bhkn-tiroir-bas,
.bhkn-panneau-haut { display: none; }

/* ---- Barre à l'ordinateur : les rubriques visibles -------------------------------------------------------------- */
.bhkn {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
}
.bhkn-rubriques {
    display: flex;
    align-items: center;
    gap: 0;
    min-width: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    overflow: hidden;
}
.bhkn-rubrique { margin: 0; padding: 0; list-style: none; }
.site-header .bhkn-rub,
.site-header .bhkn-rub-lien {
    display: flex;
    align-items: center;
    gap: 5px;
    height: var(--bhkn-h);
    padding: 3px 11px 0;
    margin: 0;
    color: var(--bhk-white) !important;
    background: transparent;
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: .6px;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}
.site-header .bhkn-rub:hover,
.site-header .bhkn-rub-lien:hover { background: var(--bhk-hover); }
.site-header .bhkn-rub[aria-expanded="true"] { background: var(--bhk-hover); border-bottom-color: var(--bhk-selection); }
.bhkn-rub .bhkn-svg { width: 12px; height: 12px; }
.bhkn-rub .bhkn-svg + .bhkn-svg { display: none; }
html.bhkn-js .bhkn-rub-lien { display: none; }
html:not(.bhkn-js) .bhkn-rub { display: none; }
/* Sans script (rare) : aucun panneau ne s'ouvre ; les rubriques restent des liens vers leurs pages, qui passent à la
   ligne plutôt que d'être coupées (audit de conformité du run 1185). */
html:not(.bhkn-js) .bhkn-active .inside-header.grid-container { flex-wrap: wrap; }
html:not(.bhkn-js) .bhkn-rubriques { flex-wrap: wrap; overflow: visible; }
html:not(.bhkn-js) .site-header .bhkn-rub-lien { height: 44px; }

.bhkn-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: none;
    margin-left: auto;
}
.site-header a.bhkn-rdv {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 16px;
    margin-left: 6px;
    background: var(--bhk-selection);
    color: var(--bhk-selection-text) !important;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .6px;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
}
.site-header a.bhkn-rdv:hover { background: color-mix(in srgb, var(--bhk-selection) 88%, var(--bhk-dark)); }
.bhkn-rdv-court { display: none; }

/* ---- Panneaux : sous la barre, alignés sur son contenu (du logo au rendez-vous), pas sur toute la largeur (#33) ---- */
.bhkn-panneau {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: min(calc(var(--bhkn-cadre) - 2 * var(--bhkn-marge)), calc(100% - 2 * var(--bhkn-marge)));
    margin-inline: auto;
    border: 1px solid var(--bhk-border);
    border-radius: 0 0 12px 12px;
    z-index: 2;
    max-height: calc(100vh - var(--bhkn-h) - var(--wp-admin--admin-bar--height, 0px));
    max-height: calc(100dvh - var(--bhkn-h) - var(--wp-admin--admin-bar--height, 0px));
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--bhk-cream);
    color: var(--bhk-dark);
    border-top: 1px solid var(--bhk-hover);
    box-shadow: var(--bhkn-ombre);
    font-size: 15px;
    line-height: 1.45;
    text-transform: none;
    letter-spacing: normal;
}
.bhkn-panneau[hidden] { display: none; }
.bhkn-panneau-corps {
    margin: 0 auto;
    padding: 22px 24px 26px;
    display: grid;
    /* Une colonne qui peut rétrécir : sinon le champ de la loupe garde sa largeur native et pousse son bouton hors de
       l'écran au téléphone (constat de la séance India, #3036). */
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: max-content;
    align-content: start;
    gap: 12px;
}
.site-header .bhkn-panneau a { color: var(--bhk-dark) !important; text-decoration: none; }

/* La ligne de tête : un bandeau comme une carte, sa flèche ronde dedans (#4, module 1). */
.site-header .bhkn-bandeau {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 52px;
    padding: 9px 12px 9px 16px;
    background: var(--bhk-white);
    border: 1px solid var(--bhk-border);
    border-radius: 8px;
    font-weight: 600;
}
.site-header .bhkn-bandeau:hover { border-color: var(--bhk); }
.bhkn-ronde {
    flex: none;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--bhk-dark);
    background: var(--bhk-white);
    color: var(--bhk-dark);
}

/* Les cartes en texte : titre et précision, sans flèche ; la carte entière est le lien (#3 et #4, modules). */
.bhkn-cartes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.bhkn-cartes li, .bhkn-liens li, .bhkn-articles li, .bhkn-liste li, .bhkn-puces li { margin: 0; padding: 0; list-style: none; }
/* Les colonnes divisent le nombre de cartes (navigation_bhk.colonnes) : aucune carte seule sur sa ligne (#32, module 1). */
.bhkn-cols-1 { grid-template-columns: minmax(0, 1fr); }
.bhkn-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bhkn-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bhkn-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bhkn-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.bhkn-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.site-header .bhkn-carte {
    display: grid;
    align-content: start;
    gap: 4px;
    height: 100%;
    min-height: 58px;
    padding: 12px 14px;
    background: var(--bhk-white);
    border: 1px solid var(--bhk-border);
    border-radius: 8px;
}
.site-header .bhkn-carte:hover { border-color: var(--bhk); }
.bhkn-carte strong { font-weight: 600; font-size: 15px; }
.bhkn-carte span { font-size: 13px; line-height: 1.4; color: var(--bhk-text-light); }

/* Nos centres : Paris en tête, même étiquette que les départements, sa page en premier lien en gras (#20, #22). */
.bhkn-lieu {
    padding: 12px 16px 8px;
    background: var(--bhk-white);
    border: 1px solid var(--bhk-border);
    border-radius: 8px;
}
.bhkn-lieu .bhkn-groupe { margin: 0 0 4px; }
.site-header .bhkn-lien-zone { display: inline-block; padding: 6px 0; font-size: 14.5px; font-weight: 700; color: var(--bhk) !important; }
.site-header .bhkn-lien-zone:hover { text-decoration: underline !important; text-underline-offset: 4px; }
.bhkn-liens.bhkn-liens-paris { display: block; columns: 200px; column-gap: 24px; }
.bhkn-liens-paris li { break-inside: avoid; }
.bhkn-groupe {
    margin: 6px 0 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--bhk-text-light);
}
.bhkn-liens { display: grid; margin: 0; padding: 0; list-style: none; }
.site-header .bhkn-liens a { display: block; padding: 6px 0; font-size: 14.5px; line-height: 1.35; }
.site-header .bhkn-liens a:hover { text-decoration: underline !important; text-underline-offset: 4px; }
.bhkn-liens-deux { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; }

/* La recherche de la liste des centres (#19, module 1). */
.bhkn-filtre { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.site-header .bhkn-filtre-champ {
    flex: 1 1 auto;
    min-width: 0;
    height: 48px;
    padding: 0 14px;
    font: inherit;
    font-size: 16px;
    color: var(--bhk-dark);
    background: var(--bhk-white);
    border: 1px solid var(--bhk-border);
    border-radius: 8px;
}
.site-header .bhkn-filtre-champ:focus-visible { outline: 2px solid var(--bhk); outline-offset: 1px; }
.site-header .bhkn-filtre-loupe {
    flex: none;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    padding: 0;
    color: var(--bhk-white);
    background: var(--bhk);
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}
.site-header .bhkn-filtre-loupe:hover { background: var(--bhk-hover); }
.bhkn-filtre-vide { flex: 1 0 100%; margin: 0 2px; font-size: 14px; color: var(--bhk-text-light); }
.bhkn-lieu[hidden], .bhkn-departement[hidden], .bhkn-liens li[hidden] { display: none; }

/* Une carte par département (#10, module 2), disposées en colonnes : pas de trou sous les cartes courtes. */
.bhkn-departements { columns: 220px; column-gap: 10px; }
.bhkn-departement {
    break-inside: avoid;
    margin: 0 0 10px;
    padding: 12px 16px 8px;
    background: var(--bhk-white);
    border: 1px solid var(--bhk-border);
    border-radius: 8px;
}
.bhkn-departement .bhkn-groupe { margin: 0 0 4px; }
.bhkn-departement-large { column-span: all; }
.bhkn-departement-large .bhkn-liens { display: block; columns: 200px; column-gap: 24px; }
.bhkn-departement-large .bhkn-liens li { break-inside: avoid; }

/* Blog : les thèmes en puces, les derniers articles en cartes verticales identiques, sans flèche (#32, module 1). */
.bhkn-puces { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.site-header .bhkn-puces a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 6px 14px;
    background: var(--bhk-white);
    border: 1px solid var(--bhk-border);
    border-radius: 999px;
    font-size: 14px;
    line-height: 1.3;
}
.site-header .bhkn-puces a:hover { border-color: var(--bhk); }
.bhkn-articles { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.site-header .bhkn-article {
    display: grid;
    grid-template-rows: auto 1fr;
    height: 100%;
    background: var(--bhk-white);
    border: 1px solid var(--bhk-border);
    border-radius: 8px;
    overflow: hidden;
}
.site-header .bhkn-article:hover { border-color: var(--bhk); }
.bhkn-article img, .bhkn-article-vide { display: block; width: 100%; max-width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.bhkn-article-vide { background: var(--bhk-cream-dark); }
.bhkn-article-titre {
    align-self: start;
    margin: 10px 12px 12px;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* À propos : une liste de liens ; à l'ordinateur, un petit menu sous son onglet (#32, module 1). */
.bhkn-liste { margin: 0; padding: 0; list-style: none; max-width: 520px; }
.site-header .bhkn-liste a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 50px;
    border-bottom: 1px solid var(--bhk-border);
    font-weight: 500;
}
html:not(.bhkn-lateral) .bhkn-panneau-petit {
    right: auto;
    width: 320px;
    margin: 0;
    border-top: 3px solid var(--bhk-selection);
    border-radius: 0 0 8px 8px;
}
html:not(.bhkn-lateral) .bhkn-panneau-petit .bhkn-panneau-corps { padding: 6px 20px 10px; }
html:not(.bhkn-lateral) .site-header .bhkn-panneau-petit .bhkn-liste a { min-height: 44px; font-weight: 500; }
html:not(.bhkn-lateral) .bhkn-panneau-petit .bhkn-liste li:last-child a { border-bottom: 0; }
html:not(.bhkn-lateral) .bhkn-panneau-petit .bhkn-liste .bhkn-svg { display: none; }

/* Recherche : un champ, la recherche du site. */
.bhkn-recherche .bhkn-panneau-corps { max-width: 760px; }
.bhkn-etiquette { display: block; font-weight: 600; margin-bottom: 8px; }
.bhkn-champ { display: flex; gap: 8px; }
.site-header .bhkn-champ input[type="search"] {
    flex: 1 1 auto;
    min-width: 0;
    height: 48px;
    padding: 0 14px;
    font: inherit;
    font-size: 16px;
    color: var(--bhk-dark);
    background: var(--bhk-white);
    border: 1px solid var(--bhk-border);
    border-radius: 6px;
}
.site-header .bhkn-champ button {
    flex: none;
    height: 48px;
    padding: 0 18px;
    font: inherit;
    font-weight: 700;
    color: var(--bhk-white);
    background: var(--bhk);
    border: 0;
    border-radius: 6px;
    cursor: pointer;
}
.site-header .bhkn-champ button:hover { background: var(--bhk-hover); }

/* Le voile sous la barre, au-dessus de la page. */
.bhkn-voile {
    position: fixed;
    inset: 0;
    z-index: 99;
    background: rgba(42, 6, 4, .38);
}
.bhkn-voile[hidden] { display: none; }

/* ---- Menu latéral : dès que tout ne tient plus sur une ligne (UX-N4), ouvert à gauche (#7) ----------------------- */
html.bhkn-lateral .bhkn-menu { display: grid !important; margin-left: -10px; }
html.bhkn-lateral .bhkn {
    position: fixed;
    top: var(--wp-admin--admin-bar--height, 0px);
    bottom: 0;
    left: 0;
    z-index: 3;
    /* La largeur suit l'écran : tout l'écran au téléphone, la moitié juste avant la barre (#32, module 1, question 24) ;
       le témoin relit cette formule (TIROIR_BASE_PX, TIROIR_PART). */
    width: min(100vw, calc(456px + 12.3vw));
    container: bhkn-tiroir / inline-size;
    flex-direction: column;
    align-items: stretch;
    background: var(--bhk-cream);
    color: var(--bhk-dark);
    box-shadow: var(--bhkn-ombre);
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform .2s ease, visibility 0s linear .2s;
    overscroll-behavior: contain;
}
@media (max-width: 600px) {
    /* La barre d'administration (connecté) reste au-dessus : le tiroir lui laisse sa hauteur (chasse, constat 6). */
    html.bhkn-lateral .admin-bar .bhkn { top: 0; padding-top: var(--wp-admin--admin-bar--height, 46px); }
}
html.bhkn-lateral .bhkn.bhkn-ouvert { transform: none; visibility: visible; transition: transform .2s ease; }
html.bhkn-lateral .bhkn-tiroir-haut,
html.bhkn-lateral .bhkn-panneau-haut {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: none;
    height: 60px;
    padding: 0 8px 0 16px;
    background: var(--bhk);
    color: var(--bhk-white);
    font-weight: 600;
    font-size: 15px;
}
html.bhkn-lateral .bhkn-panneau-haut { padding-left: 6px; }
html.bhkn-lateral .bhkn-panneau-titre { flex: 1 1 auto; min-width: 0; }
html.bhkn-lateral .bhkn-rubriques {
    display: block;
    flex: 1 1 auto;
    overflow-y: auto;
}
html.bhkn-lateral .site-header .bhkn-rub,
html.bhkn-lateral .site-header .bhkn-rub-lien {
    width: 100%;
    height: auto;
    min-height: 62px;
    justify-content: space-between;
    padding: 0 18px 0 20px;
    color: var(--bhk-dark) !important;
    background: transparent;
    border-bottom: 1px solid var(--bhk-border);
    font-family: var(--bhkn-titre);
    font-size: 27px;
    font-weight: 400;
    letter-spacing: .02em;
    text-transform: uppercase;
}
html.bhkn-lateral .site-header .bhkn-rub:hover { background: var(--bhk-cream-dark); }
html.bhkn-lateral .bhkn-rub .bhkn-svg:first-of-type { display: none; }
html.bhkn-lateral .bhkn-rub .bhkn-svg + .bhkn-svg { display: block; width: 18px; height: 18px; }
html.bhkn-lateral .bhkn-tiroir-bas {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: none;
    height: var(--bhkn-bas);
    padding: 0 16px;
    background: var(--bhk-white);
    border-top: 1px solid var(--bhk-border);
}
html.bhkn-lateral .site-header .bhkn-tiroir-bas .bhkn-icone { color: var(--bhk-dark); border: 1px solid var(--bhk-dark); }
html.bhkn-lateral .site-header .bhkn-tiroir-bas .bhkn-icone:hover { background: var(--bhk-cream); }
html.bhkn-lateral .site-header .bhkn-tiroir-bas a.bhkn-rdv { flex: 1 1 auto; margin: 0; }

/* Une rubrique ouverte au menu latéral : par-dessus la liste, la carte et le rendez-vous gardés en bas. */
html.bhkn-lateral .bhkn .bhkn-panneau {
    top: 0;
    bottom: var(--bhkn-bas);
    left: 0;
    right: 0;
    width: auto;
    margin: 0;
    border: 0;
    border-radius: 0;
    z-index: 4;
    max-height: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-top: 0;
    box-shadow: none;
}
html.bhkn-lateral .bhkn .bhkn-panneau[hidden] { display: none; }
html.bhkn-lateral .bhkn .bhkn-panneau-corps {
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    width: 100%;
    padding: 14px 14px 20px;
}
html.bhkn-lateral .bhkn-cartes { grid-template-columns: minmax(0, 1fr); }
html.bhkn-lateral .bhkn-articles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
html.bhkn-lateral .bhkn-departements { columns: auto; }
/* Deux colonnes dès que le menu a la place (#32, module 1, question 24). */
@container bhkn-tiroir (min-width: 540px) {
    html.bhkn-lateral .bhkn-cartes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    html.bhkn-lateral .bhkn-departements { columns: 2; column-gap: 12px; }
}
html.bhkn-lateral .site-header .bhkn-icone.bhkn-fermer,
html.bhkn-lateral .site-header .bhkn-icone.bhkn-retour { color: var(--bhk-white); }

/* La page ne défile pas sous le menu latéral ouvert (verrou posé sur html seul : la barre reste collante). */
html.bhkn-verrou { overflow: hidden; }

/* Téléphone : barre compacte, rendez-vous en libellé court. */
@media (max-width: 520px) {
    .bhkn-active .inside-header.grid-container { padding: 0 10px; }
    .bhkn-active .site-logo { margin-right: 4px; }
    .bhkn-active .site-header .header-image.is-logo-image { max-height: 44px; }
    .bhkn-actions .bhkn-rdv-long { display: none; }
    .bhkn-actions .bhkn-rdv-court { display: inline; }
    .site-header .bhkn-actions a.bhkn-rdv { padding: 0 12px; margin-left: 4px; }
}

/* Petits écrans (sous 360 px) : les écarts entre les éléments tombent, marges, cibles de 44 px et libellé gardés ;
   à 320 px, avec la carte, le rendez-vous sortait de l'écran (variante A, #3, module 1 de la séance bhk Kilo, run 1205).
   Après le bloc du téléphone : même spécificité, l'ordre tranche. */
@media (max-width: 359px) {
    .bhkn-active .inside-header.grid-container { gap: 0; }
    .bhkn-active .site-logo { margin-right: 0; }
    .bhkn-actions { gap: 0; }
    .site-header .bhkn-actions a.bhkn-rdv { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
    html.bhkn-lateral .bhkn,
    html.bhkn-lateral .bhkn.bhkn-ouvert { transition: none; }
}
