/* =================================================================
   MAIRIE DE LAPOUYADE — Design System (style institutionnel)
   Inspiration : marseille.fr — blanc, bleu marine, accent orange.
   Typo : Archivo (titres) + Inter (texte).
   ================================================================= */

/* ---------- Tokens ---------- */
:root {
  /* Bleu institutionnel (alias hérités green-*) */
  --green-950: #06223f;
  --green-900: #0a3260;
  --green-800: #11487f;   /* primaire */
  --green-700: #1b5a96;
  --green-600: #2a6cac;
  --green-500: #4a86c2;
  --green-100: #eaf1f8;

  /* Accent orange (alias hérités gold-*) */
  --gold-600: #d4571a;
  --gold-500: #ec6726;
  --gold-400: #f3884e;
  --gold-200: #fbdcc7;

  /* Neutres */
  --cream:  #f5f7fa;
  --paper:  #ffffff;
  --paper-2:#eef2f7;
  --ink:    #182230;
  --ink-soft:#3c4654;
  --stone:  #5d6878;
  --line:   #e2e8f0;

  --bleu: #11487f;
  --rouge:#c8362f;

  /* Typo */
  --f-display: "Archivo", system-ui, sans-serif;
  --f-serif:   "Archivo", system-ui, sans-serif;
  --f-body:    "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Mesure */
  --maxw: 1240px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 3px rgba(16,40,70,.06), 0 4px 16px rgba(16,40,70,.05);
  --shadow:    0 10px 30px -10px rgba(16,40,70,.22);
  --shadow-lg: 0 30px 70px -30px rgba(8,34,63,.45);
  --ease: cubic-bezier(.22,.61,.36,1);
  --top-h: 40px;
  --head-h: 76px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--f-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--green-800); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--gold-600); }
ul { list-style: none; padding: 0; }

/* ---------- Typo ---------- */
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 800; line-height: 1.1; color: var(--green-900); letter-spacing: -.02em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); }
h3 { font-size: clamp(1.2rem, 2.2vw, 1.55rem); font-weight: 700; }
p { color: var(--ink-soft); }
.lead { font-size: clamp(1.1rem, 1.8vw, 1.4rem); line-height: 1.5; color: var(--ink-soft); font-weight: 400; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--f-body); font-weight: 700; font-size: .78rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--gold-600);
}
.eyebrow::before { content: ""; width: 26px; height: 3px; background: var(--gold-500); border-radius: 3px; }

