/* ============================================================
   Village des Associations — Saint-Maurice Pellevoisin
   style.css — version finale
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=Source+Sans+3:wght@300;400;600&display=swap');

/* Variables */
:root {
  --bleu:       #1C3B8E;
  --bleu-clair: #2D50A8;
  --creme:      #F7F3EC;
  --blanc:      #FDFAF5;
  --terra:      #C47B5A;
  --terra-dark: #A85E3E;
  --ardoise:    #3D3D3D;
  --gris-mid:   #7A7A7A;
  --gris-light: #E8E3DA;
  --font-titre: 'Playfair Display', Georgia, serif;
  --font-corps: 'Source Sans 3', system-ui, sans-serif;
  --radius: 8px;
  --shadow: 0 2px 12px rgba(28,59,142,.10);
  --transition: .2s ease;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-corps);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ardoise);
  background: var(--blanc);
}
img { max-width: 100%; display: block; }
a { color: var(--bleu); text-decoration: none; }
a:hover { color: var(--terra); }

/* Navigation */
.nav {
  background: var(--bleu);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: .75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
}
.nav-logo {
  height: 40px;
  width: auto;
}
.nav-brand-text {
  font-family: var(--font-titre);
  font-size: 1.05rem;
  color: var(--creme);
  white-space: nowrap;
}
.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}
.nav-links a {
  color: var(--creme);
  font-size: .9rem;
  font-weight: 600;
  opacity: .85;
  transition: opacity var(--transition);
}
.nav-links a:hover { opacity: 1; color: var(--creme); }

/* Hero */
.hero {
  background: var(--bleu);
  color: var(--creme);
  text-align: center;
  padding: 4rem 1.5rem 3rem;
  position: relative;
  overflow: hidden;
}
.hero-eyebrow {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--terra);
  margin-bottom: .75rem;
}
.hero h1 {
  font-family: var(--font-titre);
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.15;
  margin-bottom: 1rem;
}
.hero-sub {
  font-size: 1.15rem;
  font-weight: 300;
  opacity: .85;
  max-width: 560px;
  margin: 0 auto 2rem;
}

/* Banderolle */
.banderolle {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}
.banderolle svg { max-width: 480px; width: 100%; }
.drapeau {
  transform-origin: top center;
  animation: swing 3s ease-in-out infinite alternate;
}
.drapeau:nth-child(2) { animation-delay: .3s; }
.drapeau:nth-child(3) { animation-delay: .6s; }
.drapeau:nth-child(4) { animation-delay: .9s; }
.drapeau:nth-child(5) { animation-delay: .5s; }
.drapeau:nth-child(6) { animation-delay: .2s; }
@keyframes swing {
  from { transform: rotate(-4deg); }
  to   { transform: rotate(4deg); }
}
@media (prefers-reduced-motion: reduce) {
  .drapeau { animation: none; }
}

/* Hero infos */
.hero-infos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .75rem 2rem;
  font-size: .95rem;
  font-weight: 600;
  margin-bottom: 2rem;
}
.hero-infos span::before { content: attr(data-icon) ' '; }

