/* =========================================================
   Etude Gambier - Brick — recréation maquette (from scratch)
   ========================================================= */

:root {
  --bordeaux: #7a1320;
  --bordeaux-mid: #8d2330;
  --bordeaux-dark: #5b0f1a;
  --bordeaux-deep: #4d0d16;

  --cream: #f4ede3;
  --cream-2: #efe6da;
  --card: #f5efe6;
  --card-line: #e2d6c6;

  --paper: #fbf8f3;

  --text: #2c2520;
  --text-soft: #6f655a;
  --text-mute: #948a7d;
  --on-dark: #f3e7e2;
  --on-dark-soft: #d8bdc0;

  --line: rgba(60, 40, 30, 0.12);

  --container: 1180px;
  --radius: 0;

  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", "Segoe UI", system-ui, Arial, sans-serif;
  /* Interlignage unique du texte courant : paragraphes et items de liste.
     Les titres et les blocs compacts (adresses, header) gardent le leur. */
  --lh-text: 1.7;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

[id] { scroll-margin-top: 90px; }

.container {
  width: min(var(--container), calc(100% - 2.4rem));
  margin: 0 auto;
}

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* =========================================================
   HEADER (2 bandeaux, sticky)
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(251, 248, 243, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

/* --- Bandeau 1 : logo + contacts + CTA (même couleur que le bandeau 2) --- */
.header-topbar {
  background: transparent;
  border-bottom: 1px solid rgba(122, 19, 32, 0.1);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 74px;
}

.topbar-right { display: flex; align-items: center; gap: 1.8rem; }

.topbar-contacts { display: flex; align-items: center; gap: 1.8rem; }

.topbar-contact { display: inline-flex; align-items: center; gap: 0.55rem; }
.topbar-contact svg { width: 1.1rem; height: 1.1rem; color: var(--bordeaux); flex: 0 0 auto; }

.tc-text { display: flex; flex-direction: column; line-height: 1.2; }
.tc-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bordeaux);
}
.tc-value { font-size: 0.82rem; font-weight: 600; color: var(--text-soft); transition: color 0.2s ease; }
.topbar-contact:hover .tc-value { color: var(--bordeaux); }

.topbar-cta { display: flex; align-items: center; gap: 0.6rem; }

.tb-btn {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 1.05rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.tb-btn:hover { transform: translateY(-1px); }
/* Les CTA du bandeau peuvent etre des <a> (actifs) ou des <button disabled>
   (fonctionnalite a venir) : le <button> n'herite ni de la police ni du curseur. */
button.tb-btn { font-family: inherit; line-height: 1; cursor: pointer; }
.tb-btn-outline {
  color: var(--bordeaux);
  border: 1px solid rgba(122, 19, 32, 0.4);
  background: rgba(255, 255, 255, 0.7);
}
.tb-btn-outline:hover { border-color: var(--bordeaux); }
.tb-btn-solid { color: #fff; background: var(--bordeaux); }
.tb-btn-solid:hover { background: var(--bordeaux-mid); }

/* Fonctionnalite pas encore ouverte : meme gabarit, teintes neutres.
   `.is-soon` ne fait que griser — la regle bordeaux d'origine reste au-dessus et
   reprend la main des qu'on retire la classe. */
.tb-btn.is-soon {
  color: var(--text-mute);
  border: 1px solid rgba(60, 40, 30, 0.18);
  background: rgba(60, 40, 30, 0.05);
  cursor: not-allowed;
}
.tb-btn.is-soon:hover {
  transform: none;
  border-color: rgba(60, 40, 30, 0.18);
  background: rgba(60, 40, 30, 0.05);
}

/* Texte reserve aux lecteurs d'ecran. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --- Bandeau 2 : nav centrée (se masque au scroll) --- */
.header-main { border-top: 1px solid rgba(122, 19, 32, 0.08); }

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  height: 56px;
  overflow: hidden;
  transition: height 0.32s ease, opacity 0.22s ease, transform 0.32s ease;
}
.site-header.nav-hidden .header-inner {
  height: 0;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

.brand { display: flex; align-items: center; gap: 0.85rem; flex: 0 0 auto; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  flex: 0 0 auto;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }

.brand-text { display: flex; flex-direction: column; gap: 0.12rem; }

.brand-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.18rem;
  letter-spacing: 0.16em;
  color: var(--text);
}
.brand-name b { color: var(--bordeaux); font-weight: 700; }

.brand-sub {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--text-soft);
  text-transform: uppercase;
}

.nav-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.9rem;
  margin: 0;
}

.nav-main a {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.01em;
  transition: color 0.2s ease;
}
.nav-main a:hover { color: var(--bordeaux); }


