/* ============================================================
   Testimonials (slug: testimonials) — brief/testimonials.md
   Figma: desktop 3441:2307 (1440x3131) · mobile 3441:1987 (375x3443)
   Pattern A: .container.container--wide on the section (gutter --gutter-wide),
   block padding --section-py-lg, inner column capped at 1280 (desktop).
   Mobile-first: base = mobile (<768), 768-1023 pseudo-tablet, 1024+ desktop.
   Section-local tokens (brief §2, D-T11) are scoped to .testimonials, never :root.
   ============================================================ */

.testimonials {
  /* MOBILE (0-767): clamp(M-min, M + (vw - 375) * 0.015, M-max) */
  --testimonials-block-gap: clamp(41px, calc(48px + (var(--max-vw) - 375px) * 0.015), 80px);
  --testimonials-head-gap: clamp(10px, calc(12px + (var(--max-vw) - 375px) * 0.015), 16px);
  --testimonials-text-gap: clamp(17px, calc(20px + (var(--max-vw) - 375px) * 0.015), 24px);
  --testimonials-media-gap: clamp(27px, calc(32px + (var(--max-vw) - 375px) * 0.015), 48px);
  --testimonials-media-gap-alt: clamp(41px, calc(48px + (var(--max-vw) - 375px) * 0.015), 48px);
  --testimonials-inner-max: 100%;
  --testimonials-head-max: 768px;

  padding-block: var(--section-py-lg);
  color: var(--color-text);
}

/* Inner column (3441:1988 / 3441:2308) — NOT a .container */
.testimonials__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--testimonials-block-gap);
  width: 100%;
  max-width: var(--testimonials-inner-max);
  margin-inline: auto;
}

/* ---------- Section title (3441:1989 / 3441:2309) ---------- */
.testimonials__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: var(--testimonials-head-max);
  text-align: center;
}

.testimonials__tagline {
  margin: 0;
  font-size: var(--text-tagline);
  font-weight: 500;
  line-height: var(--lh-body);
}

.testimonials__title {
  margin: 0;
  margin-top: var(--testimonials-head-gap);
  width: 100%;
  font-size: var(--text-h2);
  font-weight: 600;
  line-height: var(--lh-h2);
}

.testimonials__lead {
  margin: 0;
  margin-top: var(--testimonials-text-gap);
  width: 100%;
  font-size: var(--text-body);
  font-weight: 400;
  line-height: var(--lh-body);
}

/* ---------- List of rows (3441:1995 / 3441:2315) ---------- */
.testimonials__list {
  display: flex;
  flex-direction: column;
  gap: var(--testimonials-block-gap);
  width: 100%;
}

/* Row — mobile: vertical stack photo -> content */
.testimonials__item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--testimonials-media-gap);              /* rows 1 + 3: 32 */
}
.testimonials__item:nth-child(even) {
  gap: var(--testimonials-media-gap-alt);          /* rows 2 + 4: 48 (BA-T2) */
}

/* Photo — mobile square crop (3441:1997 …), desktop portrait via <source> */
.testimonials__media {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
}
.testimonials__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Content (3441:1998 …) */
.testimonials__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: var(--testimonials-head-gap);
  min-width: 0;
  text-align: left;
}

.testimonials__author {
  margin: 0;
  font-size: var(--text-tagline);
  font-weight: 500;
  line-height: var(--lh-body);
}

.testimonials__body {
  display: flex;
  flex-direction: column;
  gap: var(--testimonials-text-gap);
  margin: 0;                                       /* UA blockquote inset reset (D-T12) */
  width: 100%;
}

.testimonials__quote {
  margin: 0;
  font-size: var(--text-h4);
  font-weight: 600;
  line-height: var(--lh-auto);                     /* Figma AUTO = 1.21 (D-T7) */
}

.testimonials__text {
  margin: 0;
  font-size: var(--text-body);
  font-weight: 400;
  line-height: var(--lh-body);
}

/* ---------- PSEUDO-TABLET 768-1023 (no Figma layer — FD-BL) ----------
   Head: stack, centred 768 measure. Rows: desktop-compressed 2-up
   (desktop zig-zag minus its empty spacer track), photo keeps the square crop. */
@media (min-width: 768px) {
  .testimonials {
    --testimonials-block-gap: clamp(53.88px, calc(53.88px + (var(--max-vw) - 768px) * 0.025), 80px);
    --testimonials-head-gap: clamp(16px, calc(16px + (var(--max-vw) - 768px) * 0.025), 16px);
    --testimonials-text-gap: clamp(24px, calc(24px + (var(--max-vw) - 768px) * 0.025), 24px);
    --testimonials-media-gap: clamp(37.88px, calc(37.88px + (var(--max-vw) - 768px) * 0.025), 48px);
  }

  .testimonials__item,
  .testimonials__item:nth-child(even) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: var(--testimonials-media-gap);
    align-items: center;                           /* D-T4: content centred on the photo */
  }

  /* odd rows: content left, photo right */
  .testimonials__item:nth-child(odd) .testimonials__content { grid-column: 1; grid-row: 1; }
  .testimonials__item:nth-child(odd) .testimonials__media   { grid-column: 2; grid-row: 1; }
  /* even rows: photo left, content right */
  .testimonials__item:nth-child(even) .testimonials__media   { grid-column: 1; grid-row: 1; }
  .testimonials__item:nth-child(even) .testimonials__content { grid-column: 2; grid-row: 1; }
}

/* ---------- DESKTOP 1024+ (3441:2307) ----------
   Each row = 3-track grid 1fr / 400 / 1fr, gap 48 (D-T1). Photo pinned to the centre
   track (one vertical spine); content alternates track 1 (odd) / track 3 (even);
   the opposite track is empty grid air (Figma "Space" — not emitted). */
@media (min-width: 1024px) {
  .testimonials {
    --testimonials-block-gap: clamp(57px, calc(80px * (var(--max-vw) / var(--vw-base))), 107px);
    --testimonials-head-gap: clamp(11px, calc(16px * (var(--max-vw) / var(--vw-base))), 21px);
    --testimonials-text-gap: clamp(17px, calc(24px * (var(--max-vw) / var(--vw-base))), 32px);
    --testimonials-media-gap: clamp(34px, calc(48px * (var(--max-vw) / var(--vw-base))), 64px);
    --testimonials-inner-max: clamp(910px, calc(1280px * (var(--max-vw) / var(--vw-base))), 1707px);
    --testimonials-head-max: clamp(853px, calc(1200px * (var(--max-vw) / var(--vw-base))), 1600px);
    --testimonials-photo-w: clamp(284px, calc(400px * (var(--max-vw) / var(--vw-base))), 533px);
  }

  .testimonials__title {
    white-space: nowrap;                           /* D-T9: 1191 of 1200 — one line as drawn */
  }

  .testimonials__item,
  .testimonials__item:nth-child(even) {
    grid-template-columns: minmax(0, 1fr) var(--testimonials-photo-w) minmax(0, 1fr);
  }

  .testimonials__item:nth-child(odd) .testimonials__media,
  .testimonials__item:nth-child(even) .testimonials__media {
    grid-column: 2;
    grid-row: 1;
    aspect-ratio: 400 / 592;
  }
  .testimonials__item:nth-child(odd) .testimonials__content  { grid-column: 1; grid-row: 1; }
  .testimonials__item:nth-child(even) .testimonials__content { grid-column: 3; grid-row: 1; }
}
