.case-slider {
  .case-slider-title {
    display: flex;
    justify-content: center;
    margin-bottom: 100px;

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

    h1 {
      display: flex;
      gap: 12px;
      align-items: center;
      justify-content: center;
      margin: 0;
      padding: 0;
      font-size: var(--fs-5xl);
      line-height: 80%;
      border: none;

      @media (max-width: 1024px) {
        flex-direction: column;
        width: auto;
        padding: 0;
        border: none;
      }

      strong {
        line-height: 80%;
      }

      span {
        padding-left: 8px;
        padding-right: 60px;
        transform: translateY(16px);
        line-height: 40%;
        border-bottom: 1px solid var(--c-gray-900);

        @media (max-width: 1024px) {
          display: flex;
          justify-content: center;
          width: 100%;
          padding: 0;
        }
      }
    }
  }

  .what-you-get-slider-wrapper {
    position: relative;
    padding: 0;

    .what-you-get-slider {
      position: relative;
      z-index: 1;

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

      .swiper-wrapper {
        .swiper-slide {
          .cases {
            @media (max-width: 1024px) {
              margin: 0 20px 20px;
            }

            h4 {
              @media (max-width: 1024px) {
                margin: 0;
              }
            }
          }

          .what-you-get-slider_desktop {
            gap: 40px;
            grid-template-columns: 1fr 550px;
            align-items: start;

            @media (max-width: 1024px) {
              display: grid;
              grid-template-columns: 1fr;
              margin: 0 20px;
            }

            .what-you-get-slider_left {
              margin-right: 0;

              @media (max-width: 1024px) {
                order: 2;
              }

              h2 {
                font-size: var(--fs-2xl);
              }

              .text {
                margin-right: 0;
                margin-bottom: 40px;
                font-style: italic;
              }

              .cta {
                display: flex;
                gap: 24px;

                @media (max-width: 1024px) {
                  flex-direction: column;
                  align-items: center;
                }
              }
            }

            figure {
              margin-top: -42px;

              @media (max-width: 1024px) {
                order: 1;
                margin: 0 -20px;
              }

              img {
                width: 100%;
                border: 1px solid var(--c-gray-900);
                border-radius: 3px;

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

    .what-you-get-slider-nav-wrapper {
      top: 0;
      left: 122px;
      &.customers {
        top: 80px;
      }
    }

    .what-you-get-slider-pagination-wrapper {
      display: flex;
      position: absolute;
      left: 122px;
      top: 0px;
      height: 42px;
      background-color: var(--c-gray-25);
      border: 1px solid var(--c-gray-900);
      border-radius: 3px;
      z-index: 2;
      @media (max-width: 1490px) {
        left: 114px;
      }
      @media (max-width: 1280px) {
        left: 100px;
      }
      @media (max-width: 1024px) {
        display: none;
      }

      .what-you-get-slider-navigation {
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        width: 42px;
        height: 100%;
        top: auto;
        bottom: auto;
        cursor: pointer;

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

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

      .what-you-get-slider-pagination {
        padding: 0 16px;
      }
    }

    .what-you-get-slider-pagination {
      display: flex;
      align-items: center;
      justify-content: center;
      width: auto;

      &.pagination-mobile-bot {
        display: none;
        border-top: 1px solid var(--c-gray-900);
        margin: 40px -20px 0;
        padding-top: 24px;

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

    .what-you-get-slider-nav {
      right: 0;

      &.what-you-get-slider-nav_prev {
        right: auto;
        left: 0;
      }
    }
  }

  &.stories {
    .what-you-get-slider-wrapper {
      /* Story images overflow the slider on purpose, so keep the plain clip here */
      .what-you-get-slider.swiper {
        overflow: hidden;
      }

      .container {
        position: relative;
      }
      .what-you-get-slider-pagination-wrapper {
        top: 80px;
      }
      .what-you-get-slider {
        padding-top: 80px;
        padding-bottom: 40px;
        @media (max-width: 1024px) {
          margin: 0;
          padding: 0;
        }
        .swiper-wrapper {
          .swiper-slide {
            .cases {
              gap: 236px;
              @media (max-width: 1280px) {
                gap: 226px;
              }
              @media (max-width: 1024px) {
                gap: 24px;
                margin: 0 -20px;
                padding: 0 20px 20px;
                border-bottom: 1px solid var(--c-gray-900);
              }
            }
            /* Desktop: text on the left, two stacked case cards next to it
               (Figma "Module/Case Switcher"). The cards take their height
               from the text column: the top card starts level with the
               heading and runs in under the USP band below, at every width. */
            .what-you-get-slider_desktop {
              --heading-top: 32px;
              --card-offset: 32px; /* how far the back card sticks out */
              --card-tuck: 24px; /* how far the top card runs in under the band */
              --fan-back-x: -48px; /* hover: how far each card slides out */
              --fan-top-x: 96px;
              position: relative;
              z-index: 2;
              grid-template-columns: minmax(0, 440px) minmax(0, 1fr);
              gap: 48px;
              margin-bottom: 0;
              @media (max-width: 1280px) {
                --fan-top-x: 40px;
              }
              /* Narrowest desktop: keep the fanned top card inside the window */
              @media (max-width: 1060px) {
                --fan-top-x: 24px;
              }
              @media (max-width: 1024px) {
                display: none;
              }
              .what-you-get-slider_left {
                position: relative;
                h2 {
                  margin: var(--heading-top) 0 16px;
                  font-size: var(--fs-3xl);
                }
                .text {
                  margin-bottom: 64px;
                }
              }
              .case-cards {
                position: relative;
                align-self: stretch;
                margin: 0;
                img {
                  position: absolute;
                  top: calc(var(--heading-top) + var(--card-offset));
                  left: 0;
                  z-index: 1;
                  width: auto;
                  max-width: none;
                  height: calc(100% - var(--heading-top) + var(--card-tuck));
                  aspect-ratio: 1160 / 640;
                  object-fit: cover;
                  border: 1px solid var(--c-gray-900);
                  border-radius: 5px;
                  translate: 0 0;
                  transform-origin: 50% 100%;
                  @media (prefers-reduced-motion: no-preference) {
                    /* Same ease as the card image zooms, longer for the longer move */
                    transition: transform 0.8s ease;
                  }
                  &.is-top {
                    z-index: 2;
                    translate: var(--card-offset) calc(-1 * var(--card-offset));
                  }
                }
                /* Hover: the cards shrink a little and fan out to the sides,
                   the back card up to the left and the top card out to the
                   right, so more of the back card shows. They stay behind
                   the band. */
                @media (hover: hover) {
                  &:hover img {
                    transform: translate(var(--fan-back-x), -64px) rotate(-6deg) scale(0.85);
                    &.is-top {
                      transform: translate(var(--fan-top-x), 12px) rotate(6deg) scale(0.85);
                    }
                  }
                }
              }
            }
            .what-you-get-slider_mobile {
              @media (max-width: 1024px) {
                padding: 0 20px;
                border: none;
                border-radius: 0;
              }
              h2 {
                line-height: 90%;
                @media (max-width: 1024px) {
                  margin: 0.5em 0;
                }
              }
              figure {
                margin: 0 -20px 32px;
                border-top: 1px solid var(--c-gray-900);
                border-bottom: 1px solid var(--c-gray-900);
                img {
                  width: 100%;
                }
              }
              .cta {
                @media (max-width: 1024px) {
                  display: flex;
                  justify-content: center;
                  margin-bottom: 32px;
                }
              }
            }
            .case-slider-features {
              margin: 0 calc(-1 * (50vw - 1200px / 2)) 40px;
              border-top: 1px solid var(--c-gray-900);
              border-bottom: 1px solid var(--c-gray-900);
              /* Opaque and above the desktop cards, which run in under it */
              position: relative;
              z-index: 3;
              background-color: var(--c-gray-25);
              @media (max-width: 1366px) {
                margin: 0 calc(-1 * (50vw - 1120px / 2)) 40px;
              }
              @media (max-width: 1280px) {
                margin: 0 calc(-1 * (50vw - 1005px / 2)) 40px;
              }
              @media (max-width: 1024px) {
                margin: 0 -20px 40px;
              }
              ul {
                display: flex;
                margin: 0;
                padding: 0;
                list-style: none;
                @media (max-width: 1024px) {
                  flex-direction: column;
                }
                li {
                  display: flex;
                  align-items: center;
                  gap: 24px;
                  padding: 12px 24px;
                  border-left: 1px solid var(--c-gray-900);
                  @media (max-width: 1024px) {
                    justify-content: center;
                    margin: 0 -20px;
                    border-left: none;
                    border-bottom: 1px solid var(--c-gray-900);
                  }
                  &:last-of-type {
                    border-right: 1px solid var(--c-gray-900);
                    @media (max-width: 1024px) {
                      border-right: none;
                      border-bottom: none;
                    }
                  }
                  /* Figma "Module/Case Switcher" USP item: Inter italic, normal case */
                  strong {
                    font-family: var(--ff-primary);
                    font-size: 18px;
                    font-style: italic;
                    font-weight: 400;
                    line-height: 1.2;
                    letter-spacing: -0.02em;
                    color: var(--c-gray-900);
                  }
                }
              }
            }
            .cta {
              @media (max-width: 1024px) {
                display: none;
              }
            }
          }
        }
      }
      .what-you-mobile {
        display: none;
        @media (max-width: 1024px) {
          display: flex;
        }
      }
    }
  }
}

/* Article Switcher (Figma "Module/Article Switcher"): label and controls share one row,
   no rule above, and the type and spacing from the design. Not the .stories variant. */
.case-slider:not(.stories) .what-you-get-slider-wrapper {
  .what-you-get-slider {
    padding-top: 0;
    border-top: none;
  }

  /* Controls sit 16px right of the "Article" label, which scales with the breakpoints */
  .what-you-get-slider-nav-wrapper {
    top: 0;
    left: 117px;

    @media (max-width: 1490px) {
      left: 108px;
    }

    @media (max-width: 1280px) {
      left: 100px;
    }
  }

  /* Same selector depth as the base rules above, so these win */
  @media (min-width: 1025px) {
    .what-you-get-slider .swiper-wrapper .swiper-slide .what-you-get-slider_desktop {
      grid-template-columns: 1fr 556px;

      .what-you-get-slider_left {
        h2 {
          margin: 48px 0 16px;
          font-size: 45px;
          line-height: 100%;
          letter-spacing: -0.03em;
        }

        .text,
        .text p {
          font-size: 18px;
          line-height: 1.5;
          letter-spacing: -0.02em;
        }
      }
    }
  }
}
