/* ============================================================
   Testimonials — image-forward review cards. The reviewer's photo
   leads each card with an overlaid quote; an author bar (name +
   verified + DS stars) sits below. Tokens only.
   ============================================================ */

.lh-testimonials {
  padding-block: var(--section-pad-top) var(--section-pad-bottom);
  background: var(--surface-page);
}

.lh-testimonials__grid {
  display: grid;
  grid-template-columns: repeat(var(--lh-test-cols-mobile, 1), minmax(0, 1fr));
  gap: var(--grid-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ---- Carousel (horizontal scroll-snap track + arrows) ---- */
.lh-testimonials__carousel { position: relative; }
.lh-testimonials__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - (var(--lh-test-cols-mobile, 1) - 1) * var(--grid-gap)) / var(--lh-test-cols-mobile, 1));
  gap: var(--grid-gap);
  margin: 0;
  padding: 0 0 var(--space-2);
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.lh-testimonials__track::-webkit-scrollbar { display: none; }
.lh-testimonials__track > .lh-testimonials__cell { scroll-snap-align: start; }

.lh-testimonials__arrow {
  position: absolute;
  top: calc(50% - var(--space-6));
  z-index: 2;
  width: 44px;
  height: 44px;
  display: none;
  place-items: center;
  border-radius: var(--radius-circle);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md);
  color: var(--text-heading);
  cursor: pointer;
  transition: var(--transition-fast);
}
.lh-testimonials__arrow:hover { color: var(--color-primary); border-color: var(--color-primary); }
.lh-testimonials__arrow:disabled { opacity: 0.35; cursor: default; }
.lh-testimonials__arrow--prev { left: calc(-1 * var(--space-5)); }
.lh-testimonials__arrow--next { right: calc(-1 * var(--space-5)); }

.lh-testimonial {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: var(--transition-base);
}
.lh-testimonial:hover {
  border-color: transparent;
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

/* ---- Image-forward media well ---- */
.lh-testimonial__media {
  position: relative;
  aspect-ratio: 4 / 5; /* default = portrait; "Photo shape" overrides below */
  background: var(--lh-img-loader, none), var(--surface-image);
  overflow: hidden;
}
/* Photo shape — driven by the section setting, applied instantly. */
.lh-testimonials[data-photo-shape="portrait"] .lh-testimonial__media { aspect-ratio: 4 / 5; }
.lh-testimonials[data-photo-shape="square"] .lh-testimonial__media { aspect-ratio: 1 / 1; }
.lh-testimonials[data-photo-shape="tall"] .lh-testimonial__media { aspect-ratio: 2 / 3; }
.lh-testimonial__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-out);
}
.lh-testimonial:hover .lh-testimonial__img { transform: scale(1.04); }

.lh-testimonial__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: var(--space-5);
  background: var(--overlay-tile);
}
.lh-testimonial__quote {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--font-body-md);
  font-style: italic;
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  color: var(--text-on-dark);
  text-shadow: var(--shadow-text);
}

/* ---- No-image fallback: clean quote card ---- */
.lh-testimonial__quote-block {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-6) var(--space-6) var(--space-2);
}
.lh-testimonial__quote--plain {
  font-size: var(--font-body-md);
  font-style: normal;
  font-weight: var(--weight-regular);
  color: var(--text-body);
  text-shadow: none;
}

/* ---- Author bar ---- */
.lh-testimonial__author {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
}
.lh-testimonial__id {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.lh-testimonial__name-row {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.lh-testimonial__name {
  font-size: var(--font-body-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-heading);
}
.lh-testimonial__check {
  display: inline-flex;
  color: var(--color-instock);
}
.lh-testimonial__detail {
  font-size: var(--font-caption);
  color: var(--text-muted);
}

/* Rating + verified pushed to the right edge of the bar */
.lh-testimonial__rate {
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.lh-testimonial__verified {
  font-size: var(--font-caption);
  font-weight: var(--weight-medium);
  color: var(--color-instock);
  white-space: nowrap;
}

/* No-image avatar (initial) */
.lh-testimonial__avatar--initial {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--radius-circle);
  background: var(--color-primary-tint);
  color: var(--color-primary);
  font-family: var(--font-display);
  font-size: var(--font-body-lg);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
}
.lh-testimonial--no-image .lh-testimonial__rating { margin: 0; }

@media (min-width: 1024px) {
  .lh-testimonials__grid {
    grid-template-columns: repeat(var(--lh-test-cols, 3), minmax(0, 1fr));
    gap: var(--grid-gap-lg);
  }
  .lh-testimonials__track {
    grid-auto-columns: calc((100% - (var(--lh-test-cols, 3) - 1) * var(--grid-gap-lg)) / var(--lh-test-cols, 3));
    gap: var(--grid-gap-lg);
  }
  .lh-testimonials__arrow { display: grid; }
}

/* ---- Carousel dots ---- */
.lh-testimonials__dots {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-5);
}
/* .lh-carousel-dot now lives in base.css (shared by all [data-carousel]s). */
