.testimonials {
  --tm-accent: #0e6f8f;
  --tm-accent-soft: rgba(14, 111, 143, .12);
  --tm-text: #1d2433;
  --tm-muted: #5f6b7d;
  --tm-border: #e3e8ee;
  --tm-radius: 1.25rem;
  --tm-gap: clamp(1rem, 2.5vw, 1.75rem);

  margin-block: 3rem;
}

.testimonials-header {
  margin-bottom: 1.5rem;
}

/* ---------- Grid ---------- */
.testimonials--grid .testimonials__track {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: var(--tm-gap);
}

/* ---------- Slider ---------- */
.testimonials--slider .testimonials__track {
  --tm-per-view: 3;

  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - (var(--tm-per-view) - 1) * var(--tm-gap)) / var(--tm-per-view));
  gap: var(--tm-gap);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: .5rem .25rem 1rem; /* room for card shadow */
}

.testimonials--slider .testimonials__track::-webkit-scrollbar {
  display: none;
}

.testimonials--slider .testimonial {
  scroll-snap-align: start;
}

.testimonials--slider .testimonials__track:focus-visible {
  outline: 3px solid var(--tm-accent);
  outline-offset: 4px;
  border-radius: var(--tm-radius);
}

@media (max-width: 1024px) {
  .testimonials--slider .testimonials__track { --tm-per-view: 2; }
}

@media (max-width: 640px) {
  .testimonials--slider .testimonials__track {
    grid-auto-columns: 85%; /* next card peeks in */
  }
}

/* Controls */
.testimonials__controls {
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
  margin-top: 1rem;
}

.testimonials__controls[hidden] {
  display: none;
}

.testimonials__nav {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1.5px solid var(--tm-accent);
  border-radius: 50%;
  background: #fff;
  color: var(--tm-accent);
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, opacity .2s ease;
}

.testimonials__nav svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.testimonials__nav:hover:not(:disabled) {
  background: var(--tm-accent);
  color: #fff;
}

.testimonials__nav:focus-visible {
  outline: 3px solid var(--tm-accent);
  outline-offset: 3px;
}

.testimonials__nav:disabled {
  opacity: .35;
  cursor: default;
}

/* ---------- Card ---------- */
.testimonial {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: 0;
  padding: 2rem 1.75rem 1.75rem;
  border: 1px solid var(--tm-border);
  border-radius: var(--tm-radius);
  background: #fff;
  color: var(--tm-text);
  box-shadow: 0 1px 3px rgba(16, 24, 40, .05), 0 10px 30px rgba(16, 24, 40, .06);
}

.testimonial__quote-mark {
  width: 2.25rem;
  height: auto;
  fill: var(--tm-accent);
  opacity: .25;
}

.testimonial__comment {
  flex: 1;
  margin: 0;
}

.testimonial__comment p {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.65;
}

.testimonial__author {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--tm-border);
}

.testimonial__avatar {
  flex: 0 0 auto;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  object-fit: cover;
}

.testimonial__avatar--initial {
  display: grid;
  place-items: center;
  background: var(--tm-accent-soft);
  color: var(--tm-accent);
  font-size: 1.35rem;
  font-weight: 700;
  text-transform: uppercase;
}

.testimonial__meta {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  min-width: 0;
}

.testimonial__name {
  font-size: 1rem;
  font-weight: 700;
}

.testimonial__company {
  color: var(--tm-muted);
  font-size: .9rem;
}

@media (prefers-reduced-motion: reduce) {
  .testimonials--slider .testimonials__track { scroll-behavior: auto; }
  .testimonials__nav { transition: none; }
}