/* ====
   Variables et polices
   ==== */
:root {
  --primary-green: #7CB342;
  --secondary-green: #8BC34A;
  --accent-orange: #FF9800;
  --accent-blue: #2196F3;
  --warm-yellow: #FFC107;
  --earth-brown: #8D6E63;
  --light-bg: #F8F9FA;
  --white: #ffff;
  --dark-text: #2E2E2E;
  --light-text: #666;
  --shadow: rgba(0,0,0,.1);

  /* Couleurs dédiées aux liens "Lieu" (Google Maps) */
  --maps-color: #1E88E5;
  --maps-color-hover: #0C63D6;
  --maps-bg: #eef5ff;
  --maps-bg-hover: #eaf2ff;
  --maps-border: #d6e8ff;
  --maps-border-hover: #cfe1ff;

  /* Hauteurs des médias dans l'agenda (contrôlées, sans rognage) */
  --agenda-media-h-desktop: 220px;
  --agenda-media-h-tablet: 200px;
  --agenda-media-h-mobile: 160px;
}

html {
  scroll-behavior: smooth;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Open Sans', sans-serif;
  background: var(--light-bg);
  color: var(--dark-text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ====
   Entête
   ==== */
.header {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--white); padding: 1rem 2rem;
  box-shadow: 0 2px 15px var(--shadow);
  position: sticky; top: 0; z-index: 1000;
  backdrop-filter: blur(10px);
}

.logo { height: 50px; transition: transform .3s ease; }
.logo:hover { transform: scale(1.05); }

.site-title {
  font-family: 'Comfortaa', cursive; font-size: 1.8rem; color: var(--primary-green);
  margin: 0 1rem; flex-grow: 1; text-align: center; font-weight: 700;
}

.nav { display: flex; gap: 1.5rem; }
.nav a {
  text-decoration: none; color: var(--primary-green); font-weight: 600;
  padding: .5rem 1rem; border-radius: 25px; transition: all .3s ease; position: relative;
}
.nav a:hover { background: var(--secondary-green); color: var(--white); transform: translateY(-2px); }
.burger { display: none; font-size: 2rem; cursor: pointer; color: var(--primary-green); }

/* ====
   Hero
   ==== */
.hero {
  height: 100vh; background-size: cover; background-position: center; background-attachment: fixed;
  display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden;
}
.hero-content { position: relative; z-index: 2; text-align: center; max-width: 800px; padding: 2rem; }
.hero-bubble {
  background: rgba(255,255,255,.95); padding: 3rem; border-radius: 50px;
  box-shadow: 0 20px 40px rgba(0,0,0,.2); transform: rotate(-2deg); animation: float 6s ease-in-out infinite;
}
@keyframes float { 0%,100% { transform: rotate(-2deg) translateY(0) } 50% { transform: rotate(-2deg) translateY(-10px) } }
.hero-bubble h2 { font-family: 'Comfortaa', cursive; font-size: 2.2rem; color: var(--primary-green); margin-bottom: 1rem; line-height: 1.3; }
.hero-subtitle { font-size: 1.2rem; color: var(--light-text); }

/* ====
   Bouton "Prochains coups de main"
   ==== */
.next-events-trigger {
  position: fixed; right: 24px; bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  background: var(--accent-orange); color: var(--white);
  padding: 1rem 1.5rem; border-radius: 50px; border: none; cursor: pointer;
  display: flex; align-items: center; gap: .5rem;
  box-shadow: 0 5px 15px rgba(255,152,0,.4);
  transition: transform .2s ease, background .2s ease, opacity .2s ease;
  z-index: 9999; animation: pulse 2s infinite;
}
.next-events-trigger:hover { transform: scale(1.05); background: var(--warm-yellow); }
.trigger-text { font-weight: 600; }
.trigger-icon { font-size: 1.2rem; }
@keyframes pulse {
  0% { box-shadow: 0 5px 15px rgba(255,152,0,.4) }
  50% { box-shadow: 0 5px 25px rgba(255,152,0,.6) }
  100% { box-shadow: 0 5px 15px rgba(255,152,0,.4) }
}

/* ====
   Panneau "Prochains coups de main"
   ==== */
.next-events-panel {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%) scale(.96);
  background: var(--white); border-radius: 20px; padding: 2.2rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.30); z-index: 9998;
  width: 80vw; max-width: 800px; min-width: 320px; height: 80vh; max-height: 600px; overflow-y: auto;
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
  opacity: 0; visibility: hidden; pointer-events: none;
}
.next-events-panel.open { opacity: 1; visibility: visible; pointer-events: auto; transform: translate(-50%,-50%) scale(1); }
.panel-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1rem; border-bottom: 2px solid var(--light-bg); padding-bottom: .6rem;
}
.panel-header h3 { color: var(--primary-green); margin: 0; }
.close-panel { background: none; border: none; font-size: 2rem; cursor: pointer; color: var(--light-text); transition: color .2s ease; }
.close-panel:hover { color: var(--accent-orange); }
.events-list { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1.2rem; }
.event-item {
  background: var(--light-bg); padding: 1rem 1.2rem; border-radius: 14px;
  border-left: 4px solid var(--secondary-green); transition: transform .2s ease;
  /* Fond pour le dégradé de la description clampée */
  --card-bg: var(--light-bg);
}
.event-item:hover { transform: translateX(5px); }
.event-item h4 { color: var(--primary-green); margin-bottom: .4rem; }
.event-date { color: var(--accent-orange); font-weight: 700; margin-bottom: .3rem; }
.view-all-link {
  display: block; text-align: center; color: var(--primary-green); text-decoration: none; font-weight: 700;
  padding: .8rem; border: 2px solid var(--primary-green); border-radius: 25px; transition: all .2s ease;
}
.view-all-link:hover { background: var(--primary-green); color: var(--white); }

