/* =======================================================================
   Styles spécifiques à la page d'accueil (index.html)
   — hero, à propos, statistiques, résultats, récits, sponsors —
   Le thème clair/sombre et le bouton de bascule sont dans theme.css.
   ======================================================================= */

/* ===== Hero cinématographique ===== */

#hero.hero { overflow: hidden; }

/* Photo du hero : léger zoom continu (idle) + zoom/assombrissement au scroll (piloté par GSAP via --hero-zoom) */
#hero #dynamic-image {
  --hero-zoom: 1.05;
  transform: scale(var(--hero-zoom));
  transform-origin: center center;
  filter: brightness(1); /* clair au départ — s'assombrit au scroll vers le bas (GSAP) */
  will-change: transform, filter;
}
@media (prefers-reduced-motion: no-preference) {
  #hero #dynamic-image { animation: heroKenBurns 20s ease-in-out infinite alternate; }
}
@keyframes heroKenBurns {
  from { transform: scale(var(--hero-zoom)); }
  to   { transform: scale(calc(var(--hero-zoom) + 0.07)); }
}

/* ===== Barre de progression de lecture ===== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 6px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: var(--accent-color);
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent-color), transparent 30%);
  z-index: 1001;
  pointer-events: none;
}

/* ===== Récits & Projets : texte en overlay sur l'image au survol (style template) =====
   Au repos, seule l'image est visible ; au survol, le panneau titre + texte
   remonte et se pose sur le bas de l'image. */
#news .news-card { position: relative; }
#news .news-card .news-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  padding: 15px;
  background: color-mix(in srgb, var(--background-color), transparent 8%);
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.45s ease, opacity 0.45s ease;
}
#news .news-card:hover .news-info {
  transform: translateY(0);
  opacity: 1;
}

/* ===== Timeline du palmarès (ligne qui se dessine + points par année) ===== */
.results-accordion {
  position: relative;
  padding-left: 28px;
}
.results-timeline-line {
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--accent-color);
  opacity: 0.85;
  border-radius: 2px;
  transform: scaleY(0);
  transform-origin: top center;
}
.results-accordion .accordion-item {
  position: relative;
}
.results-accordion .accordion-item::before {
  content: "";
  position: absolute;
  left: -25px;
  top: 22px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-color);
  box-shadow: 0 0 0 3px var(--background-color);
  z-index: 1;
}

/* Défilement fluide Lenis : neutralise le scroll-behavior:smooth du template pour éviter le double lissage */
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* Scrim + vignette au-dessus de la photo (z-index 1), sous le contenu (z-index 3) */
#hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(102deg, rgba(9,13,22,0.86) 0%, rgba(9,13,22,0.52) 34%, rgba(9,13,22,0.06) 60%, rgba(9,13,22,0.18) 100%),
    linear-gradient(to top, rgba(9,13,22,0.72) 0%, rgba(9,13,22,0) 46%),
    radial-gradient(130% 120% at 55% 42%, transparent 52%, rgba(0,0,0,0.5) 100%);
}

/* Intitulé "eyebrow" — signature magenta des cartes d'orientation */
.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--accent-bright);
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 12px 0;
  text-shadow: 0 1px 10px rgba(0,0,0,0.5);
}
.hero-eyebrow::before {
  content: "";
  width: 36px;
  height: 2px;
  background: var(--accent-bright);
  flex-shrink: 0;
}

/* Typo du nom renforcée + profondeur */
#hero h2 {
  font-size: 78px;
  font-weight: 800;
  letter-spacing: -1.5px;
  margin-bottom: 6px;
  text-shadow: 0 2px 28px rgba(0,0,0,0.5);
}
#hero .container > .row p { text-shadow: 0 1px 14px rgba(0,0,0,0.55); }
#hero p span { border-bottom-color: var(--accent-bright); }

/* Indicateur de défilement (point 2) */
.hero-scroll {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 3;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  text-decoration: none;
  transition: background 0.3s ease, border-color 0.3s ease;
}
.hero-scroll:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: #fff;
  color: #fff;
}

