/* Testimonials — Fancyapps Carousel of testimonial posts (infinite + autoplay).
   Card styling ported from the Bricks template (id 618); slider behaviour is
   driven by the vendored carousel in script.view.js. */

.testimonials {
  overflow: hidden;
  padding-left: 0;
  padding-right: 0;

  /* Width of the fade shadows on the sides of the carousel. */
  --testimonials-transparency-size: 10%;
}

.testimonials__container {
  display: flex;
  flex-direction: column;
  align-items: center;
  row-gap: var(--space-xl);
  width: 100%;
}

.testimonials__container-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  row-gap: var(--space-xs);
  width: var(--content-width);
  max-width: 100%;
  margin-inline: auto;
}

.testimonials__heading {
  font-size: var(--h1);
  text-align: center;
}

.testimonials__description {
  max-width: 65ch;
  font-size: var(--text-l);
  text-align: center;
}

.testimonials__testimonial-list-wrapper {
  display: flex;
  flex-direction: column;
  row-gap: var(--grid-gap);
  width: 100%;
}

/* Carousel: slide width follows the card (33vw etc.); --f-carousel-spacing is
   the inter-slide gap. Edges fade out via a mask on the generated viewport. */
.testimonials__carousel {
  width: 100%;
  --f-carousel-slide-width: auto;
  --f-carousel-spacing: var(--grid-gap);
}

.testimonials__carousel .f-carousel__viewport {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--testimonials-transparency-size), #000 calc(100% - var(--testimonials-transparency-size)), transparent);
  mask-image: linear-gradient(to right, transparent, #000 var(--testimonials-transparency-size), #000 calc(100% - var(--testimonials-transparency-size)), transparent);
}

/* Equal-height cards across the row. */
.testimonials__carousel .f-carousel__track {
  align-items: stretch;
}

/* Card */
.card-testimonials__wrapper {
  display: flex;
  height: auto;
}

.card-testimonials {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  row-gap: var(--content-gap);
  height: 100%;
  margin: 0;
  padding: var(--space-m);
  width: 33vw;
  border: 1px solid var(--secondary-light);
  border-radius: var(--radius-m);
  background-color: var(--secondary-ultra-light);
}

.card-testimonials__blockquote {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  row-gap: var(--space-xs);
  margin: 0;
  padding: 0;
  border: none;
  font-family: inherit;
}

.card-testimonials__testimonial {
  margin: 0;
  padding-left: 0;
  border: 0;
  font-size: var(--text-m);
  font-family: inherit;
  text-wrap: wrap;
}

.card-testimonials__info-container {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  column-gap: var(--space-xs);
  margin-top: auto;
  margin-bottom: 0;
}

.card-testimonials__avatar {
  flex-shrink: 0;
  width: 4.5rem;
  aspect-ratio: 1;
  margin: 0;
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.card-testimonials__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50%;
}

.card-testimonials__author-container {
  display: flex;
  flex-direction: column;
  row-gap: 0;
}

.card-testimonials__author {
  font-size: var(--text-m);
  font-weight: 700;
  line-height: 120%;
  color: var(--primary);
}

.card-testimonials__position {
  font-size: var(--text-s);
  color: color-mix(in srgb, var(--primary) 80%, transparent);
}

@media (max-width: 768px) {
  .card-testimonials {
    width: 90vw;
    max-width: 90vw;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .card-testimonials {
    width: 45vw;
    max-width: 45vw;
  }
}

/* Editor / pre-JS fallback layout.
   The Fancyapps init lives in script.view.js, which is frontend-only and runs
   after load, so in the editor (and for a frontend flash before JS) the raw
   slides are direct children of the carousel with no viewport/track and would
   stack vertically. Lay them out as a horizontal, edge-faded strip. Once
   Fancyapps initialises it moves the slides into .f-carousel__viewport/__track,
   so the carousel no longer has direct .f-carousel__slide children, this
   :has() selector stops matching, and the real carousel takes over. */
.testimonials__carousel:has(> .f-carousel__slide) {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: var(--grid-gap);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--testimonials-transparency-size), #000 calc(100% - var(--testimonials-transparency-size)), transparent);
  mask-image: linear-gradient(to right, transparent, #000 var(--testimonials-transparency-size), #000 calc(100% - var(--testimonials-transparency-size)), transparent);
}

.testimonials__carousel > .f-carousel__slide {
  flex: 0 0 auto;
}
