/* =============================================================
   ❋ EMILIE — Carrousel témoignages 3D coverflow "Galets dans la rivière"
   ============================================================= */
.testi-carousel {
  position: relative;
  margin: 40px auto 0;
  padding: 24px 0 80px;
  perspective: 1600px;
  perspective-origin: 50% 45%;
  min-height: 460px;
}

.testi-stage {
  position: relative;
  width: 100%;
  height: 460px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
}

.testi-track {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}

/* Override des testi-card pour le carrousel */
.testi-carousel .testi-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(480px, 88vw);
  max-height: 440px;
  margin: 0 !important;
  padding: 36px 36px 28px !important;
  background:
    linear-gradient(135deg, rgba(255,251,244,0.98) 0%, rgba(245,240,232,0.96) 100%) !important;
  border: 1px solid rgba(212, 175, 106, 0.28);
  border-radius: 18px;
  box-shadow:
    0 2px 6px rgba(58, 49, 40, 0.08),
    0 16px 32px rgba(58, 49, 40, 0.12),
    0 48px 80px -24px rgba(122, 158, 135, 0.22);
  transform: translate(-50%, -50%) translateZ(-1200px) scale(0.4);
  opacity: 0;
  transition:
    transform 720ms cubic-bezier(.22,.85,.2,1),
    opacity 540ms ease,
    box-shadow 540ms ease;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
  pointer-events: none;
  z-index: 1;
}

/* Position centrale (active) */
.testi-carousel .testi-card[data-pos="0"] {
  transform: translate(-50%, -50%) translateZ(0) scale(1);
  opacity: 1;
  z-index: 10;
  pointer-events: auto;
  box-shadow:
    0 4px 10px rgba(58, 49, 40, 0.10),
    0 24px 48px rgba(58, 49, 40, 0.14),
    0 72px 120px -32px rgba(193, 122, 90, 0.28);
}
/* Cartes adjacentes (1 place) */
.testi-carousel .testi-card[data-pos="-1"] {
  transform: translate(-50%, -50%) translate3d(-340px, 0, -260px) rotateY(28deg) scale(0.86);
  opacity: 0.68;
  z-index: 8;
  pointer-events: auto;
}
.testi-carousel .testi-card[data-pos="1"] {
  transform: translate(-50%, -50%) translate3d(340px, 0, -260px) rotateY(-28deg) scale(0.86);
  opacity: 0.68;
  z-index: 8;
  pointer-events: auto;
}
/* Cartes lointaines (2 places) */
.testi-carousel .testi-card[data-pos="-2"] {
  transform: translate(-50%, -50%) translate3d(-560px, 0, -520px) rotateY(42deg) scale(0.72);
  opacity: 0.32;
  z-index: 6;
}
.testi-carousel .testi-card[data-pos="2"] {
  transform: translate(-50%, -50%) translate3d(560px, 0, -520px) rotateY(-42deg) scale(0.72);
  opacity: 0.32;
  z-index: 6;
}
/* Cartes très loin (≥3) — invisibles */
.testi-carousel .testi-card:not([data-pos]),
.testi-carousel .testi-card[data-pos="-3"],
.testi-carousel .testi-card[data-pos="3"],
.testi-carousel .testi-card[data-pos="-4"],
.testi-carousel .testi-card[data-pos="4"] {
  opacity: 0;
  pointer-events: none;
}

