/* Testimonials — premium editorial member stories */
#testimonials {
  --t-bg: #e6f4f0;
  --t-accent: #22c9a9;
  --t-text: #182826;
  --t-muted: #5c726e;
  --t-body: #2f4542;
  --t-radius-hero: 2.5rem;
  --t-radius-mini: 1.65rem;
  --t-border: rgba(34, 201, 169, 0.12);
  --t-shadow: 0 24px 52px -20px rgba(20, 40, 36, 0.11);
  padding-top: 5.5rem !important;
  padding-bottom: 6rem !important;
  background: var(--t-bg) !important;
  color: var(--t-text);
  overflow: hidden;
}

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

#testimonials .t-layout {
  display: grid;
  gap: 2.5rem;
}

#testimonials .t-grid {
  display: contents;
}

/* ── Intro column ── */
#testimonials .t-intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#testimonials .t-eyebrow {
  margin: 0;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--t-accent);
}

#testimonials .t-eyebrow::after {
  content: "";
  display: block;
  width: 2.25rem;
  height: 2px;
  margin-top: 0.75rem;
  background: var(--t-accent);
  opacity: 0.5;
  border-radius: 999px;
}

#testimonials .t-headline {
  margin: 1.35rem 0 0;
  max-width: 12.5ch;
  font-family: var(--nav-display, "Playfair Display", Georgia, serif);
  font-size: clamp(2.4rem, 5vw, 3.55rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--t-text);
}

#testimonials .t-lede {
  margin: 1.25rem 0 0;
  max-width: 20rem;
  font-size: 1.02rem;
  line-height: 1.72;
  color: var(--t-muted);
}

/* ── Shared testimonial card (hero + mini use same structure) ── */
#testimonials .t-hero,
#testimonials .t-mini {
  --t-photo: 18rem;
  --t-photo-y: 1.35rem;
  --t-arc: calc(var(--t-photo) / 2 + 0.55rem);
  position: relative;
  display: grid;
  grid-template-columns: var(--t-arc) minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: start;
  column-gap: 1rem;
  border: 1px solid var(--t-border);
  box-shadow: var(--t-shadow);
  isolation: isolate;
  background: #fff;
  overflow: hidden;
  min-height: 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#testimonials .t-hero::before,
#testimonials .t-mini::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(ellipse 100% 90% at 100% 100%, rgba(34, 201, 169, 0.14) 0%, rgba(34, 201, 169, 0.04) 35%, transparent 62%),
    linear-gradient(315deg, rgba(228, 247, 242, 0.9) 0%, rgba(255, 255, 255, 0) 48%);
  pointer-events: none;
  z-index: 0;
}

/* Large curved portrait — identical treatment on all four cards */
#testimonials .t-hero .t-avatar-frame,
#testimonials .t-mini .t-avatar-frame {
  position: absolute;
  top: calc(var(--t-photo) / -2 + var(--t-photo-y));
  left: calc(var(--t-photo) / -2);
  width: var(--t-photo);
  height: var(--t-photo);
  margin: 0;
  padding: 0;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--t-accent);
  background: transparent;
  box-shadow: none;
  z-index: 3;
}

#testimonials .t-avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  object-fit: cover;
  object-position: center 14%;
  display: block;
}

#testimonials .t-top-row {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  min-height: 0;
  margin: 0;
  position: relative;
  z-index: 2;
  justify-self: end;
  align-self: start;
}

#testimonials .t-author-box {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  padding: 0.15rem 0 0;
  position: relative;
  z-index: 2;
  justify-self: start;
  align-self: start;
  max-width: 58%;
}

#testimonials .t-rating-box {
  display: flex;
  align-items: center;
}

#testimonials .t-stars {
  display: inline-flex;
  align-items: center;
  gap: 0.16rem;
  color: var(--t-accent);
}

#testimonials .t-star-icon {
  width: 0.78rem;
  height: 0.78rem;
  fill: var(--t-accent);
}