/* Entrée orchestrée du hero (point 3) — uniquement si l'utilisateur accepte les animations */
@media (prefers-reduced-motion: no-preference) {
  #hero .col-lg-9 > .hero-eyebrow,
  #hero .col-lg-9 > h2,
  #hero .col-lg-9 > p,
  #hero .col-lg-9 > .social-links,
  #hero .col-lg-9 > .hero-partners {
    opacity: 0;
    animation: heroReveal 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
  }
  #hero .col-lg-9 > .hero-eyebrow { animation-delay: 0.20s; }
  #hero .col-lg-9 > h2 { animation-delay: 0.36s; }
  #hero .col-lg-9 > h2 + p { animation-delay: 0.54s; }
  #hero .col-lg-9 > .social-links { animation-delay: 0.70s; }
  #hero .col-lg-9 > .hero-partners { animation-delay: 0.88s; }

  .hero-scroll {
    opacity: 0;
    animation: heroReveal 0.7s ease 1.15s forwards;
  }
  .hero-scroll i { animation: heroChevron 1.8s ease-in-out infinite; }
}
@keyframes heroReveal {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes heroChevron {
  0%, 100% { transform: translateY(-3px); }
  50%      { transform: translateY(3px); }
}

@media (max-width: 768px) {
  #hero h2 { font-size: 40px; }
  .hero-eyebrow { font-size: 11px; letter-spacing: 2px; }
  .hero-eyebrow::before { width: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  #hero #dynamic-image { animation: none; }
}

/* Remonte le contenu du hero (au lieu d'un centrage vertical) */
#hero.hero {
  align-items: flex-start;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  padding-top: 30px;
  padding-bottom: 30px;
}
#hero .container {
  max-width: 100%;
  margin-top: 0;
  margin-left: 0;
  margin-right: 0;
  padding-left: 130px;
  padding-right: 20px;
}
#hero .row.justify-content-center {
  justify-content: flex-start !important;
}
#hero .col-lg-9 {
  max-width: 620px;
  flex: 0 0 auto;
  width: auto;
}

