/* ==========================================================================
   A.M.S. — Association Mouvement Solidaire
   Charte : crème / orange / turquoise — Fraunces (titres) + Work Sans (texte)
   ========================================================================== */

:root {
  --orange: #D4AF37;
  --orange-dark: #A8862B;
  --orange-pale: #F7EEDA;
  --turquoise: #2CA6A4;
  --turquoise-dark: #1F7A78;
  --turquoise-pale: #E6F5F4;
  --creme: #FFFFFF;
  --creme-deep: #FAFAFA;
  --anthracite: #2C2C2A;
  --gris: #6C6C68;
  --gris-clair: #EFEFEA;
  --radius: 12px;
  --max-width: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Work Sans", "Segoe UI", Arial, sans-serif;
  background: var(--creme);
  color: var(--anthracite);
  line-height: 1.6;
}

h1, h2, h3, .voice {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  color: var(--anthracite);
  line-height: 1.25;
}

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

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Skip link (accessibilité clavier) */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--anthracite);
  color: #fff;
  padding: 10px 16px;
  z-index: 1000;
}
.skip-link:focus { left: 12px; top: 12px; }

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--gris-clair);
  background: var(--creme);
  position: sticky;
  top: 0;
  z-index: 100;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Fraunces", serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--anthracite);
  white-space: nowrap;
  flex: 0 0 auto;
}
.brand img { width: 84px; height: auto; flex: none; }

/* Le menu reste sur une seule ligne : aucun libellé ne se coupe, et
   l'espacement se resserre progressivement quand l'écran se réduit. */
nav.main-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 20px;
  margin: 0;
  padding: 0;
  font-size: 14px;
}
nav.main-nav li { margin: 0; flex: none; }
nav.main-nav a { color: var(--anthracite); white-space: nowrap; }
nav.main-nav a[aria-current="page"] {
  color: var(--turquoise-dark);
  border-bottom: 2px solid var(--turquoise);
  padding-bottom: 3px;
}
.nav-toggle { display: none; }

@media (max-width: 1320px) {
  .site-header { padding: 14px 18px; }
  .brand { font-size: 15px; }
  .brand img { width: 74px; }
  nav.main-nav ul { gap: 15px; font-size: 13.5px; }
}
@media (max-width: 1120px) {
  .brand { font-size: 0; gap: 0; }
  .brand img { width: 70px; }
  nav.main-nav ul { gap: 13px; font-size: 13px; }
}

@media (max-width: 720px) {
  nav.main-nav ul {
    position: fixed;
    inset: 64px 0 auto 0;
    background: var(--creme);
    flex-direction: column;
    padding: 16px 24px;
    border-bottom: 1px solid var(--gris-clair);
    display: none;
  }
  nav.main-nav ul.open { display: flex; }
  .nav-toggle {
    display: block;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--anthracite);
  }
}

/* Hero */
.hero {
  display: flex;
  gap: 32px;
  align-items: center;
  flex-wrap: wrap;
  padding: 56px 0 32px;
}
.hero-text { flex: 1 1 320px; }
.hero-text h1 { font-size: 30px; margin: 0 0 14px; }
.hero-text p { color: var(--gris); font-size: 15px; max-width: 480px; margin: 0 0 20px; }
.hero-media {
  flex: 1 1 280px;
  min-height: 220px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--orange-pale), var(--turquoise-pale));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gris);
  font-size: 13px;
  text-align: center;
  padding: 16px;
}