#testimonials .t-name {
  margin: 0;
  font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #122226;
  line-height: 1.15;
}

#testimonials .t-role {
  margin: 0.35rem 0 0;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #6d8388;
}

#testimonials .t-quote {
  grid-column: 2;
  grid-row: 2;
  margin: 0.85rem 0 0;
  padding: 0;
  max-width: 100%;
  position: relative;
  z-index: 2;
  justify-self: stretch;
  align-self: start;
  font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  line-height: 1.68;
  color: var(--t-body);
  font-weight: 400;
  text-align: left;
}

#testimonials .t-quote-deco {
  position: absolute;
  right: 1rem;
  bottom: 0.75rem;
  width: 4.5rem;
  height: 4.5rem;
  color: var(--t-accent);
  opacity: 0.07;
  pointer-events: none;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

#testimonials .t-quote-deco-svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

/* ── Featured card ── */
#testimonials .t-hero {
  border-radius: var(--t-radius-hero);
  padding: 1.5rem 2.25rem 2.1rem 1.4rem;
}

#testimonials .t-hero:hover {
  transform: translateY(-4px);
  box-shadow: 0 32px 64px -20px rgba(20, 40, 36, 0.14);
}

#testimonials .t-hero .t-star-icon {
  width: 0.88rem;
  height: 0.88rem;
}

#testimonials .t-hero .t-name {
  font-size: 1.5rem;
}

#testimonials .t-hero .t-quote {
  font-size: clamp(1rem, 1.4vw, 1.12rem);
  line-height: 1.72;
}

#testimonials .t-hero .t-quote-deco {
  width: 8rem;
  height: 8rem;
  right: 1.35rem;
  bottom: 0.9rem;
}

/* ── Smaller matching cards ── */
#testimonials .t-minis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.15rem;
}

#testimonials .t-mini {
  --t-photo: 10.5rem;
  --t-photo-y: 1rem;
  border-radius: var(--t-radius-mini);
  padding: 1rem 1.05rem 1.15rem 0.9rem;
  min-height: 16.5rem;
  cursor: pointer;
}

#testimonials .t-mini:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 44px -16px rgba(20, 40, 36, 0.12);
}

#testimonials .t-mini:focus-visible {
  outline: 2px solid var(--t-accent);
  outline-offset: 3px;
}

#testimonials .t-hero.t-hero-swap {
  animation: t-hero-swap 0.45s ease;
}

@keyframes t-hero-swap {
  from {
    opacity: 0.55;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

#testimonials .t-mini .t-name {
  font-size: 1.02rem;
}

#testimonials .t-mini .t-star-icon {
  width: 0.72rem;
  height: 0.72rem;
}

#testimonials .t-mini .t-quote {
  font-size: 0.82rem;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#testimonials .t-mini .t-quote-deco {
  width: 3.75rem;
  height: 3.75rem;
  opacity: 0.07;
}

/* ── Desktop / laptop ── */
@media (min-width: 900px) {
  #testimonials .t-layout {
    grid-template-columns: minmax(16rem, 0.38fr) minmax(0, 0.62fr);
    grid-template-rows: auto auto;
    gap: 3rem 4.75rem;
    align-items: start;
  }

  #testimonials .t-intro {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    padding: 1rem 0;
  }

  #testimonials .t-hero {
    grid-column: 2;
    grid-row: 1;
    --t-photo: 20rem;
    margin-top: 1.25rem;
  }

  #testimonials .t-minis {
    grid-column: 1 / -1;
    grid-row: 2;
    margin-top: 0.75rem;
    gap: 1.25rem;
  }

  #testimonials .t-mini {
    --t-photo: 11rem;
    min-height: 17rem;
  }
}

@media (min-width: 1120px) {
  #testimonials .t-layout {
    gap: 3.25rem 5.5rem;
  }

  #testimonials .t-hero {
    --t-photo: 21rem;
    padding: 1.65rem 2.5rem 2.35rem 1.55rem;
  }

  #testimonials .t-minis {
    gap: 1.5rem;
  }

  #testimonials .t-mini {
    --t-photo: 11.5rem;
    min-height: 17.5rem;
  }
}

