/* Testimonials Block Styles */
.testimonials-block {
  padding: 80px 40px;
  margin: 0 !important;
  max-width: 100% !important;
}

.testimonials-container {
  max-width: 1512px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.testimonials-heading {
  font-size: 24px;
  font-weight: 600;
  margin: 0;
  color: #f99c28;
  text-align: left;
}

/* Swiper Styles */
.testimonials-swiper {
  width: 100%;
  overflow: hidden;
  min-height: 400px;
  position: relative;
  touch-action: pan-y;
}

.testimonial-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  /* Aspect ratio 42:61 (w:h) */
  aspect-ratio: 42/72;
}

/* Separate background image element with grayscale filter */
.testimonial-background-image {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
}

/* Background video element with grayscale filter */
.testimonial-background-video {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  filter: grayscale(100%);
  z-index: 0;
}

.testimonial-video-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* White card overlay inside the testimonial - takes most of the space */
.testimonial-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  z-index: 3;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  /* Remove grayscale filter from white card content */
  filter: none;
  width: calc(100% - 100px);
  height: calc(100% - 100px);
  padding: 20px;
}

/* Profile image inside the white card - square, no grayscale */
.testimonial-profile-image {
  width: 100%;
  height: auto;
  aspect-ratio: 3/4;
  object-fit: cover;
  border: none;
  /* Ensure image is not affected by parent's grayscale filter */
  filter: none !important;
  margin-bottom: 20px;
}

/* Video container for positioning play button */
.testimonial-video-container {
  position: relative;
  width: 100%;
  margin-bottom: 20px;
}

/* Profile video inside the white card - square, no grayscale */
.testimonial-profile-video {
  width: 100%;
  height: auto;
  aspect-ratio: 3/4;
  object-fit: cover;
  border: none;
  /* Ensure video is not affected by parent's grayscale filter */
  filter: none !important;
  border-radius: 0;
  cursor: pointer;
}

/* Custom play button overlay */
.testimonial-play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: none;
  border: none;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
  opacity: 1;
  visibility: visible;
}

.testimonial-play-button:hover {
  transform: translate(-50%, -50%) scale(1.1);
  opacity: 0.8;
}

/* Hide play button when video is playing */
.testimonial-video-container.playing .testimonial-play-button {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Play button SVG styling */
.testimonial-play-button svg {
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
  transition: filter 0.3s ease;
}

.testimonial-play-button:hover svg {
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
}

/* Remove the old image container since we're using background */
.testimonial-image {
  display: none;
}

.testimonial-name {
  font-size: 30px;
  font-weight: 400;
  font-family: var(--wp--preset--font-family--pacifico);
  color: #f99c28;
  margin: 0 0 20px 0;
}

.testimonial-quote {
  font-size: 18px;
  font-weight: 500;
  color: #000000;
  opacity: 0.75;
  font-style: italic;
  margin: 0;
}

/* Enhanced styling for the new design */
.testimonial-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.3) 70%,
    rgba(0, 0, 0, 0.6) 100%
  );
  z-index: 2;
}

/* Ensure proper spacing in the white card */
.testimonial-content .testimonial-name {
  margin-bottom: 10px;
}

.testimonial-content .testimonial-quote {
  margin-top: 10px;
}

/* Swiper Navigation and Pagination */
.testimonials-swiper .swiper-slide {
  height: auto;
  min-height: 400px;
}

/* Ensure equal height slides */
.testimonials-swiper .swiper-wrapper {
  align-items: stretch;
}

.testimonials-swiper .swiper-slide {
  display: flex;
  flex-shrink: 0;
  width: auto;
}

/* Fallback styles when Swiper.js is not loaded */
.testimonials-fallback .swiper-wrapper {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  transform: none !important;
}

.testimonials-fallback .swiper-slide {
  transform: none !important;
  width: auto !important;
  margin: 0 !important;
}

/* Debug: Ensure testimonial cards are visible */
.testimonials-swiper {
  width: 100%;
  overflow: hidden;
  min-height: 400px;
}

.testimonials-swiper .swiper-wrapper {
  display: flex;
  align-items: stretch;
}

.testimonials-swiper .swiper-slide {
  flex-shrink: 0;
  width: auto;
}

@media (max-width: 768px) {
  .testimonials-block {
    padding: 80px 0;
  }

  .testimonials-heading {
    padding: 0 15px;
  }
}

@media (max-width: 480px) {
  .testimonial-name {
    font-size: 22px;
  }

  .testimonial-quote {
    font-size: 13px;
  }
}