/* ====
   Sections générales
   ==== */
.section { padding: 5rem 2rem; position: relative; scroll-margin-top: 90px; }
.container { max-width: 1200px; margin: 0 auto; }

h3 {
  font-family: 'Comfortaa', cursive; font-size: 2.5rem; color: var(--primary-green);
  text-align: center; margin-bottom: 1rem; position: relative;
}
h3::after {
  content: ''; position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%);
  width: 60px; height: 4px; background: var(--accent-orange); border-radius: 2px;
}

/* ====
   Présentation
   ==== */
.presentation { background: var(--white); }
.content-zigzag {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; margin-bottom: 4rem;
}
.content-zigzag.reverse { direction: rtl; }
.content-zigzag.reverse > * { direction: ltr; }
.text-bubble {
  background: var(--light-bg); padding: 2.5rem; border-radius: 30px; transform: rotate(1deg);
  box-shadow: 0 10px 30px var(--shadow); transition: transform .3s ease;
}
.text-bubble:hover { transform: rotate(0) scale(1.02); }
/* Correction du typo "le ft" -> "left" */
.text-bubble h3 { text-align: left; margin-bottom: 1.2rem; font-size: 1.8rem; }
.text-bubble h3::after { display: none; }
.visual-zone { display: flex; justify-content: center; align-items: center; }
.placeholder-visual {
  background: linear-gradient(135deg, var(--secondary-green), var(--primary-green));
  color: var(--white); padding: 3rem; border-radius: 20px; text-align: center; font-weight: 600;
  min-height: 200px; display: flex; align-items: center; justify-content: center; transform: rotate(-1deg); transition: transform .3s ease;
}
.placeholder-visual:hover { transform: rotate(0); }
.placeholder-visual.large { min-height: 300px; font-size: 1.2rem; }

/* ====
   Vision
   ==== */
.vision { background: linear-gradient(135deg, var(--light-bg), var(--white)); position: relative; overflow: hidden; }
.vision::before {
  content: ''; position: absolute; top: -50%; right: -50%; width: 100%; height: 200%;
  background: radial-gradient(circle, rgba(124,179,66,.1) 0%, transparent 70%); animation: rotate 20s linear infinite;
}
@keyframes rotate { from { transform: rotate(0) } to { transform: rotate(360deg) } }
.vision-content { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; position: relative; z-index: 2; }
.vision-bubble {
  background: var(--white); padding: 3rem; border-radius: 50px; box-shadow: 0 15px 40px var(--shadow); text-align: center; transform: rotate(-1deg);
}
.vision-text { font-size: 1.3rem; font-style: italic; color: var(--primary-green); line-height: 1.5; }

/* ====
   Objectifs
   ==== */
