/* Cadre commun a toutes les pages (lot 3) : conteneur unique, en-tete,
   menu mobile, pied de page, fil d'Ariane. Valeurs issues de tokens.css. */

/* ---------- conteneur unique : en-tete, contenu et pied partagent le meme
   bord gauche (le logo s'aligne sur le contenu) ---------- */
body { margin: 0; }
.conteneur { max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gut); box-sizing: border-box; }
main.page { padding-bottom: 56px; }
.visuellement-cache {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.evitement { position: absolute; left: 8px; top: -60px; z-index: 60; background: var(--paper);
             padding: 10px 14px; border-radius: var(--r-ctl); }
.evitement:focus { top: 8px; }

/* ---------- en-tete ---------- */
.site {
  position: sticky; top: 0; z-index: 40; background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.site-barre { display: flex; align-items: center; gap: 24px; min-height: var(--header-h); }
.site-nav { display: flex; align-items: stretch; gap: 4px; align-self: stretch; }
.site-nav a {
  display: flex; align-items: center; padding: 0 10px; color: var(--ink);
  font-size: var(--fs-16); font-weight: 500; text-decoration: none; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.site-nav a:hover { color: var(--accent); }
.site-nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.site-droite { margin-left: auto; display: flex; align-items: center; gap: 10px; }
/* Selecteurs qualifies par .site : un gabarit qui redefinit .btn (l'accueil)
   ne doit pas pouvoir faire reapparaitre le bouton Menu sur ordinateur. */
.site .site-menu { display: none; }

/* ---------- boutons et champ du cadre ----------
   Qualifies par .site / .tiroir pour ne pas subir les regles generiques
   « button », « input » ou « .btn » que des gabarits de page definissent
   encore (largeur 100 %, marges, tailles de texte hors systeme). */
.site .btn, .tiroir .btn {
  margin: 0; width: auto; min-height: var(--target); padding: 0 18px; box-shadow: none;
  font-family: var(--f); font-size: var(--fs-16); font-weight: 600; line-height: 1.2;
  border-radius: var(--r-ctl);
}
.site .btn:not(.secondaire), .tiroir .btn:not(.secondaire) {
  background: var(--accent); border: 1px solid var(--accent); color: #ffffff;
}
.site .btn:not(.secondaire):hover, .tiroir .btn:not(.secondaire):hover { background: var(--accent-strong); }
.site .btn.secondaire, .tiroir .btn.secondaire {
  background: var(--paper); border: 1px solid var(--ctl-border); color: var(--ink);
}
.site .recherche input, .tiroir .recherche input {
  margin: 0; font-family: var(--f); font-size: var(--fs-16); padding: 0 14px 0 38px;
  border: 1px solid var(--ctl-border); border-radius: var(--r-ctl); color: var(--ink);
}

/* ---------- recherche et suggestions ---------- */
.recherche { position: relative; width: 300px; }
.recherche input {
  width: 100%; min-height: var(--target); padding-left: 38px; box-sizing: border-box;
  background: var(--surface);
}
.recherche-icone { position: absolute; left: 12px; top: 50%; width: 18px; height: 18px;
                   transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.suggestions {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 45; margin: 0; padding: 4px;
  list-style: none; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-ctl);
  box-shadow: 0 8px 24px rgba(23, 33, 38, .12); max-height: 60vh; overflow-y: auto;
}
.suggestions li {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  min-height: var(--target); padding: 0 10px; border-radius: var(--r-ctl); cursor: pointer;
  font-size: var(--fs-16); color: var(--ink);
}
.suggestions li .type { font-size: var(--fs-14); color: var(--muted); white-space: nowrap; }
.suggestions li[aria-selected="true"], .suggestions li:hover { background: var(--accent-soft); }

/* ---------- menu mobile ---------- */
.voile { position: fixed; inset: 0; z-index: 50; background: rgba(23, 33, 38, .45); }
.tiroir {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 51; width: min(340px, 88vw);
  box-sizing: border-box; overflow-y: auto; padding: 12px 16px 32px;
  background: var(--paper); box-shadow: -12px 0 32px rgba(23, 33, 38, .18);
}
.voile[hidden], .tiroir[hidden] { display: none; }
.tiroir-tete { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.tiroir-titre { margin: 0; font-size: var(--fs-18); font-weight: 600; }
.tiroir .recherche { width: auto; margin-bottom: 12px; }
.tiroir .tiroir-action { width: 100%; box-sizing: border-box; }
.tiroir-groupe { margin: 22px 0 4px; }
.tiroir-liens { list-style: none; margin: 0; padding: 0; }
.tiroir-liens a {
  display: flex; align-items: center; min-height: 48px; color: var(--ink);
  text-decoration: none; border-bottom: 1px solid var(--rule);
}
.tiroir-liens a:hover { color: var(--accent); }

@media (max-width: 900px) {
  .site .site-nav, .site .site-droite .recherche, .site .site-action { display: none; }
  .site .site-menu { display: inline-flex; }
}
@media (max-width: 640px) {
  .logo .mot { font-size: var(--fs-18); }
}

/* ---------- fil d'Ariane ---------- */
.fil-ariane { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px;
              margin: 18px 0 0; font-size: var(--fs-14); color: var(--muted); }
.fil-ariane a { color: var(--muted); text-decoration: none; }
.fil-ariane a:hover { color: var(--accent); text-decoration: underline; }
.fil-ariane a { display: inline-flex; align-items: center; min-height: 24px; }
.fil-ariane .sep { color: var(--muted); }
.fil-ariane [aria-current="page"] { color: var(--ink); font-weight: 500; }
@media (max-width: 700px) {
  .fil-ariane a, .fil-ariane span { display: inline-flex; align-items: center; min-height: var(--target); }
}

/* ---------- sources propres a une page (ancien pied de page de chaque gabarit) ---------- */
.sources { margin-top: 32px; font-size: var(--fs-14); color: var(--muted); line-height: 1.6; }
.sources a { color: var(--muted); display: inline-flex; align-items: center; min-height: 24px; }
@media (max-width: 700px) { .sources a { min-height: var(--target); } }

/* ---------- pied de page ---------- */
.site-foot { background: var(--surface); border-top: 1px solid var(--rule); padding: 32px 0 24px; }
.site-foot-grille { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr; gap: 24px; }
.site-foot ul { list-style: none; margin: 0; padding: 0; }
.site-foot .etiquette { margin: 0 0 6px; }
.site-foot li a {
  display: inline-flex; align-items: center; min-height: 32px;
  color: var(--ink-2); font-size: var(--fs-14); text-decoration: none;
}
.site-foot li a:hover { color: var(--accent); text-decoration: underline; }
.site-foot-legal { margin: 24px 0 0; padding-top: 16px; border-top: 1px solid var(--rule);
                   font-size: var(--fs-12); color: var(--muted); line-height: 1.6; }
@media (max-width: 760px) {
  .site-foot-grille { grid-template-columns: 1fr 1fr; }
  .site-foot li a { min-height: var(--target); }
}
