/**
 * @file
 * Testimonials component styles
 */

.testimonials {
  padding: var(--spacing-xxl) 0;
  margin: var(--spacing-xxl) 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  color: #FFFFFF;
  /* Default gradient background when no image is provided */
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
}

/* Dark overlay only when background image is present */
.testimonials[style*="background-image"]::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1;
}

/* No overlay when no background image - gradient is sufficient */
.testimonials:not([style*="background-image"])::before {
  display: none;
}

.testimonials__header {
  position: relative;
  z-index: 2;
  text-align: center;
  margin-bottom: var(--spacing-xl);
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 var(--spacing-md);
}

.testimonials__heading {
  font-size: clamp(2rem, 4vw, 2.5rem);
  font-weight: 700;
  color: #FFFFFF;
  margin: 0 0 var(--spacing-md);
}

.testimonials__lede {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.6;
  margin: 0;
}

.testimonials__carousel-wrapper {
  position: relative;
  z-index: 2;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

.testimonials__carousel {
  overflow: hidden;
  margin: 0 50px;
}

.testimonials__track {
  display: flex;
  align-items: stretch;
  transition: transform 0.5s ease;
  gap: var(--spacing-lg);
}

.testimonial-card {
  background-color: var(--color-secondary);
  border-radius: 12px;
  padding: var(--spacing-lg);
  display: flex;
  flex-direction: column;
  flex: 0 0 calc((100% - 2 * var(--spacing-lg)) / 3);
  min-width: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  max-height: 450px;
  height: 450px;
  overflow: hidden;
}

.testimonial__body {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.testimonial__quote {
  font-size: 1.125rem;
  line-height: 1.7;
  color: #FFFFFF;
  margin: 0 0 var(--spacing-md);
  flex: 1;
  font-style: normal;
  font-weight: 400;
  overflow-y: auto;
  padding-right: 6px;
  min-height: 0;
  max-height: 100%;
}

.testimonial__quote::before,
.testimonial__quote::after {
  content: '';
}

.testimonial__meta {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-top: auto;
}

.testimonial__avatar {
  flex-shrink: 0;
}

.testimonial__avatar img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.testimonial__author {
  font-weight: 700;
  font-size: 0.875rem;
  color: #FFFFFF;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

.testimonial__role {
  display: none;
}

/* Carousel Navigation */
.testimonials__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  transition: background 0.3s ease, transform 0.2s ease;
  color: var(--color-secondary);
}

.testimonials__arrow:hover {
  background: #FFFFFF;
  transform: translateY(-50%) scale(1.1);
}

.testimonials__arrow:active {
  transform: translateY(-50%) scale(0.95);
}

.testimonials__arrow--prev {
  left: 0;
}

.testimonials__arrow--next {
  right: 0;
}

.testimonials__arrow:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.testimonials__arrow:disabled:hover {
  transform: translateY(-50%);
}

.testimonials__pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: var(--spacing-lg);
  z-index: 2;
  position: relative;
}

.testimonials__pagination-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.3s ease, transform 0.2s ease;
}

.testimonials__pagination-dot:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: scale(1.2);
}

.testimonials__pagination-dot.active {
  background: #FFFFFF;
  transform: scale(1.3);
}

/* Responsive */
@media (max-width: 992px) {
  .testimonial-card {
    flex: 0 0 calc((100% - var(--spacing-lg)) / 2);
    max-height: 480px;
    height: 480px;
  }
}

@media (max-width: 768px) {
  .testimonials {
    padding: var(--spacing-xl) 0;
    margin: var(--spacing-xl) 0;
  }

  .testimonials__carousel-wrapper {
    padding: 0 var(--spacing-md);
  }

  .testimonials__carousel {
    margin: 0 40px;
  }

  .testimonial-card {
    flex: 0 0 100%;
    padding: var(--spacing-md);
    max-height: 420px;
    height: 420px;
  }

  .testimonial__quote {
    font-size: 1rem;
  }

  .testimonials__arrow {
    width: 40px;
    height: 40px;
  }

  .testimonials__arrow svg {
    width: 20px;
    height: 20px;
  }
}