/* Boutons */
.btn {
  display: inline-block;
  padding: .75rem 2rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .95rem;
  transition: background var(--transition), transform var(--transition);
  cursor: pointer;
  border: none;
}
.btn-terra { background: var(--terra); color: #fff; }
.btn-terra:hover { background: var(--terra-dark); color: #fff; transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--creme); border: 2px solid var(--creme); }
.btn-outline:hover { background: var(--creme); color: var(--bleu); transform: translateY(-1px); }
.hero-ctas { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* Sections */
.section { padding: 4rem 1.5rem; }
.section-alt { background: var(--creme); }
.container { max-width: 1100px; margin: 0 auto; }
.section-titre {
  font-family: var(--font-titre);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--bleu);
  margin-bottom: .5rem;
}
.section-sous-titre {
  color: var(--gris-mid);
  font-size: 1rem;
  margin-bottom: 2.5rem;
  max-width: 600px;
}

/* Passeport */
.passeport-encart {
  background: var(--bleu);
  color: var(--creme);
  border-radius: var(--radius);
  padding: 2rem 2.5rem;
  display: flex;
  gap: 2rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}
.passeport-icon { font-size: 3rem; flex-shrink: 0; }
.passeport-encart h3 {
  font-family: var(--font-titre);
  font-size: 1.3rem;
  margin-bottom: .4rem;
}
.passeport-encart p { opacity: .85; font-size: .95rem; }

/* Grille associations */
.asso-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.asso-card {
  background: var(--blanc);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  border-top: 3px solid var(--bleu);
  transition: transform var(--transition), box-shadow var(--transition);
}
.asso-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(28,59,142,.15);
}
.asso-logo { height: 60px; object-fit: contain; object-position: left center; }
.asso-logo-placeholder { height: 60px; display: flex; align-items: center; }
.asso-logo-placeholder span { font-family: var(--font-titre); font-size: 1.4rem; color: var(--bleu); }
.asso-nom { font-family: var(--font-titre); font-size: 1.1rem; color: var(--bleu); line-height: 1.3; }
.asso-desc { font-size: .9rem; color: var(--ardoise); flex: 1; }
.asso-liens { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .25rem; }
.asso-lien {
  font-size: .8rem;
  font-weight: 600;
  color: var(--terra);
  border: 1px solid var(--terra);
  border-radius: 20px;
  padding: .2rem .7rem;
  transition: background var(--transition), color var(--transition);
}
.asso-lien:hover { background: var(--terra); color: #fff; }
.asso-animation { font-size: .8rem; color: var(--bleu-clair); font-weight: 600; }
.asso-animation::before { content: 'objectif '; }
.empty-state { grid-column: 1 / -1; text-align: center; padding: 3rem 1rem; color: var(--gris-mid); }
.empty-state p { margin-bottom: 1rem; font-size: 1.05rem; }

/* Titres d'année (galerie) */
.annee-titre {
  font-family: var(--font-titre);
  font-size: 1.4rem;
  color: var(--bleu);
  margin: 2rem 0 1rem;
  padding-bottom: .4rem;
  border-bottom: 2px solid var(--gris-light);
  display: flex;
  align-items: center;
  gap: .75rem;
}
.annee-count {
  font-family: var(--font-corps);
  font-size: .8rem;
  color: var(--gris-mid);
  font-weight: 400;
}

/* Galerie */
.galerie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .75rem;
}
.galerie-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4/3;
  cursor: zoom-in;
}
.galerie-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.galerie-item:hover img { transform: scale(1.05); }
.galerie-legende {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(61,61,61,.7));
  color: #fff;
  font-size: .8rem;
  padding: .5rem .75rem;
  transform: translateY(100%);
  transition: transform .25s ease;
}
.galerie-item:hover .galerie-legende { transform: translateY(0); }
.credit-photo { text-align: right; font-size: .8rem; color: var(--gris-mid); margin-top: .75rem; }
.credit-photo a { color: var(--terra); }

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.lightbox.active { display: flex; }
.lightbox img { max-height: 85vh; max-width: 90vw; border-radius: var(--radius); }
.lightbox-close {
  position: absolute;
  top: 1rem; right: 1.5rem;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  background: none;
  border: none;
}

/* Infos pratiques */
.infos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.5rem;
}
.info-bloc {
  background: var(--blanc);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  text-align: center;
}
.info-icon { font-size: 2rem; margin-bottom: .5rem; }
.info-label {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--terra);
  margin-bottom: .3rem;
}
.info-valeur { font-family: var(--font-titre); font-size: 1.1rem; color: var(--bleu); line-height: 1.3; }

/* CTA inscription */
.cta-section {
  background: var(--bleu);
  color: var(--creme);
  text-align: center;
  padding: 4rem 1.5rem;
}
.cta-section h2 {
  font-family: var(--font-titre);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 1rem;
}
.cta-section p { opacity: .85; max-width: 520px; margin: 0 auto 2rem; }
.deadline {
  display: inline-block;
  background: var(--terra);
  color: #fff;
  border-radius: 20px;
  padding: .3rem 1rem;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

/* Footer */
.footer {
  background: var(--ardoise);
  color: var(--gris-light);
  text-align: center;
  padding: 2rem 1.5rem;
  font-size: .85rem;
}
.footer a { color: var(--terra); }
.footer-orga { margin-bottom: .5rem; font-weight: 600; color: #fff; }

/* Flash messages */
.flash {
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  font-weight: 600;
}
.flash-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.flash-error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.flash-info    { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* Responsive */
@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-brand-text { font-size: .9rem; }
  .hero { padding: 3rem 1rem 2rem; }
  .passeport-encart { flex-direction: column; text-align: center; }
  .infos-grid { grid-template-columns: 1fr 1fr; }
}