.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(122, 19, 32, 0.25);
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
}
.menu-toggle span { width: 20px; height: 2px; margin: 0 auto; background: var(--bordeaux); }

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--cream) url("assets/images/fond-bandeau-5.jpg") right center / cover no-repeat;
}

.hero-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 3.4rem 0 4.6rem;
  max-width: 40rem;
}

.hero h1 {
  margin: 0;
  font-family: "Libre Baskerville", Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-size: clamp(1.9rem, 3.4vw, 2.9rem);
  line-height: 1.2;
  color: var(--text);
  text-wrap: balance;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 0 0 1.3rem;
  color: var(--bordeaux);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.hero-eyebrow-line {
  width: 46px;
  height: 2px;
  background: var(--bordeaux);
  opacity: 0.7;
  flex: 0 0 auto;
}

.hero-sep {
  display: block;
  width: 46px;
  height: 2px;
  margin: 1.6rem 0 1.4rem;
  background: var(--bordeaux);
  opacity: 0.7;
}

.hero-lead {
  margin: 0;
  max-width: 30rem;
  font-size: 1.02rem;
  line-height: var(--lh-text);
  color: var(--text-soft);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 52px;
  padding: 0 1.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}
.btn svg { width: 1rem; height: 1rem; }
.btn:hover { transform: translateY(-1px); }

.btn-primary { background: var(--bordeaux); color: #fff; }
.btn-primary:hover { background: var(--bordeaux-mid); }

.btn-outline {
  background: transparent;
  color: var(--bordeaux);
  border: 1px solid rgba(122, 19, 32, 0.45);
}
.btn-outline:hover { background: rgba(122, 19, 32, 0.06); }

/* Bouton d'appel : "Nous appeler" laisse place au numero au survol.
   Les deux libellés occupent la MEME cellule de grille -> le bouton garde la
   largeur du plus long et ne saute pas au moment de l'echange. */
.btn-tel-swap { display: grid; }
.btn-tel-label,
.btn-tel-numero {
  grid-area: 1 / 1;
  transition: opacity 0.18s ease;
}
.btn-tel-numero { opacity: 0; }
.btn-tel:hover .btn-tel-label,
.btn-tel:focus-visible .btn-tel-label { opacity: 0; }
.btn-tel:hover .btn-tel-numero,
.btn-tel:focus-visible .btn-tel-numero { opacity: 1; }

/* Sur ecran tactile il n'y a pas de survol : le numero reste alors affiche. */
@media (hover: none) {
  .btn-tel-label { opacity: 0; }
  .btn-tel-numero { opacity: 1; }
}

.hero-note {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.7rem;
  font-size: 0.86rem;
  color: var(--text-soft);
}
.hero-note svg { width: 1.05rem; height: 1.05rem; color: var(--bordeaux); }

/* =========================================================
   SECTION HEADING (label centré + filet)
   ========================================================= */
.eyebrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 2.6rem;
}
.eyebrow span {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bordeaux);
}
.eyebrow::after {
  content: "";
  width: 46px;
  height: 2px;
  background: var(--bordeaux);
  opacity: 0.7;
}

/* =========================================================
   ACCÈS DIRECTS
   ========================================================= */
.access { padding: 4.6rem 0; background: var(--paper); }

.access-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
}

.access-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.3rem;
  min-height: 244px;
  padding: 2.2rem 1.6rem;
  background: var(--card);
  border: 1px solid var(--card-line);
  text-align: center;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.access-card:hover {
  transform: translateY(-4px);
  border-color: rgba(122, 19, 32, 0.28);
  box-shadow: 0 18px 40px rgba(91, 15, 26, 0.1);
}
.access-card h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
}
.access-card p {
  margin: 0;
  font-size: 0.86rem;
  line-height: var(--lh-text);
  color: var(--text-soft);
}
.access-card .access-btn { margin-top: auto; }
.access-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 1.5rem;
  background: rgba(122, 19, 32, 0.08);
  border: 1px solid rgba(122, 19, 32, 0.2);
  color: var(--bordeaux);
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.access-btn:hover {
  background: rgba(122, 19, 32, 0.14);
  border-color: rgba(122, 19, 32, 0.35);
  transform: translateY(-1px);
}

/* =========================================================
   PRESENTATION
   ========================================================= */
