/* ============================================================
   testimonials — "Real Women, Real Mornings" (brief/testimonials.md)
   Figma: desktop 3446:889 (1440) · mobile 3446:1935 (375). Pattern A (.container on the section).
   Templates (already linked page-wide by the scaffold — only markup + scoped overrides here):
     marquee  → photo strip (right → left, 5 unique tiles, JS clones)        D-T3 / BA-T1
     slider   → review cards, arrows below the track, state-driven disabled  D-T5 / D-T6 (FD-86)
   Fluid values per pipeline/components/fluid-formulas.md (section-scoped vars).
   Marquee layout values are FIXED px per band (marquee EXCEPTION rule).
   ============================================================ */

/* ---------- MOBILE (base, anchor 375) ---------- */
.testimonials {
  /* stars→title, title→lead, card↔card, card inner gap: M 10 / D 20 */
  --tm-gap-10-20: clamp(9px, calc(10px + (var(--max-vw) - 375px) * 0.015), 20px);
  /* head → photo strip: M 20 / D 40 */
  --tm-strip-mt: clamp(17px, calc(20px + (var(--max-vw) - 375px) * 0.015), 40px);
  /* photo strip → card track: M 20 / D 60 */
  --tm-track-mt: clamp(17px, calc(20px + (var(--max-vw) - 375px) * 0.015), 60px);
  /* card track → arrows: 30 / 30 */
  --tm-arrows-mt: clamp(26px, calc(30px + (var(--max-vw) - 375px) * 0.015), 30px);
  /* card padding-block: M 15 / D 20 ; padding-inline: M 10 / D 20 */
  --tm-card-pb: clamp(13px, calc(15px + (var(--max-vw) - 375px) * 0.015), 20px);
  --tm-card-pi: clamp(9px, calc(10px + (var(--max-vw) - 375px) * 0.015), 20px);
  /* rating row → quote: 15 / 15 */
  --tm-rating-gap: clamp(13px, calc(15px + (var(--max-vw) - 375px) * 0.015), 15px);
  /* head stars height: M 14 / D 24 */
  --tm-stars-h: clamp(12px, calc(14px + (var(--max-vw) - 375px) * 0.015), 24px);
  /* reviewer avatar: 40 / 40 */
  --tm-avatar: clamp(34px, calc(40px + (var(--max-vw) - 375px) * 0.015), 40px);
  /* photo tile — FIXED per band (marquee rule): M 92 / T 120 / D 150 */
  --tm-tile: 92px;
  /* card width: 315 at 375 (335 gutter box − 20) → 1 card + 30px peek */
  --tm-card-w: calc(100% - 20px);
  /* quote box keeps Figma's drawn height (D-T2): M 108 at 14px */
  --tm-quote-min: 7.715em;

  margin-top: var(--section-gap); /* founder → testimonials (D 120 / M 60) */
}

/* ---------- Head: stars + title + lead ---------- */
.testimonials__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--tm-gap-10-20);
  text-align: center;
}

.testimonials__stars img {
  width: auto;
  height: var(--tm-stars-h);
}

.testimonials__title {
  width: 100%;
  font-family: var(--font-display);
  font-variation-settings: var(--fv-display);
  font-weight: 400;
  font-size: var(--text-h2);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-heading);
  color: var(--color-heading);
  text-align: center;
}

/* title → lead gap (Figma 3446:903 / 3446:1944) = stars → title gap → the head's flex gap */
.testimonials__lead {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--text-lead);
  line-height: var(--lh-lead);
  color: var(--color-text);
}

/* ---------- Photo strip — MARQUEE (template overrides) ---------- */
.testimonials .testimonials__strip {
  /* full-bleed band: break out of the gutter on both sides (brief-page §1) */
  width: auto;
  margin-top: var(--tm-strip-mt);
  margin-inline: calc(-1 * var(--gutter));
  height: auto;
  padding: 0;
  background: none;
  column-gap: 10px; /* THE SEAM between tickers — equals the track gap */
}

