.testimonial-carousel {
  width: 100vw;
  max-width: 1474px;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 0 60px 56px;
}

.testimonial-carousel-row {
  display: flex;
  align-items: center;
  gap: 20px;
}

.testimonial-carousel-viewport {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.testimonial-carousel-viewport::before,
.testimonial-carousel-viewport::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 27%;
  pointer-events: none;
  z-index: 2;
}

.testimonial-carousel-viewport::before {
  left: 0;
  background: linear-gradient(90deg, #e6f9e0 0%, rgba(230, 249, 224, 0) 75%);
}

.testimonial-carousel-viewport::after {
  right: 0;
  background: linear-gradient(270deg, #e6f9e0 0%, rgba(230, 249, 224, 0) 75%);
}

.testimonial-carousel-track {
  display: flex;
  gap: 24px;
  align-items: center;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

/* slide = ~50% of viewport → peek ≈ 25% per side ≈ half the card */
.testimonial-carousel-slide {
  flex: 0 0 calc(50% - 24px);
  opacity: 0.38;
  transition: opacity 0.5s ease;
}

.testimonial-carousel-slide .testimonial-card {
  transform: scaleY(0.72);
  transform-origin: center;
}

.testimonial-carousel-slide.is-active {
  opacity: 1;
}

.testimonial-carousel-slide.is-active .testimonial-card {
  transform: scaleY(1);
}

.testimonial-card {
  background: #d7f6cb;
  border: 1.5px solid transparent;
  border-radius: 20px;
  height: 360px;
  padding: 38px 48px 34px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.09);
  overflow: hidden;
  will-change: transform;
  transition:
    transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    background-color 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease;
}

/* Push side-card content toward the center so it's readable in the visible peek */
.testimonial-carousel-slide.is-left .testimonial-card {
  align-items: flex-end;
  text-align: right;
}

.testimonial-carousel-slide.is-right .testimonial-card {
  align-items: flex-start;
  text-align: left;
}

/* Attribution line stays centered regardless of card side */
.testimonial-carousel-slide.is-left .testimonial-card ._1031-15-text,
.testimonial-carousel-slide.is-right .testimonial-card ._1031-15-text {
  align-self: center;
  text-align: center;
}

.testimonial-carousel-slide.is-active .testimonial-card {
  background: transparent;
  border: 1.5px solid #d1d5db;
  box-shadow: none;
}

.testimonial-carousel-slide:not(.is-active) {
  cursor: pointer;
}

.testimonial-card ._1031_h_31_med.testimonial-quote.text-align-center._1031_green_2 {
  color: var(--green-2--basic-2);
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 26ch;
  margin-bottom: 20px;
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.testimonial-card ._1031-15-text {
  margin-top: 0;
}

/* Arrow buttons hidden */
.testimonial-carousel-btn {
  display: none;
}

/* Dots hidden — navigation via side card clicks */
.testimonial-carousel-dots {
  display: none;
}

.testimonial-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: rgba(49, 96, 72, 0.25);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background-color 0.3s;
}

.testimonial-dot.is-active {
  background-color: #316048;
}

/* Tablet */
@media (max-width: 991px) {
  .testimonial-carousel {
    padding: 0 32px 40px;
  }

  .testimonial-carousel-slide {
    flex: 0 0 calc(60% - 24px);
  }

  .testimonial-carousel-slide.is-active .testimonial-card {
    padding: 40px 36px;
    min-height: 220px;
  }

  .testimonial-card {
    height: 340px;
    padding: 34px 34px 30px;
  }

  .testimonial-card ._1031_h_31_med.testimonial-quote.text-align-center._1031_green_2 {
    max-width: 24ch;
  }
}

/* Mobile */
@media (max-width: 767px) {
  ._1031_basic_section._1031_testimonial {
    justify-content: flex-start;
    padding-top: 40px;
    padding-bottom: 40px;
    gap: 0;
  }

  /* Tighten heading-to-carousel gap */
  ._1031_basic_section._1031_testimonial ._1031_basic_container {
    margin-bottom: 24px;
  }

  .testimonial-carousel {
    padding: 0 0 40px;
  }

  /* Fixed peek: 20px left offset + card + 24px gap + ~56px peek = viewport */
  .testimonial-carousel-slide {
    flex: 0 0 calc(100vw - 100px);
    position: relative;
  }

  /* No height compression on mobile — all cards full height */
  .testimonial-carousel-slide .testimonial-card {
    transform: scaleY(1);
  }

  .testimonial-card {
    height: auto;
    padding: 32px 24px;
  }

  /* Override 21ch max-width constraint from Webflow — let quote fill the card */
  .testimonial-card ._1031_h_31_med.testimonial-quote.text-align-center._1031_green_2 {
    flex: none;
    max-width: 100%;
    display: block;
    text-wrap: pretty;
  }

  /* Active card: left-aligned text */
  .testimonial-carousel-slide.is-active .testimonial-card {
    align-items: flex-start;
    text-align: left;
  }

  /* Override desktop side-card text direction on mobile */
  .testimonial-carousel-slide.is-left .testimonial-card,
  .testimonial-carousel-slide.is-right .testimonial-card {
    align-items: flex-start;
    text-align: left;
  }

  .testimonial-carousel-slide.is-left .testimonial-card ._1031-15-text,
  .testimonial-carousel-slide.is-right .testimonial-card ._1031-15-text {
    align-self: flex-start;
    text-align: left;
  }

  /* Figma grey overlay on the peeking card — bounded by card height, not viewport */
  .testimonial-carousel-slide:not(.is-active)::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
      270deg,
      rgba(217, 217, 217, 0) 49.6%,
      rgba(115, 115, 115, 0.6) 126.4%
    );
    pointer-events: none;
    border-radius: 20px;
  }

  /* Hide both viewport fades on mobile — slide-level overlay handles the effect */
  .testimonial-carousel-viewport::before,
  .testimonial-carousel-viewport::after {
    display: none;
  }
}