/* ---------- Layout ---------- */
.container { width: min(100% - 2.4rem, var(--maxw)); margin-inline: auto; }
.section { padding: clamp(3.5rem, 7vw, 6rem) 0; }
.section--tight { padding: clamp(2.5rem, 5vw, 4rem) 0; }
.section--gray { background: var(--cream); }
.center { text-align: center; }
.section-head { max-width: 760px; margin-bottom: 2.6rem; }
.section-head.center { margin-inline: auto; }
.section-head h2 { margin: .6rem 0 .7rem; }
.section-head p { font-size: 1.06rem; }
.section-head--row { display:flex; justify-content:space-between; align-items:flex-end; gap:1.5rem; max-width:none; flex-wrap:wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--f-body); font-weight: 600; font-size: .96rem;
  padding: .85rem 1.5rem; border-radius: 8px; cursor: pointer;
  border: 2px solid transparent; transition: all .2s var(--ease); line-height: 1;
}
.btn svg { width: 18px; height: 18px; }
.btn--primary { background: var(--green-800); color: #fff; }
.btn--primary:hover { background: var(--green-900); color: #fff; transform: translateY(-2px); }
.btn--gold { background: var(--gold-500); color: #fff; }
.btn--gold:hover { background: var(--gold-600); color: #fff; transform: translateY(-2px); }
.btn--ghost { background: transparent; color: var(--green-800); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--green-800); color: var(--green-900); background: var(--green-100); }
.btn--light { background: #fff; color: var(--green-900); border-color: #fff; }
.btn--light:hover { background: transparent; color: #fff; border-color: rgba(255,255,255,.7); }

/* =================================================================
   TOP BAR + HEADER
   ================================================================= */
.topbar { background: var(--green-950); color: rgba(255,255,255,.8); font-size: .82rem; }
.topbar .container { display: flex; justify-content: space-between; align-items: center; height: var(--top-h); gap: 1rem; }
.topbar a { color: rgba(255,255,255,.8); }
.topbar a:hover { color: #fff; }
.topbar__left, .topbar__right { display: flex; align-items: center; gap: 1.3rem; }
.topbar__right span { display: inline-flex; align-items: center; gap: .4rem; }
.topbar svg { width: 14px; height: 14px; }
@media (max-width: 720px){ .topbar__left { display: none; } .topbar .container { justify-content: center; } }

.site-header {
  position: sticky; top: 0; z-index: 100; background: #fff;
  border-bottom: 1px solid var(--line);
  transition: box-shadow .3s var(--ease);
}
.site-header.scrolled { box-shadow: 0 6px 24px -14px rgba(16,40,70,.35); }
.header-main { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; height: var(--head-h); }

/* Wordmark (pas de logo) */
.brand { display: flex; flex-direction: column; gap: 1px; line-height: 1.05; }
.brand__name {
  font-family: var(--f-display); font-weight: 800; font-size: 1.36rem; color: var(--green-900);
  letter-spacing: -.02em; text-transform: uppercase; white-space: nowrap;
}
.brand__name b { color: var(--gold-500); }
.brand__sub { font-size: .64rem; letter-spacing: .22em; text-transform: uppercase; color: var(--stone); font-weight: 600; }

/* Desktop nav */
.nav { display: flex; align-items: center; gap: .1rem; height: 100%; }
.nav > li { position: relative; height: 100%; display: flex; align-items: center; }
.nav__link {
  display: inline-flex; align-items: center; gap: .3rem; height: 100%;
  font-weight: 600; font-size: .9rem; color: var(--ink); padding: 0 .72rem;
  white-space: nowrap;
  border-bottom: 3px solid transparent; transition: color .2s, border-color .2s;
}
.nav__link svg { width: 13px; height: 13px; opacity: .55; transition: transform .25s var(--ease); }
.nav__link:hover { color: var(--green-800); }
.nav > li:hover .nav__link { color: var(--green-800); border-color: var(--gold-500); }
.nav > li:hover .nav__link svg { transform: rotate(180deg); }
.nav__link.is-active { color: var(--green-800); border-color: var(--gold-500); }

/* Mega dropdown */
.dropdown {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%) translateY(10px);
  min-width: 280px; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); padding: .5rem; opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .22s var(--ease), transform .22s var(--ease);
}
.dropdown::before { content:""; position:absolute; top:-12px; left:0; right:0; height:12px; }
.nav > li:hover .dropdown { opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.dropdown a {
  display: flex; align-items: center; gap: .7rem; padding: .7rem .8rem; border-radius: 8px;
  color: var(--ink-soft); font-size: .92rem; font-weight: 500; transition: background .18s, color .18s;
}
.dropdown a:hover { background: var(--green-100); color: var(--green-900); }
.dropdown a.is-active { background: var(--green-100); color: var(--green-900); }
.dropdown a .dot { width: 7px; height: 7px; border-radius: 2px; background: var(--gold-500); flex:none; }
.dropdown a .ext { width: 13px; height: 13px; margin-left: auto; opacity: .45; }
.dropdown__head { display: block; padding: .5rem .8rem .2rem; font-size: .68rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--green-700); }
.dropdown__head:not(:first-child) { margin-top: .3rem; border-top: 1px solid var(--line); padding-top: .55rem; }

.header-actions { display: flex; align-items: center; gap: .7rem; }
.icon-btn { width: 42px; height: 42px; border-radius: 8px; border: 1px solid var(--line); background:#fff; display: grid; place-items: center; cursor: pointer; color: var(--green-900); transition: background .2s, border-color .2s; }
.icon-btn:hover { background: var(--green-100); border-color: var(--green-600); }
.icon-btn svg { width: 19px; height: 19px; }

/* Burger */
.burger { display: none; width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; position: relative; }
.burger span { position: absolute; left: 12px; right: 12px; height: 2px; background: var(--green-900); border-radius: 2px; transition: all .3s var(--ease); }
.burger span:nth-child(1){ top: 16px; } .burger span:nth-child(2){ top: 22px; } .burger span:nth-child(3){ top: 28px; }
body.menu-open .burger span:nth-child(1){ top:22px; transform: rotate(45deg);}
body.menu-open .burger span:nth-child(2){ opacity:0;}
body.menu-open .burger span:nth-child(3){ top:22px; transform: rotate(-45deg);}

/* Mobile menu */
.mobile-menu {
  position: fixed; inset: 0; z-index: 99; background: var(--green-950);
  transform: translateX(100%); transition: transform .45s var(--ease);
  overflow-y: auto; padding: calc(var(--top-h) + var(--head-h) + 1rem) 1.4rem 3rem;
}
body.menu-open .mobile-menu { transform: translateX(0); }
.mobile-menu__group { border-bottom: 1px solid rgba(255,255,255,.12); }
.mobile-menu__title { display:flex; justify-content:space-between; align-items:center; width:100%; background:none; border:0; color:#fff; font-family: var(--f-display); font-weight:700; font-size: 1.2rem; padding: 1rem 0; cursor: pointer; text-align:left; }
.mobile-menu__title svg { width: 20px; height:20px; color: var(--gold-400); transition: transform .3s var(--ease); }
.mobile-menu__group.open .mobile-menu__title svg { transform: rotate(45deg); }
.mobile-menu__sub { max-height:0; overflow:hidden; transition: max-height .5s var(--ease); }
.mobile-menu__group.open .mobile-menu__sub { max-height: 1200px; }
.mobile-menu__sub a { display:block; color: rgba(255,255,255,.72); padding:.5rem 0 .5rem 1rem; font-size:1rem; border-left:2px solid rgba(236,103,38,.5); margin-bottom:.2rem; }
.mobile-menu__sub a:hover, .mobile-menu__sub a.is-active { color:#fff; border-color: var(--gold-400); }
.mobile-menu__sub a .ext { width:12px; height:12px; margin-left:.35rem; opacity:.6; vertical-align:middle; }
.mobile-menu__sub .mm-head { display:block; color: var(--gold-400); font-size:.7rem; font-weight:800; letter-spacing:.05em; text-transform:uppercase; padding:.75rem 0 .2rem 1rem; }
.mobile-menu__single a { display:block; color:#fff; font-family: var(--f-display); font-weight:700; font-size: 1.2rem; padding:1rem 0; }

/* =================================================================
   HERO (accueil)
   ================================================================= */
.hero { position: relative; color: #fff; overflow: hidden; }
.hero__media { position: absolute; inset: 0; z-index: 0; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; }
.hero__media::after { content:""; position:absolute; inset:0; background: linear-gradient(105deg, rgba(6,34,63,.92) 0%, rgba(8,42,77,.72) 42%, rgba(6,34,63,.28) 100%); }
.hero__inner { position: relative; z-index: 2; padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(6rem, 9vw, 8rem); max-width: 680px; }
.hero h1 { color: #fff; margin: 1rem 0 1.1rem; }
.hero .lead { color: rgba(255,255,255,.92); }
.hero .eyebrow { color: var(--gold-400); }
.hero .eyebrow::before { background: var(--gold-400); }
.hero__actions { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: 2rem; }

/* Tuiles d'accès rapide (chevauchent le hero) */
.quick { position: relative; z-index: 5; margin-top: clamp(-5rem, -7vw, -4rem); }
.quick__grid { background: #fff; border-radius: 16px; box-shadow: var(--shadow); padding: .6rem; display: grid; grid-template-columns: repeat(6, 1fr); gap: .3rem; }
.quick__item { display: flex; flex-direction: column; align-items: center; gap: .6rem; text-align: center; padding: 1.4rem .7rem; border-radius: 12px; color: var(--green-900); transition: background .2s; }
.quick__item:hover { background: var(--green-100); color: var(--green-900); }
.quick__item .qi { width: 48px; height: 48px; border-radius: 12px; background: var(--green-100); color: var(--green-800); display: grid; place-items: center; transition: background .2s, color .2s; }
.quick__item:hover .qi { background: var(--green-800); color: #fff; }
.quick__item .qi svg { width: 24px; height: 24px; }
.quick__item span { font-size: .82rem; font-weight: 600; line-height: 1.25; }

/* =================================================================
   PAGE HERO (pages intérieures)
   ================================================================= */
.page-hero {
  position: relative; padding: clamp(2.6rem,6vw,4rem) 0 clamp(2.6rem,6vw,4rem); color: #fff; overflow: hidden;
  background: linear-gradient(120deg, var(--green-950), var(--green-800));
  background-size: cover; background-position: center;
}
.page-hero::after { content:""; position:absolute; inset:0; z-index:1; background: linear-gradient(110deg, rgba(6,34,63,.92), rgba(8,42,77,.7)); }
.page-hero__pattern { position:absolute; inset:0; opacity:.25; z-index:2; }
.page-hero .container { position: relative; z-index: 3; }
.page-hero h1 { color:#fff; margin:.5rem 0 0; }
.page-hero .lead { color: rgba(255,255,255,.9); margin-top: .9rem; max-width: 740px; }
.page-hero .lead a { color: var(--gold-200); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.page-hero .lead a:hover { color: #fff; }
.page-hero .eyebrow { color: var(--gold-400); }
.page-hero .eyebrow::before { background: var(--gold-400); }
.breadcrumb { display:flex; gap:.5rem; align-items:center; font-size:.85rem; color: rgba(255,255,255,.75); margin-bottom: .9rem; }
.breadcrumb a { color: rgba(255,255,255,.75); }
.breadcrumb a:hover { color:#fff; }
.breadcrumb span { opacity:.5; }

/* Heros photo par page */
body[data-page="mairie"] .page-hero,
body[data-page="contact"] .page-hero,
body[data-page="informations-utiles"] .page-hero,
body[data-page="ecole-publique"] .page-hero,
body[data-page="les-professionnels-lapouyadais"] .page-hero { background-image: url("../assets/img/mairie.jpg"); }
body[data-page="la-commune"] .page-hero,
body[data-page="les-associations-lapouyadaises"] .page-hero { background-image: url("../assets/img/croix.jpg"); }
body[data-page="a-voir"] .page-hero { background-image: url("../assets/img/cadran.jpg"); }
body[data-page="une-petite-pause"] .page-hero,
body[data-page="la-cali"] .page-hero,
body[data-page="halle-espace-roland-coureau"] .page-hero { background-image: url("../assets/img/fontaine.jpg"); }
body[data-page="mediatheque-municipale"] .page-hero,
body[data-page="agence-postale"] .page-hero,
body[data-page="espace-pierre-claveleau-auditorium"] .page-hero,
body[data-page="vie-culturelle"] .page-hero { background-image: url("../assets/img/eglise.jpg"); }

/* =================================================================
   COMPONENTS
   ================================================================= */
/* Intro split */
.intro { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem,5vw,4rem); align-items: center; }
.intro__media { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); position: relative; aspect-ratio: 4/3; }
.intro__media img, .intro__media svg { width:100%; height:100%; object-fit:cover; }
.intro__badge { position:absolute; bottom:1rem; left:1rem; background:rgba(255,255,255,.95); backdrop-filter: blur(6px); padding:.6rem .9rem; border-radius:8px; font-size:.8rem; font-weight:700; color:var(--green-900); box-shadow: var(--shadow-sm);}

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1rem; }
.stat { text-align: center; padding: 1.6rem 1rem; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); }
.stat__num { font-family: var(--f-display); font-weight: 800; font-size: clamp(2rem, 4.2vw, 2.9rem); color: var(--green-800); line-height:1; letter-spacing:-.02em; }
.stat__num .suffix { color: var(--gold-500); }
.stat__label { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--stone); margin-top: .55rem; font-weight:600; }
.stats--dark .stat { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); }
.stats--dark .stat__num { color: #fff; }
.stats--dark .stat__label { color: rgba(255,255,255,.7); }

/* Cards grid */
.grid { display: grid; gap: 1.4rem; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

/* Thematic card */
.card {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.8rem 1.6rem; box-shadow: var(--shadow-sm); overflow: hidden;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s;
  display: flex; flex-direction: column; height: 100%;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--green-600); }
.card__icon { width: 52px; height: 52px; border-radius: 12px; display:grid; place-items:center; background: var(--green-100); color: var(--green-800); margin-bottom: 1.1rem; transition: background .25s, color .25s; }
.card:hover .card__icon { background: var(--green-800); color: #fff; }
.card__icon svg { width: 26px; height: 26px; }
.card h3 { margin-bottom: .5rem; color: var(--green-900); }
.card p { font-size: .95rem; flex: 1; }
.card__link { margin-top: 1rem; font-weight: 700; font-size: .9rem; color: var(--gold-600); display: inline-flex; align-items:center; gap:.4rem; }
.card__link svg { width:16px; height:16px; transition: transform .25s var(--ease); }
.card:hover .card__link svg { transform: translateX(5px); }
a.card { color: inherit; }

/* Tuile thématique avec flèche (style marseille) */
.tile { display:flex; align-items:center; gap:1rem; background:#fff; border:1px solid var(--line); border-radius:var(--radius); padding:1.3rem 1.4rem; box-shadow:var(--shadow-sm); transition: border-color .2s, transform .2s, box-shadow .2s; color:var(--green-900); }
.tile:hover { border-color:var(--green-600); transform: translateY(-3px); box-shadow:var(--shadow); color:var(--green-900); }
.tile .ti { width:46px; height:46px; border-radius:10px; background:var(--green-100); color:var(--green-800); display:grid; place-items:center; flex:none; }
.tile .ti svg { width:24px; height:24px; }
.tile .tl { font-weight:700; flex:1; line-height:1.2; }
.tile .ta { color:var(--gold-500); transition: transform .2s; }
.tile:hover .ta { transform: translateX(4px); }
.tile .ta svg { width:20px; height:20px; }

/* News card (avec photo) */
.news { display:flex; flex-direction:column; background:#fff; border:1px solid var(--line); border-radius: var(--radius); overflow:hidden; box-shadow: var(--shadow-sm); transition: transform .25s var(--ease), box-shadow .25s; height:100%; }
.news:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.news__media { aspect-ratio: 16/10; overflow:hidden; background:var(--green-100); }
.news__media img { width:100%; height:100%; object-fit:cover; transition: transform .5s var(--ease); }
.news:hover .news__media img { transform: scale(1.05); }
.news__body { padding: 1.4rem 1.5rem 1.6rem; display:flex; flex-direction:column; flex:1; }
.news__tag { align-self:flex-start; font-size:.7rem; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--gold-600); background:var(--gold-200); padding:.3rem .65rem; border-radius:6px; margin-bottom:.8rem; }
.news h3 { font-size:1.18rem; margin-bottom:.5rem; }
.news p { font-size:.93rem; flex:1; }
.news__link { margin-top:1rem; font-weight:700; font-size:.88rem; color:var(--gold-600); display:inline-flex; align-items:center; gap:.4rem; }
.news__link svg { width:16px; height:16px; }

/* Prose */
.prose { max-width: 820px; }
.prose > * + * { margin-top: 1.1rem; }
.prose h2 { margin-top: 2.4rem; }
.prose h3 { margin-top: 1.6rem; color: var(--green-800); }
.prose p, .prose li { color: var(--ink-soft); }
.prose ul.bullets { display: grid; gap: .55rem; }
.prose ul.bullets li { position: relative; padding-left: 1.5rem; }
.prose ul.bullets li::before { content:""; position:absolute; left:0; top:.6em; width:8px; height:8px; border-radius:2px; background: var(--gold-500); }
.prose a { font-weight:600; text-decoration: underline; text-decoration-color: rgba(236,103,38,.4); text-underline-offset: 3px; }

/* Panel */
.panel { background: #fff; border:1px solid var(--line); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow-sm); }
.panel--green { background: var(--green-900); color:#fff; border:none; }
.panel--green h3, .panel--green h2 { color:#fff; }
.panel--green a { color: var(--gold-200); }
.info-list { display:grid; gap:1rem; }
.info-row { display:flex; gap:1rem; align-items:flex-start; }
.info-row .ic { width:44px; height:44px; border-radius:10px; flex:none; display:grid; place-items:center; background: var(--green-100); color:var(--green-800); }
.panel--green .info-row .ic { background: rgba(255,255,255,.12); color: var(--gold-200); }
.info-row .ic svg { width:20px; height:20px; }
.info-row .lbl { display:block; font-size:.72rem; letter-spacing:.1em; text-transform:uppercase; color:var(--stone); font-weight:700; }
.panel--green .info-row .lbl { color: rgba(255,255,255,.65); }
.info-row .val { display:block; font-weight:600; color: var(--green-900); font-size:1rem; }
.panel--green .info-row .val { color:#fff; }

/* Hours */
.hours { width:100%; border-collapse: collapse; }
.hours td { padding:.65rem 0; border-bottom:1px solid var(--line); font-size:.96rem; }
.hours td:first-child { font-weight:600; color:var(--green-900); }
.hours td:last-child { text-align:right; color:var(--ink-soft); }
.panel--green .hours td { border-color: rgba(255,255,255,.15); }
.panel--green .hours td:first-child { color:#fff; }
.panel--green .hours td:last-child { color: rgba(255,255,255,.8); }

/* Directory */
.dir { display:grid; gap:1rem; }
.dir-item { background:#fff; border:1px solid var(--line); border-radius: var(--radius-sm); padding:1.5rem 1.6rem; box-shadow: var(--shadow-sm); transition: box-shadow .25s, border-color .25s; border-left:4px solid var(--green-600); }
.dir-item:hover { box-shadow: var(--shadow); border-left-color: var(--gold-500); }
.dir-item h3 { font-size:1.2rem; margin-bottom:.3rem; color:var(--green-900); }
.dir-item .meta { display:flex; flex-wrap:wrap; gap:.4rem 1.3rem; margin-top:.7rem; font-size:.9rem; color:var(--stone); }
.dir-item .meta span { display:inline-flex; align-items:center; gap:.4rem; }
.dir-item .meta svg { width:15px; height:15px; color: var(--gold-600); flex:none; }
.tag-pill { display:inline-block; font-size:.7rem; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--green-800); background:var(--green-100); padding:.3rem .65rem; border-radius:6px; margin-bottom:.4rem; }

/* Feature split */
.feature-split { display:grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem,5vw,4rem); align-items:center; }
.feature-split.reverse .feature-split__media { order: 2; }
.feature-split__media { border-radius: var(--radius); overflow:hidden; box-shadow: var(--shadow); aspect-ratio: 4/3; }
.feature-split__media img, .feature-split__media svg { width:100%; height:100%; object-fit:cover; }

/* CTA band */
.cta-band { position: relative; overflow:hidden; background: linear-gradient(120deg, var(--green-900), var(--green-800)); color:#fff; border-radius: var(--radius); padding: clamp(2.2rem, 5vw, 3.6rem); }
.cta-band__deco { position:absolute; right:-30px; bottom:-50px; opacity:.1; z-index:0; }
.cta-band > * { position: relative; z-index:1; }
.cta-band h2 { color:#fff; }
.cta-band p { color: rgba(255,255,255,.88); }

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

/* Form */
.form-grid { display:grid; gap:1.1rem; }
.form-row { display:grid; grid-template-columns:1fr 1fr; gap:1.1rem; }
.field label { display:block; font-size:.82rem; font-weight:600; color:var(--green-900); margin-bottom:.4rem; }
.field input, .field textarea {
  width:100%; font-family: var(--f-body); font-size:1rem; padding:.8rem 1rem; border:1.5px solid var(--line);
  border-radius:8px; background:#fff; color:var(--ink); transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field textarea:focus { outline:none; border-color: var(--green-600); box-shadow: 0 0 0 3px rgba(42,108,172,.15); }
.field textarea { min-height:150px; resize:vertical; }

/* Doc */
.doc { display:flex; align-items:center; gap:1rem; background:#fff; border:1px solid var(--line); border-radius:10px; padding:1rem 1.2rem; box-shadow: var(--shadow-sm); }
.doc .ic { width:46px; height:46px; border-radius:9px; background:var(--rouge); color:#fff; display:grid; place-items:center; flex:none; font-weight:700; font-size:.7rem; }
.doc .t { font-weight:600; color:var(--green-900); }
.doc .s { font-size:.82rem; color:var(--stone); }

/* Divider */
.leaf-divider { display:flex; align-items:center; justify-content:center; gap:1rem; color: var(--gold-500); margin: 0 auto; }
.leaf-divider span { height:2px; width:50px; background: var(--gold-400); border-radius:2px; }

/* =================================================================
   FOOTER
   ================================================================= */
.site-footer { background: var(--green-950); color: rgba(255,255,255,.7); padding-top: clamp(3rem, 6vw, 4.5rem); position:relative; }
.footer-grid { display:grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 2.5rem; padding-bottom: 2.6rem; }
.footer-brand .brand__name { color:#fff; }
.footer-brand .brand__sub { color: rgba(255,255,255,.6); }
.footer-brand p { color: rgba(255,255,255,.6); font-size:.93rem; margin-top:1rem; max-width:340px; }
.footer-col h4 { color:#fff; font-family: var(--f-body); font-weight:700; font-size:.82rem; letter-spacing:.1em; text-transform:uppercase; margin-bottom:1rem; }
.footer-col a { color: rgba(255,255,255,.66); display:block; padding:.3rem 0; font-size:.93rem; }
.footer-col a:hover { color: var(--gold-400); }
.footer-contact .row { display:flex; gap:.7rem; margin-bottom:.85rem; font-size:.93rem; align-items:flex-start; }
.footer-contact .row svg { width:18px; height:18px; color: var(--gold-400); flex:none; margin-top:2px; }
.footer-contact a { color: rgba(255,255,255,.8); }
.footer-bottom { border-top:1px solid rgba(255,255,255,.12); padding: 1.4rem 0; display:flex; justify-content:space-between; gap:1rem; flex-wrap:wrap; font-size:.84rem; color: rgba(255,255,255,.5); }
.footer-bottom a { color: rgba(255,255,255,.55); }
.footer-bottom a:hover { color: var(--gold-400); }
.footer-strip { height:5px; background: linear-gradient(90deg, var(--bleu) 0 33.3%, #fff 33.3% 66.6%, var(--rouge) 66.6%); }

/* =================================================================
   ANIMATIONS
   ================================================================= */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"]{ transition-delay:.07s;} .reveal[data-delay="2"]{ transition-delay:.14s;}
.reveal[data-delay="3"]{ transition-delay:.21s;} .reveal[data-delay="4"]{ transition-delay:.28s;}
.reveal[data-delay="5"]{ transition-delay:.35s;}
@media (prefers-reduced-motion: reduce) { .reveal { opacity:1 !important; transform:none !important; } html{scroll-behavior:auto;} }

/* =================================================================
   RESPONSIVE
   ================================================================= */
@media (max-width: 1280px) { .header-actions .btn { display: none; } }
@media (max-width: 1140px) {
  .nav { display: none; }
  .burger { display: block; }
}
@media (max-width: 1100px) {
  .quick__grid { grid-template-columns: repeat(3,1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2,1fr); }
  .intro, .feature-split { grid-template-columns: 1fr; }
  .feature-split.reverse .feature-split__media { order: 0; }
  .form-row { grid-template-columns:1fr; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .grid--3, .grid--4, .grid--2 { grid-template-columns: 1fr; }
  .quick__grid { grid-template-columns: repeat(2,1fr); }
  .footer-grid { grid-template-columns: 1fr; gap:2rem; }
  .btn { width:100%; justify-content:center; }
  .hero__actions { width:100%; }
  .section-head--row { gap:.8rem; }
  .section-head--row .btn { width:auto; }
}

/* =================================================================
   POLISSAGE FINAL
   ================================================================= */
/* Motifs de bandeau : points en blanc discret (cohérence palette) */
.page-hero__pattern circle { fill: #fff; }
.page-hero__pattern [stroke] { stroke: #fff; }

/* Hero accueil : cadrage & présence */
.hero { min-height: clamp(440px, 60vh, 600px); display: flex; align-items: center; }
.hero .container { width: min(100% - 2.4rem, var(--maxw)); margin-inline: auto; }
.hero__media img { object-position: center 35%; }

/* Accessibilité : focus clavier visible */
a:focus-visible, button:focus-visible, .btn:focus-visible, input:focus-visible, textarea:focus-visible,
.quick__item:focus-visible, .tile:focus-visible, .card:focus-visible {
  outline: 3px solid var(--gold-500); outline-offset: 3px; border-radius: 6px;
}

/* Liens images : pas de soulignement parasite */
a.news__media, a.card { text-decoration: none; }

/* Évite l'ancrage caché sous le header sticky */
:target { scroll-margin-top: calc(var(--top-h) + var(--head-h) + 16px); }

/* Cohérence : sélection */
::selection { background: var(--gold-500); color: #fff; }

/* =====================================================================
   RESPONSIVE — REFONTE COMPLÈTE (mairie : ~80% du trafic sur mobile)
   Objectif : zéro débordement, zéro texte cassé, du 320px au grand écran.
   ===================================================================== */

/* ---- Sécurités anti-débordement (cause n°1 des sections cassées) ---- */
*, *::before, *::after { min-width: 0; }                 /* enfants flex/grid ne débordent plus */
body { overflow-x: hidden; }
img, svg, iframe, video, table { max-width: 100%; }
.container { width: min(100% - 2rem, var(--maxw)); }
h1, h2, h3, h4, p, li, a, span, blockquote, .stat__num, .brand__name, .val, .news__link, .card__link {
  overflow-wrap: anywhere; word-break: break-word;
}
.header-actions > * { flex: none; }                       /* boutons d'en-tête ne rétrécissent pas */
.btn { white-space: normal; }                             /* le texte des boutons peut passer à la ligne */

/* ---- Très grand écran / moniteur (≥ 1500px) ---- */
@media (min-width: 1500px) { :root { --maxw: 1320px; } }

/* ---- Petit laptop / grande tablette paysage (≤ 1080px) ---- */
@media (max-width: 1080px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Tablette (≤ 920px) ---- */
@media (max-width: 920px) {
  .intro, .feature-split { grid-template-columns: 1fr; gap: 2rem; }
  .feature-split.reverse .feature-split__media { order: 0; }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .cta-grid { grid-template-columns: 1fr !important; gap: 1.6rem !important; }
}

/* ---- Grand téléphone / petite tablette (≤ 720px) ---- */
@media (max-width: 720px) {
  .topbar__left { display: none; }
  .topbar .container { justify-content: center; }
  .topbar__right { width: 100%; justify-content: center; gap: 1rem; }
  .topbar__right span:first-child { display: none; }   /* adresse cachée, téléphone conservé */
  .section { padding: 3rem 0; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: .8rem; }
  .quick { margin-top: 1.4rem; }                         /* maquette : plus de chevauchement */
  .quick__grid { grid-template-columns: repeat(2, 1fr); box-shadow: var(--shadow-sm); }
}

/* ---- Téléphone (≤ 600px) ---- */
@media (max-width: 600px) {
  body { font-size: 15.5px; }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .section { padding: 2.6rem 0; }
  .section-head { margin-bottom: 1.7rem; }
  .panel { padding: 1.4rem; }
  .card { padding: 1.5rem 1.3rem; }
  .btn { width: 100%; justify-content: center; }
  .hero__actions { width: 100%; flex-direction: column; align-items: stretch; }
  .hero { min-height: auto; }
  .hero__inner { padding: 2.4rem 0 2rem; max-width: 100%; }
  .page-hero { padding: 2.4rem 0; }
  .map-wrap iframe { min-height: 300px; }
  .breadcrumb { flex-wrap: wrap; }
  .feature-split__media, .intro__media { aspect-ratio: 16/10; }
  .info-row .val { font-size: .98rem; }
  .cta-band { padding: 1.8rem 1.4rem; }
}

/* ---- Petit téléphone (≤ 400px) ---- */
@media (max-width: 400px) {
  .header-main { height: 64px; }
  .brand__name { font-size: 1.1rem; }
  .brand__sub { font-size: .54rem; letter-spacing: .12em; }
  .icon-btn { display: none; }              /* on garde le burger uniquement */
  .stats { grid-template-columns: 1fr; }
  h1 { font-size: 1.85rem; line-height: 1.15; }
  .lead { font-size: 1.02rem; }
  .stat__num { font-size: 1.8rem; }
  .section { padding: 2.2rem 0; }
}

/* ---- Mini écrans (≤ 340px) ---- */
@media (max-width: 340px) {
  body { font-size: 15px; }
  .brand__sub { display: none; }
  .topbar { font-size: .76rem; }
}

/* =====================================================================
   TOUCHES FINALES — identité française, raccourcis, retour en haut
   ===================================================================== */
/* Liseré tricolore en haut de page */
.lpy-topflag { height: 4px; width: 100%; background: linear-gradient(90deg,#0055A4 0 33.33%,#ffffff 33.33% 66.66%,#EF4135 66.66%); }

/* Badge République Française (hero) */
.lpy-fr-badge {
  display:inline-flex; align-items:center; gap:.5rem; margin-bottom:1rem;
  background:rgba(255,255,255,.14); border:1px solid rgba(255,255,255,.28); color:#fff;
  font-size:.72rem; font-weight:700; letter-spacing:.1em; text-transform:uppercase;
  padding:.35rem .75rem; border-radius:999px; backdrop-filter:blur(4px);
}
.lpy-flag { display:inline-block; width:22px; height:14px; border-radius:2px; overflow:hidden; box-shadow:0 0 0 1px rgba(255,255,255,.3); flex:none; }
.lpy-flag svg { display:block; width:100%; height:100%; }

/* Bandeau raccourcis : s'adapte au nombre d'éléments */
.quick__grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/* Bouton retour en haut */
.lpy-top {
  position:fixed; right:18px; bottom:18px; width:48px; height:48px; border-radius:50%;
  background:var(--green-800); color:#fff; border:none; display:grid; place-items:center; cursor:pointer;
  box-shadow:0 8px 24px -8px rgba(8,34,63,.6); opacity:0; visibility:hidden; transform:translateY(10px);
  transition:opacity .3s var(--ease), transform .3s var(--ease), background .2s; z-index:90;
}
.lpy-top.show { opacity:1; visibility:visible; transform:none; }
.lpy-top:hover { background:var(--gold-500); }
.lpy-top svg { width:22px; height:22px; }
@media (max-width:600px){ .quick__grid{ grid-template-columns:repeat(2,1fr); } .lpy-top{ width:44px; height:44px; right:14px; bottom:14px; } }

/* =====================================================================
   CARTE INTERACTIVE (Leaflet) — contour commune + épingle mairie
   ===================================================================== */
.lpy-map { width: 100%; height: 460px; background: #eaf1f8; }
.map-wrap .lpy-map { display: block; }
.leaflet-container { font-family: var(--f-body); }
.leaflet-control-zoom a { color: var(--green-900) !important; border-radius: 8px !important; }
.leaflet-bar { border: none !important; box-shadow: 0 4px 14px -6px rgba(8,34,63,.4) !important; }
.leaflet-popup-content-wrapper { border-radius: 10px; }
.leaflet-popup-content { font-size: .92rem; color: var(--ink); }

/* Épingle mairie (orange, pulsation) */
.lpy-pin span {
  display:block; width:24px; height:24px; border-radius:50% 50% 50% 0;
  background: var(--gold-500); transform: rotate(-45deg); border:2px solid #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,.35);
}
.lpy-pin::after {
  content:""; position:absolute; left:50%; top:24px; width:24px; height:8px;
  transform: translate(-50%,0); background: radial-gradient(rgba(8,34,63,.35), transparent 70%);
}
.lpy-pin span::before {
  content:""; position:absolute; inset:0; border-radius:inherit;
  box-shadow: 0 0 0 0 rgba(236,103,38,.5); animation: lpyPulse 2s infinite;
}
@keyframes lpyPulse { 0%{box-shadow:0 0 0 0 rgba(236,103,38,.5);} 70%{box-shadow:0 0 0 16px rgba(236,103,38,0);} 100%{box-shadow:0 0 0 0 rgba(236,103,38,0);} }

@media (max-width:600px){ .lpy-map{ height: 360px; } }
@media (prefers-reduced-motion: reduce){ .lpy-pin span::before{ animation:none; } }

/* Crédit agence (footer) */
.lpy-credit { color: var(--gold-400) !important; font-weight: 600; }
.lpy-credit:hover { color: #fff !important; }

/* Agenda (événements) */
.agenda { display: grid; gap: 1.1rem; max-width: 920px; margin-inline: auto; }
.agenda-item { display: grid; grid-template-columns: 210px 1fr; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.agenda-item:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.agenda-item--nomedia { grid-template-columns: 1fr; }
.agenda-item__media { overflow: hidden; }
.agenda-item__media img { width: 100%; height: 100%; min-height: 170px; object-fit: cover; display: block; }
.agenda-item__body { padding: 1.3rem 1.5rem; }
.agenda-item__date { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; font-size: .82rem; color: var(--green-800); text-transform: uppercase; letter-spacing: .02em; }
.agenda-item__date svg { width: 15px; height: 15px; color: var(--gold-600); }
.agenda-item__body h3 { margin: .45rem 0 .55rem; }
.agenda-item__info { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-bottom: .6rem; font-size: .9rem; color: var(--ink-soft); }
.agenda-item__info svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: .3rem; opacity: .7; }
.ai-price { font-weight: 700; color: var(--green-800); }
.ai-free { background: var(--green-100); color: var(--green-800); padding: .12rem .55rem; border-radius: 20px; font-size: .78rem; }
.agenda-item__contact { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; margin-top: .7rem; font-size: .88rem; }
.agenda-item__contact a { display: inline-flex; align-items: center; gap: .35rem; color: var(--green-800); font-weight: 600; }
.agenda-item__contact svg { width: 14px; height: 14px; opacity: .8; }
.agenda-item .card__link { margin-top: .9rem; }
@media (max-width: 640px) { .agenda-item { grid-template-columns: 1fr; } .agenda-item__media img { min-height: 190px; } }

/* Facebook (Page Plugin, vignette compacte) */
.pp-cell { display: flex; }
.pp-cell iframe { display: block; width: 100%; height: 100%; min-height: 380px; border: none; background: transparent; }

.fb-embed { margin-inline: auto; }
.fb-embed iframe { display: block; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm); background: #fff; }
.fb-embed__fallback { display: inline-flex; align-items: center; gap: .35rem; margin-top: .9rem; font-weight: 600; color: var(--green-800); }
.fb-embed__fallback svg { width: 16px; height: 16px; }
