/* En-tête et hero communs à TOUTES les pages : chargés par l'application React
   (import dans src/components/Navbar.jsx) et copié en /ressources/entete.css
   pour les pages statiques (scripts/lib/entete.js). Un seul fichier, donc un
   seul rendu. Les classes sont préfixées cbh- pour ne rien toucher d'autre.
   Palette « Corail et nuit » (DESIGN.md, décision du fondateur du 27/10/2026,
   maquette 4 de l'accueil) : fond crème, encre nuit, une seule action corail
   (#D33447, texte blanc : 4,83:1). Les valeurs sont celles de la source unique
   (src/index.css, --color-jb-*), recopiées ici parce que les pages statiques
   ne chargent pas l'application. */

:root {
  --cbh-fond: #FFF6F2; --cbh-encre: #16131F; --cbh-texte2: #55505F; --cbh-bord: #E6DDE3;
  --cbh-action: #D33447; --cbh-action-appui: #B02A3B; --cbh-accent: #FFC93C; --cbh-accent-doux: #FFF0C2;
  --cbh-nuit: #16131F; --cbh-nuit-texte2: #E6E1EE; --cbh-corail-doux: #FFE3E6;
  --cbh-police: 'Work Sans', system-ui, sans-serif; --cbh-titres: 'Zilla Slab', Georgia, serif;
}

:root { --cbh-hauteur: 65px; }
.cbh-fixe { position: fixed; top: 0; left: 0; right: 0; z-index: 50; }
.cbh-cale { height: 65px; }


.cbh {
  position: relative; background: var(--cbh-fond); border-bottom: 1px solid var(--cbh-bord);
  font-family: var(--cbh-police); color: var(--cbh-encre);
}
.cbh * { box-sizing: border-box; }
.cbh-in {
  max-width: 80rem; height: 64px; margin: 0 auto; padding: 0 24px;
  display: flex; flex-wrap: nowrap; align-items: center; gap: 24px; font-size: 16px;
}
.cbh-logo {
  display: flex; align-items: center; flex-shrink: 0; min-height: 44px;
  text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer;
}
.cbh-logo img { height: 40px; width: auto; display: block; }

.cbh-menu { display: flex; align-items: center; gap: 24px; margin-left: auto; }
.cbh-lien, .cbh-compte {
  color: var(--cbh-encre); font: 600 16px/1.2 var(--cbh-police);
  text-decoration: none; white-space: nowrap;
}
.cbh-lien { display: inline-flex; align-items: center; min-height: 44px; }
.cbh-lien:hover, .cbh-compte:hover { color: var(--cbh-action-appui); }
.cbh-lien[aria-current="page"] { color: var(--cbh-action-appui); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.cbh-compte { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--cbh-encre); }
.cbh-compte svg { width: 20px; height: 20px; flex-shrink: 0; }
/* Entre 1140 et 1279 px, l'en-tête ne tient sur une ligne que si le lien du
   compte se réduit à son icône (mesuré en production, Coach actif, en
   allemand). Le libellé reste lu par les lecteurs d'écran. */
