/* ── Road2Luxe — home-histoire.css ────────────────────────────
   Section « Notre histoire » (front-page uniquement).
   Bento 3 colonnes : récit · photo fondateur · éventail voyageurs.
   Bandeau chiffres clés avec filet animé au hover.
   Tout est préfixé .r2l-histoire (BEM) — zéro collision.
   ─────────────────────────────────────────────────────────────── */

/* ── Wrapper section ── */
.r2l-histoire {
  padding-block: clamp(4rem, 9vw, 8rem);
  /* sable-1 = même fond que .r2l-voyages — supprime la couture entre les deux sections */
  background:
    radial-gradient(120% 80% at 50% -10%, #fff 0%, rgba(255,255,255,0) 55%),
    var(--r2l-sable-1);
}

/* ── Eyebrow centré (miroir de la section Avis) ── */
.r2l-histoire .r2l-eyebrow {
  display: flex;
  width: fit-content;
  margin-inline: auto;
}

/* ── Statement H2 ── */
.r2l-histoire__statement {
  font-family: var(--r2l-font-titres);
  font-weight: 600;
  font-size: clamp(1.75rem, 4vw, 2.875rem); /* 28–46px */
  line-height: 1.14;
  letter-spacing: -0.01em;
  max-width: 32ch;
  color: var(--r2l-charbon);
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
  text-align: center;
  margin-inline: auto;
}

.r2l-histoire__statement em {
  font-style: italic;
  font-weight: 500;
  color: var(--r2l-charbon);
}

/* ── Bento 3 colonnes ── #24 : Photo (gauche) · Récit+CTA (centre) · Pile (droite) */
.r2l-histoire__bento {
  display: grid;
  grid-template-columns: 0.95fr 1.2fr 0.95fr;
  gap: 20px;
  align-items: stretch;
}

/* ════════════════════════════════════
   CARTE RÉCIT
   ════════════════════════════════════ */
.r2l-histoire__recit {
  background: var(--r2l-sable-3);
  border: 1px solid var(--r2l-sable-4);
  border-radius: 18px;
  padding: 34px 32px;
  display: flex;
  flex-direction: column;
  transition:
    transform 0.5s var(--r2l-ease-reveal),
    box-shadow 0.5s var(--r2l-ease-reveal);
}

.r2l-histoire__recit:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px -24px rgba(44, 40, 42, 0.35);
}

/* Boussole */
.r2l-histoire__boussole {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--r2l-terre-sec);
  color: var(--r2l-charbon);
  margin-bottom: 24px;
  flex-shrink: 0;
  transition: transform 0.6s var(--r2l-ease-reveal);
}

.r2l-histoire__recit:hover .r2l-histoire__boussole {
  transform: rotate(28deg);
}

.r2l-histoire__boussole .r2l-icon {
  width: 20px;
  height: 20px;
}

/* Corps du récit */
.r2l-histoire__recit-corps {
  flex: 1;
  font-size: 15.5px;
  color: var(--r2l-terre-corps);
  margin-bottom: 26px;
  line-height: 1.65;
}

.r2l-histoire__recit-corps p {
  margin: 0;
}

.r2l-histoire__recit-corps b,
.r2l-histoire__recit-corps strong {
  color: var(--r2l-charbon);
  font-weight: 700;
}

/* Marque « stabilo brossé » — 1re occurrence de Road2Luxe.
   Terre (jamais orange) ; multiply pour l'effet marqueur sur le beige. */
.r2l-histoire__brand {
  font-weight: 700;
  color: var(--r2l-charbon);
  position: relative;
  z-index: 0;
  white-space: nowrap;
}
.r2l-histoire__brand::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: -.12em;
  right: -.12em;
  top: .06em;
  bottom: 0;
  background: color-mix(in srgb, var(--r2l-terre-sec) 26%, transparent);
  transform: skewX(-9deg) rotate(-1.2deg);
  border-radius: .7em .3em .6em .35em;
  mix-blend-mode: multiply;
}

/* CTA — soulignement flamingo depuis le centre + flèche */
.r2l-histoire__cta {
  margin-top: auto;
  align-self: flex-start;
  font-family: var(--r2l-font-corps);
  font-weight: 700;
  font-size: 15px;
  color: var(--r2l-terre-sec);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  position: relative;
  padding-bottom: 4px;
}

.r2l-histoire__cta::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--r2l-flamingo);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.42s var(--r2l-ease-reveal);
}

.r2l-histoire__cta:hover::after {
  transform: scaleX(1);
}

.r2l-histoire__cta-arrow {
  color: var(--r2l-flamingo);
  transition: transform 0.4s var(--r2l-ease-reveal);
}

.r2l-histoire__cta:hover .r2l-histoire__cta-arrow {
  transform: translateX(5px);
}

/* ════════════════════════════════════
   CARTE PHOTO FONDATEUR
   ════════════════════════════════════ */
.r2l-histoire__photo {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  min-height: 460px;
  background: var(--r2l-charbon);
  margin: 0;
  transition:
    transform 0.5s var(--r2l-ease-reveal),
    box-shadow 0.5s var(--r2l-ease-reveal);
}

.r2l-histoire__photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--r2l-ease-reveal);
}

/* Gradient overlay */
.r2l-histoire__photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(44, 40, 42, 0) 40%,
    rgba(44, 40, 42, 0.78) 100%
  );
}

.r2l-histoire__photo:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 50px -28px rgba(44, 40, 42, 0.55);
}

.r2l-histoire__photo:hover img {
  transform: scale(1.06);
}

/* Légende positionnée sur la photo */
.r2l-histoire__photo-caption {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 26px;
  z-index: 2;
  transition: transform 0.5s var(--r2l-ease-reveal);
}

