/* ================================
   ANP - Association Nationale du Padel
   Design V2 - Fidèle maquette Figma
   ================================ */

/* --- Anti-FOUC : masque les éléments pilotés par Sanity tant que le CMS
   n'a pas répondu, puis fade-in 280ms. Le timeout fallback dans
   sanity-client.js garantit l'affichage même si Sanity est lent (1.2s max). --- */
.hero__title,
.hero__subtitle,
.hero .btn,
.about__title,
.about__text,
.about__image img,
.members__title,
.join__title,
.join__subtitle,
.join__form-submit .btn,
.footer__desc,
.footer__col ul,
.nav__list,
.nav__logo-img {
  transition: opacity 280ms ease;
}
/* !important : nécessaire pour battre l'animation heroReveal (animation-fill-mode forwards
   l'emporte sur les rules statiques sans !important). Cascade légitime ici car c'est
   un état UX transient (≤ 1.2s) qui doit override toute autre règle. */
body.sanity-loading .hero__title,
body.sanity-loading .hero__subtitle,
body.sanity-loading .hero .btn,
body.sanity-loading .about__title,
body.sanity-loading .about__text,
body.sanity-loading .about__image img,
body.sanity-loading .members__title,
body.sanity-loading .join__title,
body.sanity-loading .join__subtitle,
body.sanity-loading .join__form-submit .btn,
body.sanity-loading .footer__desc,
body.sanity-loading .footer__col ul,
body.sanity-loading .nav__list,
body.sanity-loading .nav__logo-img {
  opacity: 0 !important;
}