.objectifs { background: var(--white); }
.objectives-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; }
.objective-card {
  background: var(--light-bg); padding: 2rem; border-radius: 20px; text-align: center; transition: all .2s ease; border: 3px solid transparent;
}
.objective-card:hover { transform: translateY(-10px); border-color: var(--secondary-green); box-shadow: 0 15px 30px var(--shadow); }

/* Icônes images (responsive) */
.objective-icon {
  display: block;
  width: 96px;
  height: 96px;
  margin: 0 auto 1rem;
  object-fit: contain;
}
@media (min-width: 600px) {
  .objective-icon { width: 120px; height: 120px; }
}
@media (min-width: 1024px) {
  .objective-icon { width: 150px; height: 150px; }
}

.objective-card h4 { color: var(--primary-green); margin-bottom: 1rem; font-size: 1.3rem; }

/* ====
   État actuel
   ==== */
.current-state { background: linear-gradient(135deg, var(--light-bg), var(--white)); }
.state-content { display: flex; flex-direction: column; gap: 3rem; }
.stats-bubble {
  background: var(--white); padding: 2rem; border-radius: 30px; display: flex; justify-content: space-around; box-shadow: 0 10px 30px var(--shadow); transform: rotate(-1deg);
}
.stat-item { text-align: center; display: flex; flex-direction: column; }
.stat-number { font-size: 3rem; font-weight: 700; color: var(--accent-orange); font-family: 'Comfortaa', cursive; }
.stat-label { color: var(--light-text); font-weight: 600; }
.activities-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.activity-card {
  background: var(--white); padding: 2rem; border-radius: 20px; box-shadow: 0 5px 20px var(--shadow); transition: transform .3s ease;
}
.activity-card:hover { transform: translateY(-5px); }
.activity-card h4 { color: var(--primary-green); margin-bottom: .75rem; font-size: 1.2rem; }
.activity-card ul { list-style: none; padding-left: 0; }
.activity-card li { padding: .3rem 0; position: relative; padding-left: 1.5rem; }
.activity-card li::before { content: '🌱'; position: absolute; left: 0; }

/* Illustrations des cartes d'activités (limitées à 140x140, fluides) */
.activity-illustration {
  display: block;
  width: clamp(88px, 10vw, 140px);
  height: clamp(88px, 10vw, 140px);
  max-width: 140px;
  max-height: 140px;
  aspect-ratio: 1 / 1;
  object-fit: contain; /* aucun rognage */
  margin: 0 auto 0.75rem; /* centre l'image et ajoute un léger espacement */
  border-radius: 8px; /* optionnel */
}

/* ====
   Contact
   ==== */
.contact { background: var(--white); }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; }
.contact-card {
  background: var(--light-bg); padding: 2rem; border-radius: 20px; text-align: center; transition: all .2s ease; border: 3px solid transparent;
}
.contact-card:hover { transform: translateY(-5px); border-color: var(--accent-blue); box-shadow: 0 10px 25px var(--shadow); }
.contact-card h4 { color: var(--primary-green); margin-bottom: 1rem; font-size: 1.3rem; }

/* ====
   Agenda Complet (mise en page)
   ==== */
