/* ===========================================
   TESTIMONIAL — "Ce qu'en disent nos clients."
   4 témoignages sur fond mint. Chaque card a sa couleur thème
   (yellow, violet, blue, orange) → shadow + avatar circle.
   Layout : 2 cols desktop/tablet, 1 col mobile.
   =========================================== */

.testimonial {
  display: flex;
  flex-direction: column;
  gap: 60px;
  padding: 100px 20px;
  background-color: var(--color-mint);
}

/* --- Titre --- */
.testimonial__heading {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 10px;
  font-size: 36px;
  font-weight: var(--fw-semibold);
  line-height: 54px;
  text-align: center;
  color: var(--color-text);
}

.testimonial__heading-accent {
  color: var(--color-bg);
}

/* --- Grid des 4 cards --- */
.testimonial__cards {
  display: grid;
  grid-template-columns: repeat(2, 350px);
  justify-content: center;
  gap: 60px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

/* --- Testimonial card ---
   Theme color appliquée via --testimonial-color (shadow + avatar). */
.testimonial-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 10px 30px 10px;
  background-color: var(--color-bg);
  border: 2px solid var(--color-text);
  box-shadow: 8px 8px 0 0 var(--testimonial-color, var(--color-accent));
}

.testimonial-card--yellow {
  --testimonial-color: var(--color-yellow);
}

.testimonial-card--violet {
  --testimonial-color: var(--color-violet);
}

.testimonial-card--blue {
  --testimonial-color: var(--color-blue);
}

.testimonial-card--orange {
  --testimonial-color: var(--color-accent);
}

/* Citation en italique */
.testimonial-card__quote {
  margin: 0;
  padding: 20px 10px;
  font-size: 20px;
  font-style: italic;
  line-height: 30px;
  color: var(--color-text);
}

/* Bas de card : nom à gauche, avatar à droite */
.testimonial-card__author {
  margin-top: auto;
  padding: 0 10px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.testimonial-card__name {
  margin: 0;
  font-size: 20px;
  line-height: 30px;
  color: var(--color-text);
  font-style: normal;
}

/* Prénom en gras orange */
.testimonial-card__name-accent {
  color: var(--color-accent);
  font-weight: var(--fw-bold);
}

/* Avatar rond avec initiale */
.testimonial-card__avatar {
  flex-shrink: 0;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background-color: var(--testimonial-color, var(--color-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: var(--fw-bold);
  line-height: 36px;
  color: var(--color-text);
}

/* ============================
   TABLET (768-1199px)
   2 cols toujours.
   ============================ */
@media (max-width: 1199px) {
  .testimonial__cards {
    grid-template-columns: repeat(2, 350px);
    max-width: 794px;
  }
}

/* ============================
   MOBILE (< 768px)
   1 col. Quote et nom shrinkent à 16/24.
   ============================ */
@media (max-width: 767px) {
  .testimonial {
    padding: 60px 20px;
  }

  .testimonial__heading {
    font-size: 32px;
    line-height: 48px;
    text-align: left;
    padding: 10px 20px;
  }

  .testimonial__cards {
    grid-template-columns: 1fr;
    max-width: 353px;
    gap: 30px;
  }

  .testimonial-card__quote,
  .testimonial-card__name {
    font-size: 16px;
    line-height: 24px;
  }
}

/* Reveal au scroll : titre slide-up, 4 cartes slide-from-right en
   cascade (droite → gauche, l'une après l'autre dans l'ordre DOM). */
@keyframes testimonial-slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes testimonial-slide-from-right {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

.js .testimonial__heading[data-reveal],
.js .testimonial__cards[data-reveal] .testimonial-card {
  opacity: 0;
}

.testimonial__heading.is-visible {
  animation: testimonial-slide-up 600ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.testimonial__cards.is-visible .testimonial-card {
  animation: testimonial-slide-from-right 600ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.testimonial__cards.is-visible .testimonial-card:nth-child(1) { animation-delay:   0ms; }
.testimonial__cards.is-visible .testimonial-card:nth-child(2) { animation-delay: 100ms; }
.testimonial__cards.is-visible .testimonial-card:nth-child(3) { animation-delay: 200ms; }
.testimonial__cards.is-visible .testimonial-card:nth-child(4) { animation-delay: 300ms; }

@media (prefers-reduced-motion: reduce) {
  .js .testimonial__heading[data-reveal],
  .js .testimonial__cards[data-reveal] .testimonial-card {
    opacity: 1;
    animation: none;
  }
}
