/* ====================================
   Testimonials Section — Carousel
   ==================================== */

.testimonials-section {
  padding: 100px 0;
  position: relative;
  z-index: 1;
}

.testimonial-carousel {
  max-width: 720px;
  margin: 48px auto 0;
  text-align: center;
}

/* Stage — holds the crossfading slides */
.testimonial-stage {
  position: relative;
  overflow: hidden;
  transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  touch-action: pan-y pinch-zoom;
}

@media (hover: hover) {
  .testimonial-stage {
    cursor: grab;
  }
  .testimonial-stage:active {
    cursor: grabbing;
  }
}

.testimonial-slide {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.testimonial-slide.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Quote */
.testimonial-quote {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(18px, 2.5vw, 24px);
  line-height: 1.6;
  color: var(--text-primary);
  font-style: normal;
  letter-spacing: -0.3px;
}

.testimonial-quote::before {
  content: '\201C';
  display: block;
  font-family: 'Instrument Serif', serif;
  font-size: 64px;
  line-height: 0.5;
  color: var(--border);
  margin-bottom: 20px;
}

/* Author tabs */
.testimonial-tabs {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-top: 48px;
  border-top: 1px solid var(--border-light);
}

.testimonial-tab {
  flex: 1;
  max-width: 200px;
  padding: 20px 16px 16px;
  background: none;
  border: none;
  border-top: 2px solid transparent;
  margin-top: -1px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  position: relative;
  transition: all 0.3s ease;
}

.testimonial-tab.active {
  border-top-color: var(--text-primary);
}

.tab-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.testimonial-tab.active .tab-name {
  color: var(--text-primary);
}

.tab-company {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.testimonial-tab.active .tab-company {
  opacity: 1;
}

.testimonial-tab:hover .tab-name {
  color: var(--text-primary);
}

/* Progress bar inside active tab */
.tab-progress {
  position: absolute;
  top: -2px;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--text-primary);
  display: none;
}

.testimonial-tab.active .tab-progress {
  display: block;
  animation: tabProgress 6s linear forwards;
}

@keyframes tabProgress {
  from { width: 0; }
  to { width: 100%; }
}

/* Inline author (hidden on desktop, shown on mobile) */
.testimonial-author {
  display: none;
}

/* Responsive */
@media (max-width: 600px) {
  .testimonials-section {
    padding: 60px 0;
  }

  .testimonial-carousel {
    margin-top: 28px;
  }

  .testimonial-quote {
    font-size: 17px;
    line-height: 1.65;
    letter-spacing: -0.2px;
  }

  .testimonial-quote::before {
    font-size: 44px;
    margin-bottom: 12px;
  }

  /* Show inline author below quote on mobile */
  .testimonial-author {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
  }

  .author-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
  }

  .author-company {
    font-size: 12px;
    color: var(--text-muted);
  }

  /* Better touch handling on mobile */
  .testimonial-stage {
    user-select: none;
    -webkit-user-select: none;
  }

  /* Convert tabs to dot indicators on mobile */
  .testimonial-tabs {
    border-top: none;
    margin-top: 28px;
    gap: 10px;
    justify-content: center;
  }

  .testimonial-tab {
    flex: none;
    max-width: none;
    width: 8px;
    height: 8px;
    padding: 0;
    border-radius: 50%;
    background: var(--border);
    border: none;
    border-top: none;
    margin-top: 0;
    overflow: hidden;
    transition: all 0.3s ease;
  }

  .testimonial-tab.active {
    background: var(--text-primary);
    border-top-color: transparent;
    width: 24px;
    border-radius: 4px;
  }

  /* Hide text inside tabs on mobile */
  .tab-company,
  .tab-name,
  .tab-progress {
    display: none;
  }
}

/* Responsive — Short viewports */
@media (max-height: 720px) {
  .testimonials-section {
    padding: 64px 0;
  }

  .testimonial-carousel {
    margin-top: 32px;
  }

  .testimonial-tabs {
    margin-top: 32px;
  }

  .testimonial-quote {
    font-size: clamp(16px, 2vw, 20px);
  }
}
