/* ==========================================================================
   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: 17px;
  font-weight: 500;
  color: var(--anthracite);
}
.brand img { width: 96px; height: auto; }

nav.main-nav ul {
  list-style: none;
  display: flex;
  gap: 22px;
  margin: 0;
  padding: 0;
  font-size: 14px;
}
nav.main-nav li { margin-right: 22px; }
nav.main-nav li:last-child { margin-right: 0; }
nav.main-nav a { color: var(--anthracite); }
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: 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; }
}
