/* Collectif des riverains de l’A6 : feuille de style
   Les couleurs sont réglées une seule fois ci-dessous. */

@font-face {
  font-family: "Overpass";
  src: url("fonts/overpass-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Overpass";
  src: url("fonts/overpass-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Overpass";
  src: url("fonts/overpass-latin-900-normal.woff2") format("woff2");
  font-weight: 900;
  font-display: swap;
}

:root {
  --jaune: #FFC81E;          /* jaune de signalisation : l’alerte */
  --jaune-appuye: #F0B400;
  --asphalte: #1D1E20;       /* texte, panneau, pied de page */
  --chaussee: #2E2F33;       /* bande de route sous l’accueil */
  --blanc: #FFFFFF;          /* marquage au sol */
  --fond: #F4F3F0;           /* fond des sections */
  --texte-doux: #55575B;
  --trait: rgba(29, 30, 32, 0.22);

  --police: "Overpass", "Segoe UI", system-ui, -apple-system, sans-serif;
  --largeur: 72rem;
  --mesure: 40rem;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--asphalte);
  font-family: var(--police);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { line-height: 1.1; margin: 0; }
p { margin: 0; }

a { color: var(--asphalte); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--asphalte);
  outline-offset: 3px;
  border-radius: 4px;
}

.evitement {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 30;
  padding: 0.6rem 1rem;
  background: var(--blanc);
  color: var(--asphalte);
  font-weight: 700;
}
.evitement:focus { top: 1rem; }

/* ---------------------------------------------------------------
   Accueil : fond jaune signalisation
   --------------------------------------------------------------- */

.hero {
  background: var(--jaune);
  color: var(--asphalte);
}

.hero__inner {
  width: 100%;
  max-width: var(--largeur);
  margin: 0 auto;
  padding: 1.1rem 1.25rem 1.75rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "collectif"
    "titre"
    "voulons"
    "panneau";
  gap: 1rem;
}

.hero__collectif {
  grid-area: collectif;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.hero__collectif::before {
  content: "";
  width: 1.75rem;
  height: 0.35rem;
  background: var(--asphalte);
}

.hero__titre {
  grid-area: titre;
  font-weight: 900;
  font-size: clamp(2.6rem, 12.5vw, 6.75rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

/* Le titre tient en deux lignes : « A6, A86 : » puis « on n’en peut plus ! ».
   La taille s’ajuste à la largeur disponible. */
.hero__titre { container-type: inline-size; }
.hero__titre span { display: block; }
@supports (font-size: 1cqi) {
  .hero__titre span {
    white-space: nowrap;
    font-size: min(6.75rem, calc(100cqi / 8.15));
  }
}

/* « Nous voulons » : les demandes, en gros */
.voulons { grid-area: voulons; }

.voulons__intro {
  font-weight: 900;
  font-size: clamp(1.2rem, 3.5vw, 1.6rem);
  margin-bottom: 0.6rem;
}

.voulons__liste {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

.voulons__liste li {
  position: relative;
  padding-left: 1.6rem;
}
.voulons__liste li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.42em;
  width: 1rem;
  height: 0.38rem;
  background: var(--asphalte);
}

.voulons__liste strong {
  display: block;
  font-weight: 900;
  font-size: clamp(1.3rem, 4.6vw, 2.4rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.voulons__liste span {
  display: block;
  font-size: clamp(0.98rem, 1.6vw, 1.15rem);
  line-height: 1.35;
  margin-top: 0.15rem;
}

/* Le compteur, dessiné comme un panneau : fond noir, liseré blanc */
.panneau {
  grid-area: panneau;
  background: var(--asphalte);
  color: var(--blanc);
  border: 3px solid var(--blanc);
  border-radius: 16px;
  box-shadow: 0 0 0 5px var(--asphalte);
  margin: 5px;
  padding: 1.25rem 1.25rem 1.1rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
  gap: 0.85rem;
}

.panneau__compteur {
  min-height: 7.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.panneau__nombre {
  font-weight: 900;
  font-size: clamp(3.4rem, 16vw, 6.25rem);
  line-height: 1;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.panneau__libelle {
  color: var(--jaune);
  font-weight: 900;
  font-size: 1.4rem;
  line-height: 1.2;
  margin-top: 0.2rem;
}

.panneau__detail {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.72);
}

.panneau__indispo {
  font-weight: 700;
  font-size: 1.3rem;
  line-height: 1.3;
}

[data-etat="chargement"] [data-compteur-nombre] { opacity: 0.35; }

.panneau__aide {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.72);
}

.alerte-config {
  background: var(--jaune);
  color: var(--asphalte);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
}

/* Bande de chaussée avec sa ligne discontinue */
.chaussee {
  height: 3.5rem;
  background: var(--chaussee);
  display: flex;
  align-items: center;
}
.chaussee span {
  display: block;
  width: 100%;
  height: 6px;
  background: repeating-linear-gradient(
    90deg,
    var(--blanc) 0 3rem,
    transparent 3rem 6rem
  );
}

/* ---------------------------------------------------------------
   Bouton principal
   --------------------------------------------------------------- */

.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.5rem;
  padding: 0.9rem 1.75rem 0.75rem;
  background: var(--jaune);
  color: var(--asphalte);
  border: 3px solid var(--asphalte);
  font-weight: 900;
  font-size: 1.25rem;
  line-height: 1.1;
  text-decoration: none;
  border-radius: 10px;
  cursor: pointer;
}
.bouton:hover { background: var(--jaune-appuye); text-decoration: none; }
.bouton:active { transform: translateY(1px); }
.bouton[aria-disabled="true"] { cursor: not-allowed; }

.bouton--panneau { border-color: var(--jaune); font-size: 1.35rem; }
.panneau :focus-visible { outline-color: var(--blanc); }

/* ---------------------------------------------------------------
   Barre de signature fixe (mobile, quand le panneau est hors écran)
   --------------------------------------------------------------- */

.barre-mobile {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 1rem calc(0.6rem + env(safe-area-inset-bottom));
  background: var(--asphalte);
  color: var(--blanc);
  transform: translateY(110%);
  transition: transform 0.2s ease;
}
.barre-mobile.visible { transform: none; }
.barre-mobile :focus-visible { outline-color: var(--blanc); }

.barre-mobile__compteur { line-height: 1.1; min-width: 0; }
.barre-mobile__compteur [data-compteur-nombre] {
  display: block;
  font-weight: 900;
  font-size: 1.6rem;
  font-variant-numeric: tabular-nums;
}
.barre-mobile__compteur [data-compteur-libelle] {
  color: var(--jaune);
  font-weight: 700;
  font-size: 0.9rem;
}
.barre-mobile__compteur [data-compteur-indispo] {
  font-size: 0.85rem;
  font-weight: 700;
}
.barre-mobile .bouton {
  min-height: 3rem;
  padding: 0.7rem 1.1rem 0.55rem;
  font-size: 1.1rem;
  border-color: var(--jaune);
  flex-shrink: 0;
}

/* ---------------------------------------------------------------
   Sections
   --------------------------------------------------------------- */

.section {
  max-width: var(--largeur);
  margin: 0 auto;
  padding: 3.25rem 1.25rem;
}

.section + .section {
  background-image: repeating-linear-gradient(
    90deg,
    var(--trait) 0 1.5rem,
    transparent 1.5rem 3rem
  );
  background-size: calc(100% - 2.5rem) 3px;
  background-position: 1.25rem 0;
  background-repeat: no-repeat;
}

.section h2 {
  font-weight: 900;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  letter-spacing: -0.015em;
  margin-bottom: 1rem;
  max-width: var(--mesure);
}

.section > p,
.texte p,
.texte.conclusion {
  max-width: var(--mesure);
}

.destinataires {
  color: var(--texte-doux);
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.texte p + p { margin-top: 1em; }
.insecable { white-space: nowrap; }

.demandes__titre {
  font-weight: 900;
  font-size: 1.35rem;
  margin: 2rem 0 0.9rem;
}

.demandes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
  max-width: var(--mesure);
}
.demandes li {
  position: relative;
  padding-left: 1.6rem;
}
.demandes li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.9rem;
  height: 0.3rem;
  background: var(--asphalte);
}

.conclusion {
  margin-top: 1.75rem;
  font-weight: 700;
  font-size: 1.15rem;
}

.relance { margin-top: 1.75rem; }

.sources {
  margin-top: 2.25rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--texte-doux);
}
.sources a { color: var(--texte-doux); }

/* Communes : petits panneaux jaunes */
.plaques {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.plaques li {
  background: var(--jaune);
  color: var(--asphalte);
  font-weight: 900;
  padding: 0.6rem 1rem 0.45rem;
  border-radius: 7px;
  border: 3px solid var(--asphalte);
  line-height: 1.2;
}

/* Contact */
.contacts {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}
.contacts li { font-size: 1.15rem; }
.contacts .libelle { font-weight: 700; }
.contacts a { font-weight: 900; word-break: break-word; }
.contacts .vide { color: var(--texte-doux); }

/* Pied de page */
.pied {
  background: var(--asphalte);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.9rem;
  line-height: 1.55;
}
.pied__inner {
  max-width: var(--largeur);
  margin: 0 auto;
  padding: 2.25rem 1.25rem 2.5rem;
  display: grid;
  gap: 0.6rem;
}
.pied__inner p { max-width: 48rem; }
.pied strong { color: var(--blanc); }
.pied__titre {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--blanc);
  margin-top: 0.6rem;
}

.noscript {
  max-width: var(--largeur);
  margin: 1rem auto 0;
  padding: 0.75rem 1.25rem;
  font-weight: 700;
}

/* ---------------------------------------------------------------
   Mobile : on garde la place pour la barre fixe
   --------------------------------------------------------------- */

@media (max-width: 51.99rem) {
  body { padding-bottom: 4.75rem; }
}

/* Petits écrans peu hauts : on resserre l’accueil */
@media (max-width: 51.99rem) and (max-height: 760px) {
  .hero__inner { gap: 0.8rem; padding-top: 0.9rem; }
  .voulons__liste { gap: 0.5rem; }
  .voulons__liste span { display: none; }
  .panneau { padding: 1rem 1rem 0.9rem; gap: 0.7rem; }
  .panneau__compteur { min-height: 6rem; }
}

/* ---------------------------------------------------------------
   Écrans larges : demandes à gauche, compteur à droite
   --------------------------------------------------------------- */

@media (min-width: 52rem) {
  .barre-mobile { display: none; }

  .hero__inner {
    min-height: calc(100vh - 3.5rem);
    min-height: calc(100svh - 3.5rem);
    padding: 1.75rem 2rem 3rem;
    grid-template-columns: minmax(0, 1.45fr) minmax(19rem, 1fr);
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "collectif collectif"
      "titre     panneau"
      "voulons   panneau";
    column-gap: 4rem;
    row-gap: 2rem;
    align-content: center;
  }

  .hero__titre { align-self: end; }
  .voulons { align-self: start; }
  .voulons__liste { gap: 1.1rem; }

  .panneau {
    align-self: center;
    padding: 2rem 1.75rem 1.5rem;
    gap: 1rem;
  }
  .panneau__compteur { min-height: 10rem; }
  .panneau__libelle { font-size: 1.6rem; }

  .section { padding: 4.5rem 2rem; }
  .section + .section {
    background-size: calc(100% - 4rem) 3px;
    background-position: 2rem 0;
  }

  .pied__inner { padding: 2.5rem 2rem 3rem; }
}

@media (prefers-reduced-motion: reduce) {
  .bouton:active { transform: none; }
  .barre-mobile { transition: none; }
}
