/* En-tête du site (04/12/2026, choisi par Quentin le 4/12 à 18 h 45 ; gabarit : templates/base.html).
   En haut, la bande verte : la date, puis le membre (crédits, messages, cloche, GeneBook, Affichage, compte) ou, pour un
   visiteur, Affichage, Connexion et Créer un compte. Dessous, une ligne : le logo, les menus, « Bientôt · Le logiciel
   GeneBase », la loupe et, sous 1 280 px, le bouton ☰.
   Sur l'accueil (classe page-entete-grand) et sur un écran de plus de 1 280 px : le grand en-tête de journal, dans la
   page (il part avec elle quand on descend). Partout ailleurs l'en-tête reste en haut de l'écran, comme avant, et
   --nav-height donne sa hauteur à toutes les pages (marges du haut, barres collées, menu ☰).
   Police Inter seule, jamais d'italique ; les couleurs du site. Chargée après style.css : elle remplace l'ancienne barre. */

:root { --nav-height: 96px; }                       /* bande 40 + ligne 55 + filet 1 */
@media (max-width: 768px) { :root { --nav-height: 88px; } }   /* bande 36 + ligne 51 + filet 1 */

.navbar { display: flex; flex-direction: column; height: var(--nav-height); background: var(--clr-bg-secondary);
  border-bottom: 1px solid var(--clr-border); font-family: var(--font-sans); }
.entete-w { width: 100%; max-width: 1280px; margin-inline: auto; padding-inline: clamp(16px, 3vw, 40px); }
.navbar a, .navbar button { -webkit-tap-highlight-color: transparent; }
.entete-cache { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0; }

/* ── La bande verte ─────────────────────────────────────────────────────────────────────────────────────────── */
.entete-bande { position: relative; z-index: 2; flex: 0 0 40px; background: #1B4332; color: #F5F0E8; font-size: .875rem;
  line-height: 1.2; }   /* au-dessus de la ligne : la liste du compte, la cloche et Affichage s'ouvrent par-dessus */