/* FD-AX work-around: copies cloned INTO one ticker need the same gap between them */
.testimonials .marquee-ticker {
  column-gap: 10px;
}

.testimonials .slider-track {
  align-items: center;
  column-gap: 10px; /* tile ↔ tile, FIXED */
}

.testimonials .testimonials__tile {
  flex: 0 0 auto;
  width: var(--tm-tile);
  height: var(--tm-tile);
  max-width: none;
  border-radius: var(--radius-card);
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}

@media (prefers-reduced-motion: reduce) {
  .testimonials .marquee-ticker {
    animation-play-state: paused;
  }
}

/* ---------- Review slider — SLIDER (template overrides) ---------- */
.testimonials__slider {
  margin-top: var(--tm-track-mt);
}

/* Scroll track: full-bleed so the peek runs to the viewport edge; first card at the gutter.
   No width cap — scrollWidth > clientWidth on every band. scroll-snap-type / is-dragging are
   left to the template (not re-stated here, so .slides-blocks.is-dragging still wins). */
.testimonials .slides-blocks {
  margin-top: 0;
  margin-inline: calc(-1 * var(--gutter));
  padding: 0;
  padding-inline: var(--gutter);
  scroll-padding-inline: var(--gutter);
  gap: var(--tm-gap-10-20);
  align-items: stretch; /* equal-height cards (D-T2) */
}

/* Review card */
.testimonials .testimonials__card {
  flex: 0 0 var(--tm-card-w);
  width: auto;
  height: auto;
  overflow: visible;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: var(--tm-gap-10-20);
  /* Figma stroke is INSIDE (does not take layout space) → padding is measured from the outer
     edge: subtract the 1px border so the card is 413 x 275 / 315 x 233 as drawn */
  padding-block: calc(var(--tm-card-pb) - 1px);
  padding-inline: calc(var(--tm-card-pi) - 1px);
  border: 1px solid rgba(26, 26, 26, 0.2);
  border-radius: var(--radius-card);
  background: none; /* Figma fill #F8F7F1 is visible:false (D-T7) */
}

/* last card: the track's own end is a snap point → last card reachable */
.testimonials .testimonials__card:last-child {
  scroll-snap-align: end;
}

.testimonials__body {
  display: flex;
  flex-direction: column;
  gap: var(--tm-rating-gap);
}

.testimonials__rating {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.testimonials__score {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-body-fixed);
  line-height: var(--lh-ui);
  color: var(--color-ink);
}

.testimonials__rating img {
  flex: 0 0 auto;
  width: auto;
  height: var(--text-body-fixed);
}

.testimonials__quote {
  min-height: var(--tm-quote-min);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--text-body);
  line-height: var(--lh-ui);
  color: var(--color-text);
}

/* 1px rgba(72,72,72,.1) line; pinned (with the author row) to the card bottom.
   margin-bottom -1px keeps the line at zero net height, as drawn (Figma line h 0). */
.testimonials__divider {
  flex: 0 0 auto;
  height: 1px;
  margin-top: auto;
  margin-bottom: -1px;
  background: rgba(72, 72, 72, 0.1);
}

.testimonials__author {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  white-space: nowrap;
}

.testimonials__who {
  display: flex;
  align-items: center;
  gap: 10px;
}

.testimonials__avatar {
  flex: 0 0 auto;
  width: var(--tm-avatar);
  height: var(--tm-avatar);
  border-radius: var(--radius-round);
  object-fit: cover;
  background: #ECEBE0;
}

.testimonials__name {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-body);
  line-height: var(--lh-ui);
  color: var(--color-ink);
}

.testimonials__verified {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--text-body);
  line-height: var(--lh-ui);
  color: var(--color-success-text);
}

.testimonials__verified img {
  flex: 0 0 auto;
  width: var(--text-body-fixed);
  height: var(--text-body-fixed);
}

