/* Shell — valeurs transcrites du code source des planches du wireframe v3.
   Chaque nombre ici correspond à une valeur du rendu, pas à une estimation. */

.ic { flex: 0 0 auto; display: block; color: currentColor; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- En-tête -------------------------------------------------------------- */

.hdr {
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  display: flex;
  flex-direction: column;
  background: var(--page);
  color: var(--ink);
}

/* Le header change de forme au défilement : l'enveloppe se resserre, la barre
   devient une pilule flottante, le rail et la recherche se replient. Tout est
   interpolé — sans transition, la bascule se faisait d'un coup. */
.hdr-enveloppe { padding: 21px 0; transition: padding var(--t-standard) var(--e-doux); }

.hdr-bar {
  height: 64px;
  display: grid;
  transition: height var(--t-standard) var(--e-doux),
              max-width var(--t-standard) var(--e-doux),
              padding var(--t-standard) var(--e-doux),
              border-radius var(--t-standard) var(--e-doux),
              box-shadow var(--t-standard) var(--e-doux),
              background-color var(--t-standard) var(--e-doux),
              border-color var(--t-rapide) linear;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 32px;
  background: var(--page);
  border-bottom: 1px solid var(--line);
}

.hdr-menu { display: none; }

.hdr-brand {
  justify-self: start;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}
.hdr-brand img { display: block; height: 28px; width: auto; }
/* Même spécificité que la règle ci-dessus, sinon elle ne peut pas la battre. */
.hdr-brand .logo-sombre { display: none; }
.hdr-brand .logo-mono { display: none; }
[data-theme="dark"] .hdr-brand .logo-clair { display: none; }
[data-theme="dark"] .hdr-brand .logo-sombre { display: block; }

.hdr-nav {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 24px;
}
.hdr-link {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 2px;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--muted);
}
.hdr-link.is-actif { color: var(--ink); }

.hdr-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 4px;
}
.hdr-act {
  position: relative;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ink);
}
/* Le cercle n'est porté que par le bouton compte, comme dans le rendu. */
.hdr-act--cercle {
  width: 36px;
  height: 36px;
  background: var(--ghost);
  border: 1px solid var(--line-strong);
}
/* La cloche porte display:none dans la source du wireframe. */
.hdr-act--masque { display: none; }
.hdr-act--texte { width: auto; padding: 0 12px; font-size: 13.5px; font-weight: 600; }

.hdr-badge {
  position: absolute;
  top: 4px;
  right: 3px;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--coral);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Rail ----------------------------------------------------------------- */

.rail {
  height: 52px;
  overflow: hidden;
  transition: height var(--t-standard) var(--e-doux),
              opacity var(--t-rapide) linear,
              border-bottom-color var(--t-rapide) linear;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 32px;
  background: var(--page);
  border-bottom: 1px solid var(--line);
}
.rail-zone { position: relative; flex: 1 1 0; min-width: 0; }
/* Fondu de 28 px sur le bord droit, comme dans la source du wireframe. */
.rail-fondu {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 28px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--page));
}
.rail-piste {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
}
.rail-piste::-webkit-scrollbar { display: none; }
.rail-puce {
  flex: 0 0 auto;
  height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--ghost);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.rail-puce.is-actif {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--page);
}

.pilule-sombre {
  flex: 0 0 auto;
  margin-left: auto;
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 15px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--page);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

/* ---- État collant --------------------------------------------------------- */
/* Au premier défilement, la barre quitte le bord et devient une pilule
   flottante centrée. Le rail disparaît, le logo passe au monogramme.
   Valeurs relevées dans la source de la planche SHELL. */

.hdr-enveloppe { display: block; }  /* la règle de hauteur est plus haut */

.hdr--colle { background: transparent; border-bottom: 0; }
.hdr--colle .hdr-enveloppe { padding: 5px 32px; }
.hdr--colle .hdr-bar {
  max-width: 1180px;
  margin: 0 auto;
  height: 48px;
  padding: 0 12px 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .12);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}
/* Repli animé : display ne s'interpole pas, la hauteur si. */
.hdr--colle .rail { height: 0; opacity: 0; border-bottom-color: transparent; }
.hdr--colle .hdr-brand .logo-long { display: none; }
.hdr--colle .hdr-brand .logo-mono { display: block; height: 26px; }

/* ---- Variantes d'en-tête -------------------------------------------------- */

.hdr--sticky .rail { display: none; }
.hdr--plain .rail { display: none; }

.hdr--tunnel {
  height: 66px;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
}

.hdr--mobile { transition: padding var(--t-standard) var(--e-doux); }
.hdr--mobile .hdr-bar {
  height: 60px;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  padding: 0 14px;
}
.hdr--mobile .hdr-menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--ink);
}
.hdr--mobile .hdr-brand { justify-self: start; }
.hdr--mobile .hdr-brand img { height: 24px; }
.hdr--mobile .hdr-nav { display: none; }
.hdr--mobile .hdr-actions { gap: 2px; }
.hdr--mobile .rail { height: 52px; padding: 0 14px; }
/* Sur mobile aussi, la barre devient une pilule flottante au défilement
   (le traitement desktop de la planche SHELL, porté sur mobile).
   Pas de .hdr-enveloppe ici : l'encart vient d'un padding sur .hdr. */
.hdr--mobile.hdr--colle {
  border-bottom: 0;
  padding: 6px 12px;
}
.hdr--mobile.hdr--colle .hdr-bar {
  max-width: none; margin: 0; height: 52px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .12);
}
.hdr--mobile.hdr--colle .hdr-recherche { height: 0; opacity: 0; padding-top: 0; padding-bottom: 0; }
.hdr--mobile.hdr--colle .rail { height: 0; opacity: 0; border-bottom-color: transparent; }