.agenda-hero { text-align: center; margin-bottom: 1rem; }
.agenda-hero h3 { font-size: 2.2rem; margin-bottom: .35rem; }
.agenda-hero h3::after { display: none; }
.agenda-subtitle { color: #4b5; font-size: 1.05rem; }

/* Barre d'outils (si utilisée) */
.agenda-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: #fff; border: 1px solid #e7efe9; border-radius: 14px;
  padding: .75rem 1rem; margin: 1rem 0 1.25rem;
  box-shadow: 0 6px 16px rgba(0,0,0,.06);
}
.toolbar-left { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.field { display: flex; align-items: center; background: #f7faf8; border: 1px solid #e1ede5; border-radius: 12px; padding: .45rem .7rem; }
.field.with-icon .icon { margin-right: .35rem; opacity: .8; }
.field input[type="search"], .field select {
  border: none; background: transparent; outline: none; font-size: .95rem; color: #223; min-width: 180px;
}
.field select { min-width: 160px; }
.checkbox-inline { gap: .5rem; background: transparent; border: none; padding: .2rem .3rem; margin-left: .3rem; }

.toolbar-right {
  display: inline-flex; gap: .4rem; background: #eef3ea; padding: .25rem; border-radius: 999px; border: 1px solid #d7e6d4;
}
.seg-btn {
  border: 0; padding: .45rem .9rem; background: transparent; border-radius: 999px; color: #2E7D32;
  font-weight: 700; cursor: pointer; transition: all .15s ease;
}
.seg-btn.active { background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.08); }

/* Grille cartes */
.agenda-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.agenda-card {
  background: #fff; border-radius: 16px; box-shadow: 0 6px 16px rgba(0,0,0,.08);
  overflow: hidden; display: flex; flex-direction: column; transition: transform .2s ease, box-shadow .2s ease;
  /* Fond pour le dégradé des descriptions clampées */
  --card-bg: #fff;
}
.agenda-card:hover { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(0,0,0,.12); }

/* Zone média: remplit la hauteur, largeur auto, pas de rognage */
.agenda-media {
  height: var(--agenda-media-h-desktop);
  background-size: auto 100%;
  background-position: center center;
  background-repeat: no-repeat;
  background-color: #f2f2f2; /* fond neutre si image étroite */
  position: relative;
}
@media (max-width: 1024px) {
  .agenda-media { height: var(--agenda-media-h-tablet); }
}
@media (max-width: 640px) {
  .agenda-media { height: var(--agenda-media-h-mobile); }
}

/* Variante si une <img> est utilisée dans .agenda-media */
.agenda-media img {
  height: 100%;
  width: auto;          /* respecte le ratio */
  max-width: none;      /* autorise largeur > conteneur si besoin */
  object-fit: contain;  /* pas de rognage */
  display: block;
  margin: 0 auto;
}

.agenda-media.fallback { display: flex; align-items: center; justify-content: center; }
.fallback-emoji { font-size: 48px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.2)); }
.agenda-body { padding: 1rem 1rem 1.2rem; }
.agenda-title { margin: 0 0 .4rem; color: var(--primary-green); font-size: 1.05rem; }

.agenda-meta {
  display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: center; color: #555; margin-bottom: .4rem;
}
.badge-date {
  background: #FFF5E6; color: #FF9800; border: 1px solid #FFD199;
  padding: .15rem .5rem; border-radius: 6px; font-weight: 700; font-size: .85rem;
}
.badge-category {
  background: #EAF4E7; color: #2E7D32; border: 1px solid #CFE8C8;
  padding: .15rem .5rem; border-radius: 6px; font-weight: 700; font-size: .85rem;
}
.agenda-desc {
  color: #444;
  margin: .25rem 0 0;
  position: relative;
}

/* Tronquage de base sur 4 lignes */
.agenda-desc.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-height: 6.5em; /* ~4 lignes selon la line-height */
}

/* Tronquage de base sur 4 lignes (doublon conservé si nécessaire) */
.agenda-desc.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-height: 6.5em; /* approx. 4 lignes selon la line-height */
}

/* N’affiche le dégradé que si le texte est réellement tronqué */
.agenda-desc.clamp[data-truncated="1"]::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2.4rem;
  background: linear-gradient(to bottom, rgba(255,255,255,0), var(--card-bg));
  pointer-events: none;
}

/* État "déployé" */
.agenda-desc.expanded {
  display: block;
  -webkit-line-clamp: unset;
  -webkit-box-orient: unset;
  overflow: visible;
  max-height: none;
}

/* Contact (panneau + cartes + frise) */
.event-contact,
.agenda-contact,
.timeline-contact {
  margin-top: .45rem;
  color: #333;
  font-size: .95rem;
}
.event-contact strong,
.agenda-contact strong,
.timeline-contact strong {
  font-weight: 800;
}

/* Bouton "Lire plus / Lire moins" */
.desc-toggle {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--primary-green);
  font-weight: 700;
  cursor: pointer;
  padding: .2rem .25rem;
  margin-top: .35rem;
  border-radius: 8px;
  line-height: 1.2;
}
.desc-toggle:hover,
.desc-toggle:focus {
  color: var(--secondary-green);
  text-decoration: underline;
  outline: none;
}

/* Liens dans la meta */
.agenda-meta a { text-decoration: none; color: var(--maps-color); }
.agenda-meta a:not(.badge-location):hover { text-decoration: underline; }

