
/* =========================
   CAROUSEL SECTION
========================= */

.carousel-section {
  margin-top: 64px;
}

.carousel-section .page-container {
  background-color: #f9f9f9;
  max-width: 1280px;
  margin: 0 auto;
  padding-top: 64px;
  padding-bottom: 100px;
}

.carousel-title-line {
  white-space: nowrap;
}

.carousel-header {
  align-items: start;
  margin-bottom: 72px;
}

.carousel-header h2 {
  grid-column: 2 / span 4;
  width: 100%;
  max-width: 331px;
  justify-self: start;
  margin: 0;
  font-family: "Geist", sans-serif;
  font-size: clamp(3.1rem, 2.4vw, 3.2rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--color-text);
}

.carousel-header h2 strong {
  font-weight: 700;
}

.carousel-header p {
  grid-column: 6 / -1;
  width: 100%;
  max-width: 604px;
  justify-self: start;
  margin: 0;
  font-family: "Barlow", sans-serif;
  font-size: 1.1rem;
  line-height: 1.4;
  color: var(--color-text);
}

.carousel-header h2,
.carousel-header p {
  grid-row: 1;
}

/* =========================
   CAROUSEL STAGE
========================= */

.carousel-stage {
  position: relative;
  width: 100%;
  height: clamp(420px, 34vw, 560px);
  
  touch-action: pan-y;
}

.carousel-track {
  position: relative;
  width: 100%;
  height: 100%;


  opacity: 0;
  transition: opacity 0.3s ease;

pointer-events: none;
}

.carousel-track.is-ready {
  opacity: 1;
}

/* =========================
   SLIDES
========================= */

.slide {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 36px;
  overflow: hidden;
  opacity: 0;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  transition:
    transform 0.45s ease,
     width 0.45s ease,
     height 0.45s ease,
    opacity 0.45s ease;
  user-select: none;  
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


.slide.pos--2,
.slide.pos--1,
.slide.pos-0,
.slide.pos-1,
.slide.pos-2 {
  opacity: 1;
  pointer-events: auto;
}


.slide::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.45s ease;
}

/* =========================
   LEFT POSITIONS
========================= */

.slide.pos--2 {
  width: 220px;
  height: 240px;
  z-index: 1;
  transform: translate(calc(-50% - 470px), -50%);
}

.slide.pos--2::after {
  opacity: 1;
  background: linear-gradient(
    to right,
    rgba(249, 249, 249, 0.92) 0%,
    rgba(249, 249, 249, 0.82) 28%,
    rgba(249, 249, 249, 0.45) 62%,
    rgba(249, 249, 249, 0) 100%
  );
}

.slide.pos--1 {
  width: 320px;
  height: 370px;
  z-index: 2;
  transform: translate(calc(-50% - 360px), -50%);
}

.slide.pos--1::after {
  opacity: 1;
  background: linear-gradient(
    to right,
    rgba(249, 249, 249, 0.78) 0%,
    rgba(249, 249, 249, 0.58) 26%,
    rgba(249, 249, 249, 0.24) 58%,
    rgba(249, 249, 249, 0) 100%
  );
}

/* =========================
   CENTER
========================= */

.slide.pos-0 {
  width: 760px;
  height: 420px;
  z-index: 3;
  transform: translate(-50%, -50%);
}

.slide.pos-0::after {
  opacity: 0;
}

/* =========================
   RIGHT POSITIONS
========================= */

.slide.pos-1 {
  width: 320px;
  height: 370px;
  z-index: 2;
  transform: translate(calc(-50% + 360px), -50%);
}

.slide.pos-1::after {
  opacity: 1;
  background: linear-gradient(
    to left,
    rgba(249, 249, 249, 0.78) 0%,
    rgba(249, 249, 249, 0.58) 26%,
    rgba(249, 249, 249, 0.24) 58%,
    rgba(249, 249, 249, 0) 100%
  );
}

.slide.pos-2 {
  width: 220px;
  height: 240px;
  z-index: 1;
  transform: translate(calc(-50% + 470px), -50%);
}

.slide.pos-2::after {
  opacity: 1;
  background: linear-gradient(
    to left,
    rgba(249, 249, 249, 0.92) 0%,
    rgba(249, 249, 249, 0.82) 28%,
    rgba(249, 249, 249, 0.45) 62%,
    rgba(249, 249, 249, 0) 100%
  );
}


.slide.is-hidden {
   opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
width: 0 !important;
  height: 0 !important;
}

.slide.no-transition {
  transition: none !important;
}

/* =========================
   CONTROLS
========================= */

.carousel-controls {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.prev,
.next {
  width: 16px;
  height: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.prev img,
.next img {
  width: 16px;
  height: 12px;
  display: block;
}

.dots {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dot {
  width: 12px;
  height: 12px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background-color: #bdbdbd;
  cursor: pointer;
  transition: transform 0.25s ease, background-color 0.25s ease;
}

.dot.active {
  width: 16px;
  height: 16px;
  background-color: #0d4ad8;
}


button:focus-visible {
  outline: 2px solid #0d4ad8;
  outline-offset: 2px;
}

/* =========================
   LIGHTBOX
========================= */

.carousel-stage .slide {
  cursor: pointer;
}

.carousel-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;

  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.carousel-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.carousel-lightbox__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}

.carousel-lightbox__content {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100vh;
  margin: 0;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.carousel-lightbox__image {
  width: 90vw;
  height: auto;
  max-height: 82vh;
  object-fit: cover;
  display: block;
}

.carousel-lightbox__controls {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.carousel-lightbox__prev,
.carousel-lightbox__next {
  width: 24px;
  height: 18px;
  padding: 0;
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.carousel-lightbox__prev img,
.carousel-lightbox__next img {
  width: 24px;
  height: 18px;
  display: block;
}

.carousel-lightbox__dots {
  display: flex;
  align-items: center;
  gap: 10px;
}

.carousel-lightbox__dot {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background-color: #bdbdbd;
  cursor: pointer;
  transition: transform 0.25s ease, background-color 0.25s ease;
}

.carousel-lightbox__dot.active {
  width: 16px;
  height: 16px;
  background-color: #0d4ad8;
}


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1000px) {

  .carousel-stage {
    height: 340px;
  }

  .slide.pos--2,
  .slide.pos--1,
  .slide.pos-1,
  .slide.pos-2 {
    display: none;
  }

  .slide.pos-0 {
    width: min(100%, 640px);
    height: 340px;
    opacity: 1;
    z-index: 3;
    transform: translate(-50%, -50%);
  }
}

@media (max-width: 900px) {

  .carousel-section {
    padding-left: var(--page-margin);
    padding-right: var(--page-margin);
  }

  .carousel-header {
    display: block;
  }

  .carousel-header h2,
  .carousel-header p {
    grid-column: auto;
    width: 100%;
    max-width: 100%;
  }

  .carousel-header p {
    margin-top: 16px;
  }
}

@media (max-width: 640px) {

  .carousel-stage {
    height: 280px;
  }

  .slide.pos-0 {
    width: min(100%, 360px);
    height: 230px;
  }

  .carousel-controls {
    margin-top: 20px;
  }
}