/* ==========================================================================
   Mairie de Gagnières — feuille de styles principale
   Palette « sobre institutionnel » : anthracite, gris, bleu acier
   ========================================================================== */

:root {
  /* Couleurs */
  --slate-950: #14181d;
  --slate-900: #243140;
  --slate-700: #3b4b5c;
  --slate-600: #51677c;
  --slate-100: #e3e9ee;
  --slate-050: #f0f3f6;
  --blue-600: #15568c;
  --blue-500: #1d6aab;
  --blue-100: #ddedf9;
  --cream: #f7f8fa;
  --white: #ffffff;
  --ink: #1d242b;
  --ink-soft: #5a6672;
  --line: #e3e7eb;

  /* Typo */
  --font-title: "Outfit", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Divers */
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 2px 10px rgba(20, 24, 29, 0.06), 0 12px 32px rgba(20, 24, 29, 0.07);
  --shadow-soft: 0 1px 4px rgba(20, 24, 29, 0.06);
  --container: 1160px;
}

/* --------------------------------- Base --------------------------------- */

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-title);
  line-height: 1.2;
  color: var(--slate-900);
  margin: 0 0 0.5em;
  font-weight: 700;
}

h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.22rem; }

p { margin: 0 0 1em; }

/* Masqué visuellement, mais lu par les lecteurs d'écran (accessibilité). */
.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;
}

a { color: var(--blue-600); }
a:hover { color: var(--slate-900); }
/* Liens intégrés dans du texte : soulignés, pour être repérables sans la
   couleur seule (critère RGAA). Les liens d'interface (menu, boutons, cartes,
   colonnes du pied de page) restent stylés par leurs composants. */
.prose a, p a:not(.btn) { text-decoration: underline; text-underline-offset: 2px; }
a.map-address[data-map-address] { text-decoration: underline; text-underline-offset: 2px; }

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

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--blue-600);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 200;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; color: #fff; }

/* ------------------------------- Barre haute ----------------------------- */

.topbar {
  background: var(--blue-600);
  color: #d3e5f4;
  font-size: 0.83rem;
}

.topbar-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.6rem;
  align-items: center;
  justify-content: flex-end;
  padding-block: 0.45rem;
}