/* Arrows: centred row BELOW the track (overrides the template's absolute overlay) */
.testimonials .carousel-controls {
  position: static;
  transform: none;
  width: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: var(--tm-arrows-mt);
  pointer-events: auto;
}

.testimonials .carousel-btn {
  position: static;
  transform: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--color-surface);
  border: 1px solid var(--color-brand);
  border-radius: var(--radius-round);
  cursor: pointer;
  transition: background-color 0.2s ease, opacity 0.2s ease;
}

.testimonials .carousel-btn img {
  width: 16px;
  height: 16px;
}

/* Disabled = Figma's 50% arrow (D-T6). Overrides the template's
   `.carousel-controls .carousel-btn:disabled { display: none }` (FD-86). */
.testimonials .carousel-controls .carousel-btn:disabled {
  display: flex;
  opacity: 0.5;
  cursor: default;
}

@media (hover: hover) {
  .testimonials .carousel-btn:not(:disabled):hover {
    background: var(--color-cream); /* BA-T3 */
  }
}

.testimonials .carousel-btn:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

/* ---------- PSEUDO-TABLET 768–1023 (no Figma layer — FD-BL) ----------
   head: stack · strip: stack (tile 120) · slider: desktop-compressed (2 cards + peek) */
@media (min-width: 768px) {
  .testimonials {
    --tm-gap-10-20: clamp(15.88px, calc(15.88px + (var(--max-vw) - 768px) * 0.025), 20px);
    --tm-strip-mt: clamp(25.88px, calc(25.88px + (var(--max-vw) - 768px) * 0.025), 40px);
    --tm-track-mt: clamp(25.88px, calc(25.88px + (var(--max-vw) - 768px) * 0.025), 60px);
    --tm-arrows-mt: 30px;
    --tm-card-pb: 20px;
    --tm-card-pi: clamp(15.88px, calc(15.88px + (var(--max-vw) - 768px) * 0.025), 20px);
    --tm-rating-gap: 15px;
    --tm-stars-h: clamp(19.88px, calc(19.88px + (var(--max-vw) - 768px) * 0.025), 24px);
    --tm-avatar: 40px;
    --tm-tile: 120px;
    --tm-card-w: calc((100% - var(--tm-gap-10-20)) / 2 - 30px);
    --tm-quote-min: 7.5em;
  }
}

/* ---------- DESKTOP 1024+ (anchor 1440, cap 1920) ---------- */
@media (min-width: 1024px) {
  .testimonials {
    --tm-gap-10-20: clamp(14px, calc(20px * (var(--max-vw) / var(--vw-base))), 27px);
    --tm-strip-mt: clamp(28px, calc(40px * (var(--max-vw) / var(--vw-base))), 53px);
    --tm-track-mt: clamp(43px, calc(60px * (var(--max-vw) / var(--vw-base))), 80px);
    --tm-arrows-mt: clamp(21px, calc(30px * (var(--max-vw) / var(--vw-base))), 40px);
    --tm-card-pb: clamp(14px, calc(20px * (var(--max-vw) / var(--vw-base))), 27px);
    --tm-card-pi: clamp(14px, calc(20px * (var(--max-vw) / var(--vw-base))), 27px);
    --tm-rating-gap: clamp(11px, calc(15px * (var(--max-vw) / var(--vw-base))), 20px);
    --tm-stars-h: clamp(17px, calc(24px * (var(--max-vw) / var(--vw-base))), 32px);
    --tm-avatar: clamp(28px, calc(40px * (var(--max-vw) / var(--vw-base))), 53px);
    --tm-tile: 150px;
    /* 413 at 1440 → 3 full cards + 101px peek of card 4 */
    --tm-card-w: clamp(294px, calc(413px * (var(--max-vw) / var(--vw-base))), 551px);
    --tm-quote-min: 7.5em;
  }
}