/* Mosaïque de petites vignettes photo, chacune alternant avant/après */
.photo-mosaic {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 4px;
  width: 100%;
  height: 100%;
  min-height: 220px;
  border-radius: var(--radius);
  overflow: hidden;
}
.photo-mosaic .tile {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
.photo-mosaic-wrap {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 220px;
}
.photo-mosaic-cta { display: none; }
.photo-mosaic .tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  animation: tileFade 36s infinite;
}
.photo-mosaic .tile img.img-avant { filter: grayscale(85%) contrast(0.95); }
.photo-mosaic .tile img.img-apres { filter: none; }
.photo-mosaic .tile:nth-child(1) img:nth-child(1) { animation-delay: 0s; }
.photo-mosaic .tile:nth-child(1) img:nth-child(2) { animation-delay: 18s; }
.photo-mosaic .tile:nth-child(2) img:nth-child(1) { animation-delay: 4.5s; }
.photo-mosaic .tile:nth-child(2) img:nth-child(2) { animation-delay: 22.5s; }
.photo-mosaic .tile:nth-child(3) img:nth-child(1) { animation-delay: 9s; }
.photo-mosaic .tile:nth-child(3) img:nth-child(2) { animation-delay: 27s; }
.photo-mosaic .tile:nth-child(4) img:nth-child(1) { animation-delay: 13.5s; }
.photo-mosaic .tile:nth-child(4) img:nth-child(2) { animation-delay: 31.5s; }
.photo-mosaic .tile:nth-child(5) img:nth-child(1) { animation-delay: 2.25s; }
.photo-mosaic .tile:nth-child(5) img:nth-child(2) { animation-delay: 20.25s; }
.photo-mosaic .tile:nth-child(6) img:nth-child(1) { animation-delay: 6.75s; }
.photo-mosaic .tile:nth-child(6) img:nth-child(2) { animation-delay: 24.75s; }
.photo-mosaic .tile:nth-child(7) img:nth-child(1) { animation-delay: 11.25s; }
.photo-mosaic .tile:nth-child(7) img:nth-child(2) { animation-delay: 29.25s; }
.photo-mosaic .tile:nth-child(8) img:nth-child(1) { animation-delay: 15.75s; }
.photo-mosaic .tile:nth-child(8) img:nth-child(2) { animation-delay: 33.75s; }
@keyframes tileFade {
  0% { opacity: 0; transform: scale(1.12); }
  5% { opacity: 1; }
  48% { opacity: 1; transform: scale(1); }
  50% { opacity: 0; transform: scale(1); }
  100% { opacity: 0; }
}

/* Boutons */
.btn {
  display: inline-block;
  border: none;
  border-radius: 8px;
  padding: 11px 22px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-dark); text-decoration: none; }
.btn-outline { background: transparent; color: var(--turquoise-dark); border: 1.5px solid var(--turquoise); }
.btn-outline:hover { background: var(--turquoise-pale); text-decoration: none; }

.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* Chiffres clés */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  padding: 8px 0 40px;
}
.stat-card {
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
}
.stat-card.o { background: var(--orange); }
.stat-card.t { background: var(--turquoise); }
.stat-number { font-size: 26px; font-weight: 600; color: #fff; }
.stat-label { font-size: 12px; color: rgba(255,255,255,0.85); margin-top: 4px; }
.partners-text { color: #fff; font-size: 13px; line-height: 1.55; text-align: center; }

.stat-details { margin-top: 10px; }
.stat-details summary {
  cursor: pointer;
  font-size: 12px;
  color: rgba(255,255,255,0.9);
  list-style: none;
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.5);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.stat-details summary:hover,
.stat-details summary:focus-visible {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.9);
}
.stat-details summary::-webkit-details-marker { display: none; }
.stat-details summary::after { content: " ▾"; }
.stat-details[open] summary::after { content: " ▴"; }
.stat-details p {
  margin: 10px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: rgba(255,255,255,0.95);
}
.stats-note { font-size: 12px; color: var(--gris); margin-top: -24px; margin-bottom: 40px; }

/* Sections génériques */
section.block { padding: 40px 0; }
section.block.alt { background: var(--creme-deep); }
section.block h2 { font-size: 22px; text-align: center; margin-bottom: 24px; }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.card {
  background: #fff;
  border: 1px solid var(--gris-clair);
  border-radius: var(--radius);
  padding: 18px;
}
.card .icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
  font-size: 16px;
}
.card.o .icon { background: var(--orange-pale); color: var(--orange); }
.card.t .icon { background: var(--turquoise-pale); color: var(--turquoise-dark); }
.card h3 { font-size: 14px; margin: 0 0 6px; }
.card p { font-size: 13px; color: var(--gris); margin: 0; }

blockquote.temoignage {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
  font-family: "Fraunces", serif;
  font-size: 18px;
  color: var(--anthracite);
  font-style: italic;
}
blockquote.temoignage footer {
  margin-top: 12px;
  font-family: "Work Sans", sans-serif;
  font-style: normal;
  font-size: 13px;
  color: var(--gris);
}