.presentation {
  padding: 4.6rem 0;
  border-top: 1px solid var(--line);
  background: var(--cream);
}
.presentation-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2.6rem;
  align-items: start;
}
.presentation h2 {
  margin: 0 0 0.9rem;
  font-family: var(--serif);
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  font-weight: 600;
  line-height: 1.15;
  color: var(--bordeaux);
}
.presentation-lead {
  margin: 0 0 1.4rem;
  font-size: 1.02rem;
  font-weight: 600;
  line-height: var(--lh-text);
  color: var(--text);
}
.presentation p {
  margin: 0 0 1rem;
  font-size: 0.93rem;
  line-height: var(--lh-text);
  color: var(--text-soft);
}
.presentation-list {
  margin: 0.4rem 0 1rem;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.55rem;
}
.presentation-list li {
  position: relative;
  padding-left: 1.6rem;
  font-size: 0.93rem;
  line-height: var(--lh-text);
  color: var(--text-soft);
}
/* Puce carree pleine, en accord avec les angles droits du theme
   (--radius: 0). Meme marqueur sur l'accueil, les pages missions et les
   pages departements : voir .article-page ul plus bas. */
.presentation-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.45rem;
  height: 0.45rem;
  background: var(--bordeaux);
}

/* =========================================================
   NOS MISSIONS
   ========================================================= */
.missions {
  padding: 4.6rem 0;
  border-top: 1px solid var(--line);
  background:
    linear-gradient(102deg,
      rgba(244, 237, 227, 0.97) 0%,
      rgba(244, 237, 227, 0.92) 34%,
      rgba(244, 237, 227, 0.55) 56%,
      rgba(244, 237, 227, 0.08) 78%,
      rgba(244, 237, 227, 0) 100%),
    url("assets/images/fond-nos-missions.jpg") center center / cover no-repeat;
}

.missions .eyebrow span {
  padding: 0.5rem 0.85rem;
  background: rgba(251, 248, 243, 0.88);
  box-shadow: 0 10px 30px rgba(91, 15, 26, 0.08);
}

.missions-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.1rem;
}

/* .mission = empreinte dans la grille. .mission-inner = carte visible.
   /!\ Ne pas repasser .mission-inner en position:absolute au survol :
   .mission ne tient sa hauteur que de son contenu, la carte sortie du flux
   la fait retomber à 0 et toute la section se réduit. Si le clamp 3 lignes
   est réactivé et qu'il faut un dépliage en overlay, donner d'abord une
   hauteur propre à .mission. */
.mission {
  position: relative;
}
.mission-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  padding: 2rem 1.2rem;
  background: var(--card);
  border: 1px solid var(--card-line);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.mission:hover {
  z-index: 20;
}
.mission:hover .mission-inner {
  transform: translateY(-4px);
  border-color: rgba(122, 19, 32, 0.3);
  box-shadow: 0 18px 40px rgba(91, 15, 26, 0.14);
}

.mission-ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 4.2rem;
  height: 4.2rem;
  color: var(--bordeaux);
}
.mission-ico svg { width: 2.9rem; height: 2.9rem; stroke-width: 1.4; }

.mission h3 {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
}

.mission p {
  margin: 0;
  font-size: 0.82rem;
  line-height: var(--lh-text);
  color: var(--text-soft);
  /* Texte tronque a 3 lignes + depliage au survol : desactive pour l instant.
     Pour le reactiver, decommenter les 5 lignes ci-dessous (le bloc
     .mission:hover p plus bas gere le depliage). */
  /* display: -webkit-box; */
  /* -webkit-line-clamp: 3; */
  /* line-clamp: 3; */
  /* -webkit-box-orient: vertical; */
  /* overflow: hidden; */
}

/* Texte complet au survol du bloc */
.mission:hover p {
  -webkit-line-clamp: unset;
  line-clamp: unset;
  overflow: visible;
}

/* =========================================================
   COUR D'APPEL / TERRITOIRE
   ========================================================= */
.territoire { padding: 4.6rem 0; background: var(--paper); }

.terr-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 3.2rem;
  align-items: center;
}

.terr-map { display: grid; place-items: center; }
.terr-map svg { width: 100%; max-width: 420px; height: auto; }

.terr-label {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bordeaux);
}

.terr-title {
  margin: 0.5rem 0 1.6rem;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2rem, 3.4vw, 2.9rem);
  line-height: 1.1;
  color: var(--text);
}

.terr-intro { margin: 0 0 1.1rem; font-size: 0.96rem; line-height: var(--lh-text); color: var(--text-soft); }

.terr-list { display: grid; gap: 0.7rem; margin-bottom: 2rem; }
.terr-list li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  list-style: none;
  font-size: 0.96rem;
  line-height: var(--lh-text);
  font-weight: 500;
  color: var(--text);
}
.terr-list { padding: 0; }
.check-dot {
  display: grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: var(--bordeaux);
  color: #fff;
  flex: 0 0 auto;
}
.check-dot svg { width: 0.8rem; height: 0.8rem; }

.national-section {
  padding: 4.6rem 0;
  background: var(--cream);
}

/* texte à gauche aligné avec la carte du bandeau au-dessus (colonne 0.95fr),
   carte à droite alignée avec le texte au-dessus (colonne 1.05fr) */