/* ---- Police Gabarito auto-hébergée (police variable, 2 fichiers pour 4 graisses) ---- */
@font-face {
  font-family: 'Gabarito';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('/assets/fonts/gabarito-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Gabarito';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('/assets/fonts/gabarito-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Fallback avec métriques ajustées pour éliminer le CLS pendant le swap.
   La fallback reproduit ~les mêmes dimensions que Gabarito, donc pas de saut. */
@font-face {
  font-family: 'Gabarito-fallback';
  src: local('Arial');
  ascent-override: 95%;
  descent-override: 22%;
  line-gap-override: 0%;
  size-adjust: 98%;
}

/* ---- Accessibilité ---- */

/* Skip link : visible uniquement au focus clavier */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 10000;
  background: #15006B;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 700;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 16px;
  outline: 3px solid #06FF89;
  outline-offset: 2px;
}

/* Focus visible homogène sur tous les éléments interactifs */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #06FF89;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Masquage visuel accessible (visible pour les lecteurs d'écran) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Min-heights pour éviter CLS lors du remplacement par Sanity */
.hero__title { min-height: 1.05em; } /* 1 ligne réservée */
.hero__subtitle { min-height: calc(1.6em * 2); }
.about__title { min-height: 1.2em; }
.about__text { min-height: calc(1.6em * 2); }
/* Espacement uniforme entre paragraphes et listes du rich text Sanity
   (les blocs non-liste sont émis en <p>, les puces en <ul>). */
.about__text > * + *,
.hero__subtitle > * + *,
.join__subtitle > * + *,
.footer__desc > * + * { margin-top: 0.8em; }

/* Listes à puces dans les champs rich text */
.about__text ul,
.hero__subtitle ul,
.join__subtitle ul,
.footer__desc ul {
  list-style: disc;
  padding-left: 1.3em;
  margin: 0; /* l'écart vertical est géré par `> * + *` */
}
.about__text ul li,
.hero__subtitle ul li,
.join__subtitle ul li,
.footer__desc ul li { margin: 0.2em 0; }
.join__title { min-height: 1.2em; }
.join__subtitle { min-height: calc(1.6em * 3); }
/* La hauteur fixe du label (2 lignes) est définie plus bas dans le bloc
   `.stats__label` — voir aussi le clamp pour les labels qui dépasseraient. */

/* Zone de statut du formulaire (aria-live) */
.form__status {
  min-height: 1.4em;
  margin-top: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
}
.form__status--success { color: #06FF89; }
.form__status--error { color: #ff6b6b; }

/* Reveal au scroll : état initial invisible + légèrement translaté */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  will-change: opacity, transform;
}
.reveal--visible {
  opacity: 1;
  transform: translateY(0);
}

/* Hero : apparition au chargement (pas au scroll car visible d'emblée) */
.hero__title,
.hero__subtitle,
.hero .btn {
  opacity: 0;
  transform: translateY(16px);
  animation: heroReveal 0.8s ease forwards;
}
.hero__subtitle { animation-delay: 0.15s; }
.hero .btn { animation-delay: 0.3s; }
@keyframes heroReveal {
  to { opacity: 1; transform: translateY(0); }
}

/* Spinner pour le bouton de soumission du formulaire */
.btn--loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.btn--loading::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 18px; height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  color: #ffffff;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Skeleton shimmer pour les cartes stats pendant le chargement Sanity */
.stats__card--loading .stats__number,
.stats__card--loading .stats__label {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.08) 0%,
    rgba(255,255,255,0.18) 50%,
    rgba(255,255,255,0.08) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: 4px;
  color: transparent !important;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Overlay de chargement carte : déclenché par classes JS.
   Survit au bfcache grâce au pageshow handler côté script.js. */
.centres__map { position: relative; }
.centres__map::before,
.centres__map::after {
  pointer-events: none; /* ne bloque jamais les clics sur les markers */
}
.centres__map::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--light-blue, #E7F1FF);
  z-index: 1;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s ease, visibility 0s 0.4s linear;
}
.centres__map::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 36px; height: 36px;
  margin: -18px 0 0 -18px;
  border: 3px solid var(--navy, #15006B);
  border-top-color: transparent;
  border-radius: 50%;
  z-index: 2;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s ease, visibility 0s 0.4s linear;
  animation: spin 0.8s linear infinite;
}
.centres__map.map--loaded::before,
.centres__map.map--loaded::after {
  opacity: 0;
  visibility: hidden;
}

/* ============ Page 404 ============ */
.error-page {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  background:
    radial-gradient(circle at 30% 20%, rgba(1, 0, 254, 0.06), transparent 50%),
    radial-gradient(circle at 70% 80%, rgba(6, 255, 137, 0.08), transparent 50%),
    var(--white, #FBFDFF);
  color: var(--navy, #15006B);
  position: relative;
  overflow: hidden;
}
.error-page__content {
  max-width: 640px;
  text-align: center;
  position: relative;
  z-index: 1;
}
.error-page__code {
  font-size: clamp(6rem, 20vw, 12rem);
  font-weight: 900;
  line-height: 0.9;
  color: var(--navy, #15006B);
  margin-bottom: 8px;
  letter-spacing: -4px;
}
.error-page__title {
  font-size: clamp(1.5rem, 3.5vw, 2.4rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -0.5px;
  color: var(--navy, #15006B);
}
.error-page__text {
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  line-height: 1.6;
  margin-bottom: 40px;
  color: rgba(21, 0, 107, 0.75);
}
.error-page__actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
/* Boutons de la 404 adaptés au fond blanc */
.error-page .btn--solid-navy {
  background: var(--navy, #15006B);
  color: var(--white, #ffffff);
  border: 1.5px solid var(--navy, #15006B);
}
.error-page .btn--solid-navy:hover {
  background: transparent;
  color: var(--navy, #15006B);
}
.error-page .btn--outline-navy {
  background: transparent;
  color: var(--navy, #15006B);
  border: 1.5px solid var(--navy, #15006B);
}
.error-page .btn--outline-navy:hover {
  background: var(--navy, #15006B);
  color: var(--white, #ffffff);
}

/* Sur la page 404, le header a un fond navy (pour rendre logo + liens visibles) */
.page-404 .header {
  position: relative;
  background: var(--navy, #15006B);
}
@media (max-width: 640px) {
  .error-page__actions .btn { width: 100%; max-width: 320px; }
}

/* Respect préférence utilisateur : réduction des animations */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  /* Cas spécifiques : sans animation, certaines mécaniques rendent mal.
     - Marquee : sans translation continue, on fige les logos au début (transform: none)
       au lieu de les pousser à -50% en 0.01ms (effet flash visible).
     - Compteurs (heroReveal, stats) : on retire le translateY initial pour un rendu net
       sans animation.
     - Reveal IntersectionObserver : on les force visibles d'emblée. */
  .members__logos-track {
    animation: none !important;
    transform: none !important;
    /* Le mask gradient continue de fader les bords pour un look cohérent */
  }
  .hero__title, .hero__subtitle, .hero .btn {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}


:root {
  --green: #06FF89;
  --blue: #0100FE;
  --light-blue: #E7F1FF;
  --navy: #15006B;
  --black: #0a0020;
  --white: #FBFDFF;
  --font: 'Gabarito', 'Gabarito-fallback', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius: 20px;
  --radius-sm: 12px;
  --transition: 0.3s ease;
  --max-width: 1200px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
section, header, footer { display: block; margin: 0; padding: 0; }
/* html en navy : invisible derrière body en temps normal, mais évite le flash
   blanc lors de l'autohide de la barre d'URL sur iOS Safari + couvre la zone
   d'overscroll (rubber band) avec la couleur de la nav. */
html { scroll-behavior: smooth; scroll-padding-top: 80px; background: var(--navy); }
body { font-family: var(--font); color: var(--white); background: var(--white); line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 40px; }

/* ==================== NAV ==================== */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: transparent;
  transition: background var(--transition);
}

.header--scrolled {
  background: var(--navy);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

.nav__logo-img { height: 44px; width: auto; display: block; }

.nav__list { display: flex; align-items: center; gap: 48px; }

.nav__link {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 2px;
  transition: color var(--transition);
}

.nav__link:hover { color: var(--green); }

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
}

.nav__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: var(--transition);
}

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 32px;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  border-radius: 50px;
  cursor: pointer;
  transition: all var(--transition);
}

.btn--outline {
  background: rgba(6, 255, 137, 0.15);
  color: var(--white);
  border: 1.5px solid var(--green);
}

.btn--outline:hover {
  background: var(--green);
  color: var(--navy);
}

.btn--outline-white {
  background: transparent;
  color: var(--white);
  border: 1.5px solid var(--white);
}

.btn--outline-white:hover {
  background: var(--white);
  color: var(--navy);
}

.btn--outline-green {
  background: transparent;
  color: var(--green);
  border: 1.5px solid var(--green);
}

.btn--outline-green:hover {
  background: var(--green);
  color: var(--navy);
}

.btn--large {
  font-size: 1.1rem;
  padding: 16px 40px;
}

/* ==================== HERO ==================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: transparent;
  margin-bottom: 0;
}

.hero__bg {
  /* <img> en object-fit: cover pour reproduire le rendu d'un background-image,
     mais avec le bénéfice du srcset responsive (mobile télécharge 42 KB au
     lieu de 205 KB → meilleur LCP). */
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: -1px;
  width: 100%;
  height: calc(100% + 1px);
  object-fit: cover;
  object-position: center;
  background-color: #1a1a3a; /* fallback pendant le download de l'image */
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.2) 100%);
}

.hero__content {
  position: relative;
  z-index: 1;
  padding-bottom: 80px;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding-left: 40px;
  padding-right: 40px;
}

.hero__title {
  max-width: 900px;
  font-size: clamp(1.6rem, 3.6vw, 2.7rem);
  font-weight: 900;
  color: var(--white);
  line-height: 1.1;
  margin-bottom: 16px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
  letter-spacing: -0.5px;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .hero__title {
    white-space: normal; /* sur mobile on laisse passer à la ligne si besoin */
    font-size: clamp(1.3rem, 5.8vw, 1.8rem);
  }
}

.hero__subtitle {
  max-width: 700px;
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 32px;
  line-height: 1.6;
  font-weight: 400;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);
}

.hero__subtitle em {
  font-style: italic;
}

.hero__subtitle strong {
  color: var(--white);
  font-weight: 700;
}

/* ==================== À PROPOS ==================== */
.about {
  padding: 60px 0;
  background: var(--white);
  position: relative;
}

.about__label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--navy);
  border: 1px solid var(--navy);
  border-radius: 50px;
  padding: 6px 20px;
  margin-bottom: 24px;
}

.about__grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.about__col {
  display: flex;
  flex-direction: column;
  max-width: 700px;
  width: 100%;
  text-align: center;
}

.about__content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
}

.about__image {
  border-radius: var(--radius);
  overflow: hidden;
  margin: 0;
  align-self: stretch;
  min-height: 100%;
}

.about__image img {
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
}

.about__image--large img {
  min-height: 480px;
}

.about__body {
  text-align: left;
}

.about__title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 20px;
  line-height: 1.15;
}

.about__text {
  font-size: 1.05rem;
  color: var(--navy);
  opacity: 0.85;
  line-height: 1.65;
}

/* Responsive : stack sur mobile / tablette */
@media (max-width: 900px) {
  .about__content {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .about__image img { min-height: 280px; }
  .about__image--large img { min-height: 320px; }
  .about__body { text-align: center; }
  .about__title { font-size: 1.6rem; }
  /* Texte centré sur mobile/tablette : les puces alignées à gauche
     créent un déséquilibre visuel — on retire la disc et l'indent. */
  .about__text ul {
    list-style: none;
    padding-left: 0;
  }
  .about__text ul li { margin: 0.5em 0; }
}

/* Carte droite avec overlay texte sur image */
.about__card-overlay {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  height: 430px;
}

.about__card-overlay img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about__card-overlay-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 28px;
  background: linear-gradient(to top, rgba(1, 0, 254, 0.85) 0%, rgba(1, 0, 254, 0.4) 70%, transparent 100%);
}

.about__card-overlay-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 8px;
}

.about__card-overlay-text {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
  margin-bottom: 12px;
}

.about__card-overlay-link {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: 0.5px;
  transition: color var(--transition);
}

.about__card-overlay-link:hover {
  color: var(--green);
}

/* ==================== MEMBRES FONDATEURS ==================== */
.members {
  padding: 80px 0 90px;
  background: var(--navy, #15006B);
  color: var(--white, #ffffff);
  text-align: center;
}

.members__title {
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
  font-weight: 600;
  color: var(--white);
  opacity: 0.95;
  margin: 0 auto 40px;
  max-width: 720px;
  line-height: 1.4;
  letter-spacing: 0.2px;
}

.members__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  max-width: 900px;
  margin: 0 auto 56px;
  align-items: start;
}

.members__stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.members__prefix {
  font-size: clamp(1.1rem, 1.8vw, 1.5rem);
  font-weight: 700;
  color: var(--green, #06FF89);
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.members__number {
  font-size: clamp(2.8rem, 6vw, 4.6rem);
  font-weight: 900;
  color: var(--white);
  line-height: 1;
  letter-spacing: -1px;
  display: block;
}

.members__label {
  font-size: 1rem;
  font-weight: 500;
  color: var(--white);
  opacity: 0.85;
  margin-top: 8px;
  max-width: 260px;
  line-height: 1.4;
}

/* --- Logos des membres (marquee / défilement infini) --- */
.members__logos-wrap {
  margin-top: 24px;
  overflow: hidden;
  width: 100%;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 15%, #000 85%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 15%, #000 85%, transparent);
}

.members__logos-placeholder {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--white);
  opacity: 0.5;
  font-style: italic;
  padding: 24px 0;
  margin: 0;
}

.members__logos-track {
  display: flex;
  align-items: center;
  gap: 28px;
  width: max-content;
  animation: marquee 50s linear infinite;
}

.members__logo-card {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border-radius: 14px;
  padding: 14px 26px;
  height: 88px;
  min-width: 180px;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  text-decoration: none;
}

.members__logo-card img {
  height: 100%;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  display: block;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Pause du défilement si l'utilisateur survole */
.members__logos-wrap:hover .members__logos-track {
  animation-play-state: paused;
}

/* Responsive : stats en colonne sur mobile */
@media (max-width: 640px) {
  .members {
    padding: 56px 0 64px;
  }
  .members__title {
    margin-bottom: 32px;
  }
  .members__stats {
    grid-template-columns: 1fr;
    gap: 32px;
    margin-bottom: 40px;
  }
  .members__logos-track {
    gap: 18px;
    animation-duration: 36s;
  }
  .members__logo-card {
    height: 68px;
    min-width: 140px;
    padding: 10px 18px;
    border-radius: 12px;
  }
  .members__logo-card img {
    max-width: 160px;
  }
}

/* ==================== TRANSITION ==================== */
/* ==================== CHIFFRES ==================== */
.stats {
  padding: 80px 0;
  background: linear-gradient(180deg, var(--blue) 0%, var(--navy) 100%);
  position: relative;
  z-index: 1;
}

.stats__title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 900;
  color: var(--white);
  letter-spacing: 2px;
  margin-bottom: 32px;
}

.stats__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}

.stats__card {
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  min-height: 260px;
}

.stats__card-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.stats__card-overlay {
  display: none;
}

.stats__card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(to top, var(--navy) 0%, rgba(21, 0, 107, 0.8) 40%, transparent 100%);
  z-index: 1;
}

.stats__card-body {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  z-index: 2;
}

.stats__number {
  font-size: 3rem;
  font-weight: 900;
  color: var(--white);
  line-height: 1;
}

.stats__prefix {
  font-size: 2.25rem;
  font-weight: 900;
  color: var(--white);
  line-height: 1; /* aligné sur .stats__number — sinon la line-box change selon que le préfixe est rempli ou non */
}
.stats__prefix:empty { display: none; }

.stats__suffix {
  font-size: 2.25rem;
  font-weight: 900;
  color: var(--white);
  line-height: 1; /* aligné sur .stats__number — voir commentaire ci-dessus */
}
.stats__suffix:empty { display: none; }

.stats__label {
  /* Hauteur fixe = 2 lignes pile, pour que les chiffres restent alignés
     verticalement entre les 3 cartes (label court vs label long).
     Au-delà de 2 lignes, le texte est tronqué avec ellipsis. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: calc(1rem * 1.5 * 2);
  margin-top: 6px;
  font-size: 1rem;
  color: var(--white);
  font-weight: 600;
  line-height: 1.5;
}

.stats__link {
  font-size: clamp(0.9rem, 1.5vw, 1.1rem);
  font-weight: 700;
  color: var(--white);
  letter-spacing: 1px;
  transition: color var(--transition);
}

.stats__link:hover {
  color: var(--green);
}

/* ==================== CENTRES ==================== */
.centres {
  padding: 80px 0;
  background: var(--white);
}

.centres__title {
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  font-weight: 900;
  color: var(--navy);
  margin-bottom: 32px;
  letter-spacing: 1px;
}

.centres__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.centres__filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.centres__filter-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--navy);
  opacity: 0.7;
}

.centres__select {
  appearance: none;
  -webkit-appearance: none;
  padding: 10px 40px 10px 16px;
  border-radius: 10px;
  border: 1.5px solid var(--navy);
  background: var(--white, #ffffff);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path fill='%2315006B' d='M6 8L2 4h8z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  color: var(--navy);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  min-width: 220px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.centres__select:hover { border-color: var(--green); }
.centres__select:focus-visible { border-color: var(--green); box-shadow: 0 0 0 3px rgba(6, 255, 137, 0.25); }

.centres__filter-reset {
  align-self: flex-end;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1.5px solid transparent;
  background: transparent;
  color: var(--navy);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.centres__filter-reset:hover { opacity: 1; }

.centres__filter-count {
  align-self: flex-end;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  opacity: 0.7;
  margin-left: auto;
  padding-bottom: 10px;
}

@media (max-width: 640px) {
  .centres__filters { gap: 10px; }
  .centres__filter-group { flex: 1 1 100%; }
  .centres__select { width: 100%; min-width: 0; }
  .centres__filter-reset { align-self: flex-start; padding-left: 0; }
  .centres__filter-count { margin-left: 0; }
}

/* Ancien style bouton (gardé au cas où mais plus utilisé) */
.centres__filter {
  padding: 8px 20px;
  border-radius: 50px;
  border: 1px solid var(--navy);
  background: transparent;
  color: var(--navy);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}

.centres__filter:hover,
.centres__filter.active {
  background: var(--navy);
  color: var(--white);
}

.centres__map {
  border-radius: var(--radius);
  overflow: hidden;
  height: 450px;
}

/* Popup d'un marker (infoWindow Google Maps) */
.map-popup {
  padding: 4px 4px 2px;
  min-width: 200px;
  max-width: 280px;
}
.map-popup__brand {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: var(--green, #06FF89);
  color: var(--navy, #15006B);
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}
.map-popup__brand--indep {
  background: var(--light-blue, #E7F1FF);
  color: var(--navy);
}
.map-popup__title {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}
.map-popup__row {
  margin: 4px 0;
  font-size: 0.85rem;
  color: #333;
  line-height: 1.4;
}
.map-popup__row a {
  color: var(--blue, #0100FE);
  text-decoration: none;
}
.map-popup__row a:hover { text-decoration: underline; }

/* ==================== REJOIGNEZ L'ANP ==================== */
.join {
  padding: 80px 0;
  background: url('assets/images/BLOCS_INTERFACE/FORMULAIRE/FOND.webp?v=4') center/cover no-repeat;
}

.join__inner {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.join__title {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 900;
  color: var(--white);
  margin-bottom: 16px;
}

.join__subtitle {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 40px;
  line-height: 1.7;
}

/* Honeypot anti-spam : invisible pour les humains, visible pour les bots */
.form__honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.join__form {
  background: transparent;
  border-radius: var(--radius);
  padding: 40px;
  text-align: left;
}

.join__form-grid {
  display: grid;
  grid-template-columns: 1.2fr 1.5fr;
  gap: 24px;
  margin-bottom: 24px;
}

.join__form-left {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.join__form-right {
  display: flex;
  min-height: 0;
  overflow: hidden;
  width: 100%;
}

.join__form-right .form__group {
  width: 100%;
}

.join__form-right textarea {
  width: 100%;
}

.form__group {
  display: flex;
  flex-direction: column;
}

.form__group--full {
  height: 100%;
}

.form__group label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.form__optional {
  font-weight: 400;
  text-transform: none;
  opacity: 0.7;
  letter-spacing: 0;
}

.form__group input,
.form__group select,
.form__group textarea {
  padding: 12px 16px;
  font-family: var(--font);
  font-size: 0.9rem;
  border: none;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
  transition: background var(--transition);
}

.form__group input::placeholder,
.form__group textarea::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.form__group input:focus,
.form__group select:focus,
.form__group textarea:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.25);
}

.form__group textarea {
  resize: none;
  height: 100%;
  min-height: 150px;
  max-height: 100%;
}

.join__form-submit {
  text-align: center;
}

.join__form-submit .btn {
  font-size: 1.1rem;
  padding: 16px 40px;
}

/* ==================== FOOTER ==================== */
.footer {
  padding: 60px 0 40px;
  background: var(--navy);
  color: rgba(255, 255, 255, 0.7);
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
}

.footer__logo-link {
  display: inline-block;
  margin-bottom: 16px;
}

.footer__logo {
  height: 28px;
  width: auto;
}

.footer__desc {
  font-size: 0.85rem;
  line-height: 1.7;
}

.footer__col h4,
.footer__title {
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.footer__col li {
  margin-bottom: 10px;
  font-size: 0.85rem;
}

.footer__col a:hover {
  color: var(--green);
}


/* ==================== COOKIE BANNER ==================== */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 20px 40px;
  background: rgba(21, 0, 107, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transform: translateY(0);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.cookie-banner--hidden {
  transform: translateY(100%);
}

.cookie-banner__text {
  font-size: 0.9rem;
  color: var(--white);
  line-height: 1.5;
}

.cookie-banner__link {
  color: var(--green);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity var(--transition);
}

.cookie-banner__link:hover {
  opacity: 0.8;
}

.cookie-banner__actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.cookie-banner__btn {
  padding: 10px 24px;
  font-size: 0.8rem;
}

.cookie-banner__btn--accept {
  background: var(--green);
  color: var(--navy);
  border: 1.5px solid var(--green);
  border-radius: 50px;
  font-family: var(--font);
  font-weight: 700;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: all var(--transition);
}

.cookie-banner__btn--accept:hover {
  background: transparent;
  color: var(--green);
}

/* ==================== LEGAL PAGES ==================== */
.legal { padding: 120px 0 80px; background: var(--white); }
.legal__title { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 900; color: var(--navy); margin-bottom: 32px; }
.legal__section { margin-bottom: 32px; }
.legal__section h2 { font-size: 1.2rem; font-weight: 800; color: var(--navy); margin-bottom: 12px; }
.legal__section p { font-size: 0.9rem; color: var(--navy); opacity: 0.7; line-height: 1.7; margin-bottom: 8px; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
  .about__grid { grid-template-columns: 1fr; }
  .about__card-overlay { min-height: 400px; }
  .stats__grid { grid-template-columns: repeat(3, 1fr); }
  .join__form-grid { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (max-width: 768px) {
  .container { padding: 0 20px; }

  .nav__list {
    position: fixed;
    top: 64px; left: 0; right: 0;
    background: var(--navy);
    flex-direction: column;
    padding: 32px 24px;
    gap: 24px;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition);
  }

  .nav__list.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  /* Quand le burger est ouvert en haut de page, le header est encore
     transparent par défaut → bande visible au-dessus de l'overlay du menu.
     La classe `header--menu-open` est posée par JS dans setNavOpen()
     quand le burger s'ouvre — on force ici le fond navy. */
  .header--menu-open {
    background: var(--navy);
  }

  .nav__toggle { display: flex; }

  .nav__toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
  .nav__toggle.active span:nth-child(2) { opacity: 0; }
  .nav__toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

  .hero__content { padding-bottom: 60px; padding-left: 24px; padding-right: 24px; }
  .hero__subtitle { font-size: 1.05rem; }

  .about { padding: 40px 0; }
  .about__image--large img { height: 240px; }
  .about__title { font-size: 1.3rem; }
  .about__text { font-size: 1rem; }

  .stats { padding: 60px 0; }
  .stats__title { font-size: 1.4rem; margin-bottom: 24px; }
  .stats__grid { grid-template-columns: 1fr; gap: 16px; }
  .stats__card { min-height: 220px; }

  .centres { padding: 60px 0; }
  .centres__title { font-size: 1.4rem; }
  .centres__filters { gap: 8px; }
  .centres__filter { padding: 6px 14px; font-size: 0.7rem; }
  .centres__map { height: 320px; }

  .join { padding: 60px 0; }
  .join__title { font-size: 1.5rem; }
  .join__subtitle { font-size: 0.95rem; }
  .join__form { padding: 0; }
  .join__form-grid { grid-template-columns: 1fr; gap: 16px; }
  .join__form-submit .btn { font-size: 1rem; padding: 14px 28px; }

  .footer__grid { grid-template-columns: 1fr; gap: 32px; }

  .cookie-banner {
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    text-align: center;
  }
  .cookie-banner__text { font-size: 0.8rem; }
  .cookie-banner__actions { width: 100%; justify-content: center; gap: 8px; }
}
