/* Stacking Cards on Scroll — изолированные классы .test-sticky-cards__* */

.test-sticky-cards {
  background: hsl(265, 10%, 75%);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.test-sticky-cards * {
  box-sizing: border-box;
}

.test-sticky-cards__space {
  height: 90vh;
}

.test-sticky-cards__space--small {
  height: 40vh;
}

.test-sticky-cards__cards {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-rows: repeat(var(--sticky-cards-count, 3), var(--sticky-card-height, 400px));
  gap: 40px 0;
}

.test-sticky-cards__card {
  position: sticky;
  top: 0;
}

.test-sticky-cards__inner {
  will-change: transform;
  background: #fff;
  border-radius: 14px;
  display: flex;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transform-origin: center top !important;
  /* transform и filter задаются из test-sticky-cards.js при скролле */
}

.test-sticky-cards__image-wrap {
  width: 40%;
  flex-shrink: 0;
}

.test-sticky-cards__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 1;
}

.test-sticky-cards__content {
  padding: 40px 30px;
  display: flex;
  flex-direction: column;
}

.test-sticky-cards__title {
  margin: 0 0 0.25em;
  font-size: 2.5rem;
  font-weight: 600;
  color: #16263a;
}

.test-sticky-cards__text {
  margin: 0;
  line-height: 1.4;
  font-size: 1.25rem;
  color: #16263a;
}

@media (max-width: 600px) {
  .test-sticky-cards__inner {
    flex-direction: column;
  }

  .test-sticky-cards__image-wrap {
    width: 100%;
  }

  .test-sticky-cards__image {
    aspect-ratio: 16 / 9;
  }

  .test-sticky-cards__title {
    font-size: 1.75rem;
  }

  .test-sticky-cards__text {
    font-size: 1rem;
  }

  .test-sticky-cards__content {
    padding: 24px 20px;
  }
}