[data-theme="dark"] .entete-bande { background: #0F2A1F; }
.entete-bande__in { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 100%; }
.entete-date { margin: 0; color: #DCE7DF; white-space: nowrap; }
.entete-date__courte { display: none; }
.entete-outils { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.entete-outils--visiteur { gap: 6px; }
.entete-bande .entete-i { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 9px;
  border: 0; border-radius: 6px; background: transparent; color: #FFFFFF; font: inherit; font-weight: 600;
  text-decoration: none; white-space: nowrap; cursor: pointer; }
.entete-bande .entete-i:hover, .entete-bande .entete-i[aria-expanded="true"] { background: rgba(255, 255, 255, .14); color: #FFFFFF; }
.entete-bande .entete-i:focus-visible, .entete-bande .entete-lien:focus-visible, .entete-bande .compte__bouton:focus-visible {
  outline: 2px solid #E9C46A; outline-offset: 1px; }
.entete-i svg { flex: none; width: 17px; height: 17px; }
.entete-mot { color: #DCE7DF; font-weight: 500; }
.entete-nombre { font-weight: 700; }
.entete-bande .entete-credits--bas { background: #C7901E; color: #11241B; }   /* moins de 30 crédits : en or */
.entete-bande .entete-credits--bas .entete-mot { color: #11241B; }
.entete-pastille { position: absolute; top: 0; right: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: #E9C46A; color: #11241B; font-size: 11px; font-weight: 800; line-height: 16px; text-align: center; }
.entete-pastille[hidden] { display: none; }
.entete-aa__lettres { font-size: 15px; font-weight: 700; }
.entete-aa__lettres small { font-size: 11px; }

/* Visiteur : Connexion, Créer un compte */
.entete-bande .entete-lien { display: inline-block; padding: 0 8px; border-radius: 6px; line-height: 32px;
  color: #FFFFFF; font-weight: 600; text-decoration: none; white-space: nowrap; }
.entete-bande .entete-lien--or { color: #E9C46A; }
.entete-court { display: none; }
.entete-bande .entete-lien:hover { background: rgba(255, 255, 255, .14); color: #FFFFFF; }
.entete-bande .entete-lien--or:hover { color: #F2D28B; }

/* Le compte : l'initiale (ou la photo) et le prénom, après un filet ; sa liste s'ouvre au survol, comme avant */
.entete-bande .compte { margin-left: 6px; padding-left: 10px; border-left: 1px solid rgba(255, 255, 255, .25); }
.entete-bande .compte__bouton { gap: 8px; padding: 2px 8px 2px 2px; border: 0; border-radius: 999px; color: #FFFFFF;
  font-size: inherit; font-weight: 600; }
.entete-bande .compte__bouton:hover, .entete-bande .compte:focus-within .compte__bouton { background: rgba(255, 255, 255, .14); color: #FFFFFF; }
.entete-bande .compte__avatar { width: 28px; height: 28px; background: #E9C46A; color: #11241B; font-size: 13px; }
.entete-bande .compte__bouton svg { width: 14px; height: 14px; }

/* Les listes et panneaux qui s'ouvrent depuis la bande : couleurs de la page, pas celles de la bande */
.entete-bande .dropdown__menu, .entete-bande .lecture__panneau, .entete-bande .cloche__panneau {
  color: var(--clr-text); font-weight: 400; line-height: 1.5; text-align: left; }
.lecture__theme { display: flex; align-items: center; justify-content: center; }
.lecture__theme svg { flex: none; width: 16px; height: 16px; margin-right: 8px; }
.lecture__theme .si-clair, .lecture__theme .si-sombre { align-items: center; }
.lecture__theme .si-clair { display: inline-flex; }
[data-theme="dark"] .lecture__theme .si-clair { display: none; }
[data-theme="dark"] .lecture__theme .si-sombre { display: inline-flex; }
.lecture__bouton, .lecture__tailles button { font-family: var(--font-sans); }

/* ── La ligne : logo, menus, logiciel, loupe, ☰ ─────────────────────────────────────────────────────────────── */
.entete-ligne { flex: 1 1 auto; min-height: 0; }
.navbar .entete-ligne > .navbar__inner { height: 100%; gap: 4px; }
.entete-logo { display: inline-flex; align-items: center; flex: none; gap: 10px; margin-right: 18px; color: var(--clr-primary);
  font-family: var(--font-sans); font-size: 23px; font-weight: 800; letter-spacing: -.03em; line-height: 1; text-decoration: none; }
.entete-logo:hover { text-decoration: none; }
.entete-logo__arbre { flex: none; width: 26px; height: 30px; }
.entete-logo__nom span:first-child { color: var(--clr-primary); }
.entete-logo__nom span:last-child { color: var(--clr-accent); }

.navbar .navbar__nav { flex: 1 1 auto; align-self: stretch; align-items: stretch; gap: 0; min-width: 0; margin: 0; padding: 0;
  list-style: none; }
.navbar .nav-item { display: flex; align-items: center; }
.navbar .nav-link { gap: 6px; padding: 8px 12px; border-radius: 6px; color: var(--clr-text); font-size: .9375rem; font-weight: 600; }
.navbar .nav-link:hover, .navbar .nav-link.active { color: var(--clr-primary); background: var(--clr-primary-light); }
.navbar .entete-logiciel { margin-left: auto; padding-left: 8px; }
.navbar .nav-link--logiciel, .entete-logiciel-seul { gap: 10px; color: var(--clr-accent-texte); font-weight: 650; }
.entete-bientot { display: inline-block; padding: 3px 8px; border-radius: 4px; background: #C7901E; color: #11241B;
  font-size: .75rem; font-weight: 700; line-height: 1.3; white-space: nowrap; }
.entete-bientot--menu { margin-left: auto; }
.entete-logiciel-seul { display: none; align-items: center; padding: 8px 10px; border-radius: 6px; font-size: .9375rem;
  white-space: nowrap; text-decoration: none; }
.entete-logiciel-seul:hover, .entete-logiciel-seul.active { background: var(--clr-primary-light); color: var(--clr-accent-texte); text-decoration: none; }

.entete-loupe { display: grid; place-items: center; flex: none; width: 40px; height: 40px; margin-left: 10px; padding: 0;
  border: 1px solid var(--clr-border); border-radius: 6px; background: transparent; color: var(--clr-text); cursor: pointer; }
.entete-loupe:hover, .entete-loupe[aria-expanded="true"] { border-color: var(--clr-primary); background: var(--clr-primary-light); color: var(--clr-primary); }
.entete-loupe svg { width: 19px; height: 19px; }
.navbar .navbar__hamburger { flex: none; align-items: center; justify-content: center; width: 44px; height: 44px; margin-left: 8px;
  padding: 0; border: 1.5px solid var(--clr-border-strong); border-radius: 6px; background: transparent; }

/* ── La case « où chercher » (la loupe l'ouvre sous la ligne ; ouverte d'office dans le grand en-tête) ─────── */
.entete-cherche { position: absolute; left: 0; right: 0; top: 100%; padding: 14px 0 16px; background: var(--clr-bg-secondary);
  border-bottom: 1px solid var(--clr-border); box-shadow: 0 12px 24px rgba(0, 0, 0, .12); }
.entete-cherche[hidden] { display: none; }
.entete-cherche .entete-form { max-width: 820px; margin-inline: auto; }
.entete-form { display: flex; width: 100%; min-width: 0; overflow: hidden; border: 1.5px solid var(--clr-text); border-radius: 6px;
  background: var(--clr-bg-secondary); }
.entete-form:focus-within { box-shadow: 0 0 0 3px rgba(199, 144, 30, .35); }
.entete-form input { flex: 1 1 160px; min-width: 0; min-height: 48px; padding: 0 14px; border: 0; border-radius: 0; outline: 0;
  background: transparent; color: var(--clr-text); font: inherit; font-size: 1rem; }
.entete-form input::placeholder { color: var(--clr-text-muted); opacity: 1; }
.entete-form select { flex: none; min-width: 0; max-width: 100%; min-height: 48px; padding: 0 8px; border: 0;
  border-left: 1px solid var(--clr-border); border-radius: 0; outline: 0; background: var(--clr-bg-secondary); color: var(--clr-text);
  font: inherit; font-size: .9375rem; cursor: pointer; }
.entete-form button { display: inline-flex; align-items: center; justify-content: center; flex: none; gap: 8px; min-height: 48px;
  padding: 0 18px; border: 0; border-radius: 0; background: #1B4332; color: #FFFFFF; font: inherit; font-size: .9375rem;
  font-weight: 650; cursor: pointer; }
.entete-form button:hover { background: #2D6A4F; }
[data-theme="dark"] .entete-form button { background: #C9952A; color: #0E1520; }
[data-theme="dark"] .entete-form button:hover { background: #E5B040; }
.entete-form button svg { width: 18px; height: 18px; }

/* ── Le grand en-tête de l'accueil (plus de 1 280 px) ───────────────────────────────────────────────────────── */
.entete-tete { display: none; }
.entete-tete__in { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 640px); align-items: center; gap: 16px 28px;
  padding-block: 22px; }
.entete-logo--grand { margin: 0; font-size: 40px; letter-spacing: -.04em; }
.entete-logo--grand .entete-logo__arbre { width: 36px; height: 42px; }
.entete-devise { margin: 0; padding-left: 22px; border-left: 1px solid var(--clr-border); color: var(--clr-text-muted);
  font-size: .9375rem; line-height: 1.35; }
html[data-texte="tres-grand"] .entete-tete__in { grid-template-columns: auto minmax(0, 1fr) minmax(0, 720px); }
@media (min-width: 1281px) {
  .page-entete-grand { --nav-height: 0px; --entete-grand: 188px; }   /* l'en-tête est dans la page : rien à réserver en haut */
  html[data-texte="tres-grand"] .page-entete-grand { --entete-grand: 214px; }   /* sa hauteur mesurée (bande 40 + tête + ligne) */
  .page-entete-grand .flash-container { top: calc(var(--entete-grand) + var(--space-4)); }   /* les messages : sous lui */
  .navbar.navbar--grand { position: relative; height: auto; border-bottom: 0; }
  .navbar--grand .entete-tete { display: block; background: var(--clr-bg-secondary); }
  .navbar--grand .entete-ligne { flex: none; border-block: 1px solid var(--clr-text); }
  .navbar--grand .entete-ligne > .navbar__inner { height: auto; min-height: 52px; }
  .navbar--grand .entete-logo--ligne, .navbar--grand .entete-loupe, .navbar--grand .entete-cherche { display: none; }
}

/* ── Écrans moyens et petits ────────────────────────────────────────────────────────────────────────────────── */
@media (max-width: 1180px) { .entete-mot, .entete-nom { display: none; } }
/* Texte très grand (la ligne ne dépasse jamais 1 280 px) : les menus se resserrent et « GeneBase » part du lien du logiciel */
html[data-texte="tres-grand"] .navbar .nav-link { padding-inline: 9px; }
html[data-texte="tres-grand"] .navbar .entete-geneb { display: none; }
@media (max-width: 1100px) { .entete-date__longue { display: none; } .entete-date__courte { display: inline; } }
/* Sous 1 280 px, les menus sont derrière ☰ (comme avant) : le logo à gauche, le logiciel, la loupe et ☰ à droite */
@media (max-width: 1280px) {
  .navbar .entete-logo--ligne { margin-right: auto; }
  .entete-logiciel-seul { display: inline-flex; }
}
@media (max-width: 720px) { .entete-logiciel-seul { display: none; } }
@media (max-width: 768px) {
  .entete-bande { flex-basis: 36px; }
  .entete-bande .entete-i { height: 30px; padding: 0 7px; }
  .entete-logo { font-size: 21px; }
  .entete-logo__arbre { width: 24px; height: 28px; }
  .entete-loupe { width: 44px; height: 44px; }
  .entete-form { flex-wrap: wrap; }
  .entete-form input { flex: 1 1 100%; border-bottom: 1px solid var(--clr-border); }
  .entete-form select { flex: 1 1 0; max-width: none; border-left: 0; }
}
@media (max-width: 560px) {
  .entete-date--membre { display: none; }
  .entete-bande__in { gap: 6px; }
  .entete-gratuit { display: none; }
  html[data-texte="tres-grand"] .entete-long { display: none; }
  html[data-texte="tres-grand"] .entete-court { display: inline; }
  .entete-bande .compte { margin-left: 2px; padding-left: 6px; }
  .entete-bande .compte__bouton svg { display: none; }
  .entete-bande .compte__bouton { padding-right: 2px; }
}
@media (max-width: 400px) {
  .entete-date { display: none; }
  .entete-long { display: none; }
  .entete-court { display: inline; }
  .entete-outils--visiteur { margin-inline: auto 0; }
}
/* Sur téléphone, la liste « où chercher » et le bouton prennent chacun toute la largeur : la liste n'est jamais coupée */
@media (max-width: 520px) {
  .entete-form select { flex-basis: 100%; border-bottom: 1px solid var(--clr-border); }
  .entete-form button { flex: 1 1 100%; }
}
@media (max-width: 360px) {
  .entete-logo { font-size: 19px; gap: 8px; }
  .entete-bande .entete-i { padding: 0 6px; }
  html[data-texte="tres-grand"] .entete-form select { padding-inline: 6px; font-size: .8125rem; }
}
/* Sur téléphone (jusqu'à 560 px), les panneaux de la bande prennent la largeur de l'écran, sous l'en-tête, comme la cloche */
@media (max-width: 560px) {
  .entete-bande .lecture__panneau { position: fixed; left: 12px; right: 12px; top: calc(var(--nav-height) + 6px); width: auto; }
}

/* « Installer l'application » (menu ☰) : caché tant que le navigateur ne propose pas l'installation (app.js) ;
   sa règle « display: inline-flex » le montrait toujours, et il ne faisait rien */
.mobile-nav__pied-lien[hidden] { display: none; }

@media print {
  .entete-cherche, .entete-loupe { display: none !important; }
}