.hdr-recherche { height: 52px; overflow: hidden;
  transition: height var(--t-standard) var(--e-doux), opacity var(--t-rapide) linear;
  display: flex; align-items: center; padding: 0 12px; }
.champ-recherche {
  flex: 1 1 0;
  min-width: 0;
  height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--sunk);
  color: var(--muted);
}
.champ-recherche input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  font-size: 13px;
  color: var(--text);
}
.champ-recherche input::placeholder { color: var(--muted); }

/* Tablette 834-1199 : le wireframe masque la navigation et sort le bouton
   menu. Barre de 60 px, marge de 22 px. */
@media (max-width: 1199px) {
  .hdr-bar {
    display: flex; align-items: center; gap: 10px;
    padding: 0 22px;
  }
  .hdr-menu {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; flex: 0 0 auto;
    border: 0; border-radius: 10px; background: none; color: var(--ink);
  }
  .hdr-nav { display: none; }
  .hdr-actions { margin-left: auto; }
  .rail { padding: 0 22px; }
}
@media (max-width: 833px) {
  .hdr-enveloppe { padding: 0; }
  .hdr-bar { gap: 8px; padding: 0 14px; }
  .hdr-menu { width: 42px; height: 42px; }
  .hdr-actions { gap: 2px; }
  .rail { padding: 0 14px; }
}

/* ---- Pied de page --------------------------------------------------------- */

.pied {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 24px;
  background: transparent;
}
.pied-bloc {
  width: 100%;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 42px 48px;
  border-radius: 24px;
  background: var(--pied-fond);
  color: var(--pied-ink);
}
.pied-haut { display: flex; align-items: center; gap: 56px; flex-wrap: wrap; }
.pied-logo {
  flex: 0 0 auto;
  display: block;
  width: 172px;
  height: 84px;
  background: url("../logos/stacked-dark.svg") center / contain no-repeat;
}
.pied-cols { flex: 1 1 0; min-width: 280px; display: flex; justify-content: space-between; gap: 32px; }
.pied-col { display: flex; flex-direction: column; gap: 16px; }
.pied-col--gauche { align-items: flex-start; }
.pied-col--droite { align-items: flex-end; text-align: right; }
.pied-col a { font-size: 14px; line-height: 1; color: var(--pied-ink); white-space: nowrap; }

.pied-trait { width: 100%; height: 1px; margin: 0; border: 0; background: var(--pied-trait); }

.pied-legal-ligne { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 12.5px; }
.pied-legal-ligne a { color: var(--pied-muted); }
.pied-legal-ligne span { color: var(--pied-trait); }

.pied-pilules { display: flex; align-items: center; justify-content: center; gap: 12px; }
.pied-pilule {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 42px;
  padding: 0 15px;
  border: 1px solid var(--pied-bord);
  border-radius: 12px;
  background: var(--pied-releve);
  color: var(--pied-ink);
}
.pied-pilule b { font-size: 13px; font-weight: 700; }
.pied-pilule span { font-size: 13px; color: var(--pied-muted); }
.pied-pilule i { flex: 0 0 auto; width: 1px; height: 14px; background: var(--pied-bord); }

.pied-bas { display: flex; align-items: center; gap: 14px; color: var(--pied-muted); }
.pied-copy { font-size: 12.5px; }
.reseaux { display: flex; align-items: center; gap: 14px; margin-left: auto; color: var(--pied-muted); }
.reseaux a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: inherit;
}

/* Pied mobile : 249 px, contact d'abord, deux accordéons fermés.
   Aucun rendu de référence — le wireframe ne le dessine jamais. */
.pied--mobile {
  display: grid;
  gap: 4px;
  height: 249px;
  padding: 20px 16px;
  background: var(--page);
  border-top: 1px solid var(--line);
}
.pied-contact { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pied-acc { border-bottom: 1px solid var(--line); }
.pied-acc summary { padding: 12px 0; font-size: 14px; font-weight: 600; cursor: pointer; }
.pied-acc div { display: grid; gap: 8px; padding-bottom: 12px; }
.pied-acc a { font-size: 14px; color: var(--muted); }
.pied-legal { display: flex; gap: 8px; margin: 0; font-size: 12px; color: var(--muted); }
.pied--mobile .pied-bas { color: var(--muted); font-size: 12.5px; }

/* ---- Tiroir --------------------------------------------------------------- */

.tiroir {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  width: min(100vw, 388px);
  overflow-y: auto;
  background: var(--page);
  border-right: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.tiroir[hidden] { display: none; }
.tiroir-tete {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 69px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.tiroir-tete .hdr-brand { margin-right: auto; }
.tiroir-fermer {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: none;
  color: var(--ink);
}
.tiroir-section > summary {
  height: 50px;
  display: flex;
  align-items: center;
  padding: 0 15px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}
.tiroir-lien {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 15px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--ink);
}
.tiroir-lien.is-actif { font-weight: 600; }
.tiroir-lien span:first-child { flex: 1; }
.tiroir-dest {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.tiroir-pied {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.interrupteur {
  margin-left: auto;
  position: relative;
  width: 46px;
  height: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--ghost);
}
.interrupteur i {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--page);
  border: 1px solid var(--line-strong);
  transition: left .16s ease;
}
[data-theme="dark"] .interrupteur i { left: 22px; }

body.tiroir-ouvert { overflow: hidden; }

/* ---- Visibilité par palier ------------------------------------------------ */

@media (min-width: 834px) { .mobile-only { display: none !important; } }

/* Mouvement réduit : la forme finale est la même, elle arrive sans trajet. */
@media (prefers-reduced-motion: reduce) {
  .hdr-enveloppe, .hdr-bar, .rail, .hdr-recherche { transition: none; }
}