.national-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 2.4rem;
  align-items: center;
}
.national-grid .terr-copy {
  width: calc(100% + 1.8rem);
  max-width: none;
  padding-left: clamp(2rem, 4vw, 3.7rem);
  justify-self: stretch;
}
/* 12 departements dans l'ordre numerique, sur 3 colonnes : le flux colonne
   remplit d'abord les 4 lignes, donc la numerotation se lit verticalement
   colonne apres colonne (02-28-60-75, puis 77-78-80-91, puis 92-93-94-95). */
.national-grid .terr-list {
  grid-template-rows: repeat(4, auto);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-flow: column;
  column-gap: 1rem;
  row-gap: 0.55rem;
  font-size: 0.88rem;
}
.national-grid .terr-list li {
  gap: 0.45rem;
  white-space: nowrap;
}
.national-grid .check-dot {
  width: 1.1rem;
  height: 1.1rem;
}
.national-grid .check-dot svg { width: 0.66rem; height: 0.66rem; }
.national-grid .terr-map { justify-items: end; }
.national-grid .terr-map svg { max-width: 300px; }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--bordeaux);
  color: var(--on-dark);
  padding: 3.6rem 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 250px));
  gap: 2.2rem;
  max-width: var(--container);
  padding-left: clamp(2rem, 4vw, 3.7rem);
}

/* TEMPORAIRE (2026-08-29) : 4e colonne de l accueil, acces aux pages
   departements pour la relecture du proprietaire. A supprimer avec le bloc
   correspondant d index.html. Les autres pages gardent 3 colonnes. */
.footer-grid-4 { grid-template-columns: repeat(4, minmax(0, 250px)); }

.footer-col { display: block; }

.footer-liens {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.45rem;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: var(--lh-text);
}

.footer-ico {
  display: none;
}

.footer-col h3 {
  margin: 0 0 0.9rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #f3e7e2;
}

