.testimonials {
  margin-left: calc(50vw - 1200px / 2);

  @media (max-width: 1440px) {
    max-width: 1230px;
    padding: 0 15px;
    margin: 0 auto;
  }

  @media (max-width: 1024px) {
    margin-left: 0;
    padding: 0 24px;
  }

  .testimonials-slider-wrapper {
    position: relative;

    @media (max-width: 1024px) {
      padding-left: 0;
      padding-right: 0;
    }

    .testimonials-slider {
      margin-bottom: 30px;
      padding-bottom: 1px;
      z-index: 1;

      .swiper-wrapper {
        .swiper-slide {
          width: 1200px;
          border: 1px solid #181818;
          border-radius: 5px;
          display: grid;
          grid-template-columns: 1fr 1fr;
          min-height: 620px;

          @media (max-width: 1440px) {
            width: auto;
          }

          @media (max-width: 1024px) {
            min-height: auto;
            width: auto;
            grid-template-columns: 1fr;
            height: auto;
          }
        }
      }
    }

    .testimonials-slider-pagination {
      display: flex;
      justify-content: center;
      max-width: 1200px;

      &.pagination-mobile-top {
        display: none;
        margin-bottom: 24px;
        justify-content: center;

        @media (max-width: 1024px) {
          display: flex;
        }
      }

      .swiper-pagination-bullet {
        width: 11px;
        height: 11px;
        border-radius: 50%;
        background-color: transparent;
        border: 1px solid var(--c-gray-900);
        transition: background-color 0.3s ease;

        &.swiper-pagination-bullet-active {
          background-color: var(--c-gray-900);
        }
      }
    }
  }
}

.testimonials_left {
  position: relative;
  height: 100%;
  border-right: 1px solid #181818;

  @media (max-width: 1024px) {
    border-right: none;
  }
}

.testimonials_left img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.testimonials_right {
  display: flex;
  flex-direction: column;
}

.testimonials_right_top {
  padding: 30px 0 24px;
  border-bottom: 1px solid #181818;
  display: flex;
  align-items: center;
  justify-content: center;

  @media (max-width: 1440px) {
    padding: 20px 0;
  }

  svg {
    max-height: 62px;

    @media (max-width: 1440px) {
      max-height: 42px;
    }

    @media (max-width: 1024px) {
      max-height: 24px;
    }
  }
}

.testimonials_right_mindle {
  padding: 32px 48px 46px;
  flex: 1;

  @media (max-width: 1440px) {
    padding: 22px 28px;
  }
}

.testimonials_right_mindle h5 {
  font-family: var(--ff-secondary);
  font-weight: 700;
  font-size: 45px;
  line-height: 100%;
  color: #000000;
  margin: 0 0 16px 0;

  @media (max-width: 1366px) {
    font-size: 28px;
  }
}

.testimonials_right_mindle p {
  font-family: 'Inter';
  font-weight: 400;
  font-size: 18px;
  line-height: 1.5;
  color: var(--c-gray-900);
  font-style: italic;

  @media (max-width: 1366px) {
    font-size: 16px;
  }

  @media (max-width: 1024px) {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
  }

  p {
    margin-bottom: 0;
  }
}

.testimonials_right_mindle.expanded p {
  @media (max-width: 1024px) {
    display: block;
    -webkit-line-clamp: unset;
  }
}

.testimonials_read_more {
  display: none;

  @media (max-width: 1024px) {
    display: block;
    background: none;
    border: none;
    color: var(--c-gray-900);
    font-size: 16px;
    font-style: italic;
    margin-top: 6px;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 1px;
    font-family: 'Inter';
    text-align: left;
  }
}

.testimonials_right_bottom {
  padding: 23px 120px;
  border-top: 1px solid #181818;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 17px;

  @media (max-width: 1024px) {
    padding: 20px;
  }
}

