.column-page .testimonial-carousel {
  --testimonial-edge: 12px;
  --testimonial-card-width: clamp(290px, 34vw, 340px);
  position: relative;
  margin-top: 22px;
}

.column-page .testimonial-carousel-track.testimonial-grid {
  display: flex;
  grid-template-columns: none;
  align-items: stretch;
  gap: 20px;
  margin: 0;
  padding: 8px var(--testimonial-edge) 26px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scroll-behavior: smooth;
  scroll-padding-inline: var(--testimonial-edge);
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
}

.column-page .testimonial-carousel-track::-webkit-scrollbar {
  display: none;
}

.column-page .testimonial-carousel-track::after {
  content: "";
  flex: 0 0 max(var(--testimonial-edge), calc(100% - var(--testimonial-card-width) - var(--testimonial-edge)));
}

.column-page .testimonial-carousel-track > .testimonial-carousel-slide {
  display: flex;
  flex: 0 0 var(--testimonial-card-width);
  width: var(--testimonial-card-width);
  max-width: calc(100% - (var(--testimonial-edge) * 2));
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.column-page .testimonial-carousel-track .testimonial-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  height: auto;
}

/* Cards can be slides themselves. Keep the photo above the readable body. */
.column-page .testimonial-carousel-track .testimonial-card > img {
  flex: 0 0 auto;
  width: 100%;
  height: auto;
  aspect-ratio: 38 / 25;
  object-fit: cover;
}

.column-page .testimonial-carousel-track .testimonial-card-body {
  min-width: 0;
  flex: 1 0 auto;
}

.column-page .testimonial-carousel-track .testimonial-body {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.column-page .testimonial-carousel-track .testimonial-link {
  margin-top: auto;
}

.testimonial-carousel-controls {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.testimonial-carousel-arrow,
.testimonial-carousel-dot {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
}

.testimonial-carousel-arrow {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgb(13 47 79 / 20%);
  border-radius: 50%;
  color: #0d2f4f;
  background: #fff;
  box-shadow: 0 8px 20px rgb(13 47 79 / 10%);
  transition: color .18s, background-color .18s, border-color .18s, transform .18s;
}

.testimonial-carousel-arrow:hover,
.testimonial-carousel-arrow:focus-visible {
  border-color: #e77722;
  color: #fff;
  background: #e77722;
  transform: translateY(-2px);
}

.testimonial-carousel-arrow span {
  display: block;
  font-size: 20px;
  line-height: 1;
}

.testimonial-carousel-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.testimonial-carousel-dot {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border-radius: 50%;
  background: transparent;
}

.testimonial-carousel-dot::before {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgb(13 47 79 / 25%);
  content: "";
  transition: width .18s, background-color .18s;
}

.testimonial-carousel-dot.is-active::before {
  width: 28px;
  background: #e77722;
}

.testimonial-carousel-dot:focus-visible {
  outline: 2px solid #e77722;
  outline-offset: 4px;
}

@media (max-width: 768px) {
  .column-page .testimonial-carousel {
    --testimonial-edge: 16px;
    --testimonial-card-width: min(82vw, 320px);
    margin-inline: -16px;
  }

  .column-page .testimonial-carousel-track.testimonial-grid {
    gap: 16px;
    padding-bottom: 22px;
  }

  .testimonial-carousel-controls {
    flex-wrap: wrap;
    gap: 8px 16px;
  }

  .testimonial-carousel-arrow {
    width: 44px;
    height: 44px;
  }

  .testimonial-carousel-prev {
    order: 1;
  }

  .testimonial-carousel-next {
    order: 2;
  }

  .testimonial-carousel-dots {
    flex: 0 0 100%;
    order: 3;
  }
}

@media (prefers-reduced-motion: reduce) {
  .column-page .testimonial-carousel-track.testimonial-grid {
    scroll-behavior: auto;
  }

  .testimonial-carousel-arrow,
  .testimonial-carousel-dot,
  .testimonial-carousel-dot::before {
    transition: none;
  }
}
