/* MON BAHUT (08/11/2026) — charte (kit : static/mon-bahut/, consignes : mon-bahut/LISEZ-MOI-charte.md) et BARRE DU SITE,
   la même sur toutes les pages : portail (templates/_barre_site.html) et livres (insérée par mon-bahut.js).
   La barre reste toujours aux couleurs Mon Bahut ; la barre de chaque livre garde son propre style et se colle
   JUSTE EN DESSOUS (ses `top` utilisent --mb-h). */
@font-face { font-family: "Bebas Neue"; font-weight: 400; font-display: swap; src: url("/static/mon-bahut/fonts/bebas-neue-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url("/static/mon-bahut/fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("/static/mon-bahut/fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("/static/mon-bahut/fonts/barlow-latin-600-normal.woff2") format("woff2"); }

:root {
  --mb-rouge: #C8322B; --mb-rouge-fonce: #B3261E; --mb-bleu: #1E3A5F; --mb-carbone: #1F2328; --mb-email: #FBF8F1;
  --mb-creme: #F4EEE2; --mb-sable: #EADFC6; --mb-ocre: #D9A441; --mb-gris: #4A4F57; --mb-bordure: #C9C2B4;
  --mb-titre: "Bebas Neue", sans-serif; --mb-libelle: "Barlow Condensed", sans-serif; --mb-texte: "Barlow", sans-serif;
  --mb-h: 85px;              /* hauteur de la barre du site (liseré compris) : les barres des livres se collent dessous */
  --haut-entete: var(--mb-h);   /* (cahiers de restauration : barres d'outils collées sous l'en-tête) */
}
@media (max-width: 959px) { :root { --mb-h: 64px; } }

.mb-barre { position: sticky; top: 0; z-index: 90; height: var(--mb-h); box-sizing: border-box; background: var(--mb-sable);
  border-bottom: 5px solid var(--mb-rouge-fonce); font-family: var(--mb-texte); color: var(--mb-carbone); }
.mb-barre * { box-sizing: border-box; }
.mb-barre-dedans { height: 100%; max-width: 1400px; margin: 0 auto; padding: 0 22px; display: flex; align-items: center; gap: 18px; }
.mb-plaque { display: flex; align-items: center; flex-shrink: 0; }
.mb-plaque img { height: 60px; width: auto; display: block; }
.mb-liens { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.mb-liens a.mb-lien { font: 600 1.05rem var(--mb-libelle); text-transform: uppercase; letter-spacing: .06em; color: var(--mb-carbone);
  text-decoration: none; padding: 6px 0 3px; border-bottom: 3px solid transparent; }
.mb-liens a.mb-lien:hover { color: var(--mb-rouge-fonce); }
.mb-liens a.mb-lien[aria-current="page"] { border-bottom-color: var(--mb-rouge-fonce); }
.mb-droite { display: flex; align-items: center; gap: 14px; }
.mb-qui { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--mb-carbone); font: 600 .95rem var(--mb-texte); }
.mb-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--mb-bleu); color: #fff; display: grid; place-items: center;
  font: 400 1.2rem var(--mb-titre); letter-spacing: .02em; }
.mb-btn { font: 600 .95rem var(--mb-libelle); text-transform: uppercase; letter-spacing: .06em; border-radius: 999px; padding: 7px 16px;
  cursor: pointer; border: 2px solid var(--mb-rouge-fonce); background: transparent; color: var(--mb-rouge-fonce); text-decoration: none; white-space: nowrap; }
.mb-btn:hover { background: var(--mb-rouge-fonce); color: #fff; }
.mb-btn.plein { background: var(--mb-rouge-fonce); color: #fff; }

/* boutons du livre déplacés dans la barre du site (Contributions, Mode édition — mon-bahut.js : adopterActions) */
.mb-actions { display: flex; align-items: center; }
:is(#mbActions, #mbActionsTel) .mb-adopte { position: static !important; display: flex; align-items: center; gap: 10px; background: none !important; border: 0 !important;
  box-shadow: none !important; padding: 0 !important; margin: 0 !important; border-radius: 0 !important; flex-wrap: nowrap; font-family: var(--mb-texte); }
.mb-adopte.hidden { display: none !important; }
:is(#mbActions, #mbActionsTel) .mb-adopte #backLink, .mb-adopte > a[href="/bibliotheque"], .mb-adopte .inv-nom, .mb-adopte #authEmail { display: none !important; }
:is(#mbActions, #mbActionsTel) .mb-adopte button:not(.hidden), :is(#mbActions, #mbActionsTel) .mb-adopte a.inv-barre-btn, :is(#mbActions, #mbActionsTel) .mb-adopte label { display: inline-flex; align-items: center; gap: 6px; height: 38px;
  padding: 0 14px; border: 2px solid var(--mb-bordure); border-radius: 999px; background: var(--mb-email); color: var(--mb-carbone);
  font: 600 .95rem var(--mb-libelle); text-transform: uppercase; letter-spacing: .05em; text-decoration: none; cursor: pointer; white-space: nowrap; }
:is(#mbActions, #mbActionsTel) .mb-adopte button:hover, :is(#mbActions, #mbActionsTel) .mb-adopte a.inv-barre-btn:hover, :is(#mbActions, #mbActionsTel) .mb-adopte label:hover { border-color: var(--mb-bleu); color: var(--mb-bleu); }
:is(#mbActions, #mbActionsTel) .mb-adopte label input { accent-color: var(--mb-rouge-fonce); width: 16px; height: 16px; margin: 0; }
:is(#mbActions, #mbActionsTel) .mb-adopte label:has(input:checked) { background: var(--mb-bleu); border-color: var(--mb-bleu); color: #fff; }
:is(#mbActions, #mbActionsTel) .mb-adopte .has-pending, :is(#mbActions, #mbActionsTel) .mb-adopte a.inv-barre-btn strong { color: var(--mb-rouge-fonce); }
:is(#mbActions, #mbActionsTel) .mb-adopte a.inv-barre-btn strong { background: var(--mb-rouge-fonce); color: #fff; border-radius: 999px; padding: 0 7px; font-size: .8rem; }
@media (max-width: 959px) {
  #mbActionsTel .mb-adopte { flex-direction: column; align-items: stretch; gap: 8px; padding: 8px 0 12px !important; border-bottom: 1px solid #e6dfcf !important; }
  #mbActionsTel .mb-adopte button:not(.hidden), #mbActionsTel .mb-adopte a.inv-barre-btn, #mbActionsTel .mb-adopte label { height: 48px; justify-content: center; width: 100%; border-bottom: 2px solid var(--mb-bordure); }
  .mb-actions-tel:empty { display: none; }
}

/* sélecteur de langue : drapeau + code + chevron ; liste extensible (mon-bahut.js : MB_LANGUES) */
.mb-langue { position: relative; }
.mb-langue-btn { display: flex; align-items: center; gap: 6px; background: var(--mb-email); border: 2px solid var(--mb-bordure); border-radius: 8px;
  padding: 5px 8px; height: 38px; cursor: pointer; font: 600 .9rem var(--mb-libelle); color: var(--mb-carbone); }
.mb-drapeau { width: 24px; height: 16px; border: 1px solid #b9b3a6; display: block; object-fit: cover; }
.mb-chevron { font-size: .7rem; color: var(--mb-gris); }
.mb-langue ul { position: absolute; right: 0; top: calc(100% + 6px); z-index: 95; min-width: 170px; margin: 0; padding: 6px; list-style: none;
  background: var(--mb-email); border: 1px solid var(--mb-bordure); border-radius: 10px; box-shadow: 0 8px 22px rgba(0, 0, 0, .18); }
.mb-langue li { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 6px; cursor: pointer; font: 400 1rem var(--mb-texte); min-height: 40px; }
.mb-langue li:hover { background: #f1ead9; }
.mb-langue li[aria-selected="true"] { background: var(--mb-sable); font-weight: 600; }

/* téléphone : plaque, langue (drapeau seul), menu ☰ qui ouvre un panneau sous la barre */
.mb-menu-btn { display: none; width: 44px; height: 44px; border-radius: 8px; border: 2px solid var(--mb-bordure); background: var(--mb-email);
  font-size: 1.3rem; cursor: pointer; color: var(--mb-carbone); }
.mb-panneau { display: none; }
@media (max-width: 959px) {
  .mb-barre-dedans { padding: 0 12px; gap: 10px; }
  .mb-plaque img { height: 42px; }
  .mb-liens, .mb-droite .mb-qui, .mb-droite .mb-btn { display: none; }
  .mb-droite { margin-left: auto; }
  .mb-langue-code { display: none; }
  .mb-menu-btn { display: block; }
  .mb-panneau { position: fixed; left: 0; right: 0; top: var(--mb-h); z-index: 89; background: var(--mb-email); border-bottom: 2px solid var(--mb-bordure);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .2); padding: 8px 16px 16px; flex-direction: column; }
  .mb-barre.ouverte .mb-panneau { display: flex; }
  .mb-panneau a, .mb-panneau button { display: flex; align-items: center; gap: 10px; min-height: 48px; font: 600 1.1rem var(--mb-libelle);
    text-transform: uppercase; letter-spacing: .06em; color: var(--mb-carbone); text-decoration: none; border: 0; border-bottom: 1px solid #e6dfcf;
    background: none; text-align: left; padding: 0 4px; cursor: pointer; width: 100%; }
  .mb-panneau a[aria-current="page"] { color: var(--mb-rouge-fonce); }
  .mb-panneau .mb-btn { justify-content: center; margin-top: 12px; border: 2px solid var(--mb-rouge-fonce); color: var(--mb-rouge-fonce); }
}

/* ===== PAGES PUBLIQUES (08/11/2026, maquette mon-bahut/web/connexion-reference.html) : connexion, invitation, accueil.
   Deux moitiés : à gauche l'ocre avec la borne et le panneau d'accroche, à droite le formulaire sur fond crème ;
   sur téléphone (< 960 px), la partie gauche passe au-dessus. ===== */
body.mb-public { background: var(--mb-creme); color: var(--mb-carbone); font-family: var(--mb-texte); margin: 0; }
.mb-deux { display: flex; flex-wrap: wrap; min-height: calc(100vh - var(--mb-h)); }
.mb-deux-gauche { flex: 1 1 480px; min-width: 0; background: var(--mb-ocre); display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 32px; padding: 64px 32px; }
.mb-deux-gauche .borne { width: 220px; height: auto; }
.mb-deux-gauche .panneau { width: 400px; max-width: 100%; height: auto; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .22)); }
.mb-deux-droite { flex: 1 1 480px; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 64px 32px; }
.mb-form { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 18px; }
.mb-surtitre, .mb-form label.mb-champ span { font-family: var(--mb-libelle); font-weight: 600; font-size: 14px; letter-spacing: 2px;
  text-transform: uppercase; color: var(--mb-gris); }
.mb-surtitre { margin: 0; letter-spacing: 3px; }
.mb-form h1 { margin: 0; font-family: var(--mb-titre); font-weight: 400; font-size: 52px; line-height: 1; letter-spacing: 2px; color: var(--mb-carbone); }
.mb-form p { margin: 0; line-height: 1.5; }
.mb-form label.mb-champ { display: flex; flex-direction: column; gap: 6px; }
.mb-form input[type=email], .mb-form input[type=password], .mb-form input[type=text] { height: 46px; padding: 0 14px; border: 2px solid var(--mb-bordure);
  border-radius: 8px; background: #fff; font: 16px var(--mb-texte); color: var(--mb-carbone); width: 100%; box-sizing: border-box; }
.mb-form input:focus-visible { outline: 3px solid var(--mb-bleu); outline-offset: 1px; }
.mb-souvenir { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; }
.mb-souvenir input { width: 18px; height: 18px; margin: 0; accent-color: var(--mb-bleu); }
.mb-bouton { height: 50px; border: 0; border-radius: 999px; background: var(--mb-rouge-fonce); color: #fff; font-family: var(--mb-libelle); font-weight: 600;
  font-size: 20px; letter-spacing: 2px; text-transform: uppercase; cursor: pointer; text-decoration: none; display: flex; align-items: center; justify-content: center; }
.mb-bouton:hover { background: #8F1E18; color: #fff; }
.mb-bouton:disabled { opacity: .6; cursor: default; }
.mb-erreur { color: var(--mb-rouge-fonce); font-weight: 600; min-height: 1.2em; }
.mb-lien-bleu { color: var(--mb-bleu); text-align: center; font-size: 15px; }
.mb-lien-bleu:hover { color: var(--mb-rouge-fonce); }
.mb-pied { text-align: center; padding: 18px 16px; font: 400 .85rem var(--mb-texte); color: var(--mb-gris); background: var(--mb-creme); }
@media (max-width: 959px) {
  .mb-deux-gauche { padding: 36px 20px; gap: 22px; }
  .mb-deux-gauche .borne { width: 140px; }
  .mb-deux-gauche .panneau { width: 300px; }
  .mb-deux-droite { padding: 36px 20px 48px; }
}

/* Dans les livres : leurs propres boutons de langue font double emploi avec celui de la barre du site (qui règle
   la langue de TOUS les livres) ; leur nom et leur « se déconnecter » aussi. */
body .sp-langues, body .inv-langues, body .tb-langues, #authBar #authEmail, #authBar #authLogoutBtn, .inv-barre .inv-nom { display: none !important; }
