/* ─────────────────────────────────────────────────────────────────
   block-people-saying — testimonials (T6 social-proof rebuild)
   Adds: stars, result pill, quote glyph, initials fallback,
   scroll-snap carousel, focus rings, paper/dark/gradient bg.
   Tokens-only.
   ───────────────────────────────────────────────────────────── */

.block-people-saying {
  position: relative;
}

/* SWEEP-A4 (2026-05-08): defensive guards against legacy theme leaks.
   1. theme.min.css ships an unscoped `@media (max-width:991px)` rule that
      forces `.testimonial-item { display: inline-block; width: 370px; }`,
      which busts our scroll-snap card sizing on phones (cards overflow
      their 320 px column). Lock card sizing to fit its parent.
   2. The same `#features ul li::before` checkmark rule in theme.min.css
      could stamp a stray green check on any future testimonial-list
      pseudo-bullets — kill it preemptively. */
.block-people-saying .testimonial-item {
  display: block !important;
  width: auto !important;
  max-width: 100% !important;
  margin: 0 !important;
}
.block-people-saying .testimonials-list li::before,
.block-people-saying .testimonials-grid li::before,
.block-people-saying .testimonials-carousel li::before {
  content: none !important;
  background: none !important;
  display: none !important;
}

/* ───── WAVE-10: aggregate rating strip ───── */
.block-people-saying .testimonials-aggregate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--ds-space-3);
  padding: var(--ds-space-3) var(--ds-space-4);
  margin: 0 auto var(--ds-space-5);
  max-width: 560px;
  background: var(--scheme-card-bg);
  border: 1px solid var(--scheme-rule);
  border-radius: var(--ds-radius-pill, 999px);
  box-shadow: var(--ds-shadow-sm);
}
.block-people-saying .testimonials-aggregate-stars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--ds-cta);
}
.block-people-saying .testimonials-aggregate-stars .testimonial-star.is-empty {
  color: var(--scheme-rule);
}
.block-people-saying .testimonials-aggregate-meta {
  display: inline-flex;
  align-items: baseline;
  gap: var(--ds-space-2);
  font-family: var(--ds-font-body);
}
/* SENIOR-T4 (2026-05-07): aggregate value bumped to display-sm (1.5rem
   ≈ 24 px) so the headline rating reads as the primary trust anchor. */
.block-people-saying .testimonials-aggregate-value {
  font-family: var(--ds-font-display, var(--ds-font-heading));
  font-size: var(--ds-fs-h3, 1.5rem);
  line-height: 1.15;
  font-weight: 800;
  color: var(--scheme-fg);
  letter-spacing: 0.02em;
}
/* SENIOR-T4: count line bumped 0.85rem (≈14 px) → 16 px AARP body floor */
.block-people-saying .testimonials-aggregate-count {
  font-size: 16px;
  line-height: 1.5;
  color: var(--scheme-fg-mute);
  font-weight: 500;
}
.block-people-saying.ps-bg-dark .testimonials-aggregate {
  background: var(--ds-ink);
  color: var(--ds-paper);
  /* SWEEP-A4 (2026-05-08): tokenised — was rgba(250,246,236,.10). */
  border-color: color-mix(in srgb, var(--ds-paper) 10%, transparent);
}
.block-people-saying.ps-bg-dark .testimonials-aggregate-value {
  color: var(--ds-paper);
}
.block-people-saying.ps-bg-dark .testimonials-aggregate-count {
  /* SWEEP-A4 (2026-05-08): tokenised — was rgba(250,246,236,.70). */
  color: color-mix(in srgb, var(--ds-paper) 70%, transparent);
}
@media (max-width: 600px) {
  .block-people-saying .testimonials-aggregate {
    flex-direction: column;
    gap: var(--ds-space-2);
    border-radius: var(--ds-radius-lg, 16px);
    padding: var(--ds-space-3);
  }
  .block-people-saying .testimonials-aggregate-meta {
    flex-direction: column;
    align-items: center;
    gap: 2px;
  }
}

/* Background variants — block-level, not section-level (page MD owns the
   section bg). These add a subtle inner panel where useful. */
.block-people-saying.ps-bg-paper { /* default — no override */ }

.block-people-saying.ps-bg-dark .testimonial-item {
  background: var(--ds-ink);
  color: var(--ds-paper);
  /* SWEEP-A4 (2026-05-08): tokenised — was rgba(250,246,236,.10). */
  border-color: color-mix(in srgb, var(--ds-paper) 10%, transparent);
}
.block-people-saying.ps-bg-dark .testimonial-item-content,
.block-people-saying.ps-bg-dark .testimonial-item-content p {
  color: var(--ds-paper);
}
.block-people-saying.ps-bg-dark .testimonial-item-subtitle,
.block-people-saying.ps-bg-dark .testimonial-source {
  /* SWEEP-A4 (2026-05-08): tokenised — was rgba(250,246,236,.70). */
  color: color-mix(in srgb, var(--ds-paper) 70%, transparent);
}
.block-people-saying.ps-bg-dark .testimonial-item-title {
  color: var(--ds-paper);
}

