/* Testimonials — source: sections/Testimonials.tsx
 *
 * The cards are native containers + heading/text-editor widgets, so every A1C
 * number, quote and name is editable in Elementor. Two consequences run through
 * this whole file:
 *   1. Type belongs on .elementor-heading-title / .elementor-widget-text-editor p,
 *      never on the widget wrapper. Elementor resets the title at (0,1,0)
 *      — including line-height:1 — and that reset beats an inherited value.
 *   2. Elementor gives every container 10px padding on all four sides
 *      (--container-default-padding-*, 10px) and there is no e-child reset, so
 *      each card container carries padding:0 in its JSON and the real padding
 *      is declared here with a shorthand.
 */

#testimonials {
  background: var(--page-panel);
  position: relative;
  overflow: hidden;
  /* .lt-section owns padding-block. Elementor's container default would add
     inline padding, which breaks the full-bleed mobile carousel. */
  padding-inline: 0;
}

/* Elementor ships every container with --flex-wrap-mobile:wrap and lands it as
   flex-wrap:wrap at <=767 (.e-con.e-flex{--flex-wrap:var(--flex-wrap-mobile)}).
   Nothing here wraps in the source, and on the track it would break the carousel
   outright: each card is ~100vw wide, so all four would stack on their own lines
   instead of scrolling. */
#testimonials .e-con {
  flex-wrap: nowrap;
}

#testimonials .lt-testi-inner {
  position: relative;
  z-index: 1;
}

/* Blob — static here: the source gives this one no animation. */
#testimonials .lt-testi-blob {
  top: -80px;
  inset-inline-start: -60px;
  width: 440px;
  height: 360px;
  border-radius: 50% 50% 60% 40% / 40% 50% 55% 45%;
  background: rgba(41, 128, 242, 0.07);
}

/* ---- Section head ---------------------------------------------------- */

/* A deliberate override of the tokens pill: this section's eyebrow is blue. */
#testimonials .lt-eyebrow {
  color: var(--brand-primary);
  background: rgba(41, 128, 242, 0.08);
  box-shadow: inset 0 0 0 1px rgba(41, 128, 242, 0.18);
}

/* Elementor forces .elementor-heading-title to line-height:1, which would
   flatten the pill to 25px against the source's 33px. */
#testimonials .lt-eyebrow .elementor-heading-title {
  line-height: 1.6;
}

#testimonials .lt-testi-h2 {
  margin-top: 18px;
}

/* tokens.css carries no h2 font-size — the source gets it from styles.css. */
#testimonials .lt-testi-h2 .elementor-heading-title {
  font-size: var(--t-h2);
  font-weight: 900;
  line-height: 1.05;
  color: var(--page-fg-strong);
  margin: 0;
}

#testimonials .lt-testi-sub {
  margin-top: 14px;
}

#testimonials .lt-testi-sub p {
  font-size: var(--t-lead);
  color: var(--page-fg-muted);
  margin: 0;
}

/* ---- Desktop grid ----------------------------------------------------
 * .lt-testi-desktop and .lt-testi-grid are one container: the source's wrapper
 * and its grid child were always coincident boxes. display:grid is deliberately
 * NOT !important so the display:none !important below can hide it outright,
 * whatever the rule order.
 */

#testimonials .lt-testi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(16px, 2vw, 24px);
}

/* ---- Card ------------------------------------------------------------ */

#testimonials .lt-testi-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: clamp(20px, 2.5vw, 28px);
  box-shadow: var(--shadow-card);
}

/* The source stamps --reveal-delay inline as i*70ms. An Elementor container
   cannot carry an inline style, so the stagger comes off the card's index —
   cards are the only children of the grid and of the track. */
#testimonials .lt-testi-card:nth-child(2) { --reveal-delay: 70ms; }
#testimonials .lt-testi-card:nth-child(3) { --reveal-delay: 140ms; }
#testimonials .lt-testi-card:nth-child(4) { --reveal-delay: 210ms; }

/* .elementor-widget is position:relative, so the absolutely-positioned bar would
   resolve against its own zero-size wrapper instead of the card. */
#testimonials .lt-testi-bar-w,
#testimonials .lt-testi-bar-w > .elementor-widget-container {
  position: static;
}

#testimonials .lt-testi-bar {
  position: absolute;
  top: 0;
  inset-inline: 0;
  height: 4px;
  background: linear-gradient(to left, var(--brand-primary), var(--brand-light));
}

#testimonials .lt-testi-label {
  padding-top: 10px;
  margin-bottom: 14px;
}

#testimonials .lt-testi-label .elementor-heading-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  /* the source's div inherits body's 1.6; Elementor's reset would force 1. */
  line-height: 1.6;
  color: var(--page-fg-subtle);
}

#testimonials .lt-testi-drop {
  margin-bottom: 6px;
}

#testimonials .lt-testi-drop .elementor-heading-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
  color: var(--page-fg-muted);
}

#testimonials .lt-testi-stat {
  text-align: center;
  margin-bottom: 6px;
}

#testimonials .lt-testi-stat-after {
  margin-bottom: 14px;
}

