/* ==========================================================================
   Testimonials: client quotes on a taupe band (onyx text throughout)

   Two layouts:
   - Default (no JavaScript, motion paused or reduced): a wrapping grid.
   - .is-animated (added by scripts/features/testimonials.js): two rows that
     drift in opposite directions, pause on hover and can be dragged.
   ========================================================================== */

.testimonials {
  display: flex;
  flex-direction: column;
  gap: clamp(32px, 4.5vw, 56px);
  padding: var(--section-y) var(--gutter);
  background: var(--color-taupe);
  color: var(--color-ink);
  overflow: hidden;
}

.testimonials .eyebrow {
  color: var(--color-ink);
}

.testimonials__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 40px;
}

.testimonials__head .section-title {
  font-size: var(--heading-md);
}

.testimonials__aside {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.testimonials__link {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  min-height: 44px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  text-underline-offset: 6px;
  color: var(--color-ink);
}

/* ---- Rows ---- */
.testimonials__rows {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Static layout: cards wrap into a grid */
.testimonials__track {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.quote.is-clone {
  display: none;
}

/* ---- Animated layout ---- */
.testimonials.is-animated .testimonials__row {
  /* bleed to the screen edges, with a soft fade at both ends */
  margin-inline: calc(var(--gutter) * -1);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  cursor: grab;
  touch-action: pan-y;        /* vertical swipes still scroll the page */
  -webkit-user-select: none;
  user-select: none;
}

.testimonials.is-animated .testimonials__row.is-dragging {
  cursor: grabbing;
}

.testimonials.is-animated .testimonials__track {
  align-items: flex-start;   /* an open card doesn't stretch its neighbours */
  flex-wrap: nowrap;
  width: max-content;
  padding-block: 6px;         /* room for the hover lift */
  will-change: transform;
}

.testimonials.is-animated .quote {
  flex: none;
  width: clamp(280px, 30vw, 400px);
}

.testimonials.is-animated .quote.is-clone {
  display: flex;
}

/* ---- One quote card ---- */
.quote {
  position: relative;
  flex: 1 1 280px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  padding: 64px 28px 28px;
  border-radius: var(--radius-box);
  background: var(--color-paper);
  transition: transform 300ms var(--ease), background-color 200ms ease, box-shadow 300ms ease;
}

/* Large opening quotation mark */
.quote::before {
  content: '\201C';
  position: absolute;
  top: 22px;
  left: 26px;
  font-family: var(--font-display);
  font-stretch: var(--stretch-display);
  font-weight: var(--weight-display);
  font-size: 56px;
  line-height: 1;
  color: var(--color-accent);
  transition: color 200ms ease;
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  html:not(.motion-off) .testimonials__row:not(.is-dragging) .quote:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 40px -24px rgba(30, 30, 30, .5);
  }

  html:not(.motion-off) .testimonials__row:not(.is-dragging) .quote:hover::before {
    color: var(--color-ink);
  }
}

.quote__text {
  margin: 0;
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.5;
}

/* Every quote is clamped to the same number of lines until "See more" is
   pressed. scripts/features/testimonials.js shows the button only on quotes
   that overflow, and sets --quote-h so every closed card is equally tall. */
.testimonials.is-animated .quote:not(.is-expanded) {
  min-height: var(--quote-h, auto);
}

.quote:not(.is-expanded) .quote__text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
  line-clamp: 6;
  overflow: hidden;
}

.quote__more {
  display: none;
  align-self: flex-start;
  margin-top: -16px;          /* sits right under the quote, closer than the card gap */
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-ink);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
  cursor: pointer;
}

.quote.is-collapsible .quote__more,
.quote.is-expanded .quote__more {
  display: block;
}

@media (hover: hover) and (pointer: fine) {
  .quote__more:hover { color: var(--color-muted); }
}

.quote__by {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--color-line);
}

.quote__name {
  font-weight: 500;
}