.footer-col p { margin: 0; max-width: 15rem; font-size: 0.84rem; font-weight: 600; line-height: var(--lh-text); color: rgba(243, 231, 226, 0.86); }
.footer-col a { color: rgba(243, 231, 226, 0.86); transition: color 0.2s ease; }
.footer-col a:hover { color: #fff; }

.footer-phone { font-family: var(--sans); font-size: 0.95rem; font-weight: 700; color: #fff; letter-spacing: 0.02em; }

.footer-col a.footer-write {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.1rem;
  min-height: 44px;
  padding: 0 1.4rem;
  background: #f3e7e2;
  border: 1px solid #f3e7e2;
  color: var(--bordeaux);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.footer-col a.footer-write::after { content: "→"; }
.footer-col a.footer-write:hover {
  background: transparent;
  border-color: #f3e7e2;
  color: #f3e7e2;
  transform: translateY(-1px);
}

.footer-legal-bar {
  background: var(--paper);
  border-top: 1px solid var(--line);
  color: var(--text-soft);
}

.footer-legal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  padding-top: 1.05rem;
  padding-bottom: 1.05rem;
  padding-left: clamp(2rem, 4vw, 3.7rem);
  font-size: 0.73rem;
  font-weight: 600;
}

.footer-legal p {
  margin: 0;
}

.footer-legal nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem 1.15rem;
}

.footer-legal a {
  color: var(--text-soft);
  transition: color 0.2s ease;
}

.footer-legal a:hover {
  color: var(--bordeaux);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1080px) {
  .missions-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .terr-grid { grid-template-columns: 1fr; gap: 2.4rem; }
  .terr-map { order: -1; }
  .national-grid .terr-list {
    grid-template-rows: repeat(6, auto);
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .national-grid .terr-list li { white-space: normal; }
}

@media (max-width: 860px) {
  /* Le bandeau est un motif tres large : en cover sur un ecran etroit le
     monogramme envahit tout, on garde donc le fond creme seul. */
  .hero { background-image: none; }
  .menu-toggle { display: inline-flex; }
  .header-main { border-top: 0; }
  .header-inner { height: 0; overflow: visible; }
  .site-header.nav-hidden .header-inner { height: 0; }
  .nav-main { display: none; }
  .nav-main.is-open {
    display: flex;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
    margin: 0;
    padding: 1rem 1.4rem 1.4rem;
    background: rgba(251, 248, 243, 0.98);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 20px 40px rgba(91, 15, 26, 0.12);
    z-index: 40;
  }
  .topbar-right { flex-direction: column; align-items: flex-end; gap: 0.5rem; }
  .tc-label { display: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.8rem; }
  .footer-legal {
    flex-direction: column;
    align-items: flex-start;
  }
  .footer-legal nav { justify-content: flex-start; }
}

@media (max-width: 560px) {
  .topbar-inner { flex-direction: column; align-items: stretch; gap: 0.5rem; padding: 0.55rem 0; }
  .topbar-contacts { justify-content: center; gap: 1.1rem; }
  .topbar-cta { justify-content: center; }
  .tb-btn { flex: 1; justify-content: center; }
}

@media (max-width: 620px) {
  .missions-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .access-grid { grid-template-columns: 1fr; }
  .presentation-grid { grid-template-columns: 1fr; gap: 1.6rem; }
  .hero-actions .btn { width: 100%; }
  .national-grid { grid-template-columns: 1fr; gap: 2.4rem; }
  .national-grid .terr-copy {
    width: 100%;
    padding-left: 0;
  }
  .national-grid .terr-map { order: -1; }
  .national-grid .terr-map { justify-items: center; }
  .national-grid .terr-list {
    grid-template-rows: none;
    grid-auto-flow: row;
    grid-template-columns: 1fr;
  }
  .brand-sub { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* La hauteur des cartes est réservée dynamiquement en JS (nouveau-app.js,
   reserveMissionHeights) : chaque .mission reçoit une min-height égale à sa
   hauteur dépliée, recalculée au resize. Aucun saut de mise en page au survol. */

/* Zone d'intervention : sous-titre + paragraphe de communes */
.terr-sub {
  margin: 0 0 0.7rem;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text);
}
.terr-outro {
  margin: 1.2rem 0 0;
  font-size: 0.9rem;
  line-height: var(--lh-text);
  color: var(--text-soft);
}

/* =========================================================
   INFO-BULLE COMMUNES (zone d'intervention)
   ========================================================= */
.terr-dept {
  cursor: help;
  transition: color 0.18s ease;
}
.terr-dept:hover,
.terr-dept:focus-visible,
.terr-dept.is-active {
  color: var(--bordeaux);
  outline: none;
}

.dept-tip {
  position: fixed;
  z-index: 200;
  width: min(30rem, calc(100vw - 24px));
  max-height: 17rem;
  overflow-y: auto;
  padding: 1rem 1.15rem;
  background: var(--paper);
  border: 1px solid var(--card-line);
  box-shadow: 0 20px 50px rgba(91, 15, 26, 0.18);
}
.dept-tip[hidden] { display: none; }

.dept-tip-title {
  margin: 0 0 0.15rem;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--bordeaux);
}
.dept-tip-sub {
  margin: 0 0 0.6rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.dept-tip-list {
  margin: 0;
  font-size: 0.8rem;
  line-height: var(--lh-text);
  color: var(--text-soft);
}

/* Lien "En savoir plus" dans une carte mission */
.mission-more {
  margin-top: auto;
  padding-top: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--bordeaux);
  border-bottom: 1px solid rgba(122, 19, 32, 0.35);
  transition: border-color 0.2s ease, gap 0.2s ease;
}
.mission-more:hover { border-color: var(--bordeaux); }

/* =========================================================
   PAGE ARTICLE (constat, etc.)
   ========================================================= */
.article-page {
  padding: 3.4rem 0 4.6rem;
  background: var(--paper);
}
.article-wrap { max-width: 46rem; }
.article-title {
  margin: 0.4rem 0 1.6rem;
  font-family: "Libre Baskerville", Georgia, "Times New Roman", serif;
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}
.article-page h2 {
  margin: 2.2rem 0 0.8rem;
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--bordeaux);
}
.article-page p {
  margin: 0 0 1.05rem;
  font-size: 0.95rem;
  line-height: var(--lh-text);
  color: var(--text-soft);
}
.article-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2.4rem;
}
/* Sortie vers l'accueil placee juste sous le chapeau : les sous-pages sont des
   portes d'entree Google, le visiteur doit pouvoir rejoindre le site sans
   derouler la page. Marges resserrees, c'est un rappel, pas la conclusion. */
.article-actions-top { margin: 1.8rem 0 3.6rem; }

/* Specificite 0,2,0 : sans le .article-page, la regle generique
   `.article-page p` (0,1,1) l'emporte et ramene le chapeau a 0.95rem. */
.article-page p.article-lead {
  margin: -0.9rem 0 1.8rem;
  font-family: var(--serif);
  /* Reste sous le h1 (min 1.7rem) meme en haut de la plage. */
  font-size: clamp(1.45rem, 2vw, 1.65rem);
  font-weight: 600;
  line-height: 1.4;
  color: var(--bordeaux);
}

/* =========================================================
   PAGES DEPARTEMENTS (SEO local)
   ========================================================= */
.article-page ul {
  margin: 0 0 1.05rem;
  padding-left: 1.15rem;
  font-size: 0.95rem;
  line-height: var(--lh-text);
  color: var(--text-soft);
}
.article-page ul li { margin-bottom: 0.25rem; }

/* Meme puce carree pleine que sur l'accueil. dep-constats et villes-list
   sont exclues : elles ont deja leur propre presentation. */
