/*-- -------------------------- -->
<---        Testimonials         -->
<--- -------------------------- -*/

/* Same stylistic language as My Specialisms - same background, same
   centred white topper/title/text - but with a looping horizontal
   carousel of quote cards instead of a grid. The track is the card
   list duplicated once so the marquee-style scroll can loop
   seamlessly; it pauses on hover/focus and is disabled entirely for
   reduced-motion users. */
@media only screen and (min-width: 0rem) {
  #testimonials {
    width: 100%;
    padding: var(--sectionPadding);
    background-image: url('../images/OFFERINGSBACKGROUND.svg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-sizing: border-box;
    overflow: hidden;
  }
  #testimonials .cs-container {
    width: 100%;
    max-width: 78rem;
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  #testimonials .cs-topper {
    color: #fff;
  }
  #testimonials .cs-title {
    color: #fff;
    margin: 0 0 3rem;
  }
  #testimonials .cs-text {
    color: #fff;
    max-width: 40rem;
    margin: 0 0 3rem;
  }

  #testimonials .cs-carousel {
    /* Direct child of the full-width section (not the centred
       .cs-container), so bleeding edge-to-edge is just cancelling out
       the section's own horizontal padding - no viewport-width hacks
       needed, and nothing fights the .cs-container's flex centring. */
    width: calc(100% + 2rem);
    margin-left: -1rem;
    margin-right: -1rem;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  }
  #testimonials .cs-carousel-track {
    width: max-content;
    display: flex;
    align-items: stretch;
    gap: 1.25rem;
    padding: 0.5rem 0;
    animation: cs-testimonials-scroll 36s linear infinite;
  }
  #testimonials .cs-carousel:hover .cs-carousel-track,
  #testimonials .cs-carousel:focus-within .cs-carousel-track {
    animation-play-state: paused;
  }
  #testimonials .cs-testimonial-card {
    flex: none;
    width: 20rem;
    box-sizing: border-box;
    padding: 2rem 1.75rem;
    border-radius: 0.75rem;
    text-align: left;
    display: flex;
    flex-direction: column;
  }
  #testimonials .cs-testimonial-card:nth-child(3n+1) {
    background-color: var(--secondaryLight);
  }
  #testimonials .cs-testimonial-card:nth-child(3n+2) {
    background-color: var(--primaryLight);
  }
  #testimonials .cs-testimonial-card:nth-child(3n+3) {
    background-color: #f7f3e1;
  }
  #testimonials .cs-quote-mark {
    font-family: var(--headingFont);
    font-size: 2.5rem;
    line-height: 1em;
    color: var(--navy);
    opacity: 0.35;
    margin: 0 0 0.5rem;
  }
  #testimonials .cs-quote {
    font-family: var(--bodyFont);
    font-size: 1rem;
    line-height: 1.6em;
    color: var(--navy);
    margin: 0 0 1.25rem;
  }
  #testimonials .cs-attribution {
    margin-top: auto;
    font-family: var(--bodyFont);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--navy);
  }

  @keyframes cs-testimonials-scroll {
    from {
      transform: translateX(0);
    }
    to {
      transform: translateX(-50%);
    }
  }
}

/* Smaller cards on mobile so more of the carousel is visible on
   screen at once. */
@media only screen and (max-width: 47.9375rem) {
  #testimonials .cs-testimonial-card {
    width: 14rem;
    padding: 1.25rem 1.125rem;
  }
  #testimonials .cs-quote-mark {
    font-size: 1.75rem;
    margin: 0 0 0.25rem;
  }
  #testimonials .cs-quote {
    font-size: 0.875rem;
    margin: 0 0 0.75rem;
  }
  #testimonials .cs-attribution {
    font-size: 0.6875rem;
  }
}

@media only screen and (min-width: 64rem) {
  #testimonials .cs-testimonial-card {
    width: 22rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  #testimonials .cs-carousel-track {
    animation: none;
  }
  #testimonials .cs-carousel {
    overflow-x: auto;
  }
}
