/* =========================================================
   VARIABLES GLOBALES (OPTION B VALIDÉE)
   ========================================================= */
:root{
  /* Identité */
  --brand: #3f6f63;            /* vert principal */
  --brand-strong: #2f5f54;     /* vert soutenu (mairie) */
  --brand-soft: #e7f0ec;       /* vert très doux */

  /* Fonds */
  --page-bg: #faf9f6;          /* fond neutre */
  --page-bg-verylight: #fcfcfb;/* fond démarches */

  --surface: #ffffff;
  --surface-alt: #f4f6f5;
  --border: #e5e7eb;

  /* Texte */
  --text: #1f2933;
  --muted: #6b7280;

  /* Bandeau photo — OPTION B (VALIDÉE) */
  --hero-overlay: rgba(250,249,246,0.78);

  /* Variables thématiques (par défaut) */
  --header-bg: var(--brand);
  --heading: var(--brand);
  --card-bg: var(--surface-alt);
}

/* =========================================================
   THÈME MAIRIE
   ========================================================= */
body.theme-mairie{
  background-color: var(--page-bg);
  --header-bg: var(--brand-strong);
  --heading: var(--brand-strong);
  --card-bg: var(--brand-soft);
}

/* =========================================================
   THÈME DÉMARCHES
   ========================================================= */
body.theme-demarches{
  background-color: var(--page-bg-verylight);
  --header-bg: var(--brand);
  --heading: var(--brand);
  --card-bg: var(--surface);
}

/* =========================================================
   BASE GÉNÉRALE
   ========================================================= */
*{ box-sizing: border-box; }

body{
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  line-height: 1.6;
  background-color: var(--page-bg);
}

a{
  color: var(--brand);
  text-decoration: none;
}
a:hover{ text-decoration: underline; }

.container{
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

/* =========================================================
   HEADER + LOGO (TOUTES LES PAGES)
   ========================================================= */
header{
  background-color: var(--header-bg);
  color: #fff;
  padding: 1rem 0;
}

.topnav{
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand{
  display: flex;
  align-items: center;
  gap: .75rem;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.brand__logo{
  width: 44px;
  height: 44px;
  object-fit: contain;
  opacity: .95;
}

.menu{
  list-style: none;
  display: flex;
  gap: 1.25rem;
  padding: 0;
  margin: 0;
}

.menu a{
  color: #fff;
  font-weight: 700;
}

/* =========================================================
   BANDEAU PHOTO (ACCUEIL)
   ========================================================= */
.hero{
  padding: 3rem 0;
  text-align: center;
}

.hero--photo{
  background-image:
    linear-gradient(var(--hero-overlay), var(--hero-overlay)),
    url("../images/bandeau-village.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero h1{
  margin: 0 0 .5rem 0;
  font-size: 2rem;
  color: var(--heading);
}

.hero p{
  max-width: 720px;
  margin: .5rem auto 0;
  color: var(--muted);
}

/* =========================================================
   SECTIONS & CARTES
   ========================================================= */
section{ padding: 3rem 0; }

h2{
  margin-bottom: 1.5rem;
  color: var(--heading);
}

.cards{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.card{
  background-color: var(--card-bg);
  padding: 1.5rem;
  border-radius: 10px;
  text-align: center;
  border: 1px solid transparent;
  transition: transform .2s ease, box-shadow .2s ease;
}

body.theme-demarches .card{
  border-color: var(--border);
}

.card:hover{
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}

.card span{
  font-size: 2rem;
  display: block;
  margin-bottom: .5rem;
}

.card h3{
  margin: .5rem 0;
  font-size: 1.1rem;
}

/* =========================================================
   INFOS & FOOTER
   ========================================================= */
.infos{
  background-color: var(--surface-alt);
}

body.theme-demarches .infos{
  background-color: #fff;
  border-top: 1px solid var(--border);
}

footer{
  background-color: var(--header-bg);
  color: #fff;
  padding: 2rem 0;
  font-size: .9rem;
}

footer a{ color: #fff; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 768px){
