/* Khallot — l'en-tête commun à toutes les pages (11 oct. 2026).
   Écrit par deploy/navigation-site.py, chargé sur chaque page, ancien et
   nouveau système. Il porte sa propre classe (kh-entete) pour ne rien
   hériter des anciennes règles de header.site. Le menu du téléphone est un
   <details> : il s'ouvre sans JavaScript ; commun.js le referme proprement.
   Les anciennes pages prennent aussi la police Geist, celle de l'accueil. */

@font-face {
  font-family: "Geist";
  src: url("polices/geist-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

html:not([data-systeme="2"]) body { font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }

.kh-entete {
  --kh-nuit: #101d35; --kh-encre: #3b4150; --kh-gris: #676e80; --kh-menthe: #0f7d69; --kh-creme: #fbf7f1;
  position: sticky; top: 10px; z-index: 60; box-sizing: border-box;
  display: flex; align-items: center; gap: 20px;
  width: min(1200px, calc(100% - 20px)); margin: 10px auto 0; padding: 8px 8px 8px 16px;
  border: 1px solid rgba(16, 29, 53, .08); border-radius: 999px;
  background: rgba(251, 247, 241, .8);
  -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
  font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.2; letter-spacing: normal;
  transition: transform .5s cubic-bezier(.16, 1, .3, 1), box-shadow .3s, background-color .3s;
}
.kh-entete *, .kh-entete *::before, .kh-entete *::after { box-sizing: border-box; }
.kh-entete.compact { background: rgba(251, 247, 241, .92); box-shadow: 0 12px 34px -22px rgba(16, 29, 53, .45); }
.kh-entete.masquee { transform: translateY(-140%); }

.kh-marque { display: inline-flex; align-items: center; gap: 9px; flex: none;
  color: var(--kh-nuit); text-decoration: none; font-weight: 700; font-size: 18px; letter-spacing: -.03em; }
.kh-marque img { display: block; width: 30px; height: 30px; border-radius: 8px; }

.kh-nav { display: flex; gap: 2px; margin: 0 auto; }
.kh-nav a { padding: 8px 12px; border-radius: 999px; color: var(--kh-encre); text-decoration: none;
  font-size: 14.5px; font-weight: 500; white-space: nowrap; transition: color .2s, background-color .2s; }
.kh-nav a::after { content: none; }
.kh-nav a:hover { color: var(--kh-nuit); background: rgba(16, 29, 53, .05); }
.kh-nav a[aria-current="page"] { color: var(--kh-nuit); background: rgba(16, 29, 53, .07); }

.kh-actions { display: flex; align-items: center; gap: 6px; flex: none; margin-left: auto; }
.kh-don, .kh-beta { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 16px;
  border-radius: 999px; font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: background-color .2s, transform .2s, box-shadow .2s; }
.kh-don { gap: 6px; color: var(--kh-menthe); }
.kh-coeur { flex: none; }
.kh-don-court { display: none; }
.kh-don:hover { background: rgba(26, 184, 156, .12); }
.kh-beta { background: var(--kh-nuit); color: #fff; }
.kh-beta:hover { background: #1b2b4f; transform: translateY(-1px); box-shadow: 0 14px 30px -16px rgba(16, 29, 53, .6); }
.kh-don:focus-visible, .kh-beta:focus-visible, .kh-nav a:focus-visible, .kh-marque:focus-visible, .kh-menu summary:focus-visible, .kh-menu-panneau a:focus-visible {
  outline: 2px solid #335cf5; outline-offset: 2px; }

/* Le menu : caché sur grand écran, seul accès à tout le site sur téléphone.
   Les anciennes feuilles habillent tous les <details> (fond, bordure, « + ») :
   l'en-tête repart de zéro. */
.kh-entete .kh-menu { display: none; position: static; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.kh-entete .kh-menu > summary { position: static; margin: 0; padding: 0; font-size: 0; }
.kh-entete .kh-menu > summary::before, .kh-entete .kh-menu > summary::after { content: none; }
.kh-entete .kh-menu-panneau p, .kh-entete .kh-menu-panneau ul, .kh-entete .kh-menu-panneau li { background: none; border: 0; box-shadow: none; }
.kh-menu summary { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; cursor: pointer;
  list-style: none; color: var(--kh-nuit); background: rgba(16, 29, 53, .06); }
.kh-menu summary::-webkit-details-marker { display: none; }
.kh-menu summary::marker { content: ""; }
.kh-menu summary span, .kh-menu summary span::before, .kh-menu summary span::after {
  display: block; width: 16px; height: 1.8px; border-radius: 2px; background: currentColor; transition: transform .3s cubic-bezier(.16, 1, .3, 1), opacity .2s; }
.kh-menu summary span { position: relative; }
.kh-menu summary span::before, .kh-menu summary span::after { content: ""; position: absolute; left: 0; }
.kh-menu summary span::before { top: -5px; }
.kh-menu summary span::after { top: 5px; }
.kh-menu[open] summary span { background: transparent; }
.kh-menu[open] summary span::before { transform: translateY(5px) rotate(45deg); }
.kh-menu[open] summary span::after { transform: translateY(-5px) rotate(-45deg); }

.kh-menu-panneau { position: absolute; left: 0; right: 0; top: calc(100% + 8px);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 24px;
  max-height: calc(100vh - 100px); overflow-y: auto; padding: 22px 22px 18px;
  border: 1px solid rgba(16, 29, 53, .08); border-radius: 22px; background: var(--kh-creme);
  box-shadow: 0 30px 60px -30px rgba(16, 29, 53, .45); animation: kh-menu .35s cubic-bezier(.16, 1, .3, 1); }
@keyframes kh-menu { from { opacity: 0; transform: translateY(-6px); } }
.kh-menu-panneau p { margin: 0 0 8px; color: var(--kh-gris); font-size: 12.5px; font-weight: 600; letter-spacing: .02em; }
.kh-menu-panneau ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.kh-menu-panneau ul a { display: block; padding: 7px 0; color: var(--kh-nuit); text-decoration: none; font-size: 17px; font-weight: 550; letter-spacing: -.01em; }
.kh-menu-panneau ul a[aria-current="page"] { color: var(--kh-menthe); }
.kh-menu-panneau .kh-menu-don { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-radius: 16px; background: rgba(26, 184, 156, .1); color: var(--kh-nuit); text-decoration: none; font-size: 15px; line-height: 1.4; }
.kh-menu-panneau .kh-menu-don b { color: var(--kh-menthe); white-space: nowrap; }

@media (max-width: 1060px) { .kh-nav a { padding: 8px 9px; font-size: 14px; } }
@media (max-width: 980px) {
  .kh-nav { display: none; }
  .kh-entete .kh-menu { display: block; }
}
@media (max-width: 600px) {
  .kh-entete { gap: 8px; padding: 6px 6px 6px 12px; }
  .kh-marque { font-size: 17px; }
  .kh-don { padding: 0 12px; background: rgba(26, 184, 156, .16); }
  .kh-don-long { display: none; }
  .kh-don-court { display: inline; }
  .kh-beta { padding: 0 14px; font-size: 13.5px; }
  .kh-menu-panneau { grid-template-columns: 1fr; gap: 16px; padding: 18px 18px 16px; }
}
@media (max-width: 420px) {
  .kh-marque span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
  .kh-entete, .kh-menu summary span, .kh-menu summary span::before, .kh-menu summary span::after { transition: none; }
  .kh-menu-panneau { animation: none; }
}

/* L'encart de don, en fin de contenu des pages de ressources (11 oct. 2026). */
.kh-encart-don { box-sizing: border-box; display: flex; align-items: center; gap: 20px 32px; width: min(860px, calc(100% - 32px));
  margin: 56px auto 0; padding: 24px 28px; border-radius: 22px; background: rgba(26, 184, 156, .1);
  border: 1px solid rgba(15, 125, 105, .18); font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.kh-encart-don > div { flex: 1; }
.kh-encart-don p { margin: 0; color: #3b4150; font-size: 15.5px; line-height: 1.5; }
.kh-encart-don .kh-encart-titre { margin-bottom: 4px; color: #101d35; font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.kh-encart-bouton { flex: none; display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px;
  border-radius: 999px; background: #0f7d69; color: #fff; font-size: 15px; font-weight: 650; text-decoration: none; transition: background-color .2s, transform .2s; }
.kh-encart-bouton:hover { background: #0c6a59; transform: translateY(-1px); }
.kh-encart-bouton:focus-visible { outline: 2px solid #335cf5; outline-offset: 3px; }
@media (max-width: 600px) {
  .kh-encart-don { flex-direction: column; align-items: stretch; margin-top: 40px; padding: 22px 20px; }
  .kh-encart-bouton { width: 100%; }
}