.article-page ul:not(.dep-constats):not(.villes-list) {
  list-style: none;
  padding-left: 0;
}
.article-page ul:not(.dep-constats):not(.villes-list) > li {
  position: relative;
  padding-left: 1.35rem;
}
.article-page ul:not(.dep-constats):not(.villes-list) > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.45rem;
  height: 0.45rem;
  background: var(--bordeaux);
}
.article-page a:not(.btn) { color: var(--bordeaux); text-decoration: underline; text-underline-offset: 0.18em; }
.article-page a:not(.btn):hover { color: var(--bordeaux-dark); }

.dep-missions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1.4rem;
  margin: 1.2rem 0 1.6rem;
}
.dep-missions article { border-top: 2px solid var(--bordeaux); padding-top: 0.85rem; }
.dep-missions h3 {
  margin: 0 0 0.4rem;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
}
.dep-missions h3 a { color: var(--bordeaux); text-decoration: none; }
.dep-missions h3 a:hover { text-decoration: underline; }
.dep-missions p { margin: 0; font-size: 0.88rem; line-height: var(--lh-text); }

.dep-villes {
  padding: 1rem 1.1rem;
  background: var(--card);
  border-left: 3px solid var(--bordeaux);
  font-size: 0.9rem !important;
  line-height: 2 !important;
}
.dep-note { font-size: 0.85rem !important; color: var(--text-mute) !important; }

.dep-faq { margin: 1.1rem 0 1.6rem; border-top: 1px solid var(--line); }
.dep-faq details { border-bottom: 1px solid var(--line); }
.dep-faq summary {
  padding: 0.95rem 0;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 2rem;
}
.dep-faq summary::-webkit-details-marker { display: none; }
.dep-faq summary::after {
  content: "+";
  position: absolute;
  right: 0.3rem;
  top: 0.85rem;
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--bordeaux);
}
.dep-faq details[open] summary::after { content: "\2212"; }
.dep-faq details p { margin: 0 0 1rem; padding-right: 2rem; }

.dep-liens-freres,
.missions-liens-freres,
.missions-liens-depts { font-size: 0.9rem !important; line-height: 2 !important; }

@media (prefers-reduced-motion: no-preference) {
  .dep-faq summary { transition: color 0.18s ease; }
  .dep-faq summary:hover { color: var(--bordeaux); }
}

/* Listes de constats + bloc contact (pages departements) */
.article-page ul.dep-constats { padding-left: 0; list-style: none; margin-bottom: 1.4rem; }
.dep-constats li {
  position: relative;
  margin-bottom: 0.45rem;
  padding-left: 1.35rem;
  line-height: var(--lh-text);
}
.dep-constats li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.42rem;
  height: 0.42rem;
  background: var(--bordeaux);
}
.dep-constats-prio li {
  font-weight: 600;
  color: var(--text);
}

.dep-contact {
  margin: 2rem 0 1.6rem;
  padding: 1.3rem 1.4rem;
  background: var(--card);
  border-top: 3px solid var(--bordeaux);
}
.dep-contact-titre {
  margin: 0 0 0.55rem !important;
  font-family: var(--serif);
  font-size: 1.25rem !important;
  font-weight: 600;
  color: var(--bordeaux) !important;
}
.dep-contact-lignes {
  margin: 0 0 0.4rem !important;
  font-size: 1.02rem !important;
  font-weight: 600;
}
.dep-contact-lignes a { color: var(--bordeaux); text-decoration: none; }
.dep-contact-lignes a:hover { text-decoration: underline; }
.dep-contact-lignes span { margin: 0 0.5rem; color: var(--text-mute); }
.dep-contact-horaires { margin: 0 !important; font-size: 0.85rem !important; color: var(--text-mute) !important; }

@media (max-width: 30rem) {
  .dep-contact-lignes a { display: block; }
  .dep-contact-lignes span { display: none; }
}

/* Empeche la coupure des noms de domaine dans les pages legales */
.nowrap { white-space: nowrap; }

/* Pages legales : encadre "a completer" et listes de definitions */
.legal-todo {
  padding: 0.95rem 1.1rem;
  background: var(--card);
  border-left: 3px solid var(--bordeaux);
  font-size: 0.9rem !important;
  line-height: var(--lh-text) !important;
}
.legal-liste {
  display: grid;
  grid-template-columns: minmax(9rem, 14rem) 1fr;
  gap: 0.1rem 1.4rem;
  margin: 1.1rem 0 1.6rem;
  padding: 1.1rem 1.2rem;
  background: var(--card);
  border: 1px solid var(--card-line);
  font-size: 0.92rem;
  line-height: var(--lh-text);
}
.legal-liste dt {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mute);
  align-self: center;
}
.legal-liste dd { margin: 0 0 0.55rem; color: var(--text); }
.legal-liste dd em { color: var(--bordeaux); font-style: normal; font-weight: 600; }
@media (max-width: 34rem) {
  .legal-liste { grid-template-columns: 1fr; gap: 0; }
  .legal-liste dt { margin-top: 0.75rem; }
  .legal-liste dd { margin-bottom: 0.15rem; }
}

