/**
 * Block: Stats
 *
 * Bandeau de chiffres-clés horizontal (N stats), chacune avec :
 *   - valeur serif large en bronze/gold (count-up animé au scroll)
 *   - suffixe unité gold inline
 *   - légende uppercase letterspacing
 * Séparateurs verticaux fins entre colonnes (gold-faded).
 *
 * Mobile : stack vertical, séparateurs horizontaux.
 *
 * Tokens : style.css `--cauris-*`. Pas de hardcode hors fallback.
 */

/* ---------------------------------------------------------------
 * Section frame
 * --------------------------------------------------------------- */

.stats-block {
  position: relative;
  padding: 5rem 0;
  overflow: hidden;
  background: var(--cauris-bronze, #3d2c14);
  color: var(--cauris-gold-2, #FCF6BA);
}

.stats-block__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  margin: 0 0 2.5rem;
  font-family: var(--cauris-font-sans);
  font-size: var(--cauris-eyebrow-fs, .75rem);
  font-weight: var(--cauris-eyebrow-weight, 600);
  letter-spacing: var(--cauris-eyebrow-tracking, .2em);
  text-transform: uppercase;
  color: var(--cauris-gold-1, #BF953F);
}
.stats-block__eyebrow::before {
  content: "";
  display: inline-block;
  width: 1.75rem;
  height: 1px;
  background: var(--cauris-gold-2, #FCF6BA);
}

/* ---------------------------------------------------------------
 * Grid — N colonnes équivalentes, séparateurs verticaux fins
 * --------------------------------------------------------------- */

.stats-block__grid {
  align-items: stretch;
}

.stats-block__col {
  position: relative;
}

/* Séparateur vertical entre colonnes (desktop) — pas avant la 1ère.
   Opacité un peu plus haute sur fond bronze pour rester lisible. */
.stats-block__col + .stats-block__col::before {
  content: "";
  position: absolute;
  left: 0;
  top: .5rem;
  bottom: .5rem;
  width: 1px;
  background: var(--cauris-gold-2, #FCF6BA);
  opacity: .22;
}

.stats-block__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.1rem;
  padding: .5rem 2rem .5rem 2.25rem;
  height: 100%;
}

/* ---------------------------------------------------------------
 * Figure — value (large serif) + unit (gold inline)
 * --------------------------------------------------------------- */

.stats-block__figure {
  display: flex;
  align-items: baseline;
  gap: .35rem;
  line-height: 1;
}

.stats-block__value {
  display: inline-block;
  font-family: var(--cauris-font-serif);
  font-weight: 700;
  font-size: clamp(2.75rem, 5.5vw, 4.5rem);
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--cauris-gold-2, #FCF6BA);
  /* Pendant l'animation, le contenu est remplacé par le compteur en cours ;
     on évite que le layout saute en réservant l'espace via min-width nul
     (le scope baseline est déjà solide). tabular-nums stabilise la largeur
     pendant l'incrément. */
  font-variant-numeric: tabular-nums;
}

.stats-block__unit {
  display: inline-block;
  font-family: var(--cauris-font-serif);
  font-weight: 500;
  font-style: italic;
  font-size: clamp(1rem, 1.6vw, 1.4rem);
  line-height: 1;
  color: var(--cauris-gold-1, #BF953F);
}

/* ---------------------------------------------------------------
 * Caption — uppercase letterspacing
 * --------------------------------------------------------------- */

.stats-block__caption {
  margin: 0;
  font-family: var(--cauris-font-sans);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  line-height: 1.45;
  color: rgba(252, 246, 186, .68);
}

/* ---------------------------------------------------------------
 * Reveal animation — fade up au scroll, déclenchée par JS via
 * `.is-revealed` (toggled par IntersectionObserver).
 * --------------------------------------------------------------- */

.stats-block__col {
  opacity: 0;
  transform: translateY(.85rem);
  transition:
    opacity .6s var(--cauris-ease, ease),
    transform .6s var(--cauris-ease, ease);
}
.stats-block__col.is-revealed {
  opacity: 1;
  transform: none;
}

/* Léger stagger via delay successif — tasse l'enchainement. */
.stats-block__col:nth-child(1) { transition-delay: 0s;    }
.stats-block__col:nth-child(2) { transition-delay: .08s;  }
.stats-block__col:nth-child(3) { transition-delay: .16s;  }
.stats-block__col:nth-child(4) { transition-delay: .24s;  }
.stats-block__col:nth-child(5) { transition-delay: .32s;  }
.stats-block__col:nth-child(6) { transition-delay: .4s;   }

/* ---------------------------------------------------------------
 * Responsive
 *
 * - <992px (md & sm) : 2 colonnes (grille reste, séparateurs gèrent eux-mêmes
 *   leur position grâce à `:nth-child(odd)::before`)
 * - <576px : stack vertical 1 colonne, séparateurs horizontaux
 * --------------------------------------------------------------- */

@media (max-width: 991px) {
  .stats-block {
    padding: 4rem 0;
  }
  /* 2 colonnes : pas de séparateur vertical avant la 3e/5e (qui sont en début
     de nouvelle ligne dans une grille à 2 cols). */
  .stats-block__col:nth-child(odd)::before {
    display: none;
  }
  .stats-block__item {
    padding: 1.5rem 1.25rem;
  }
  /* Séparateur horizontal entre lignes (entre row 1 et row 2). */
  .stats-block__col:nth-child(n+3)::after {
    content: "";
    position: absolute;
    top: 0;
    left: 1rem;
    right: 1rem;
    height: 1px;
    background: var(--cauris-gold-2, #FCF6BA);
    opacity: .22;
  }
}

@media (max-width: 575px) {
  .stats-block {
    padding: 3rem 0;
  }
  .stats-block__item {
    padding: 1.5rem .5rem;
    align-items: flex-start;
  }
  /* 1 colonne pleine : séparateur horizontal entre chaque card sauf la 1ère.
     On reset les variantes desktop/tablet et on applique une règle simple. */
  .stats-block__col + .stats-block__col::before {
    display: none;
  }
  .stats-block__col:nth-child(odd)::before,
  .stats-block__col:nth-child(n+3)::after {
    display: none;
  }
  .stats-block__col + .stats-block__col::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--cauris-gold-2, #FCF6BA);
    opacity: .22;
    display: block;
  }
}

/* ---------------------------------------------------------------
 * Réduction des animations utilisateur
 * --------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .stats-block__col {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
