/* Testimonials layout */
#testimonials .container {
  max-width: var(--content-max);
}

/* Card box */
#testimonials .testimonial-container {
  position: relative; /* important */
  overflow: hidden; /* important */

  max-width: var(--content-max);
  margin: 0 auto;

  background: rgba(255, 255, 255, 0.82);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);

  padding: clamp(1rem, 2.25vw, 2rem);

  transition: height 320ms ease;
  will-change: height;
}

/* Slides */
#testimonials .testimonial {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;

  opacity: 0;
  transform: translateY(0.5rem);
  transition:
    opacity 260ms ease,
    transform 320ms cubic-bezier(0.22, 1, 0.36, 1);

  pointer-events: none;
  will-change: opacity, transform;
}

/* Make the active slide a column so gap is real layout height */
#testimonials .testimonial.active {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem; /* controls space between paragraph and name */
}

/* Keep your visible state */
#testimonials .testimonial.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Remove margins so height measurement includes spacing via gap */
#testimonials .testimonial p {
  max-width: 90ch;
  margin: 0;
  font-size: 1.2em;
  font-weight: 600;
  line-height: 1.85;
  color: #0a2463;
  text-align: left;
}

#testimonials .testimonial h3 {
  margin: 0;
  font-size: 1.1em;
  font-weight: 700;
  color: #cd533b;
  text-align: center;
  font-style: italic;
}

/* Dots */
#testimonials .controls {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 1.25rem;
  gap: 10px;
}

#testimonials .controls .dot {
  width: 12px;
  height: 12px;
  background: #ddd;
  border-radius: 50%;
  cursor: pointer;
}

#testimonials .controls .dot.active {
  background: #484d55;
}