@media (min-width: 1140px) and (max-width: 1279px) {
  .cbh-compte span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

.cbh-cta {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  min-height: 46px; padding: 0 22px; border-radius: 999px; border: 0;
  background: var(--cbh-action); color: #FFFFFF; font: 700 16px/1 var(--cbh-police);
  text-decoration: none; white-space: nowrap; cursor: pointer;
}
.cbh-cta:hover { background: var(--cbh-action-appui); color: #FFFFFF; }
/* Libellé court du bouton sur les petits téléphones (« Mes critères » au lieu
   de « Terminer mes critères ») : l'en-tête tient à 320 px dans les 7 langues. */
.cbh-cta .cbh-court { display: none; }
@media (max-width: 389px) {
  .cbh-cta .cbh-long { display: none; }
  .cbh-cta .cbh-court { display: inline; }
}
/* Offres du jour encore à voir (bouton « Mes offres du jour », 29/10/2026). */
.cbh-nb {
  display: inline-grid; place-items: center; min-width: 24px; height: 24px; margin-left: 8px; padding: 0 6px;
  border-radius: 999px; background: #FFFFFF; color: var(--cbh-action-appui); font: 700 14px/1 var(--cbh-police);
}

/* Sélecteur de langue : <details>, donc utilisable sans JavaScript. */
.cbh .lang-switcher { position: relative; margin: 0; }
.cbh .lang-switcher summary {
  list-style: none; display: flex; align-items: center; gap: 8px; min-height: 40px;
  padding: 0 12px; border: 1px solid var(--cbh-bord); border-radius: 999px;
  color: var(--cbh-encre); font: 600 15px/1 var(--cbh-police); cursor: pointer; white-space: nowrap;
  background: transparent;
}
.cbh .lang-switcher summary::-webkit-details-marker { display: none; }
.cbh .lang-switcher summary::after {
  content: ""; width: 7px; height: 7px; margin-left: 2px; border: solid currentColor;
  border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(45deg);
}
.cbh .lang-switcher summary:hover { border-color: var(--cbh-encre); }
.cbh .lang-switcher ul {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 190px; margin: 0; padding: 6px;
  list-style: none; background: #FFFFFF; border: 1px solid var(--cbh-bord); border-radius: 16px; box-shadow: 0 16px 40px -16px rgba(22,19,31,.45); z-index: 60;
}
.cbh .lang-switcher li { margin: 0; }
.cbh .lang-switcher a {
  display: flex; gap: 10px; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 8px;
  color: var(--cbh-encre); font: 600 15px/1 var(--cbh-police); text-decoration: none;
}
.cbh .lang-switcher a:hover { background: var(--cbh-fond); }
.cbh .lang-switcher a[aria-current] { color: var(--cbh-action-appui); background: var(--cbh-corail-doux); }

.cbh-burger {
  display: none; width: 44px; height: 44px; flex-shrink: 0; align-items: center; justify-content: center;
  border: 1px solid var(--cbh-bord); border-radius: 999px; background: transparent; color: var(--cbh-encre); cursor: pointer; padding: 0;
}
.cbh-burger svg { width: 22px; height: 22px; }

.cbh a:focus-visible, .cbh button:focus-visible, .cbh summary:focus-visible {
  outline: 3px solid var(--cbh-action); outline-offset: 2px;
}

/* Téléphone et tablette : le menu passe dans un panneau. Le seuil tient compte
   des libellés allemands, les plus longs (mesuré par scripts/test-entete.js). */
@media (max-width: 1139px) {
  .cbh-in { padding: 0 16px; gap: 10px; }
  .cbh-burger { display: inline-flex; }
  .cbh-cta { margin-left: auto; }
  .cbh-menu {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0; margin: 0; padding: 8px 16px 20px;
    background: var(--cbh-fond); border-bottom: 1px solid var(--cbh-bord);
    max-height: calc(100vh - 65px); overflow-y: auto;
  }
  .cbh.ouvert .cbh-menu { display: flex; }
  .cbh-lien, .cbh-compte {
    display: flex; align-items: center; min-height: 52px; font-size: 16px;
    border-bottom: 1px solid var(--cbh-bord);
  }
  .cbh .lang-switcher { margin-top: 16px; }
  .cbh .lang-switcher summary { min-height: 48px; }
  .cbh .lang-switcher ul { position: static; margin-top: 8px; box-shadow: none; }
}
@media (max-width: 479px) {
  .cbh-in { gap: 8px; }
  .cbh-logo img { height: 32px; }
  .cbh-cta { padding: 0 14px; font-size: 15px; min-height: 44px; }
}
/* Sous 390 px, le nom du logo ne laisse plus la place au bouton : l'icône
   seule reste (le nom est dans l'image, l'image recadrée sur l'icône). */
@media (max-width: 389px) { .cbh-logo { width: 34px; overflow: hidden; } .cbh-logo img { max-width: none; } }

/* ─── Bandeau nuit : premier bloc de chaque page héritée, couleur pleine.
   Contrastes sur #16131F : blanc 18,3:1, #E6E1EE 14,3:1, #FFC93C 11,9:1.
   Les pages statiques ajoutent leurs réglages dans blog.css. */
.cbh-hero {
  position: relative; overflow: hidden; color: var(--cbh-nuit-texte2);
  background: var(--cbh-nuit);
}
.cbh-hero h1 { color: #FFFFFF; font-family: var(--cbh-titres); font-weight: 700; letter-spacing: -.01em; }
.cbh-hero p, .cbh-hero li { color: var(--cbh-nuit-texte2); }
.cbh-hero strong { color: #FFFFFF; }
.cbh-hero a:not(.cbh-btn):not([class*="cta"]) { color: var(--cbh-accent); }
.cbh-hero-pastille {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
  background: var(--cbh-accent-doux); color: #6B4A00;
  font: 700 16px/1.2 var(--cbh-police);
}
.cbh-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 26px;
  border-radius: 999px; background: var(--cbh-action); color: #FFFFFF; border: 0; cursor: pointer;
  font: 700 17px/1.2 var(--cbh-police); text-decoration: none;
}
.cbh-btn:hover { background: var(--cbh-action-appui); color: #FFFFFF; }
.cbh-btn-ghost { background: transparent; color: #FFFFFF; border: 2px solid #FFFFFF; font-weight: 600; }
.cbh-btn-ghost:hover { background: #FFFFFF; color: var(--cbh-encre); }

@media print { .cbh-fixe, .cbh-cale { display: none; } .cbh-hero { background: none; color: #000; } }