.testimonials_right_image {
  min-width: 107px;
  height: 107px;
  border-radius: 100%;
  position: relative;
  overflow: hidden;
  border: 1px solid #181818;
}

.testimonials_right_image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.testimonials_right_content {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.testimonials_right_content strong {
  font-weight: 700;
  font-size: 24px;
  color: #000000;
}

.testimonials_right_content span {
  font-family: 'Inter';
  font-weight: 400;
  font-size: 18px;
  line-height: 1.5;
  color: #000000;
}

.testimonials_goto {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
}

.testimonials_mobile {
  display: none;
  height: 600px;

  @media (max-width: 1024px) {
    display: block;
  }

  @media (max-width: 576px) {
    height: 400px;
  }

  img {
    width: 100%;
    height: 100%;
    max-height: 500px;
    object-fit: cover;
    object-position: top;

    @media (max-width: 576px) {
      max-height: 300px;
    }
  }
}

.testimonials_mobile_link {
  padding: 24px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #181818;
  border-top: 1px solid #181818;
}

/* ----------------------------------------------------------------------------
   Card/Testimonial (Fibbl Design System, node 1842:47) on /customers/.
   Everything below is scoped to .testimonials-slider or the slider's head row:
   product pages load this file for .testimonials_right_mindle without the
   slider and must not change.
   ------------------------------------------------------------------------- */

/* Label and Carousel/Controls, 32 above the cards. The label is the case
   slider's .cases h4 (base.css); the controls copy its square prev / dots /
   next box (what-you-get.css), which is scoped to that slider. */
.testimonials .testimonials-head {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-bottom: 32px;

  @media (max-width: 1024px) {
    margin-bottom: 24px;
  }

  .cases {
    margin-bottom: 0;

    /* The label is long; 14px (its size between 1025 and 1280) keeps it on
       one line on phones, where .cases h4 is otherwise 18px */
    h4 {
      @media (max-width: 576px) {
        font-size: 14px;
      }
    }
  }
}

.testimonials .testimonials-controls {
  display: flex;
  height: 42px;
  background-color: var(--c-gray-25);
  border: 1px solid var(--c-gray-900);
  border-radius: 3px;

  @media (max-width: 1024px) {
    display: none;
  }

  .testimonials-controls_nav {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 100%;
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;

    &.testimonials-controls_prev {
      border-right: 1px solid var(--c-gray-900);
    }

    &.testimonials-controls_next {
      border-left: 1px solid var(--c-gray-900);
    }

    &:focus-visible {
      outline: 2px solid var(--c-gray-900);
      outline-offset: 3px;
    }
  }
}

.testimonials .testimonials-slider-wrapper {
  /* Swiper's CSS gives horizontal pagination width: 100%, which would
     squeeze the arrow buttons, so the dots hug their content */
  .testimonials-slider-pagination.testimonials-controls_dots {
    flex: none;
    align-items: center;
    width: auto;
    padding: 0 16px;
  }

  .testimonials-slider-pagination .swiper-pagination-bullet:focus-visible {
    outline: 2px solid var(--c-gray-900);
    outline-offset: 3px;
  }

  /* The dots below the slider are for 1024 and below; above that they sit
     in the controls */
  .testimonials-slider-pagination.testimonials-slider-pagination_mobile {
    @media (min-width: 1025px) {
      display: none;
    }
  }
}

/* Black and white at rest (greyscale with color/overlay/image on top). On
   desktop, hover brings the colour back. The portraits have the look baked
   into the files, so they get nothing here. */
.testimonials-slider .testimonials_left {
  overflow: hidden;

  img {
    filter: grayscale(100%);
    transition:
      filter 0.3s ease,
      transform 0.4s ease;
  }

  &::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background-color: var(--color-overlay-image);
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .testimonials_goto {
    z-index: 2;

    /* One link per card: below 1025 the card uses the mobile Go to link */
    @media (max-width: 1024px) {
      display: none;
    }
  }
}

.testimonials-slider .testimonials_mobile_photo {
  position: relative;
  display: block;

  img {
    display: block;
    filter: grayscale(100%);
  }

  &::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: var(--color-overlay-image);
    pointer-events: none;
  }
}