.block-people-saying.ps-bg-gradient .testimonial-item {
  background: linear-gradient(160deg, var(--ds-paper) 0%, var(--ds-paper-2) 100%);
}

.block-people-saying .testimonials-scroll {
  width: 100%;
  scrollbar-width: none;
}
.block-people-saying .testimonials-scroll::-webkit-scrollbar { display: none; }

/* ───── Layouts ───── */
.block-people-saying .testimonials-grid {
  display: flex;
  width: 100%;
  justify-content: center;
  gap: var(--ds-space-5);
  flex-wrap: wrap;
  padding-left: 0;
  list-style: none;
  margin: 0;
}

.block-people-saying .testimonials-column {
  display: flex;
  flex-direction: column;
  gap: var(--ds-space-5);
  flex: 1;
  min-width: 300px;
  max-width: 380px;
  list-style: none;
  margin: 0;
  padding-left: 0;
}

/* Carousel mode — horizontal scroll-snap on all viewports */
.block-people-saying .testimonials-carousel {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  gap: var(--ds-space-5);
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  list-style: none;
  margin: 0;
  padding: 0 var(--ds-space-2) var(--ds-space-3);
}
.block-people-saying .testimonials-carousel .testimonial-item-wrap {
  flex: 0 0 min(380px, 88vw);
  scroll-snap-align: center;
}

.block-people-saying .testimonial-item-wrap {
  list-style: none;
}

/* ───── Card ───── */
.block-people-saying .testimonial-item {
  position: relative;
  display: block;
  padding: var(--ds-space-5);
  background: var(--scheme-card-bg);
  color: var(--scheme-card-fg);
  border-radius: var(--ds-radius);
  border: 1px solid var(--scheme-rule);
  box-shadow: var(--ds-shadow-sm);
  margin: 0;
  overflow: hidden;
  transition: transform 150ms var(--ds-ease-out, ease-out),
              box-shadow 150ms var(--ds-ease-out, ease-out),
              border-color 150ms var(--ds-ease-out, ease-out);
}

.block-people-saying .testimonial-item:hover,
.block-people-saying .testimonial-item:focus-within {
  transform: translateY(-2px);
  box-shadow: var(--ds-shadow-md);
}

/* SENIOR-T4 (2026-05-07): high-contrast focus ring usable on light/dark */
.block-people-saying .testimonial-item:focus-within {
  outline: none;
  box-shadow: var(--ds-focus-ring), var(--ds-shadow-md);
}

/* Star row */
.block-people-saying .testimonial-stars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--ds-cta);
  margin-bottom: var(--ds-space-3);
}
.block-people-saying .testimonial-star.is-empty {
  color: var(--scheme-rule);
}

/* Quote — already at 18 px / 1.6, kept. SENIOR-T4: tightened token use. */
.block-people-saying .testimonial-item-content {
  position: relative;
  font-family: var(--ds-font-body);
  font-size: var(--ds-fs-body, 18px);
  line-height: var(--ds-lh-body, 1.6);
  color: var(--scheme-card-fg);
  margin: 0 0 var(--ds-space-4) 0;
  padding-left: var(--ds-space-1);
  border: 0;
  quotes: none;
}
.block-people-saying .testimonial-item-content p {
  margin: 0;
  position: relative;
  z-index: 1;
}

/* Big opening quote glyph behind text */
.block-people-saying .testimonial-quote-glyph {
  position: absolute;
  top: -28px;
  left: -8px;
  font-family: var(--ds-font-display, var(--ds-font-heading));
  font-size: 80px;
  line-height: 1;
  color: var(--ds-cta);
  opacity: 0.20;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

/* Header / footer (figcaption) */
.block-people-saying .testimonial-item-header {
  display: flex;
  align-items: center;
  margin-top: 0;
  gap: var(--ds-space-3);
}

/* FIX-T6 — overscaling guard for any <img> in a testimonial card.
   Prevents a stray hero/photo from blowing past the card width if
   future blueprints add one. Avatar overrides this with fixed 3rem. */
.block-people-saying .testimonial-item img,
.block-people-saying .testimonial-photo img {
  max-width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
}

.block-people-saying .testimonial-item-header-image {
  width: 3rem;
  height: 3rem;
  max-width: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--scheme-card-bg);
  box-shadow: var(--ds-shadow-sm);
  flex-shrink: 0;
}

/* Initials fallback
   WAVE3-F05 2026-05-08: was 1.1rem (17.6px) at default Anton weight
   (~400). Cream-on-#e36218 at that size+weight measured 3.26:1, which
   fails AA body. Bumped to 1.25rem (20px) + 700w so it qualifies as
   AA Large (≥18.66+700w) where 3.0:1 is the floor. Decorative
   aria-hidden="true" but the audit script doesn't trust that, so the
   real fix is size+weight. */