/* Highlight bord supérieur */
.testi-carousel .testi-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212,175,106,0.55), transparent);
  z-index: 1;
}
/* Ornement coin top-left : flocon */
.testi-carousel .testi-card::after {
  content: '❋';
  position: absolute;
  top: 16px; left: 18px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  color: var(--lumiere-doree, #D4AF6A);
  opacity: 0.45;
  z-index: 1;
}

/* Étoiles repositionnées */
.testi-carousel .testi-stars {
  align-self: flex-end;
  font-size: 14px;
  color: var(--lumiere-doree, #D4AF6A);
  letter-spacing: 0.12em;
  margin-bottom: -6px;
}

.testi-carousel .testi-quote {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  line-height: 1.55;
  color: var(--texte-principal, #3A2E26);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.005em;
  margin: 0;
  overflow-y: auto;
  flex: 1;
  padding-right: 6px;
  /* Scrollbar fine personnalisée */
  scrollbar-width: thin;
  scrollbar-color: rgba(212,175,106,0.55) transparent;
}
.testi-carousel .testi-quote::-webkit-scrollbar { width: 5px; }
.testi-carousel .testi-quote::-webkit-scrollbar-thumb {
  background: rgba(212,175,106,0.55);
  border-radius: 4px;
}

/* Style spécial pour la card poésie */
.testi-carousel .testi-card.poesie .testi-quote {
  font-family: 'Caveat', cursive;
  font-size: 24px;
  font-style: normal;
  line-height: 1.4;
  text-align: center;
  color: var(--terre-sacree, #C17A5A);
  white-space: pre-line;
}

.testi-carousel .testi-author {
  font-family: 'Caveat', cursive;
  font-size: 26px;
  color: var(--foret-profonde, #7A9E87);
  text-align: right;
  line-height: 1;
  letter-spacing: 0.01em;
  margin-top: 4px;
  position: relative;
  padding-top: 12px;
}
.testi-carousel .testi-author::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 40px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--lumiere-doree, #D4AF6A));
}
.testi-carousel .testi-author small {
  display: block;
  font-family: 'Manrope', sans-serif;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(58,46,38,0.5);
  margin-top: 4px;
  font-weight: 500;
}

/* === Boutons navigation === */
.testi-arrow {
  position: absolute;
  top: 45%;
  transform: translateY(-50%);
  z-index: 20;
  width: 56px; height: 56px;
  background: rgba(255, 251, 244, 0.92);
  border: 1px solid rgba(212, 175, 106, 0.45);
  border-radius: 999px;
  cursor: pointer;
  color: var(--terre-sacree, #C17A5A);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow:
    0 4px 12px rgba(58, 49, 40, 0.12),
    0 12px 28px rgba(58, 49, 40, 0.10);
  transition: all 360ms cubic-bezier(.2,.7,.2,1);
  backdrop-filter: blur(6px);
}
.testi-arrow:hover {
  background: var(--terre-sacree, #C17A5A);
  color: #FBF7EE;
  border-color: var(--terre-sacree, #C17A5A);
  transform: translateY(-50%) scale(1.08);
  box-shadow: 0 6px 18px rgba(193, 122, 90, 0.35), 0 16px 36px rgba(193, 122, 90, 0.30);
}
.testi-arrow:active { transform: translateY(-50%) scale(0.96); }
.testi-arrow-prev { left: 1%; }
.testi-arrow-next { right: 1%; }

/* === Indicateurs (galets) === */
.testi-dots {
  position: absolute;
  bottom: 16px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 20;
}
.testi-dot {
  width: 10px; height: 10px;
  border: none;
  border-radius: 999px;
  background: rgba(122, 158, 135, 0.28);
  cursor: pointer;
  transition: all 360ms cubic-bezier(.2,.7,.2,1);
  position: relative;
  padding: 0;
}
.testi-dot:hover {
  background: rgba(212, 175, 106, 0.55);
  transform: scale(1.3);
}
.testi-dot.active {
  width: 28px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--lumiere-doree, #D4AF6A), var(--terre-sacree, #C17A5A));
  box-shadow: 0 0 12px rgba(212, 175, 106, 0.45);
}

/* === Counter === */
.testi-counter {
  position: absolute;
  top: 8px; right: 16px;
  font-family: 'Manrope', sans-serif;
  font-size: 11px;
  letter-spacing: 0.24em;
  color: rgba(58,46,38,0.45);
  z-index: 15;
  display: flex; gap: 6px;
}
.testi-counter .sep { color: var(--lumiere-doree, #D4AF6A); }
.testi-counter #testi-current { color: var(--terre-sacree, #C17A5A); font-weight: 600; }

/* === Mobile === */
@media (max-width: 720px) {
  .testi-carousel { padding: 16px 0 70px; min-height: 520px; }
  .testi-stage { height: 520px; }
  .testi-carousel .testi-card {
    width: 86vw;
    max-height: 480px;
    padding: 30px 24px 22px !important;
  }
  .testi-carousel .testi-card[data-pos="-1"] {
    transform: translate(-50%, -50%) translate3d(-200px, 0, -240px) rotateY(28deg) scale(0.78);
    opacity: 0.5;
  }
  .testi-carousel .testi-card[data-pos="1"] {
    transform: translate(-50%, -50%) translate3d(200px, 0, -240px) rotateY(-28deg) scale(0.78);
    opacity: 0.5;
  }
  .testi-carousel .testi-card[data-pos="-2"],
  .testi-carousel .testi-card[data-pos="2"] { opacity: 0; pointer-events: none; }
  .testi-arrow { width: 44px; height: 44px; }
  .testi-arrow-prev { left: 4px; }
  .testi-arrow-next { right: 4px; }
  .testi-carousel .testi-quote { font-size: 16px; line-height: 1.5; }
  .testi-carousel .testi-card.poesie .testi-quote { font-size: 21px; }
}

@media (max-width: 480px) {
  .testi-arrow { background: rgba(255,251,244,0.95); }
}

@media (prefers-reduced-motion: reduce) {
  .testi-carousel .testi-card {
    transition: opacity 200ms ease !important;
  }
  .testi-carousel { perspective: none; }
}

/* === Cacher l'ancienne testi-grid si elle existait encore === */
.testi-grid { display: none !important; }
