/* ════════════════════════════════════════════════════════════════════════
   testimonials.css — turns the reviews grid into a swipeable carousel with a
   pill page-indicator + arrows. Native scroll-snap (touch/trackpad friendly);
   a small vanilla script drives the dots, arrows and autoplay.
   ════════════════════════════════════════════════════════════════════════ */

.tests-slider { position: relative; }

.ts-viewport {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  /* breathing room so card shadows/hover aren't clipped by the overflow */
  margin: 0 -6px;
  padding: 6px;
}
.ts-viewport::-webkit-scrollbar { display: none; }

.ts-track {
  display: flex;
  gap: 20px;
  align-items: stretch;
}

/* 3 per view on desktop, 2 on tablet, 1 on phone (gap = 20px) */
.ts-track > .test {
  flex: 0 0 calc((100% - 40px) / 3);
  scroll-snap-align: start;
}
@media (max-width: 991px) {
  .ts-track > .test { flex-basis: calc((100% - 20px) / 2); }
}
@media (max-width: 639px) {
  .ts-track > .test { flex-basis: 100%; }
}

/* keep all cards a consistent height — clamp the quote so the featured one
   doesn't blow the row out. Don't let the clamped -webkit-box flex-grow
   (that miscomputes height); pin the author to the bottom instead. */
.tests-slider .test .quote {
  display: -webkit-box;
  -webkit-line-clamp: 7;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 0 1 auto;
}
.tests-slider .test .author { margin-top: auto; }
/* robust author stack: explicit column + real gap so a 2-line name can never
   crowd the role (the 2px margin looked glued when the name wrapped). */
.tests-slider .test .author > :last-child {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.tests-slider .test .name { line-height: 1.2; }
.tests-slider .test .role { margin-top: 0; line-height: 1.3; }

/* ── controls row ── */
.ts-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 40px;
}

.ts-arrow {
  width: 50px; height: 50px;
  flex: 0 0 50px;
  border-radius: 50%;
  border: 1.5px solid var(--d-200);
  background: #fff;
  color: var(--d-800);
  display: flex; align-items: center; justify-content: center;
  transition: transform .18s ease, box-shadow .2s ease, border-color .2s ease, color .2s ease, opacity .2s ease;
}
.ts-arrow svg { width: 20px; height: 20px; }
.ts-arrow:hover:not(:disabled) {
  border-color: var(--r-600);
  color: var(--r-600);
  transform: translateY(-1px);
  box-shadow: var(--sh-md);
}
.ts-arrow:active:not(:disabled) { transform: translateY(0); }
.ts-arrow:disabled { opacity: 0.3; cursor: default; }

.ts-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ts-dot {
  width: 8px; height: 8px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: var(--d-200);
  cursor: pointer;
  transition: width .28s cubic-bezier(.4,.8,.3,1), background .2s ease;
}
.ts-dot:hover { background: var(--d-400); }
.ts-dot.on {
  width: 28px;
  background: var(--g-red);
}

@media (prefers-reduced-motion: reduce) {
  .ts-viewport { scroll-behavior: auto; }
}