/* Type from the component, at every width */
.testimonials-slider .testimonials_right_mindle {
  h5 {
    letter-spacing: -0.03em;
    color: var(--c-gray-900);
  }

  p {
    letter-spacing: -0.02em;
    color: var(--c-gray-900);
  }
}

.testimonials-slider .testimonials_right_content {
  gap: 4px;

  strong {
    font-family: var(--ff-secondary);
    font-size: 25px;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--c-gray-900);
  }

  span {
    letter-spacing: -0.02em;
    color: var(--c-gray-900);
  }
}

/* Desktop card: fixed rows so nothing moves between slides, the outline as an
   ::after that fades on hover (as .knowledge_item in knowledge.css), and the
   Shadow/Lift shadow. Mobile keeps the earlier layout. */
@media (min-width: 1025px) {
  /* The slider no longer clips, so the lift shadow can show below and to the
     right of the card; the section clips sideways instead, which also hides
     the neighbouring slides. */
  .testimonials {
    overflow-x: clip;
  }

  .testimonials .testimonials-slider-wrapper .testimonials-slider {
    overflow: visible;
    margin-bottom: 0;
  }

  .testimonials .testimonials-slider-wrapper .testimonials-slider .swiper-wrapper .swiper-slide {
    position: relative;
    height: 604px;
    min-height: 0;
    overflow: hidden;
    background-color: var(--c-gray-25);
    border: 0;
    border-radius: 5px;
    cursor: pointer;
    transition: box-shadow 0.3s ease;

    &::after {
      content: '';
      position: absolute;
      inset: 0;
      z-index: 3;
      border: 1px solid var(--c-gray-900);
      border-radius: inherit;
      pointer-events: none;
      transition: opacity 0.3s ease;
    }
  }

  .testimonials-slider .testimonials_right_top {
    flex-shrink: 0;
    height: 117px;
    padding: 0;

    svg,
    img {
      max-width: 400px;
      max-height: 66px;
    }
  }

  .testimonials-slider .testimonials_right_mindle {
    min-height: 0;
    padding: 32px 16px 0 48px;

    @media (max-width: 1440px) {
      padding: 22px 16px 0 28px;
    }

    p {
      max-width: 509px;
      margin: 0;
    }
  }

  .testimonials-slider .testimonials_right_bottom {
    flex-shrink: 0;
    height: 159px;
    padding: 0 16px 0 48px;
    justify-content: flex-start;
    gap: 16px;

    @media (max-width: 1440px) {
      padding-left: 28px;
    }
  }
}

/* Above 1440 the photo column is square, as in the component (604 x 604) */
@media (min-width: 1441px) {
  .testimonials {
    /* 24px of room on the left for the shadow's blur, card in the same place */
    margin-left: calc(50vw - 1200px / 2 - 24px);
    padding-left: 24px;
  }

  .testimonials .testimonials-slider-wrapper .testimonials-slider .swiper-wrapper .swiper-slide {
    grid-template-columns: 604px 1fr;
  }
}

@media (min-width: 1025px) and (hover: hover) {
  .testimonials .testimonials-slider-wrapper .testimonials-slider .swiper-wrapper .swiper-slide:hover {
    box-shadow: var(--shadow-lift);

    &::after {
      opacity: 0;
    }

    .testimonials_left img {
      filter: grayscale(0%);
    }

    .testimonials_left::after {
      opacity: 0;
    }
  }
}

@media (min-width: 1025px) and (hover: hover) and (prefers-reduced-motion: no-preference) {
  .testimonials .testimonials-slider-wrapper .testimonials-slider .swiper-wrapper .swiper-slide:hover .testimonials_left img {
    transform: scale(1.08);
  }
}
