/* ===== Layout: featured (static, left) + slider (right) ===== */

.testimonials__layout {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 24px;
}

@media (min-width: 80rem) {
  .testimonials__layout {
    display: grid;
    grid-template-columns: 540px 1fr;
    gap: 41px;
    align-items: start;
  }
}

/* ===== Featured card (static, with photo) ===== */

.testimonials__featured {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
  background: var(--color-white-pure);
  border-radius: 12px;
  box-shadow: 0 60px 140px -16px rgba(37, 45, 61, 0.06);
  overflow: hidden;
}

@media (min-width: 80rem) {
  .testimonials__featured {
    max-width: none;
    width: 540px;
    height: 544px;
  }
}

.testimonials__featured-img {
  flex-shrink: 0;
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.testimonials__featured-img--placeholder {
  background-color: var(--color-brand-dark);
  background-image: var(--gradient-linear);
}

@media (min-width: 48rem) {
  .testimonials__featured-img { height: 290px; }
}

.testimonials__featured-icon {
  position: relative;
  flex-shrink: 0;
  margin-top: -45px;
  margin-left: 24px;
  width: 72px;
  height: 72px;
  filter: drop-shadow(0 50px 60px rgba(0, 0, 0, 0.08));
}

.testimonials__featured-icon svg {
  width: 100%;
  height: 100%;
}

@media (min-width: 48rem) {
  .testimonials__featured-icon {
    margin-left: 44px;
    width: 88px;
    height: 88px;
  }
}

.testimonials__featured-text {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 24px 24px 32px;
}

@media (min-width: 48rem) {
  .testimonials__featured-text {
    padding: 30px 44px 44px;
  }
}

.testimonials__featured-author {
  font-family: var(--font-poppins);
  font-weight: 600;
  font-size: 22px;
  line-height: 32px;
  color: var(--color-dark-darkest);
}

@media (min-width: 48rem) {
  .testimonials__featured-author {
    font-size: 30px;
    line-height: 42px;
  }
}

.testimonials__featured-quote {
  font-family: var(--font-poppins);
  font-weight: 400;
  font-size: 15px;
  line-height: 22px;
  color: var(--color-dark-darkest);
}

@media (min-width: 48rem) {
  .testimonials__featured-quote {
    font-size: 16px;
    line-height: 24px;
  }
}

/* ===== Slider (right side) ===== */

.testimonials__slider {
  --card-w: 100%;
  --card-gap: 16px;

  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
  gap: 24px;
  user-select: none;
}

@media (min-width: 48rem) {
  .testimonials__slider {
    --card-gap: 24px;
    gap: 32px;
  }
}

@media (min-width: 80rem) {
  .testimonials__slider {
    --card-w: 540px;
    --card-gap: 32px;
    max-width: none;
    margin: 0;
    width: calc(100% + 80px);
  }
}

/* Track: a 1×1 grid that stacks all slides into the same cell so the
 * row auto-sizes to the tallest content. Visible peek of the next
 * slide on desktop is created by overflow:hidden on the slider plus
 * translateX positioning of [data-pos] siblings. */

.testimonials__track {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto;
  width: 100%;
  overflow: hidden;
  touch-action: pan-y;
}

@media (min-width: 80rem) {
  .testimonials__track {
    -webkit-mask-image: linear-gradient(to right, #000 0, #000 70%, transparent 100%);
            mask-image: linear-gradient(to right, #000 0, #000 70%, transparent 100%);
  }
}

.testimonials__slide {
  grid-row: 1;
  grid-column: 1;
  align-self: stretch;
  width: var(--card-w);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 450ms var(--ease-out-expo),
    opacity   280ms linear;
}

/* Pre-JS fallback: show first slide before slider boots (avoids FOUC). */
.testimonials__slide:first-child:not([data-pos]) {
  opacity: 1;
  pointer-events: auto;
}

.testimonials__slide[data-pos="0"] {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.testimonials__slide[data-pos="-1"] {
  transform: translateX(calc(-1 * (var(--card-w) + var(--card-gap))));
}

.testimonials__slide[data-pos="1"] {
  transform: translateX(calc(var(--card-w) + var(--card-gap)));
}

.testimonials__slide[data-pos="-2"] {
  transform: translateX(calc(-2 * (var(--card-w) + var(--card-gap))));
}

.testimonials__slide[data-pos="2"] {
  transform: translateX(calc(2 * (var(--card-w) + var(--card-gap))));
}

/* Desktop: also reveal pos=1 (the peek). */
@media (min-width: 80rem) {
  .testimonials__slide[data-pos="1"] {
    opacity: 1;
    pointer-events: auto;
  }
}

/* ===== Quote card (text-only, brand gradient + texture) ===== */

.testimonials__quote-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 24px;
  padding: 24px;
  width: 100%;
  border-radius: 16px;
  background-color: var(--color-brand);
  background-image:
    linear-gradient(180deg, rgba(64, 114, 242, 0.42) 0%, rgba(45, 71, 172, 0.62) 100%),
    var(--testimonials-card-bg, url('/wp-content/themes/medspa/assets/images/testimonial-card-bg.webp'));
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  color: var(--color-white-pure);
}

@media (min-width: 48rem) {
  .testimonials__quote-card {
    gap: 40px;
    padding: 32px;
  }
}

@media (min-width: 80rem) {
  .testimonials__quote-card {
    gap: 64px;
    padding: 36px 28px;
  }
}

.testimonials__quote-author {
  font-family: var(--font-poppins);
  font-weight: 600;
  font-size: 20px;
  line-height: 28px;
  color: var(--color-white-pure);
}

@media (min-width: 48rem) {
  .testimonials__quote-author {
    font-size: 26px;
    line-height: 36px;
  }
}

@media (min-width: 80rem) {
  .testimonials__quote-author {
    font-size: 30px;
    line-height: 42px;
  }
}

.testimonials__quote-body {
  font-family: var(--font-poppins);
  font-weight: 400;
  font-size: 15px;
  line-height: 22px;
  color: var(--color-white-pure);
}

@media (min-width: 48rem) {
  .testimonials__quote-body {
    font-size: 16px;
    line-height: 24px;
  }
}

/* ===== Nav (prev / next) ===== */

.testimonials__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

@media (min-width: 48rem) {
  .testimonials__nav { gap: 20px; }
}

@media (min-width: 80rem) {
  .testimonials__nav {
    width: var(--card-w);
    justify-content: center;
  }
}

.testimonials__nav-btn {
  position: relative;
  width: 60px;
  height: 60px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  overflow: visible;
  transition: transform 200ms var(--ease-out-swift);
}

.testimonials__nav-btn svg {
  position: absolute;
  top: -32px;
  left: -40px;
  width: 140px;
  height: 140px;
  pointer-events: none;
}

.testimonials__nav-btn:hover { transform: translateY(-1px); }
.testimonials__nav-btn:active { transform: translateY(1px); }

.testimonials__nav-btn:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 4px;
  border-radius: 9999px;
}
