:root {
  --pf-noir: #111111;
  --pf-blanc: #ffffff;
  --pf-accent: #ff3b1f;
  --pf-gris: #6b6b6b;
  --header-h: 72px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--pf-noir);
  background: var(--pf-blanc);
}

/* Lien d'accessibilité : caché, visible au focus clavier */
.skip-link {
  position: absolute;
  top: -48px;
  left: 8px;
  z-index: 1000;
  background: var(--pf-noir);
  color: var(--pf-blanc);
  padding: 12px 18px;
  border-radius: 4px;
  text-decoration: none;
  transition: top .15s ease;
}
.skip-link:focus {
  top: 8px;
}

/* En-tête fixe */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(0, 0, 0, .08);
  z-index: 500;
}

.header-inner {
  max-width: 1280px;
  height: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 6px;
  text-decoration: none;
  color: var(--pf-noir);
  font-weight: 800;
  letter-spacing: .02em;
  white-space: nowrap;
}
.logo-nom { font-size: 1.1rem; }
.logo-sub { font-size: .75rem; font-weight: 500; color: var(--pf-gris); text-transform: uppercase; }

.anchor-nav {
  display: flex;
  gap: clamp(12px, 1.7vw, 22px);
  margin-left: auto;
  /* Surtout pas de flex-wrap : le header a une hauteur fixe (--header-h), une
     nav qui passe à la ligne déborde par le bas au lieu de se resserrer. */
  flex-wrap: nowrap;
  min-width: 0;
}
.anchor-nav a {
  color: var(--pf-noir);
  text-decoration: none;
  font-size: .92rem;
  font-weight: 600;
  white-space: nowrap;
}
.anchor-nav a:hover,
.anchor-nav a:focus-visible {
  color: var(--pf-accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-rejoindre {
  display: inline-block;
  background: var(--pf-accent);
  color: var(--pf-blanc);
  text-decoration: none;
  font-weight: 700;
  font-size: .9rem;
  padding: 10px 20px;
  border-radius: 999px;
  white-space: nowrap;
}
.btn-rejoindre:hover,
.btn-rejoindre:focus-visible {
  filter: brightness(1.1);
}

.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
}
.burger span {
  display: block;
  height: 2px;
  width: 24px;
  background: var(--pf-noir);
  margin: 0 auto;
}

main {
  margin-top: var(--header-h);
}

.section {
  min-height: 60vh;
  padding: 64px 20px;
  max-width: 1280px;
  margin: 0 auto;
  scroll-margin-top: var(--header-h);
}
/* La dernière section doit remplir la vue : sinon le document s'arrête trop
   tôt, le navigateur bute sur le bas de page et la dernière ancre ne peut pas
   se poser sous l'en-tête fixe (elle atterrit au milieu de l'écran). Règle de
   défilement, pas de mise en forme : elle vaut pour la section en dernière
   position, quelle qu'elle soit. */
.section:last-of-type { min-height: calc(100svh - var(--header-h)); }

.section h2 { font-size: 2rem; margin: 0 0 12px; }
.placeholder-note { color: var(--pf-gris); }

#top { min-height: 1px; padding: 0; }

.compteurs { display: flex; gap: 24px; flex-wrap: wrap; list-style: none; padding: 0; margin: 24px 0; }
.villes { display: flex; gap: 12px; flex-wrap: wrap; list-style: none; padding: 0; margin: 12px 0; }

.avertissements:empty { display: none; }

/* Palier intermédiaire : entre le tiroir mobile (≤768px) et le confort large
   (≥1100px), les 6 ancres + logo + CTA ne tiennent pas sur une ligne à taille
   pleine. On resserre au lieu de laisser la nav passer à la ligne. */
@media (min-width: 769px) and (max-width: 1099px) {
  .header-inner { gap: 14px; padding: 0 14px; }
  .anchor-nav a { font-size: .8rem; }
  .btn-rejoindre { padding: 9px 15px; font-size: .82rem; }
  .logo-nom { font-size: 1rem; }
  .logo-sub { display: none; }
}

/* Responsive : bascule menu en tiroir sous 768px */
@media (max-width: 768px) {
  .anchor-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--pf-blanc);
    flex-direction: column;
    gap: 0;
    padding: 8px 20px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, .08);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease, transform .15s ease;
  }
  .anchor-nav.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  /* Tiroir plus haut que l'écran (petit mobile paysage) : il défile seul. */
  .anchor-nav {
    max-height: calc(100svh - var(--header-h));
    overflow-y: auto;
  }
  .anchor-nav a {
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 0, 0, .06);
  }
  .btn-rejoindre { padding: 8px 14px; font-size: .82rem; }
  .burger { display: flex; }
  .logo-sub { display: none; }
}

/* Tiroir ouvert : on gèle le défilement de la page derrière, sinon le doigt
   fait glisser le contenu sous un menu qui, lui, reste en place. */
body.menu-ouvert { overflow: hidden; }

/* Défilement doux : confortable par défaut, désactivé pour qui demande à ne
   pas être animé (le saut d'ancre reste instantané et exact). */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .skip-link, .anchor-nav { transition: none; }
}