/* ── Tablet ── */
@media (max-width: 899px) and (min-width: 721px) {
  #testimonials .t-hero {
    --t-photo: 17.5rem;
    margin-top: 1rem;
  }

  #testimonials .t-mini {
    --t-photo: 9.5rem;
  }

  #testimonials .t-minis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ── Mobile ── */
@media (max-width: 720px) {
  #testimonials {
    padding-top: 2.75rem !important;
    padding-bottom: 3rem !important;
    background: #fff !important;
  }

  #testimonials .t-layout {
    display: block;
  }

  #testimonials .t-intro {
    text-align: center;
    margin-bottom: 1.75rem;
  }

  #testimonials .t-eyebrow::after {
    margin: 0.45rem auto 0;
  }

  #testimonials .t-headline {
    margin: 0.75rem auto 0;
    max-width: 14ch;
    font-size: clamp(1.9rem, 7.5vw, 2.3rem);
  }

  #testimonials .t-lede {
    margin: 0.7rem auto 0;
    max-width: 30rem;
    font-size: 0.92rem;
  }

  #testimonials .t-grid {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0.9rem;
    width: max-content;
    padding-bottom: 0.5rem;
    animation: t-marquee 40s linear infinite;
  }

  #testimonials .t-minis {
    display: contents;
  }

  #testimonials .t-hero {
    --t-photo: 8.25rem;
    --t-photo-y: 0.75rem;
    flex: 0 0 16.5rem;
    width: 16.5rem;
    min-height: 15rem;
    margin: 0;
    padding: 0.9rem 0.95rem 1.05rem 0.85rem;
    border-radius: var(--t-radius-mini);
    column-gap: 0.75rem;
  }

  #testimonials .t-hero .t-name {
    font-size: 1.02rem;
  }

  #testimonials .t-hero .t-quote {
    font-size: 0.82rem;
    -webkit-line-clamp: 6;
    line-clamp: 6;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  #testimonials .t-hero .t-quote-deco {
    width: 3.25rem;
    height: 3.25rem;
    right: 0.55rem;
    bottom: 0.45rem;
  }

  #testimonials .t-inner {
    overflow: hidden;
  }

  #testimonials .t-minis {
    gap: 0;
    width: auto;
    padding-bottom: 0;
    animation: none;
  }

  #testimonials .t-mini {
    --t-photo: 8.25rem;
    --t-photo-y: 0.75rem;
    flex: 0 0 16.5rem;
    width: 16.5rem;
    min-height: 15rem;
    padding: 0.9rem 0.95rem 1.05rem 0.85rem;
  }

  @media (prefers-reduced-motion: reduce) {
    #testimonials .t-grid {
      animation: none;
      overflow-x: auto;
      width: auto;
      max-width: 100%;
      scroll-snap-type: x mandatory;
    }

    #testimonials .t-hero,
    #testimonials .t-mini {
      scroll-snap-align: start;
    }
  }
}

/* ── Dark mode ── */
html.dark #testimonials {
  --t-bg: #131f1d;
  --t-text: #eef5f3;
  --t-muted: #95aaa5;
  --t-body: #cde0dc;
  --t-border: rgba(34, 201, 169, 0.2);
  --t-shadow: 0 24px 52px -20px rgba(0, 0, 0, 0.4);
}

html.dark #testimonials .t-hero,
html.dark #testimonials .t-mini {
  background: #1c2b28;
}

html.dark #testimonials .t-hero::before,
html.dark #testimonials .t-mini::before {
  background:
    radial-gradient(ellipse 100% 90% at 100% 100%, rgba(34, 201, 169, 0.12) 0%, transparent 60%),
    linear-gradient(315deg, rgba(34, 201, 169, 0.06) 0%, transparent 48%);
}

@keyframes t-marquee {
  to {
    transform: translateX(calc(-50% - 0.45rem));
  }
}