.topbar a {
  color: #d3e5f4;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.topbar a:hover { color: #fff; }
.topbar .icon { width: 14px; height: 14px; }

/* --------------------------------- Header -------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 0.7rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

/* Logo (blason de la commune) dans l'en-tête et le pied de page */
.brand-logo {
  height: 48px;
  width: auto;
  flex: none;
  display: block;
}

.brand-text { line-height: 1.15; }
.brand-text .brand-name {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.12rem;
  color: var(--slate-900);
  display: block;
}
.brand-text .brand-sub {
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* Navigation */

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
  cursor: pointer;
  color: var(--slate-900);
}
.nav-toggle svg { width: 22px; height: 22px; }

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.site-nav a,
.site-nav .nav-drop > button {
  font-family: var(--font-title);
  font-weight: 500;
  font-size: 0.97rem;
  color: var(--ink);
  text-decoration: none;
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: none;
  border: none;
  cursor: pointer;
}

.site-nav a:hover,
.site-nav .nav-drop > button:hover { background: var(--slate-050); color: var(--slate-900); }

.site-nav a.active { color: var(--blue-600); background: var(--slate-050); font-weight: 600; }

.site-nav a.nav-cta {
  background: var(--blue-500);
  color: #fff;
  font-weight: 600;
  margin-left: 0.4rem;
}
.site-nav a.nav-cta:hover { background: var(--blue-600); color: #fff; }

.nav-drop { position: relative; }
.nav-drop > button .caret { width: 12px; height: 12px; transition: transform 0.2s; }
.nav-drop.open > button .caret { transform: rotate(180deg); }

.nav-drop .dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 240px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 0.45rem;
  display: none;
  flex-direction: column;
  gap: 2px;
}
.nav-drop.open .dropdown { display: flex; }
.nav-drop .dropdown a {
  display: block;
  width: 100%;
  font-weight: 500;
  font-size: 0.93rem;
}

/* ---------------------------------- Hero --------------------------------- */

.hero {
  position: relative;
  /* Voile sombre uniquement derrière le texte (à gauche), paysage dégagé à droite */
  background:
    linear-gradient(100deg, rgba(20, 24, 29, 0.78) 0%, rgba(20, 24, 29, 0.55) 38%, rgba(20, 24, 29, 0.18) 70%, rgba(20, 24, 29, 0.05) 100%),
    url("../img/village/ville-de-gagnieres.jpg") center / cover no-repeat;
  /* Couleur de repli si l'image ne se charge pas (texte blanc lisible) */
  background-color: var(--slate-950);
  color: #fff;
  overflow: hidden;
}

.hero-inner {
  position: relative;
  z-index: 2;
  padding-block: clamp(3.5rem, 8vw, 6.5rem) clamp(6rem, 11vw, 9rem);
  max-width: 700px;
}

.hero .kicker {
  display: inline-block;
  font-family: var(--font-title);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #dbe7f3;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  margin-bottom: 1.2rem;
}

.hero h1 { color: #fff; margin-bottom: 0.5rem; }
.hero p.lead {
  font-size: 1.13rem;
  color: #dbe3ea;
  max-width: 56ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.8rem;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 2.2rem;
}
.hero-stats .stat {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}
.hero-stats .stat strong {
  display: block;
  font-family: var(--font-title);
  font-size: 1.25rem;
  color: #fff;
}

.hero-hills {
  position: absolute;
  inset-inline: 0;
  bottom: -2px;
  z-index: 1;
  pointer-events: none;
}
.hero-hills svg { width: 100%; height: auto; }

/* Bandeau de page interne */

.page-hero {
  background: linear-gradient(150deg, var(--slate-100), var(--slate-050));
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  padding-block: clamp(2.4rem, 5vw, 3.6rem);
}
.page-hero h1 { color: var(--slate-900); margin-bottom: 0.2em; }
/* Fil d'Ariane */
.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
  margin: 0 0 1rem;
  padding: 0;
  font-size: 0.9rem;
}
.breadcrumb li { display: flex; align-items: center; gap: 0.35rem 0.55rem; }
.breadcrumb li:not(:first-child)::before {
  content: "›";
  color: var(--slate-600);
  font-size: 1.1rem;
  line-height: 1;
}
.breadcrumb a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--blue-600);
  text-decoration: none;
  font-weight: 500;
}
.breadcrumb a:hover { color: var(--blue-500); text-decoration: underline; }
.breadcrumb [aria-current="page"] { color: var(--slate-900); font-weight: 600; }
.breadcrumb svg { width: 15px; height: 15px; }
.page-hero p.lead { color: var(--ink-soft); max-width: 65ch; margin: 0; font-size: 1.05rem; }

/* ------------------------------ Images & galerie -------------------------- */

.card-img {
  width: calc(100% + 3rem);
  margin: -1.5rem -1.5rem 1.1rem;
  height: 170px;
  object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0;
  display: block;
}

.photo-section img { border-radius: var(--radius); }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.photo-grid figure {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--line);
  background: #fff;
}
.photo-grid img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  transition: transform 0.25s;
}
.photo-grid figure:hover img { transform: scale(1.04); }
.photo-grid figcaption {
  font-size: 0.85rem;
  color: var(--ink-soft);
  padding: 0.6rem 0.9rem;
}

@media (max-width: 880px) { .photo-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .photo-grid { grid-template-columns: 1fr; } }

.img-rounded {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  height: auto;
}