/* =========================================================
   JUSTIFICATION DES BLOCS DE TEXTE
   ---------------------------------------------------------
   Uniquement le texte courant : les libelles, les chapeaux et
   les listes de departements gardent leur alignement d'origine.
   La cesure automatique evite les "rivieres" blanches que la
   justification creuse sinon dans les colonnes etroites.
   ========================================================= */
.presentation-grid p:not(.presentation-lead),
.terr-intro,
.terr-outro,
.mission p,
.article-page p:not(.terr-label):not(.article-lead),
.article-page li {
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  -webkit-hyphens: auto;
}

/* Sous 560px la colonne est trop etroite pour justifier proprement :
   les espaces inter-mots deviennent enormes, on revient au fer a gauche. */
@media (max-width: 560px) {
  .presentation-grid p:not(.presentation-lead),
  .terr-intro,
  .terr-outro,
  .mission p,
  .article-page p:not(.terr-label):not(.article-lead),
  .article-page li {
    text-align: left;
    hyphens: manual;
    -webkit-hyphens: manual;
  }
}

/* =========================================================
   BANDEAU COMMUNES (pages missions)
   ---------------------------------------------------------
   Liste dense de communes, en colonnes. Le code departement
   reste en retrait pour que l'oeil accroche le nom de ville.
   ========================================================= */
.villes-bandeau {
  margin: 2.2rem 0;
  padding: 1.6rem 1.7rem;
  background: var(--card);
  border-left: 3px solid var(--bordeaux);
}
.article-page .villes-bandeau h2 {
  margin: 0 0 1.1rem;
  font-size: 1.15rem;
}
.article-page ul.villes-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 1.4rem;
  row-gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.86rem;
}
.villes-list li {
  position: relative;
  padding-left: 0.85rem;
  text-align: left;
  color: var(--text);
}
.villes-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 0.3rem;
  height: 0.3rem;
  border-radius: 50%;
  background: var(--bordeaux);
}
.ville-dep { color: var(--text-mute); font-size: 0.92em; }
.article-page p.villes-note {
  margin: 1.2rem 0 0;
  font-size: 0.82rem;
  color: var(--text-mute);
}

@media (max-width: 1080px) {
  .article-page ul.villes-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .article-page ul.villes-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 460px) {
  .article-page ul.villes-list { grid-template-columns: 1fr; }
  .villes-bandeau { padding: 1.2rem 1.1rem; }
}

/* =========================================================
   FORMULAIRE DE CONTACT (contact.html)
   Seule brique dynamique du site : le POST part vers
   envoi-contact.php, qui renvoie sur #envoi-ok / #envoi-erreur.
   Les retours s affichent en :target, sans JS (les sous-pages
   ne chargent pas app.js).
   ========================================================= */
.form-contact {
  margin: 1.6rem 0 1.4rem;
  display: grid;
  gap: 1.1rem;
}

.form-ligne { display: grid; gap: 0.4rem; }

.form-duo {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
}

.form-contact label {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
}

.form-contact input[type="text"],
.form-contact input[type="email"],
.form-contact input[type="tel"],
.form-contact select,
.form-contact textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: var(--radius);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-contact textarea { resize: vertical; min-height: 9rem; line-height: var(--lh-text); }

.form-contact input:focus-visible,
.form-contact select:focus-visible,
.form-contact textarea:focus-visible {
  outline: none;
  border-color: var(--bordeaux);
  box-shadow: 0 0 0 3px rgba(122, 19, 32, 0.14);
}

/* Champ refuse : bordure et fond rouges. :user-invalid ne se declenche qu apres
   que le visiteur a saisi quelque chose ou tente d envoyer — contrairement a
   :invalid, qui colorerait en rouge tous les champs obligatoires vides des
   l ouverture de la page. La classe .est-invalide fait la meme chose pour les
   navigateurs qui ne connaissent pas encore :user-invalid (elle est posee par
   app.js). */
/* Selecteurs calques sur ceux de la regle de base ci-dessus (avec [type=...]) :
   sans l attribut, les deux regles ont la meme specificite et la bordure rouge
   ne s appliquait pas — seul le fond changeait. */