.r2l-histoire__photo:hover .r2l-histoire__photo-caption {
  transform: translateY(-4px);
}

.r2l-histoire__photo-caption h3 {
  font-family: var(--r2l-font-titres);
  font-weight: 600;
  font-size: 24px;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--r2l-blanc);
  margin: 0;
}

.r2l-histoire__photo-caption span {
  display: block;
  margin-top: 7px;
  font-size: 13.5px;
  color: rgba(247, 243, 238, 0.82);
  font-weight: 500;
}

/* ════════════════════════════════════
   PILE PHOTOS — COVERFLOW AUTO (#25)
   3 visibles : 1 centrale (nette, premier plan) + 2 latérales en retrait
   qui dépassent derrière. La centrale change en boucle (JS home-histoire.js).
   Extensible à N : au-delà de 3, les autres s'empilent derrière (cachées).
   ════════════════════════════════════ */
.r2l-histoire__pile-wrap {
  background: var(--r2l-sable-1);
  border: 1px solid var(--r2l-sable-4);
  border-radius: 18px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  margin: 0;
}

.r2l-histoire__pile {
  position: relative;
  flex: 1;
  min-height: 340px;
  overflow: hidden; /* les latérales se fondent proprement aux bords du cadre */
  perspective: 1100px;
}

/* Wrapper de chaque photo — positionné, pas le <img> lui-même
   (wp_get_attachment_image ajoute width/height HTML qui conflictent
   avec position:absolute + aspect-ratio directement sur img). */
.r2l-histoire__pile-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 58%;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  border: 4px solid #fff;
  overflow: hidden;
  background: var(--r2l-sable-4);
  box-shadow: 0 12px 28px -16px rgba(44, 40, 42, 0.5);
  transform: translate(-50%, -50%) scale(0.78);
  transform-origin: center;
  transition:
    transform 0.7s var(--r2l-ease-reveal),
    opacity 0.7s var(--r2l-ease-reveal),
    box-shadow 0.7s var(--r2l-ease-reveal);
}

.r2l-histoire__pile-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Fallback sans JS : coverflow statique sur les 3 premières photos.
   Sous html.js, ces positions sont surchargées par les classes JS ci-dessous. ── */
.r2l-histoire__pile-card:nth-child(1) { transform: translate(-50%, -50%) scale(1);                z-index: 5; opacity: 1; }
.r2l-histoire__pile-card:nth-child(2) { transform: translate(-10%, -50%) scale(0.85) rotateY(-14deg); z-index: 2; opacity: 0.5; }
.r2l-histoire__pile-card:nth-child(3) { transform: translate(-90%, -50%) scale(0.85) rotateY(14deg);  z-index: 2; opacity: 0.5; }
.r2l-histoire__pile-card:nth-child(n+4) { opacity: 0; z-index: 1; }

/* ── Coverflow piloté par JS (html.js) : tout est masqué par défaut,
   puis la classe positionne le trio actif. ── */
html.js .r2l-histoire__pile-card {
  z-index: 1;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.78);
}
html.js .r2l-histoire__pile-card.is-center {
  z-index: 5;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  box-shadow: 0 18px 40px -18px rgba(44, 40, 42, 0.55);
}
html.js .r2l-histoire__pile-card.is-right {
  z-index: 2;
  opacity: 0.5;
  transform: translate(-10%, -50%) scale(0.85) rotateY(-14deg);
}
html.js .r2l-histoire__pile-card.is-left {
  z-index: 2;
  opacity: 0.5;
  transform: translate(-90%, -50%) scale(0.85) rotateY(14deg);
}

.r2l-histoire__pile-legende {
  margin-top: 22px;
  font-size: 13.5px;
  color: var(--r2l-terre-corps);
  line-height: 1.55;
}

/* A11y : pas d'animation de transition sous reduced-motion (le JS ne cycle pas non plus). */
@media (prefers-reduced-motion: reduce) {
  .r2l-histoire__pile-card { transition: none; }
}

/* ════════════════════════════════════
   BANDEAU CHIFFRES CLÉS
   ════════════════════════════════════ */
.r2l-histoire__stats {
  margin-top: clamp(3rem, 6vw, 5rem);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  border-top: 1px solid var(--r2l-sable-4);
  padding-top: clamp(2.25rem, 4vw, 3.25rem);
}

.r2l-histoire__stat {
  position: relative;
}

.r2l-histoire__stat-num {
  display: inline-block;
  font-family: var(--r2l-font-titres);
  font-weight: 600;
  font-size: clamp(2.125rem, 3.4vw, 2.875rem); /* 34–46px */
  color: var(--r2l-charbon);
  line-height: 1;
  letter-spacing: -0.02em;
}

/* Filet animé sous le chiffre au hover */
.r2l-histoire__stat-num::after {
  content: "";
  display: block;
  height: 2px;
  width: 0;
  margin-top: 6px;
  background: var(--r2l-terre-sec);
  opacity: 0.45;
  transition: width 0.5s var(--r2l-ease-reveal);
}

.r2l-histoire__stat:hover .r2l-histoire__stat-num::after {
  width: 34px;
}

.r2l-histoire__stat-lbl {
  display: block;
  margin-top: 4px;
  font-size: 13.5px;
  color: var(--r2l-terre-corps);
  font-weight: 500;
  max-width: 18ch;
}

/* ════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════ */
@media (max-width: 880px) {
  .r2l-histoire__bento {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .r2l-histoire__photo {
    min-height: 360px;
  }

  .r2l-histoire__statement {
    max-width: 24ch;
  }

  .r2l-histoire__stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 30px 24px;
  }
}

@media (max-width: 460px) {
  .r2l-histoire__stats {
    grid-template-columns: 1fr 1fr;
  }
}