#testimonials .lt-testi-stat-l {
  margin-bottom: 3px;
}

#testimonials .lt-testi-stat-l .elementor-heading-title {
  font-size: 10px;
  line-height: 1.6;
  color: var(--page-fg-subtle);
}

#testimonials .lt-testi-before .elementor-heading-title,
#testimonials .lt-testi-after .elementor-heading-title {
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 900;
  line-height: 1;
}

#testimonials .lt-testi-before .elementor-heading-title { color: var(--brand-red); }
#testimonials .lt-testi-after .elementor-heading-title { color: var(--brand-primary); }

#testimonials .lt-testi-arrow {
  margin: 6px 0;
}

/* The markup carries stroke="var(--brand-primary)" verbatim from the source,
   but var() in an SVG presentation attribute is unsupported on older WebKit —
   where it would resolve to no stroke and the arrow would vanish entirely. */
#testimonials .lt-testi-arrow path {
  stroke: var(--brand-primary);
}

/* The pill is the widget wrapper: it is the card's flex item, and align-items:
   center shrinks it to its text exactly as the source's block div. */
#testimonials .lt-testi-extra {
  margin-bottom: 10px;
  padding: 4px 10px;
  text-align: center;
  background: rgba(242, 155, 136, 0.14);
  border: 1px solid rgba(242, 155, 136, 0.30);
  border-radius: var(--r-sm);
}

#testimonials .lt-testi-extra .elementor-heading-title {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.6;
  color: #a04020;
}

/* flex:1 sits on the wrapper, not the <p> — the wrapper is the card's flex item
   and is what has to absorb the free space that pushes .lt-testi-who down. */
#testimonials .lt-testi-quote {
  flex: 1;
  margin: 0 0 12px;
}

#testimonials .lt-testi-quote p {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  font-style: italic;
  text-align: center;
  color: var(--page-fg-muted);
}

#testimonials .lt-testi-who {
  margin-top: auto;
  /* shorthand, not padding-top: this is a container, so the other three sides
     would otherwise keep Elementor's 10px default. */
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
  width: 100%;
  text-align: center;
}

#testimonials .lt-testi-name .elementor-heading-title {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--page-fg-strong);
}

#testimonials .lt-testi-tag {
  margin-top: 2px;
}

#testimonials .lt-testi-tag .elementor-heading-title {
  font-size: 12px;
  line-height: 1.6;
  color: var(--page-fg-subtle);
}

/* ---- Disclaimer ------------------------------------------------------ */

#testimonials .lt-testi-note {
  margin-top: 24px;
  text-align: center;
}

#testimonials .lt-testi-note p {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--page-fg-muted);
}

/* ---- Mobile: scroll-snap carousel (lifetec.js binds .lt-snap) --------
 * Scoped to #testimonials on purpose: Process shares these hook names but
 * sizes its cards differently, and unscoped rules here would reach into it.
 */
@media (max-width: 820px) {
  #testimonials .lt-snap {
    position: relative;
    z-index: 1;
  }

  #testimonials .lt-snap-track {
    display: flex;
    overflow-x: scroll;
    scroll-snap-type: x mandatory;
    gap: 14px;
    padding: 4px 20px 8px;
    scroll-padding-right: 20px;
    scrollbar-width: none;
  }

  #testimonials .lt-snap-track::-webkit-scrollbar {
    display: none;
  }

  /* The card is the track's flex item itself now — lifetec.js measures
     track.firstElementChild.offsetWidth, so it must not be wrapped. That means
     height:100% (set above for the desktop grid cell) would resolve against the
     track's indefinite height AND opt the card out of stretch, leaving the row
     ragged. auto restores the equal heights the old wrapper div used to give. */
  #testimonials .lt-snap-track > .lt-testi-card {
    flex: 0 0 calc(100vw - 56px);
    max-width: 300px;
    scroll-snap-align: start;
    height: auto;
  }

  #testimonials .lt-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 18px;
  }

  #testimonials .lt-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border-radius: 999px;
    border: 0;
    background: rgba(41, 128, 242, 0.25);
    transition: width .3s var(--ease);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  #testimonials .lt-dot.is-active {
    width: 24px;
    background: var(--brand-primary);
  }

  #testimonials .lt-testi-desktop {
    display: none !important;
  }

  /* Source: styles.css tightens section-head line length below 820. */
  #testimonials .lt-section-head p {
    max-width: 480px;
    margin-inline: auto;
  }
}

@media (min-width: 821px) {
  #testimonials .lt-snap {
    display: none !important;
  }
}

/*
 * A1C values are LTR numeric runs. In this RTL context the neutral en-dash in
 * "12.5–15.5" adopts the surrounding RTL direction and flips the two number
 * runs, so the range RENDERS as "15.5–12.5" — a descending range, which is
 * medically nonsense. The DOM text is correct; only the visual order is wrong.
 * The source design has the same bug; fixed here per the WP-only fix policy.
 */
#testimonials .lt-testi-before,
#testimonials .lt-testi-after,
#testimonials .lt-testi-before .elementor-heading-title,
#testimonials .lt-testi-after .elementor-heading-title {
  direction: ltr;
}