.form-contact input[type="text"]:user-invalid,
.form-contact input[type="email"]:user-invalid,
.form-contact input[type="tel"]:user-invalid,
.form-contact select:user-invalid,
.form-contact textarea:user-invalid,
.form-contact input[type="text"].est-invalide,
.form-contact input[type="email"].est-invalide,
.form-contact input[type="tel"].est-invalide,
.form-contact select.est-invalide,
.form-contact textarea.est-invalide {
  border-color: #a5292a;
  background: #fdf4f3;
}
.form-contact input[type="text"]:user-invalid:focus-visible,
.form-contact input[type="email"]:user-invalid:focus-visible,
.form-contact input[type="tel"]:user-invalid:focus-visible,
.form-contact textarea:user-invalid:focus-visible,
.form-contact input[type="text"].est-invalide:focus-visible,
.form-contact input[type="email"].est-invalide:focus-visible,
.form-contact input[type="tel"].est-invalide:focus-visible,
.form-contact textarea.est-invalide:focus-visible {
  border-color: #a5292a;
  box-shadow: 0 0 0 3px rgba(165, 41, 42, 0.16);
}
/* Le libelle du champ fautif passe lui aussi en rouge : sur un formulaire a
   deux colonnes, la seule bordure ne saute pas aux yeux. */
.form-ligne:has(input:user-invalid) > label,
.form-ligne:has(textarea:user-invalid) > label,
.form-ligne:has(.est-invalide) > label {
  color: #a5292a;
}

.article-page p.form-aide {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-mute);
}

/* Info-bulle d aide sur un libelle de champ. Sans JS : le formulaire doit
   rester complet meme si app.js ne se charge pas. Meme habillage que
   .dept-tip (papier, filet, ombre bordeaux), en plus compact. */
/* La bulle se cale sur la colonne du champ (.form-ligne), pas sur l icone :
   centree sur l icone, elle sortait de l ecran des que la colonne etait a
   droite — a 768 px de large comme sur telephone. */
.form-ligne { position: relative; }
.champ-info {
  display: inline-flex;
  margin-left: 0.35rem;
  vertical-align: -0.15em;
  color: var(--bordeaux);
  cursor: help;
}
.champ-info svg { width: 0.95rem; height: 0.95rem; }
.champ-info:focus-visible { outline: 2px solid var(--bordeaux); outline-offset: 2px; }

.champ-bulle {
  position: absolute;
  bottom: calc(100% + 0.35rem);
  left: 0;
  z-index: 60;
  width: 100%;
  min-width: 15rem;
  padding: 0.7rem 0.85rem;
  background: var(--paper);
  border: 1px solid var(--card-line);
  box-shadow: 0 14px 34px rgba(91, 15, 26, 0.18);
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 400;
  line-height: var(--lh-text);
  letter-spacing: normal;
  text-transform: none;
  color: var(--text-soft);
  /* Cachee sans display:none : la bulle reste dans l arbre d accessibilite,
     donc lisible par aria-describedby. */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease;
}
.champ-info:hover .champ-bulle,
.champ-info:focus .champ-bulle,
.champ-info:focus-within .champ-bulle {
  opacity: 1;
  visibility: visible;
}
@media (prefers-reduced-motion: reduce) {
  .champ-bulle { transition: none; }
}

.form-consent {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 0.7rem;
}
.form-consent input { margin-top: 0.15rem; width: 1.05rem; height: 1.05rem; accent-color: var(--bordeaux); }
.form-consent label {
  font-size: 0.86rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-soft);
}

/* Piege a robots : hors flux et hors lecture d ecran, sans display:none
   (certains robots ignorent les champs masques de cette facon). */
.form-piege {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Retours d envoi : caches tant que l ancre correspondante n est pas ciblee. */
.article-page p.form-retour {
  display: none;
  margin: 1.4rem 0;
  padding: 1rem 1.2rem;
  font-size: 0.92rem;
  background: var(--card);
  border-left: 3px solid var(--bordeaux);
}
.article-page p.form-retour-ko { border-left-color: #8a6d3b; }
.article-page p.form-retour:target { display: block; }

/* Le header est sticky : sans marge de defilement, l ancre #envoi-ok arrive
   sous la barre de menus et le visiteur ne voit pas que son message est parti.
   Le 90px de la regle generale [id] ne suffit pas quand la bande logo + nav
   est depliee. */
.article-page p.form-retour { scroll-margin-top: 10rem; }

/* Envoi reussi : le formulaire n a plus lieu d etre. On le retire, ainsi que
   sa phrase d introduction, pour que la confirmation soit la seule chose a
   lire — et qu on ne renvoie pas le meme message deux fois. Les retours
   d erreur, eux, laissent le formulaire en place : il faut pouvoir corriger. */
#envoi-ok:target ~ p.form-intro,
#envoi-ok:target ~ .form-contact { display: none; }

@media (max-width: 560px) {
  .form-duo { grid-template-columns: 1fr; }
}