/* Logos des partenaires dans le hero — colonne verticale, gabarit identique */
.hero-partners-label {
  color: rgba(255, 255, 255, 0.75);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 12px;
  margin: 0 0 14px 0;
}
.hero-partners {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 11px;
  width: max-content;
  max-width: 100%;
  margin: 0;
  padding: 20px 24px;
  background: rgba(0, 0, 0, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
/* Chaque logo remplit exactement la même grande boîte (neutralise aussi .hero img) */
.hero-partners .hero-partner-logo {
  position: static;
  inset: auto;
  z-index: auto;
  width: 160px;
  height: 42px;
  object-fit: contain;
  object-position: center;
  /* Uniformise tous les logos en blanc, quelle que soit leur couleur d'origine */
  filter: brightness(0) invert(1);
  opacity: 0.9;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.hero-partners a:hover .hero-partner-logo {
  opacity: 1;
  transform: scale(1.06);
}
@media (max-width: 768px) {
  #hero.hero { height: auto; min-height: 100vh; overflow: visible; align-items: stretch; padding-top: 84px; padding-bottom: 19px; }
  #hero > .container { display: flex; flex-direction: column; padding-left: 20px; padding-right: 20px; }
  #hero > .container > .row { flex: 1 1 auto; }
  #hero h2 { font-size: 40px; }
  #hero .col-lg-9 { max-width: 100%; display: flex; flex-direction: column; }
  .hero-partners {
    margin-top: auto; /* pousse la box tout en bas de l'image */
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 13px 20px;
    padding: 14px 16px;
    max-width: 300px;
  }
  .hero-partners .hero-partner-logo { width: auto; height: 22px; }
  .hero-scroll { display: none; }
}

/* Fiche d'informations "À propos" */
.about-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px 30px;
  margin: 14px 0 22px;
}
.about-info-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.about-info-item--wide {
  grid-column: 1 / -1;
}
.about-info-item > i {
  font-size: 20px;
  color: var(--accent-color);
  margin-top: 2px;
  flex-shrink: 0;
}
.about-info-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: color-mix(in srgb, var(--default-color), transparent 45%);
  margin-bottom: 2px;
}
.about-info-value {
  display: block;
  font-weight: 600;
  line-height: 1.45;
}
@media (max-width: 768px) {
  .about-info-grid { grid-template-columns: 1fr; }
}

/* Filtres par année de la section Résultats (même style que Récits & Projets) */
.results-filters {
  padding: 0;
  margin: 0 auto 30px auto;
  list-style: none;
  text-align: center;
}
.results-filters li {
  cursor: pointer;
  display: inline-block;
  padding: 8px 20px 10px 20px;
  margin: 0 0 5px 0;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  border-radius: 50px;
  transition: all 0.3s ease-in-out;
  font-family: var(--heading-font);
}
.results-filters li:hover,
.results-filters li.filter-active,
.news .news-filters li:hover,
.news .news-filters li.filter-active {
  color: #ffffff;
  background-color: var(--accent-color);
}
html[data-theme="dark"] .results-filters li:hover,
html[data-theme="dark"] .results-filters li.filter-active,
html[data-theme="dark"] .news .news-filters li:hover,
html[data-theme="dark"] .news .news-filters li.filter-active {
  color: #1a1a1a;
}
.contact .php-email-form button[type=submit] { color: #ffffff; }
html[data-theme="dark"] .contact .php-email-form button[type=submit] { color: #1a1a1a; }

/* Accordéons de résultats par année */
.results-accordion {
  margin-bottom: 30px;
}
.results-accordion .accordion-item {
  border: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: transparent;
}
.results-accordion .accordion-button {
  font-weight: 700;
  font-size: 20px;
  padding: 14px 8px;
  background: transparent;
  box-shadow: none;
  color: #808080; /* années en gris */
  --bs-accordion-btn-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23808080'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
  --bs-accordion-btn-active-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23808080'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}
.results-accordion .accordion-button:not(.collapsed) {
  color: #a8a8a8; /* année ouverte : gris un peu plus clair */
  background: transparent;
}
.results-accordion .accordion-body,
.results-accordion .accordion-body li {
  color: var(--default-color); /* textes en blanc (mode sombre) / noir (mode clair) */
}
.results-accordion .accordion-button:focus {
  box-shadow: none;
}
.results-accordion .accordion-body {
  padding: 0 8px 16px 8px;
}
.results-accordion .accordion-body ul {
  margin: 0;
  padding-left: 20px;
}
.results-accordion .accordion-body li {
  margin-bottom: 6px;
  line-height: 1.5;
}

/* Cartes Récits & Projets — même taille pour toutes, un peu plus compactes */
.news .news-img { width: 100%; height: 200px; object-fit: cover; }

/* Logos sponsors : même gabarit, contenus dans leur boîte, jamais de débordement */
.sponsors .sponsors-item .icon {
  width: 100%;
  height: 90px;
  margin: 0 auto 10px auto;
  overflow: hidden;
}
.sponsors .sponsors-item .icon .img-fluid-sponsors {
  max-width: 80%;
  max-height: 84px;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* ===== Cartes sponsors & résultats : toujours blanches (mode clair ET sombre) ===== */
.sponsors-item { background-color: #ffffff !important; }
.sponsors-item h3,
.sponsors-item h5 { color: #14171a; }
.sponsors-item p { color: #3a3f44; }
.sponsors-item p a { color: #4d4d4d; }

/* Bordures d'accordéon lisibles dans les deux modes */
.results-accordion .accordion-item { border-bottom-color: rgba(128, 128, 128, 0.25) !important; }

/* ===== Records personnels (chronos) — bloc indépendant pleine largeur ===== */
.records-block { margin-top: 40px; }

.records-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 992px) { .records-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .records-grid { grid-template-columns: 1fr; } }

.record-tile {
  position: relative;
  padding: 24px 22px 20px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--default-color), transparent 95%);
  border: 1px solid color-mix(in srgb, var(--default-color), transparent 88%);
  overflow: hidden;
  transition: transform .35s ease, border-color .35s ease, box-shadow .35s ease;
}
/* Liseré d'accent en haut de la tuile */
.record-tile::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-color), transparent 85%);
  opacity: .95;
}
.record-tile:hover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--accent-color), transparent 45%);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
}
/* Icône chrono, discrète en haut à droite */
.record-ico {
  position: absolute;
  right: 16px; top: 14px;
  font-size: 22px;
  color: color-mix(in srgb, var(--accent-color), transparent 55%);
  transition: color .35s ease, transform .35s ease;
}
.record-tile:hover .record-ico {
  color: var(--accent-color);
  transform: scale(1.1);
}
/* Distance (petit label en capitales) */
.record-dist {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--default-color), transparent 42%);
  margin-bottom: 12px;
  padding-right: 30px; /* laisse la place à l'icône */
}
/* Chrono — l'élément vedette */
.record-time {
  font-size: clamp(30px, 3.4vw, 42px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
  color: var(--heading-color);
  margin-bottom: 12px;
}
/* Contexte (lieu · date) */
.record-ctx {
  font-size: 12.5px;
  line-height: 1.45;
  color: color-mix(in srgb, var(--default-color), transparent 48%);
}

/* Séparation nette avant l'appel au soutien */
.soutenez-title { margin-top: 70px; padding-top: 44px; border-top: 1px solid color-mix(in srgb, var(--default-color), transparent 88%); }

/* News : grille CSS propre et responsive (neutralise le positionnement absolu d'isotope) */
.news .news-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 30px !important;
  position: static !important;
  height: auto !important;
  margin-top: 45px !important;
}
.news .news-grid > .news-item {
  position: static !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  width: auto !important;
  max-width: 100% !important;
  margin: 0 !important;
}
@media (max-width: 991px) { .news .news-grid { grid-template-columns: repeat(2, 1fr) !important; } }
@media (max-width: 640px)  { .news .news-grid { grid-template-columns: 1fr !important; } }

.news .news-grid { margin-left: 0 !important; margin-right: 0 !important; }

/* ===== Normalisation mobile : rien ne déborde ===== */
@media (max-width: 768px) {
  .container { max-width: 100% !important; padding-left: 14px !important; padding-right: 14px !important; }
  .row { margin-left: 0 !important; margin-right: 0 !important; }
  [class*="col-"] { padding-left: 8px !important; padding-right: 8px !important; }
  img:not(.hero-partner-logo):not(#dynamic-image) { max-width: 100% !important; }
  .news .news-img { width: 100% !important; height: 190px !important; }
}