/* Frise */
.agenda-timeline { position: relative; margin-top: .75rem; padding-left: 1.25rem; }
.agenda-timeline.hidden { display: none; }
.agenda-grid.hidden { display: none; }
.timeline-line { position: absolute; left: 9px; top: 0; bottom: 0; width: 2px; background: #DCE7D9; }
.timeline-item { position: relative; margin: 0 0 1rem 0; padding-left: 1.25rem; }
.timeline-dot {
  position: absolute; left: -2px; top: .25rem; width: 10px; height: 10px; background: #7CB342;
  border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 3px rgba(124,179,66,.15);
}
.timeline-content {
  background: #fff; border-radius: 12px; box-shadow: 0 6px 16px rgba(0,0,0,.08); padding: .75rem .9rem;
  /* Fond pour le dégradé des descriptions clampées */
  --card-bg: #fff;
}
.timeline-title { margin: 0 0 .25rem; color: var(--primary-green); font-size: 1rem; }
.timeline-meta { font-size: .95rem; color: #555; margin-bottom: .4rem; }

/* ====
   États utilitaires
   ==== */
.hidden { display: none; }
.back-btn {
  background: var(--primary-green); color: var(--white); border: none;
  padding: 1rem 2rem; border-radius: 25px; cursor: pointer; font-size: 1rem; transition: all .2s ease;
}
.back-btn:hover { background: var(--secondary-green); transform: translateY(-2px); }

/* ====
   Lieu (badge)
   ==== */
.badge-location {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .22rem .6rem; border-radius: 999px;
  background: var(--maps-bg); border: 1px solid var(--maps-border);
  color: var(--maps-color); font-weight: 800; line-height: 1;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.badge-location::before { content: '📍'; }
a.badge-location, a.badge-location:link, a.badge-location:visited {
  text-decoration: none !important;
  border-bottom: 0 !important;
  color: var(--maps-color) !important;
}
a.badge-location:hover,
a.badge-location:focus,
a.badge-location:focus-visible {
  color: var(--maps-color-hover) !important;
  background: var(--maps-bg-hover);
  border-color: var(--maps-border-hover);
  box-shadow: 0 2px 8px rgba(30,136,229,.12);
  outline: none;
}
.badge-location.is-static { color: #3b6faa; cursor: default; pointer-events: none; }

/* Panel 3 prochains: ligne dédiée au lieu */
.event-location { margin: .35rem 0 .1rem; }

/* ====
   Responsive
   ==== */
@media (max-width: 768px) {
  .header { padding: 1rem; }
  .site-title { font-size: 1.4rem; }
  .nav {
    display: none; flex-direction: column; position: absolute; top: 70px; right: 0;
    background: var(--white); width: 100%; box-shadow: 0 4px 15px var(--shadow); padding: 1rem 0;
  }
  .nav.open { display: flex; }
  .nav a { padding: 1rem 2rem; width: 100%; text-align: center; border-radius: 0; }
  .burger { display: block; }
  .hero-bubble { padding: 2rem; transform: none; }
  .hero-bubble h2 { font-size: 1.8rem; }
  .hero-subtitle { font-size: 1rem; }
  .next-events-trigger { padding: .8rem 1.2rem; }
  .content-zigzag { grid-template-columns: 1fr; gap: 2rem; }
  .vision-content { grid-template-columns: 1fr; gap: 2rem; }
  .stats-bubble { flex-direction: column; gap: 1rem; transform: none; }
  .section { padding: 3rem 1rem; }
  h3 { font-size: 2rem; }
  .agenda-toolbar { flex-direction: column; align-items: stretch; gap: .7rem; }
  .toolbar-left { justify-content: stretch; }
  .field input[type="search"], .field select { min-width: unset; width: 100%; }
  .toolbar-right { align-self: center; }
}

@media (max-width: 480px) {
  .next-events-panel { width: 95%; padding: 1.5rem; }
  .objectives-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}

/* ===== Optimisations smartphone (≤ 748px) — n'impacte pas le desktop ===== */
@media (max-width: 748px) {
  /* En-tête compact + menu déroulant ancré */
  .header { padding: 0.6rem 0.9rem; }
  .logo { height: 38px; }
  .site-title { font-size: 1.25rem; margin: 0 0.5rem; }

  .nav {
    position: absolute;
    top: 100%; /* s'accroche sous l'entête */
    left: 0; right: 0;
    display: none;
    flex-direction: column;
    background: var(--white);
    box-shadow: 0 8px 20px var(--shadow);
    padding: 0.25rem 0.75rem 0.75rem;
    z-index: 1001;
  }
  .nav.open { display: flex; }
  .nav a { padding: 0.85rem 1rem; border-radius: 12px; }

  /* Hero: plus fluide et moins haut sur mobile */
  .hero {
    height: 70vh;
    min-height: 420px;
    background-attachment: scroll;
    background-position: center top;
  }
  @media (max-width: 420px) {
    .hero { height: 60vh; min-height: 360px; }
  }
  .hero-bubble {
    padding: 1.25rem 1rem;
    border-radius: 24px;
    transform: none;
    animation: none;
  }
  .hero-bubble h2 { font-size: 1.35rem; }
  .hero-subtitle { font-size: 0.95rem; }

  /* Images des zones visuelles => fluides */
  .visual-zone img,
  .vision-visual img {
    max-width: 100%;
    height: auto;
  }

  /* Grilles en 1 colonne + cartes plus compactes */
  .content-zigzag { grid-template-columns: 1fr; gap: 1.25rem; }
  .vision-content { grid-template-columns: 1fr; gap: 1.25rem; }
  .activities-grid { grid-template-columns: 1fr; }
  .objective-card { padding: 1.25rem; }
  .activity-card { padding: 1.25rem; }
  .section { padding: 2.25rem 1rem; scroll-margin-top: 70px; }
  h3 { font-size: 1.6rem; }
  .stats-bubble { padding: 1rem; }

  /* Agenda – contrôles (corrige le manque de styles de .agenda-controls) */
  .agenda-controls {
    display: grid;
    gap: 0.6rem;
    background: #fff;
    border: 1px solid #e7efe9;
    border-radius: 14px;
    padding: 0.75rem;
    box-shadow: 0 6px 16px rgba(0,0,0,.06);
    margin: 0.5rem 0 1rem;
  }
  .agenda-controls .control-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .agenda-controls input[type="search"],
  .agenda-controls select {
    width: 100%;
    min-width: 0;
    appearance: none;
    background: #f7faf8;
    border: 1px solid #e1ede5;
    border-radius: 10px;
    padding: 0.55rem 0.65rem;
    font-size: 1rem;
  }
  .agenda-controls .checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
  }
  .agenda-controls .toggles {
    display: inline-flex;
    justify-content: center;
    gap: 0.4rem;
    background: #eef3ea;
    padding: 0.25rem;
    border-radius: 999px;
    border: 1px solid #d7e6d4;
  }
  .view-toggle {
    border: 0;
    padding: .45rem .9rem;
    background: transparent;
    border-radius: 999px;
    color: #2E7D32;
    font-weight: 700;
  }
  .view-toggle.active {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
  }

  /* Agenda – cartes et frise */
  .agenda-grid { grid-template-columns: 1fr; gap: 0.8rem; }
  .agenda-media { height: var(--agenda-media-h-mobile); }
  .agenda-title { font-size: 1rem; }
  .badge-date, .badge-category { font-size: 0.82rem; }
  .agenda-meta { gap: 0.4rem 0.6rem; }
  .agenda-desc { word-break: break-word; } /* évite les débordements */

  .agenda-timeline { padding-left: 0.75rem; }
  .timeline-line { left: 6px; }
  .timeline-item { padding-left: 1rem; }
  .timeline-title { font-size: 0.95rem; }
  .timeline-meta { font-size: 0.9rem; }

  /* Bouton “Prochains coups de main” moins intrusif */
  .next-events-trigger {
    padding: 0.6rem 0.9rem;
    gap: 0.35rem;
  }
  @media (max-width: 420px) {
    .next-events-trigger { padding: 0.5rem 0.7rem; }
    .trigger-text { display: none; } /* ne garde que l’icône sur tout petits écrans */
  }

  /* Panneau “Prochains coups de main” ajusté */
  .next-events-panel {
    width: 94vw;
    max-width: none;
    min-width: 0;
    height: 80vh;
    max-height: none;
    padding: 1.2rem;
  }
  .panel-header { padding-bottom: 0.4rem; }
  .close-panel { line-height: 1; padding: 0 0.25rem; }
  .event-item { padding: 0.85rem 1rem; }

  /* Contact: lisible en 1 colonne */
  .contact-grid { grid-template-columns: 1fr; gap: 0.9rem; }
  .contact-card { padding: 1.1rem; text-align: left; }
  .contact-card h4 { font-size: 1.1rem; }
}

/* Illustrations - Présentation ("Qui sommes-nous ?"), "Au cœur de l'action" et "Notre Vision" */
.presentation .visual-zone,
.vision .vision-visual {
  /* Centre l'image dans sa colonne, déjà flex dans ta base */
  justify-content: center;
}

/* Desktop/tablette: images fluides mais plafonnées pour garder une belle présence */
.presentation .visual-zone img,
.vision .vision-visual img {
  display: block;
  width: clamp(360px, 50vw, 780px); /* largeur confortable sur grands écrans */
  max-width: 100%;
  height: auto;                     /* respecte le ratio, aucun rognage */
  border-radius: 20px;
  box-shadow: 0 10px 24px rgba(0,0,0,.08);
}

/* Smartphone (≤ 748px) : images compactes, centrées, sans débordement */
@media (max-width: 748px) {
  .presentation .visual-zone,
  .vision .vision-visual {
    margin: 0 auto 0.75rem; /* petit espace sous l'image */
  }

  .presentation .visual-zone img,
  .vision .vision-visual img {
    width: 100%;                     /* prend toute la largeur dispo */
    max-width: min(520px, 92vw);     /* limite la largeur utile pour éviter l’effet “géant” */
    height: auto;                    /* pas de rognage, ratio respecté */
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(0,0,0,.08);
  }

  /* Resserre légèrement les espacements du duo texte/visuel */
  .content-zigzag,
  .vision-content {
    gap: 1.25rem;
  }

  /* Bulle de texte un peu plus compacte pour éviter l’effet “serré” */
  .text-bubble {
    padding: 1.4rem;
  }
}

/* Très petits écrans (≤ 380px) : arrondis plus petits */
@media (max-width: 380px) {
  .presentation .visual-zone img,
  .vision .vision-visual img {
    border-radius: 14px;
  }
}

/* Popover Contacts — centrage en "modal" sur smartphone */
@media (max-width: 748px) {
  .coord-ui {
    position: fixed !important;      /* détaché de la carte */
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;

    width: min(92vw, 440px);
    max-height: min(70vh, 420px);
    overflow: auto;

    padding: .75rem;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,.25);
    z-index: 10010;                  /* au-dessus du bouton flottant (9999) */
  }

  /* On masque la flèche du popover en mode modal */
  .coord-ui::before,
  .coord-ui::after {
    display: none !important;
  }
}

/* Optionnel : fond assombri quand un popover est ouvert (navigateurs modernes) */
@media (max-width: 748px) {
  body:has(.coord-protect .coord-ui:not([hidden]))::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.32);
    z-index: 10005;
  }
}

/* Optionnel : verrouillage du défilement quand le popover est ouvert (si tu ajoutes la classe no-scroll côté JS) */
html.no-scroll, body.no-scroll {
  overflow: hidden;
}

/* Popover Contacts — modal parfaitement centré et contenu non rogné */
@media (max-width: 748px) {
  .coord-ui {
    position: fixed !important;
    /* Bordures à 12px pour empêcher tout débordement à gauche/droite */
    left: 12px !important;
    right: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin: 0 auto !important;

    width: auto !important;           /* annule width/min(...) du style inline */
    max-width: 520px !important;      /* plafond confortable */
    max-height: min(70vh, 420px);
    overflow: auto;

    box-sizing: border-box;
    padding: 12px 12px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,.25);
    z-index: 10010;
  }

  /* Masquer la petite flèche en mode modal */
  .coord-ui::before,
  .coord-ui::after {
    display: none !important;
  }
}

/* Optionnel: fond assombri quand un popover est ouvert (navigateurs modernes) */
@media (max-width: 748px) {
  body:has(.coord-protect .coord-ui:not([hidden]))::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.32);
    z-index: 10005;
  }
}