/* -------------------------------- Boutons -------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary { background: var(--blue-500); color: #fff; }
.btn-primary:hover { background: var(--blue-600); color: #fff; }

.btn-light { background: #fff; color: var(--slate-900); }
.btn-light:hover { background: var(--slate-050); color: var(--slate-900); }

.btn-outline {
  background: transparent;
  color: var(--slate-900);
  border: 2px solid var(--slate-600);
}
.btn-outline:hover { background: var(--slate-050); color: var(--slate-900); }

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

.section { padding-block: clamp(3rem, 7vw, 5rem); }
.section.tint { background: var(--slate-050); }
.section.dark { background: var(--blue-600); color: #d3e5f4; }
.section.dark h2 { color: #fff; }

.section-head {
  max-width: 640px;
  margin-bottom: clamp(1.8rem, 4vw, 2.8rem);
}
.section-head .kicker {
  font-family: var(--font-title);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue-600);
  display: block;
  margin-bottom: 0.4rem;
}
.section-head p { color: var(--ink-soft); margin: 0; }

.section-head.center { margin-inline: auto; text-align: center; }

/* --------------------------------- Cartes -------------------------------- */

.grid {
  display: grid;
  gap: 1.2rem;
}
.grid > *, .row-2 > *, .follow-card > div { min-width: 0; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-soft);
}

a.card {
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
a.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--blue-500);
  color: inherit;
}

.card .icon-badge {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--slate-100);
  color: var(--slate-700);
  margin-bottom: 1rem;
}
.card .icon-badge svg { width: 24px; height: 24px; }
.card.accent .icon-badge { background: var(--blue-100); color: var(--blue-600); }

.card h2, .card h3 { font-size: 1.22rem; margin-bottom: 0.35rem; }
.card p { color: var(--ink-soft); font-size: 0.94rem; margin-bottom: 0; }

.card .card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.9rem;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--blue-600);
}
a.card:hover .card-link { color: var(--slate-900); }

.tag {
  display: inline-block;
  font-family: var(--font-title);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  background: var(--slate-100);
  color: var(--slate-900);
  border-radius: 999px;
  padding: 0.22rem 0.7rem;
  margin-bottom: 0.7rem;
}
.tag.ochre { background: var(--blue-100); color: var(--blue-600); }

/* Liens (réseaux sociaux, site web) d'une fiche professionnel */
.pro-links { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.pro-links a {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--slate-050);
  color: var(--slate-700);
  border: 1px solid var(--line);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.pro-links a:hover { background: var(--blue-500); color: #fff; border-color: var(--blue-500); }
.pro-links svg { width: 18px; height: 18px; }

/* Lien « Voir l'image » (logo, carte de visite, photo) */
.pro-doc {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.9rem;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--blue-600);
  text-decoration: none;
}
.pro-doc:hover { color: var(--slate-900); text-decoration: underline; }

/* Fenêtre modale (lightbox) pour agrandir une image */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(20, 24, 29, 0.85);
  display: none;
  place-items: center;
  padding: 2rem;
}
.lightbox.open { display: grid; }
.lightbox img {
  max-width: min(92vw, 1000px);
  max-height: 88vh;
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 12px 44px rgba(0, 0, 0, 0.45);
}
.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.9rem;
  line-height: 1;
  cursor: pointer;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.3); }

/* Liste d'informations (téléphone, adresse…) dans les cartes */

.info-list {
  list-style: none;
  margin: 0.9rem 0 0;
  padding: 0;
  font-size: 0.92rem;
  color: var(--ink-soft);
  display: grid;
  gap: 0.45rem;
}
.info-list li {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
}
.info-list .icon {
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 0.22rem;
  color: var(--slate-600);
}
.info-list a { color: var(--blue-600); text-decoration: none; font-weight: 500; }
.info-list a:hover { text-decoration: underline; }

/* Annuaire des services médicaux — grille de petites fiches (tuiles) */
.med-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);   /* 2 lignes de 3 sur ordinateur */
  gap: 1rem;
  margin-top: 1.4rem;
}
@media (max-width: 900px) { .med-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .med-grid { grid-template-columns: 1fr; } }
.med-tile {
  background: var(--slate-050);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.2rem;
}
.med-tile h4 {
  font-family: var(--font-title);
  font-size: 0.98rem;
  color: var(--slate-900);
  margin: 0 0 0.8rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem;
}
/* Badge de localité (à côté d'un titre ou d'un nom) */
.med-loc {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--blue-600);
}
.med-who .med-loc { margin-left: 0.35rem; }
/* Un praticien / une structure */
.med-entry + .med-entry {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
}
.med-who { font-weight: 600; color: var(--ink); margin: 0; font-size: 0.94rem; }
.med-who + .med-who { margin-top: 0.15rem; }
.med-line {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin: 0.35rem 0 0;
  font-size: 0.86rem;
  color: var(--ink-soft);
}
.med-line svg { width: 15px; height: 15px; flex: none; margin-top: 0.12rem; color: var(--slate-600); }
.med-line a { color: var(--blue-600); text-decoration: none; font-weight: 500; }
.med-line a:hover { text-decoration: underline; }

