.testimonial-wall {
  --review-gap: 16px;
  padding: 22px 0 36px;
}

.testimonial-controls {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.testimonial-controls:has([hidden]) {
  display: none;
}

.testimonial-toggle {
  min-height: 44px;
}

.testimonial-toggle[hidden],
.testimonial-copy {
  display: none;
}

.testimonial-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--review-gap);
}

.testimonial-set {
  display: grid;
  gap: var(--review-gap);
  padding-bottom: var(--review-gap);
}

.testimonial-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 174px;
  margin: 0;
  padding: clamp(16px, 2vw, 26px);
  background: #fffdfa;
  border: 1px solid #e8dbcf;
  border-radius: 12px;
}

.testimonial-stars {
  color: #95551c;
  font-size: .87rem;
  letter-spacing: .17em;
  line-height: 1.3;
}

.testimonial-card blockquote {
  margin: 0;
  font-size: clamp(.95rem, 1.24vw, 1.08rem);
  line-height: 1.55;
}

.testimonial-card blockquote p {
  margin: 0;
}

.testimonial-card figcaption {
  display: grid;
  gap: 2px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #eee6de;
  font-size: .79rem;
  line-height: 1.45;
}

.testimonial-card figcaption span {
  color: var(--muted);
}

@keyframes testimonial-loop {
  from { transform: translateY(0); }
  to { transform: translateY(-50%); }
}

@media (prefers-reduced-motion: no-preference) {
  .testimonial-wall.is-animated .testimonial-column {
    height: 520px;
    overflow: hidden;
    mask-image: linear-gradient(to bottom, transparent, #000 26px, #000 calc(100% - 32px), transparent);
  }

  .testimonial-wall.is-animated .testimonial-track {
    /* Both sets include their trailing space, so exactly half the track is one loop. */
    animation: testimonial-loop 42s linear infinite;
  }

  .testimonial-wall.is-animated .testimonial-column:nth-child(2) .testimonial-track {
    animation-direction: reverse;
    animation-duration: 45s;
  }

  .testimonial-wall.is-animated .testimonial-column:nth-child(3) .testimonial-track {
    animation-duration: 44s;
  }

  .testimonial-wall.is-animated .testimonial-copy {
    display: grid;
  }

  .testimonial-wall.is-paused .testimonial-track,
  .testimonial-wall.is-outside-view .testimonial-track {
    animation-play-state: paused;
  }
}

@media (prefers-reduced-motion: no-preference) and (hover: hover) {
  .testimonial-wall .testimonial-column:hover .testimonial-track {
    animation-play-state: paused;
  }
}

@media (max-width: 680px) {
  .testimonial-columns {
    grid-template-columns: 1fr;
  }

  .testimonial-wall.is-animated .testimonial-columns {
    grid-template-columns: repeat(3, minmax(0, 84%));
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }

  .testimonial-wall.is-animated .testimonial-column {
    scroll-snap-align: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .testimonial-controls {
    display: none;
  }
}