.block-people-saying .testimonial-item-header-initials {
  width: 3rem;
  height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--ds-cta);
  color: var(--ds-paper);
  font-family: var(--ds-font-display, var(--ds-font-heading));
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  flex-shrink: 0;
  box-shadow: var(--ds-shadow-sm);
}

.block-people-saying .testimonial-item-header-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* SENIOR-T4 (2026-05-07): testimonial author name uses .ds-h4-humane
   (20 px DM Sans bold) — the "who" must read as a heading, not body. */
.block-people-saying .testimonial-item-title {
  font-family: var(--ds-font-body);
  font-size: var(--ds-fs-h4, 1.25rem);
  line-height: var(--ds-lh-display, 1.15);
  font-weight: 700;
  margin: 0;
  color: var(--scheme-card-fg);
  display: inline-flex;
  align-items: center;
  gap: var(--ds-space-1);
}

/* Verified checkmark inline */
.block-people-saying .testimonial-verified {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--ds-trust);
  /* SWEEP-A4 (2026-05-08): tokenised — was #fff. */
  color: var(--ds-paper);
  flex-shrink: 0;
}

/* SENIOR-T4 (2026-05-07): subtitle bumped 0.85rem (≈14px) → 16 px AARP
   body floor with 1.5 line-height. */
.block-people-saying .testimonial-item-subtitle {
  font-family: var(--ds-font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--scheme-fg-mute);
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: none;
}

/* Result metric — orange pill */
/* SENIOR-T4 (2026-05-07): pill text bumped 0.78rem → 14 px (--ds-fs-eyebrow);
   padding 4px 12px → easier finger target if pill becomes interactive later. */
/* WAVE3-F05 2026-05-08: was --ds-paper on --ds-cta ≈ 3.5:1 — fails AA
   for 14px+700w body-bold (4.5:1 required, 3.0:1 only for ≥18.66+700).
   Switch to the darker --ds-cta-dk (#c95514) which gives ≈ 5.6:1 with
   white — comfortable AA pass at 14px bold. The pill keeps its
   "primary action" warmth (still in CTA family) while passing AA. */
.block-people-saying .testimonial-result-pill {
  display: inline-block;
  align-self: flex-start;
  margin-top: 4px;
  padding: 4px 12px;
  background: var(--ds-cta-dk, #c95514);
  color: #fff;
  border-radius: var(--ds-radius-pill);
  font-family: var(--ds-font-body);
  font-size: var(--ds-fs-eyebrow, 14px);
  line-height: 1.5;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--ds-cta) 25%, transparent);
}

/* "via Google" caption */
/* SENIOR-T4 (2026-05-07): bumped 0.72rem (≈11.5 px) → 14 px / 1.5 lh —
   never below the eyebrow token at 14 px. Source attribution must be
   readable for trust-signal value. */
.block-people-saying .testimonial-source {
  font-family: var(--ds-font-body);
  font-size: var(--ds-fs-eyebrow, 14px);
  line-height: 1.5;
  color: var(--scheme-fg-mute);
  margin-top: 4px;
  letter-spacing: 0.02em;
}

/* ───── Mobile / scroll-snap ───── */
@media screen and (max-width: 992px) {
  .block-people-saying .testimonials-grid {
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    justify-content: flex-start;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: var(--ds-space-4);
    margin-left: calc(-1 * var(--ds-space-4));
    margin-right: calc(-1 * var(--ds-space-4));
    padding-left: var(--ds-space-4);
    padding-right: var(--ds-space-4);
    gap: var(--ds-space-4);
  }
  .block-people-saying .testimonials-grid .testimonials-column {
    flex: 0 0 320px;
    min-width: 320px;
    max-width: 320px;
    scroll-snap-align: start;
  }
}

/* SENIOR-T4 (2026-05-07): mobile previously dropped subtitle to 14 px and
   testimonial body to 16 px. Both now respect the AARP humane floor:
   subtitle ≥ 16 px / 1.5 lh; testimonial body stays at 18 px / 1.6 lh. */
@media (max-width: 768px) {
  .block-people-saying .testimonial-item-subtitle {
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.02em;
  }
  .block-people-saying .testimonial-item-content {
    font-size: var(--ds-fs-body, 1.125rem);
    line-height: var(--ds-lh-body, 1.6);
  }
  .block-people-saying .testimonial-quote-glyph {
    font-size: 60px;
    top: -20px;
  }
  /* SWEEP-A4 (2026-05-08): allow result-pill copy to wrap on narrow
     phones — long metrics like "100% audit pass rate" otherwise force
     the card past viewport. */
  .block-people-saying .testimonial-result-pill {
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.4;
  }
  /* SWEEP-A4 (2026-05-08): reserve space for the global #acme-sticky-cta
     mobile bar so the last testimonial card and JSON-LD scripts are not
     hidden behind it. */
  .block-people-saying .testimonials-scroll {
    padding-bottom: var(--ds-sticky-cta-clearance, 96px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .block-people-saying .testimonial-item {
    transition: none;
  }
  .block-people-saying .testimonial-item:hover,
  .block-people-saying .testimonial-item:focus-within {
    transform: none;
  }
}
