﻿:root {
  --top-gap: 80px;
  --x-gap: 16px;
}

@media screen and (min-width: 768px) {
  :root {
    --top-gap: 102px;
    --x-gap: 32px;
  }
}

@media screen and (min-width: 1024px) {
  :root {
    --top-gap: 134px;
    --x-gap: 32px;
  }
}

@media screen and (min-width: 1440px) {
  :root {
    --top-gap: 150px;
    --x-gap: 112px;
  }
}

.card-carousel-container {
  position: relative;
  width: 100%;
  padding: var(--top-gap) var(--x-gap) 44px;
  box-sizing: border-box;
  background-color: transparent;
  overflow: hidden;
  margin-top: -88px;
  margin-bottom: 40px;
}

.card-carousel {
  position: relative;
  width: 100%;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  display: none;
  z-index: 1;
}

.card-carousel.active {
  opacity: 1;
  display: block;
  z-index: 2;
}

.card-carousel.inactive {
  opacity: 1;
  z-index: 2;
  pointer-events: none;
}

.carousel-image-background {
  filter: blur(5px);
  height: calc(100%);
  inset: -32px;
  position: absolute;
  bottom: var(--top-gap);
  transform: scale(1.4);
  transition: opacity var(--slide-transition-duration);
  width: calc(100%);
  z-index: -1; /* Add this line to position it behind other content */
  opacity: 0.5; /* Add this line to make it less prominent */
  background-position: center;
  background-size: cover;
  isolation: isolate;
}

.carousel-image-backgroundd.active {
  opacity: 1;
  z-index: 0;
}

/* SLIDE */

.carousel-slide {
  position: relative;
  width: 100%;
  height: auto;
}

.carousel-slide img {
  position: relative;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  object-fit: cover;
  aspect-ratio: 1 / 1;
}

.slide-content {
  z-index: 2;
  position: relative;
  bottom: -50%;
  left: 0;
  width: 100%;
  box-sizing: border-box;
  color: white;
  text-align: center;
  display: flex;
  flex-direction: column;
  max-height: 100%;
  overflow-y: auto;
  transition: bottom 2.1s cubic-bezier(0, 0, 0.21, 0.96);
  bottom: 0;
}

.start-slide-content-ani {
  bottom: -500px;
}

.slide-content h3 {
  box-sizing: border-box;
  font-size: 32px;
  font-weight: 300;
  letter-spacing: normal;
  line-height: 38px;
  margin: 1px 0 16px;
}

.slide-content p {
  font-size: 14px;
  margin: 0;
  margin-bottom: 15px;
  font-weight: 300;
}

.slide-content button {
  padding: 13px 22px;
  font-size: 16px;
}

.slide-content icon-picker {
  margin-right: 15px;
}

/* SLIDE PICKER */

.slide-picker {
  position: absolute;
  top: 30px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  padding: 0 10px;
  transition: all 1s ease-in-out;
  z-index: 11;
}

.slide-picker-section {
  position: relative;
  width: 44px;
  height: 2px;
  background-color: rgba(255, 255, 255, 0.3);
  transition: background-color 0.3s ease;
  cursor: pointer;
  margin: 0;
}

.slide-picker-section::before {
  content: "";
  position: absolute;
  top: -14px;
  bottom: -14px;
  left: -10px;
  right: -10px;
  z-index: 1;
}

.slide-picker-section::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: inherit;
  z-index: 2; /* Place the visible part above the clickable area */
}

.slide-picker-section.active::after {
  background-color: white;
  opacity: 1;
}

.slide-picker-section.active {
  background-color: white;
  opacity: 1;
}

.slide-image-main {
  transition: all 1s ease;
}

/* OVERLAY */

.card-carousel-container {
  position: relative;
  overflow: hidden;
  background-color: black;
}

.gradient-overlay {
  position: absolute;
  left: 0;
  right: 0;
  height: 50%;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  animation: fadeIn 3s ease-in-out forwards;
}

.gradient-overlay--top {
  top: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.5) 0%,
    rgba(0, 0, 0, 0) 40%
  );
}

@media screen and (min-width: 768px) {
  .slide-content h3 {
    margin-bottom: 10px;
    font-size: 36px;
  }

  .gradient-overlay--top {
    top: 0;
    background: linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.5) 0%,
      rgba(0, 0, 0, 0) 100%
    );
  }

  .gradient-overlay--bottom {
    bottom: 0;
    background: linear-gradient(
      to top,
      rgba(0, 0, 0, 0.5) 0%,
      rgba(0, 0, 0, 0) 100%
    );
  }

  .slide-content {
    /* bottom: 20px; */
    margin-bottom: 20px;
  }

  .carousel-slide {
    padding-top: 0; /* Remove the padding-top trick */
    height: auto;
    max-height: 100%;
    overflow: hidden;
  }

  .carousel-slide img {
    position: static; /* Reset position */
    width: 100%;
    height: auto;
    aspect-ratio: 704 / 406;
    object-fit: cover;
  }

  .slide-content {
    position: absolute;
    clip-path: inset(0); /* Clip to the image's boundaries */
  }

  .slide-picker {
    justify-content: flex-start;
    left: 10px;
    right: auto;
  }
}

@media screen and (min-width: 1024px) {
  .slide-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    padding: 32px;
    width: 100%;
  }

  .slide-content h3 {
    margin-bottom: 16px;
  }

  .text-wrapper {
    margin-bottom: 0;
  }

  .text-wrapper h3 {
    color: white !important;
  }

  .slide-content {
    margin-bottom: 0;
  }
}

@media screen and (min-width: 1440px) {
  .slide-content h3 {
    font-size: 48px;
  }

  .slide-content p {
    font-size: 16px;
  }
}

@media screen and (min-width: 1440px) {
  .slide-content {
    padding: 32px 32px 16px 32px;

    h3 {
      font-size: 54px;
    }

    p {
      font-size: 18px;
    }
  }

  .card-carousel.active .carousel-slide img {
    max-height: 80vh;
  }

  /* .text-wrapper {
    margin-bottom: 0 !important;
    display: flex;
    align-items: center;

    p {
      margin: 0 !important;
    }
  } */
}

/* UTILS */
.text-wrapper {
  margin-bottom: 16px;
}

/* ANIMATIONS */

.card-carousel.active .carousel-slide img,
.card-carousel.active .slide-content {
  animation: fadeInGrow 1s ease-in-out forwards;
}

.exit {
  animation: fadeOutShrink 1s ease-in-out forwards;
}
