/* ===== PRM Testimonials — Carousel Component ===== */

/* Optional full-bleed wrapper if the theme is boxed */
.prm-fullbleed { width: 100vw; margin-left: 50%; transform: translateX(-50%); }

/* --- Tokens --- */
.prm-testimonials {
  --gap: clamp(16px, 2.5vw, 32px);     /* gap between testimonials and arrows */
  --dur: 420ms;
  --ease: cubic-bezier(.22,.61,.36,1);
  position: relative;
  width: 100%;
  max-width: 100%;
}

.prm-testimonials__empty {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

/* Title spacing lives outside the viewport so it never clips peeks */
.prm-testimonials__title { 
  text-align: center; 
  margin: 0 0 clamp(16px, 3vw, 32px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.prm-testimonials__viewport {
  position: relative;
  width: 100%;
  overflow: hidden;
  /* Enable touch gestures for swipe navigation */
  touch-action: pan-y pinch-zoom; /* Allow vertical scroll and pinch, but handle horizontal swipe */
}

/* Track: UL contains all slides, positioned by JS */
.prm-testimonials__track {
  display: flex;
  gap: var(--gap);
  list-style: none;
  margin: 0;
  padding: 0;
  will-change: transform;
  transition: transform var(--dur) var(--ease);
  width: max-content;
  flex-wrap: nowrap;
}

/* Slides are LIs - sized dynamically by JS */
.prm-testimonials__slide {
  flex: 0 0 auto;
  min-width: 0;
  display: grid;
  place-items: center;
  min-height: clamp(220px, 28vw, 360px);
  padding: clamp(16px, 4vw, 32px);
  box-sizing: border-box;
  opacity: 0;
  transform: scale(.94);
  will-change: opacity, transform;
  transition:
    opacity var(--dur) var(--ease),
    transform var(--dur) var(--ease);
  position: relative;
}

/* 3-state system set by JS */
.prm-testimonials__slide.is-active { 
  opacity: 1; 
  transform: scale(1); 
  z-index: 2;
}
.prm-testimonials__slide.is-prev,
.prm-testimonials__slide.is-next { 
  opacity: 0.17;                       /* 17% opacity as per design */
  transform: scale(.96); 
  z-index: 1;
  visibility: visible;
  display: grid;
}

/* Controls positioned between testimonials on desktop */
.prm-testimonials__controls {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  pointer-events: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
  /* On desktop, buttons are positioned between testimonials by JS */
  /* On mobile, they're at the edges via flexbox */
  padding-inline: clamp(16px, 4vw, 32px);
}

.prm-testimonials__btn { 
  pointer-events: auto;
  position: relative;
  flex-shrink: 0;
  /* Ensure both buttons are always visible */
  visibility: visible !important;
  opacity: 1 !important;
  display: grid !important;
  place-items: center !important;
  align-items: center !important;
  justify-items: center !important;
  /* Token .prm-nav-button provides the core button styles */
  /* Ensure SVG is perfectly centered */
  padding: 0 !important;
  text-align: center;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .prm-testimonials__track,
  .prm-testimonials__slide { transition: none !important; }
}

/* Testimonial Content - Elementor controlled styles */
.prm-testimonials__quote {
  text-align: center;
  font-size: clamp(18px, 2.6vw, 28px);
  line-height: 1.4;
  max-width: 48ch;
  margin: 0 auto 18px;
  font-style: normal;
}

.prm-testimonials__quote p {
  margin: 0 0 12px;
}

.prm-testimonials__quote p:last-child {
  margin-bottom: 0;
}

.prm-testimonials__meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2vw, 20px);
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.prm-testimonials__logo-wrapper {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.prm-testimonials__logo {
  max-width: clamp(60px, 8vw, 100px);
  max-height: clamp(60px, 8vw, 100px);
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.prm-testimonials__author-wrapper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 0;
  gap: 0.25em;
}

/* When no logo exists, author-wrapper takes full width */
.prm-testimonials__meta:not(.prm-testimonials__meta--has-logo) .prm-testimonials__author-wrapper {
  width: 100%;
  flex: none;
}

/* Author and role colors are controlled by Elementor */

/* Navigation Button Styles - Elementor controlled */
/* Testimonials-specific button sizing (responsive overrides) */
.prm-testimonials__btn.prm-nav-button,
.prm-testimonials__btn {
  display: grid !important;
  place-items: center !important;
  align-items: center !important;
  justify-items: center !important;
}

/* Override any pink/red focus backgrounds from theme or browser defaults */
.prm-testimonials__btn:focus,
.prm-testimonials__btn:focus-visible {
  background: rgba(255, 255, 255, 0.68) !important;
  border-color: #0093BE !important;
  outline: none !important;
  box-shadow: none !important;
}

.prm-testimonials__btn svg {
  width: 24px;
  height: 24px;
  color: #0093BE;
  stroke: currentColor;
  display: block;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  position: relative;
  grid-column: 1;
  grid-row: 1;
  /* Ensure SVG is centered within its grid cell */
  align-self: center;
  justify-self: center;
}

/* Screen reader only text */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
  /* Ensure sr-only doesn't affect grid layout */
  grid-column: 1;
  grid-row: 1;
  opacity: 0;
  pointer-events: none;
}

.prm-testimonials--highlight .prm-testimonials__slide.is-active {
  background-color: #F1F1F1;
  border-radius: 10px;
  padding: clamp(32px, 6vw, 48px);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.08);
}

/* Responsive - Tablet and Mobile */
@media (max-width: 1024px) {
  /* Hide prev/next testimonials visually, but keep in layout for proper positioning */
  .prm-testimonials__slide.is-prev,
  .prm-testimonials__slide.is-next {
    visibility: hidden !important;
    opacity: 0 !important;
    /* Keep display: grid to maintain flex layout for offset calculations */
  }
  
  /* Ensure active slide is always visible on mobile */
  .prm-testimonials__slide.is-active {
    display: grid !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  /* Hide clone slides on mobile (they're only needed for desktop infinite scroll) */
  .prm-testimonials__slide.is-clone {
    display: none !important;
  }
  
  /* Ensure all non-clone slides maintain their layout space */
  .prm-testimonials__slide:not(.is-clone) {
    display: grid !important;
  }
  
  /* Increase slide padding on mobile to prevent button overlap */
  .prm-testimonials__slide {
    padding: clamp(24px, 6vw, 48px) clamp(60px, 12vw, 80px) !important;
  }
  
  /* Add extra padding to quote content on mobile */
  .prm-testimonials__quote {
    padding-inline: clamp(8px, 2vw, 16px);
    margin-bottom: clamp(16px, 4vw, 24px) !important;
  }
  
  /* Add spacing to meta on mobile */
  .prm-testimonials__meta {
    margin-top: clamp(12px, 3vw, 20px);
    gap: clamp(10px, 2.5vw, 16px);
  }
  
  /* Logo sizing on mobile */
  .prm-testimonials__logo {
    max-width: clamp(50px, 10vw, 80px);
    max-height: clamp(50px, 10vw, 80px);
  }
  
  /* Author wrapper maintains flex layout on mobile */
  .prm-testimonials__meta--has-logo .prm-testimonials__author-wrapper {
    flex: 1;
    min-width: 0;
  }
  
  /* Position arrows at edges on tablet/mobile with more spacing */
  .prm-testimonials__controls {
    padding-inline: clamp(12px, 3vw, 20px);
    z-index: 10;
  }
  
  .prm-testimonials__btn {
    width: 40px;
    height: 40px;
    /* Ensure buttons don't overlap content */
    position: absolute;
    display: grid !important;
    place-items: center !important;
    align-items: center !important;
    justify-items: center !important;
    padding: 0 !important;
    text-align: center;
  }
  
  .prm-testimonials__btn.prev {
    left: clamp(12px, 3vw, 20px);
  }
  
  .prm-testimonials__btn.next {
    right: clamp(12px, 3vw, 20px);
  }

  .prm-testimonials--highlight .prm-testimonials__btn.prev {
    left: clamp(20px, 5vw, 32px);
  }

  .prm-testimonials--highlight .prm-testimonials__btn.next {
    right: clamp(20px, 5vw, 32px);
  }
  
  .prm-testimonials__btn svg {
    width: 20px;
    height: 20px;
    display: block;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
  }
}