/* ------------------------------ Élus / équipe ----------------------------- */

.person {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.3rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  box-shadow: var(--shadow-soft);
}
.person .avatar {
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.05rem;
  background: var(--slate-100);
  color: var(--slate-900);
}
.person.lead-person .avatar { background: var(--blue-500); color: #fff; }
.person h3 { font-size: 1.02rem; margin: 0; }
.person p { margin: 0.1rem 0 0; font-size: 0.88rem; color: var(--ink-soft); }

/* ------------------------------ Tableaux horaires ------------------------- */

.hours-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.hours-table th,
.hours-table td {
  text-align: left;
  padding: 0.6rem 0.4rem;
  border-bottom: 1px solid var(--line);
}
.hours-table th { font-family: var(--font-title); font-weight: 600; color: var(--slate-900); }
.hours-table tr:last-child th,
.hours-table tr:last-child td { border-bottom: none; }
.hours-table .closed { color: var(--ink-soft); font-style: italic; }

/* ------------------------------ Mot du maire ----------------------------- */

.prose {
  max-width: 720px;
  font-size: 1.05rem;
}
.prose p { margin-bottom: 1.2em; }
.prose .signature {
  margin-top: 2rem;
  font-family: var(--font-title);
  font-weight: 600;
  color: var(--slate-900);
}

/* ------------------------------- Formulaire ------------------------------ */

.form-grid { display: grid; gap: 1.1rem; }
.form-grid .row-2 { display: grid; gap: 1.1rem; grid-template-columns: 1fr 1fr; }

label {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--slate-900);
  display: block;
  margin-bottom: 0.35rem;
}
label .req { color: var(--blue-600); }

input[type="text"],
input[type="email"],
textarea,
select {
  width: 100%;
  font: inherit;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--slate-600);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
}
input:focus, textarea:focus, select:focus {
  outline: 3px solid var(--blue-500);
  outline-offset: 2px;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(29, 106, 171, 0.16);
}
textarea { min-height: 160px; resize: vertical; }

.form-note { font-size: 0.85rem; color: var(--ink-soft); }

