/* ============================================================
   Section « Comment ça marche » — carrousel crossfade + stepper
   Fond : sable-1. Accent : Terre (--r2l-terre-sec).
   Progressive enhancement : html.js conditionne le crossfade.
   ============================================================ */

.r2l-ccm {
  /* Halo blanc en tête sur sable-1 partagé avec .r2l-avis → ligne de couture
     douce à la jointure Avis ↔ Comment ça marche (miroir de .r2l-histoire). */
  background:
    radial-gradient(120% 80% at 50% -10%, #fff 0%, rgba(255,255,255,0) 55%),
    var(--r2l-sable-1);
  color: var(--r2l-charbon);
  padding: clamp(3.5rem, 8vw, 6.5rem) clamp(1.25rem, 5vw, 4rem);
  --r2l-ccm-accent:      var(--r2l-terre-sec);
  --r2l-ccm-accent-tint: rgba(139,115,85,.12);
}

.r2l-ccm__inner { max-width: var(--r2l-container); margin: 0 auto; }

/* ── Entête (centré) ─────────────────────────────────────── */

.r2l-ccm__head {
  text-align: center;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.r2l-ccm__head .r2l-eyebrow {
  justify-content: center;
}

.r2l-ccm__title {
  font-family: var(--r2l-font-titres);
  font-weight: 700;
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -.02em;
  margin: var(--r2l-s-2) 0 0;
  color: var(--r2l-charbon);
}

.r2l-ccm__title em {
  font-style: normal;
  color: var(--r2l-ccm-accent);
}

/* ── Carte ───────────────────────────────────────────────── */

.r2l-ccm__card {
  background: linear-gradient(108deg,#fff 0%,#fff 55%,var(--r2l-sable-3) 130%);
  border: 1px solid var(--r2l-sable-4);
  border-radius: 26px;
  box-shadow: 0 1px 2px rgba(44,40,42,.04),0 24px 60px -36px rgba(44,40,42,.28);
  overflow: hidden;
}

/* ── Track + slides ──────────────────────────────────────── */

/* No-JS : slides en flux normal, tout visible */
.r2l-ccm__slide {
  display: grid;
  grid-template-columns: minmax(0,46%) minmax(0,54%);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
  padding: clamp(1.75rem, 4vw, 3.25rem);
}

/* JS : superposition sur une seule cellule de grille → crossfade */
html.js .r2l-ccm__track {
  position: relative;
  display: grid;
}

html.js .r2l-ccm__slide {
  grid-column: 1;
  grid-row: 1;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .55s ease, visibility .55s;
}

html.js .r2l-ccm__slide.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ── Illustration ────────────────────────────────────────── */

.r2l-ccm__illu {
  border-radius: 18px;
  overflow: hidden;
  background: var(--r2l-sable-2);
  aspect-ratio: 3 / 2;
}

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

/* ── Corps textuel ───────────────────────────────────────── */

.r2l-ccm__body { padding: 6px 4px; }

.r2l-ccm__meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: var(--r2l-s-3);
}

.r2l-ccm__num {
  font-family: var(--r2l-font-titres);
  font-weight: 800;
  font-size: clamp(2.125rem, 4vw, 2.875rem);
  line-height: 1;
  color: var(--r2l-ccm-accent);
}

.r2l-ccm__num-sep {
  width: 1px;
  height: 26px;
  background: var(--r2l-sable-4);
  flex-shrink: 0;
}

.r2l-ccm__role {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--r2l-ccm-accent);
}

.r2l-ccm__step-title {
  font-family: var(--r2l-font-titres);
  font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 2.375rem);
  line-height: 1.08;
  letter-spacing: -.015em;
  margin: 0 0 var(--r2l-s-2);
  color: var(--r2l-charbon);
}

.r2l-ccm__step-text {
  font-size: clamp(.9375rem, 1.5vw, 1.125rem);
  line-height: 1.62;
  color: var(--r2l-terre-corps);
  max-width: 46ch;
  margin: 0;
}

/* ── Stepper ─────────────────────────────────────────────── */

.r2l-ccm__nav { margin-top: clamp(2rem, 4vw, 2.75rem); }

.r2l-ccm__stepper {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.r2l-ccm__step-btn {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: var(--r2l-font-corps);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  padding: 9px 16px;
  border-radius: 12px;
  color: var(--r2l-terre-sec);
  transition: background .22s, border-color .22s, color .22s;
}

.r2l-ccm__step-btn:hover {
  background: #fff;
  border-color: var(--r2l-sable-4);
}

.r2l-ccm__sn {
  font-family: var(--r2l-font-titres);
  font-weight: 700;
  font-size: 15px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--r2l-sable-3);
  color: var(--r2l-terre-corps);
  transition: background .22s, color .22s;
}

.r2l-ccm__st {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
}

.r2l-ccm__step-btn.is-active {
  background: #fff;
  border-color: var(--r2l-sable-4);
  color: var(--r2l-charbon);
}

.r2l-ccm__step-btn.is-active .r2l-ccm__sn {
  background: var(--r2l-ccm-accent);
  color: #fff;
}

.r2l-ccm__step-btn:focus-visible {
  outline: 2px solid var(--r2l-ccm-accent);
  outline-offset: 2px;
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 760px) {
  .r2l-ccm__slide {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .r2l-ccm__step-btn .r2l-ccm__st {
    display: none;
  }

  .r2l-ccm__step-btn {
    padding: 9px;
  }
}

/* ── Barre de progression auto-play ─────────────────────── */

.r2l-ccm__progress {
  height: 3px;
  background: rgba(139,115,85,.12);
}

.r2l-ccm__progress-bar {
  height: 100%;
  background: var(--r2l-ccm-accent);
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform;
}

.r2l-ccm__progress-bar.is-running {
  animation: r2l-ccm-bar 8s linear forwards;
}

@keyframes r2l-ccm-bar {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* ── Accessibilité mouvement ─────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html.js .r2l-ccm__slide {
    transition: none;
  }

  .r2l-ccm__progress { display: none; }
}