.cta-final { padding: 44px 0; }
.cta-final .container {
  max-width: 540px;
  text-align: center;
  border: 1.5px solid var(--gris-clair);
  border-radius: var(--radius);
  padding: 32px 24px;
}
.cta-final h2 { margin-bottom: 16px; }
.btn-outline { background: var(--turquoise); color: #fff; border: none; }
.btn-outline:hover { background: var(--turquoise-dark); text-decoration: none; }

/* Formulaires */
form.stack { max-width: 520px; margin: 0 auto; display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 500; }
.field input, .field textarea, .field select {
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid var(--gris-clair);
  border-radius: 8px;
  background: #fff;
  color: var(--anthracite);
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--turquoise); border-color: var(--turquoise); }
.field-hint { font-size: 12px; color: var(--gris); }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-message { border-radius: 8px; padding: 12px 14px; font-size: 14px; margin-bottom: 8px; }
.form-message.success { background: var(--turquoise-pale); color: var(--turquoise-dark); }
.form-message.error { background: #FBE7E2; color: #A6350B; }

/* Footer */
footer.site-footer {
  background: var(--anthracite);
  color: #C9C9C4;
  padding: 28px 0;
  font-size: 12.5px;
}
footer.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
footer.site-footer a { color: #C9C9C4; }
footer.site-footer .footer-links { display: flex; gap: 16px; }

@media (max-width: 600px) {
  .hero { padding-top: 32px; }
  .hero-text h1 { font-size: 24px; }
}

/* Bloc « Télécharger nos plaquettes » (page Notre association) */
.hero-plaquettes {
  flex: 0 1 230px;
  min-height: 0;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  padding: 18px;
  color: var(--anthracite);
  text-align: left;
}
.plaquettes-titre {
  font-family: "Fraunces", Georgia, serif;
  font-size: 15px;
  margin: 0 0 12px;
}
.plaquettes-liste {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.plaquette {
  display: block;
  text-decoration: none;
  color: var(--anthracite);
}
a.plaquette:hover { text-decoration: none; }
.plaquette-vignette {
  position: relative;
  display: block;
  width: 66px;
  aspect-ratio: 640 / 905;
  border-radius: 5px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--gris-clair);
  box-shadow: 0 1px 5px rgba(0, 0, 0, .09);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.plaquette-vignette img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
a.plaquette:hover .plaquette-vignette,
a.plaquette:focus-visible .plaquette-vignette {
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(0, 0, 0, .16);
  border-color: var(--turquoise);
}
.plaquette-loupe {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--turquoise);
  color: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}
.plaquette-loupe svg { width: 10px; height: 10px; }
.plaquette-nom {
  display: block;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  margin-top: 6px;
}
.plaquette-poids { display: block; font-size: 11px; color: var(--gris); }

@media (max-width: 700px) {
  .hero-plaquettes { flex: 1 1 auto; }
}


/* Actualités : image d'illustration et bouton de lien */
.actu-image {
  width: 100%;
  height: 170px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 12px;
}
.actu-lien { margin-top: 10px; }

/* Actualités : pièce jointe téléchargeable */
.actu-fichier {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 9px 11px;
  border: 1px solid var(--gris-clair);
  border-radius: 8px;
  background: #fff;
  color: var(--anthracite);
  text-decoration: none;
  transition: border-color .15s ease, transform .15s ease;
}
a.actu-fichier:hover {
  text-decoration: none;
  border-color: var(--turquoise);
  transform: translateY(-1px);
}
.actu-fichier-ico {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--turquoise-pale);
  color: var(--turquoise-dark);
}
.actu-fichier-ico svg { width: 15px; height: 15px; }
.actu-fichier-txt { display: grid; line-height: 1.3; min-width: 0; }
.actu-fichier-txt strong { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.actu-fichier-txt small { font-size: 11px; color: var(--gris); }

/* Page Nos chantiers : note de liste et encart fort */
.note-liste {
  font-size: 13px;
  font-weight: 500;
  color: var(--orange-dark);
  text-align: center;
  margin: 16px 0 0;
}
.encart-fort {
  margin: 18px auto 0;
  max-width: 760px;
  background: var(--anthracite);
  color: #fff;
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 14px;
  line-height: 1.5;
}
.encart-fort strong { color: #fff; }

/* Alignement des textes modifiables depuis la console */
.txt-gauche { text-align: left; }
.txt-centre { text-align: center; }
.txt-droite { text-align: right; }
.txt-justifie { text-align: justify; text-justify: inter-word; hyphens: auto; }

/* Bandeau « Nos prestations » : territoires d'intervention */
.hero-presence {
  flex: 0 1 380px;
  align-self: center;
  background: #fff;
  border: 1px solid var(--gris-clair);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.hero-presence-titre {
  margin: 0 0 14px;
  font-size: 12px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--gris);
  text-align: center;
}
.hero-presence-liste { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.presence-item { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.presence-ico {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.presence-ico-or { background: var(--orange-pale); color: var(--orange-dark); }
.presence-ico-turquoise { background: var(--turquoise-pale); color: var(--turquoise-dark); }
.presence-nom { font-size: 12.5px; font-weight: 600; line-height: 1.25; }
.presence-nom small { display: block; font-size: 11px; font-weight: 400; color: var(--gris); }
@media (max-width: 520px) {
  .hero-presence { padding: 16px; }
  .presence-nom { font-size: 12px; }
}

/* Animation discrète du bloc « Nous sommes présents ici » */
.presence-item {
  opacity: 0;
  transform: translateY(8px);
  animation: presenceApparition .5s ease forwards;
}
.presence-item:nth-child(1) { animation-delay: .05s; }
.presence-item:nth-child(2) { animation-delay: .20s; }
.presence-item:nth-child(3) { animation-delay: .35s; }
@keyframes presenceApparition {
  to { opacity: 1; transform: none; }
}

/* Le point marque la ville où nous sommes implantés : Fréjus, Nice, Paris. */
.presence-point { fill: #fff; stroke: currentColor; stroke-width: 1.4; }
.presence-halo {
  fill: none;
  stroke: #fff;
  stroke-width: 1.6;
  transform-origin: center;
  transform-box: fill-box;
  animation: presencePulse 2.6s ease-out infinite;
}
.presence-item:nth-child(2) .presence-halo { animation-delay: .8s; }
.presence-item:nth-child(3) .presence-halo { animation-delay: 1.6s; }
@keyframes presencePulse {
  0%   { opacity: .9; transform: scale(.6); }
  70%  { opacity: 0;  transform: scale(3.2); }
  100% { opacity: 0;  transform: scale(3.2); }
}

.presence-ico { transition: transform .2s ease; }
.presence-item:hover .presence-ico { transform: translateY(-3px) scale(1.04); }

/* Confort : plus aucune animation si la personne l'a désactivé dans son système. */
@media (prefers-reduced-motion: reduce) {
  .presence-item { opacity: 1; transform: none; animation: none; }
  .presence-halo { animation: none; opacity: .5; }
  .presence-item:hover .presence-ico { transform: none; }
}

/* Animation discrète des plaquettes (page Notre association) */
.plaquette {
  opacity: 0;
  transform: translateY(8px);
  animation: plaquetteApparition .5s ease forwards;
}
.plaquettes-liste .plaquette:nth-child(1) { animation-delay: .10s; }
.plaquettes-liste .plaquette:nth-child(2) { animation-delay: .25s; }
@keyframes plaquetteApparition {
  to { opacity: 1; transform: none; }
}

/* Au survol : la couverture se soulève et la flèche amorce le téléchargement. */
a.plaquette:hover .plaquette-vignette,
a.plaquette:focus-visible .plaquette-vignette {
  transform: translateY(-4px);
}
.plaquette-loupe { transition: transform .2s ease; }
a.plaquette:hover .plaquette-loupe { transform: scale(1.1); }
a.plaquette:hover .plaquette-loupe svg { animation: flecheDescend .9s ease-in-out infinite; }
@keyframes flecheDescend {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(2px); }
}

@media (prefers-reduced-motion: reduce) {
  .plaquette { opacity: 1; transform: none; animation: none; }
  a.plaquette:hover .plaquette-vignette { transform: none; }
  a.plaquette:hover .plaquette-loupe,
  a.plaquette:hover .plaquette-loupe svg { transform: none; animation: none; }
}

/* Reflet qui balaie l'encart des plaquettes pour attirer l'oeil sans
   mouvement brusque : une bande de lumière traverse en diagonale toutes
   les six secondes. */
.hero-plaquettes { position: relative; overflow: hidden; }
.hero-plaquettes::after {
  content: "";
  position: absolute;
  top: -60%;
  left: -75%;
  width: 45%;
  height: 220%;
  background: linear-gradient(100deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.75) 50%, rgba(255,255,255,0) 100%);
  transform: rotate(14deg);
  pointer-events: none;
  animation: refletPlaquettes 6s ease-in-out 1.2s infinite;
}
@keyframes refletPlaquettes {
  0%   { left: -75%; opacity: 0; }
  6%   { opacity: 1; }
  26%  { left: 115%; opacity: 0; }
  100% { left: 115%; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-plaquettes::after { display: none; }
}