/* Message de confirmation après envoi du formulaire */
.form-success {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  background: #e7f5ec;
  border: 1px solid #b6e0c5;
  color: #1c6b3a;
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  font-size: 0.95rem;
}
.form-success svg { width: 22px; height: 22px; flex: none; color: #2e9e57; margin-top: 0.1rem; }
.form-success strong { color: #14532b; }

/* Message d'erreur du formulaire */
.form-error {
  background: #fdecea;
  border: 1px solid #f3c0bd;
  color: #8a2a24;
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.1rem;
  margin-bottom: 1.1rem;
  font-size: 0.92rem;
}
.form-error ul { margin: 0.35rem 0 0; padding-left: 1.1rem; }
.form-field-error { color: #8a2a24; margin: 0.4rem 0 0; }

/* Champ piège anti-robot (honeypot) — masqué aux humains */
.form-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* --------------------------------- Carte --------------------------------- */

.map-frame {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.map-frame iframe { display: block; width: 100%; height: 380px; border: 0; }

/* ------------------------------- Bandeau CTA ------------------------------ */

.cta-band {
  background: linear-gradient(135deg, var(--blue-600), var(--blue-500));
  background-color: var(--blue-600);
  border-radius: calc(var(--radius) + 6px);
  color: #fff;
  padding: clamp(2rem, 5vw, 3.2rem);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.cta-band h2 { color: #fff; margin: 0 0 0.3rem; }
.cta-band p { margin: 0; color: #ddebf7; }
.cta-band .btn-primary { background: #fff; color: var(--blue-600); }
.cta-band .btn-primary:hover { background: var(--blue-100); color: var(--blue-600); }

/* --------------------------------- Footer -------------------------------- */

.site-footer {
  background: var(--blue-600);
  color: #cfe2f2;
  font-size: 0.93rem;
  margin-top: auto;
}

.footer-main {
  display: grid;
  grid-template-columns: 1.3fr 1.5fr 1fr 1fr;
  gap: 2.5rem;
  padding-block: clamp(2.5rem, 6vw, 4rem) 2rem;
}

.site-footer h2 {
  color: #fff;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  /* Aligne les titres de colonnes avec le nom « Mairie de Gagnières »
     (dont la hauteur est celle du logo). */
  min-height: 42px;
  display: flex;
  align-items: center;
}
@media (max-width: 640px) {
  .site-footer h2 { min-height: 0; margin-top: 0.5rem; }
}

.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.site-footer a { color: #cfe2f2; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }

.footer-brand { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 1rem; }
.footer-brand .brand-logo { height: 42px; }
.footer-brand .brand-name { font-family: var(--font-title); font-weight: 700; color: #fff; font-size: 1.05rem; }

.footer-hours { display: grid; gap: 0.3rem; font-variant-numeric: tabular-nums; }
.footer-hours div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1.2rem; }
.footer-hours dt { color: #ffffff; font-weight: 500; }
.footer-hours dd { margin: 0; }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-block: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.6rem;
  align-items: center;
  justify-content: space-between;
  font-size: 0.83rem;
  color: #bcd5ea;   /* contraste AA sur le bleu du pied de page (~5:1) */
}
.footer-bottom ul { display: flex; flex-wrap: wrap; gap: 1.2rem; list-style: none; margin: 0; padding: 0; }
.footer-bottom a { color: #bcd5ea; }
.footer-credit { color: #cfe2f2; font-weight: 500; text-decoration: underline; }
.footer-credit:hover { color: #fff; text-decoration: underline; }

/* Le focus bleu ne contraste pas suffisamment sur ces fonds sombres. */
.site-footer :focus-visible,
.topbar :focus-visible,
.hero :focus-visible,
.cta-band :focus-visible,
.lightbox :focus-visible { outline-color: #fff; }
.hero :focus-visible { box-shadow: 0 0 0 6px var(--slate-950); }

/* -------------------------------- Divers ---------------------------------- */

.icon { width: 18px; height: 18px; }

/* Encadré d'avertissement : reste en ambre, code couleur universel des alertes */
.alert {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  background: #fdf3df;
  border: 1px solid #ecd9b8;
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  font-size: 0.94rem;
  color: #6b4a1d;
}
.alert .icon { flex: none; margin-top: 0.15rem; color: #b07d18; }
.alert strong { color: #54390f; }

.divider { border: none; border-top: 1px solid var(--line); margin: clamp(2rem, 5vw, 3rem) 0; }

/* ------------------------------- Responsive ------------------------------- */

@media (max-width: 980px) {
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-main { grid-template-columns: 1fr 1fr; gap: 2rem; }
}

@media (max-width: 880px) {
  .nav-toggle { display: inline-flex; align-items: center; }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    display: none;
    padding: 0.8rem 1rem 1.2rem;
    max-height: calc(100dvh - 80px);
    overflow-y: auto;
  }
  .site-nav.open { display: block; }

  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0.15rem; }
  .site-nav a, .site-nav .nav-drop > button { width: 100%; justify-content: space-between; }
  .site-nav a.nav-cta { margin-left: 0; justify-content: center; }

  .nav-drop .dropdown {
    position: static;
    box-shadow: none;
    border: none;
    background: var(--slate-050);
    margin-top: 2px;
  }
}

@media (max-height: 480px) {
  .site-header { position: relative; }
}

@media (max-width: 640px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .form-grid .row-2 { grid-template-columns: 1fr; }
  .footer-main { grid-template-columns: 1fr; gap: 1.8rem; }
  .topbar-inner { justify-content: center; }
  .person { flex-direction: row; }
}

/* ================= Actualités : carrousel de cartes portrait ============== */
.carousel { position: relative; }
.carousel-track { display: flex; align-items: stretch; gap: 1.25rem; list-style: none; margin: 0; padding: 0; }

/* 3 annonces ou moins : largeur FIXE à 1/3, cartes centrées. À 3 elles
   remplissent la largeur ; à 1 ou 2 elles gardent leur taille et se centrent
   (marges équilibrées), sans jamais s'étirer. */
.carousel.is-static .carousel-track { flex-wrap: wrap; justify-content: center; }
.carousel.is-static .carousel-slide { flex: 0 0 calc((100% - 2.5rem) / 3); }

/* Plus de 3 annonces : 3 cartes visibles + défilement horizontal. */
.carousel.is-scroll .carousel-track {
  flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x mandatory;
  scroll-behavior: smooth; scrollbar-width: thin; padding-bottom: 0.5rem;
}
.carousel.is-scroll .carousel-slide { flex: 0 0 calc((100% - 2.5rem) / 3); scroll-snap-align: start; }

/* Carte portrait : les infos EN HAUT, l'image EN DESSOUS (affichée en entier). */
.actu-card {
  display: flex; flex-direction: column; height: 100%;
  background: #fff; border: 1px solid var(--slate-100); border-radius: 14px;
  overflow: hidden; box-shadow: var(--shadow-soft);
}
/* Le corps occupe la place restante -> toutes les cartes ont la même hauteur. */
.actu-body { flex: 1 1 auto; padding: 1.1rem 1.25rem 1.2rem; }
.actu-body time {
  display: inline-flex; align-items: center; gap: 0.4rem; color: var(--blue-600);
  font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em;
}
.actu-body time svg { width: 15px; height: 15px; }
.actu-body h3 { margin: 0.45rem 0 0.5rem; font-size: 1.12rem; color: var(--slate-900); }
.actu-body p {
  margin: 0; color: var(--ink-soft); font-size: 0.93rem;
}
/* Image dans une zone de hauteur FIXE, affichée EN ENTIER (jamais rognée). */
.actu-media { flex: 0 0 auto; height: 230px; background: var(--slate-050); }
.actu-media img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* Flèches de défilement (uniquement en mode défilable) */
.carousel-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer; z-index: 2;
  border: 1px solid var(--slate-100); background: #fff; color: var(--slate-900);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(20, 30, 45, 0.15);
}
.carousel-arrow:hover { background: var(--blue-600); color: #fff; border-color: var(--blue-600); }
.carousel-arrow:disabled { opacity: 0; pointer-events: none; }
.carousel-arrow svg { width: 20px; height: 20px; }
.carousel-prev { left: -10px; }
.carousel-next { right: -10px; }
.carousel-prev svg { transform: rotate(90deg); }
.carousel-next svg { transform: rotate(-90deg); }

/* Encadré « Suivez l'actualité » — sous les actualités, pleine largeur */
.follow-card { display: flex; align-items: flex-start; gap: 1.25rem; margin-top: 1.5rem; }
.follow-card .icon-badge { flex-shrink: 0; }
.follow-card h3 { margin-top: 0; }
.follow-links { margin-top: 0.6rem; margin-bottom: 0; }

@media (max-width: 900px) {
  .carousel.is-scroll .carousel-slide,
  .carousel.is-static .carousel-slide { flex-basis: calc((100% - 1.25rem) / 2); }
}
@media (max-width: 600px) {
  /* Sur mobile : cartes empilées verticalement (pas de défilement horizontal) */
  .carousel.is-scroll .carousel-track,
  .carousel.is-static .carousel-track {
    flex-direction: column; overflow-x: visible; scroll-snap-type: none;
  }
  .carousel.is-scroll .carousel-slide,
  .carousel.is-static .carousel-slide { flex-basis: auto; max-width: 100%; }
  .carousel-arrow { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
