.image-carousel {
  position: relative;
  overflow: hidden;
  padding: clamp(4rem, 8vw, 6rem) 1.25rem;
  background: #ffffff;
  color: #1e293b;
}

.image-carousel__backdrop {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(180deg, rgba(11, 17, 35, 0.78), rgba(11, 17, 35, 0.9)),
    var(--image-carousel-bg-image);
  background-size: cover;
  background-position: center;
  filter: blur(5px);
  transform: scale(1.03);
}

.image-carousel__inner {
  position: relative;
  z-index: 1;
  width: min(1440px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 3rem;
}

.image-carousel__header {
  display: grid;
  gap: 0.75rem;
  max-width: 40rem;
}

.image-carousel__title {
  margin: 0;
  font-family:
    "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: #0f172a;
}

.image-carousel__subtitle {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.6;
  font-weight: 400;
  color: #64748b;
}

.image-carousel__slider {
  overflow: hidden;
  width: 100%;
  padding-bottom: 2rem;
  margin-bottom: -2rem;
  container-type: inline-size;
}

.image-carousel__track {
  display: flex;
  gap: 1.5rem;
  will-change: transform;
}

.image-carousel__card {
  position: relative;
  flex: 0 0 auto;
  width: calc((100% - 4.5rem) / 4);
  width: calc((100cqi - 4.5rem) / 4);
  aspect-ratio: 1 / 1;
  border-radius: 1rem;
  overflow: hidden;
  cursor: pointer;
  /* box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08); */
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.image-carousel__card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.image-carousel__card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.image-carousel__card:hover img {
  transform: scale(1.05);
}

.image-carousel--has-background-image {
  color: #f8fafc;
}

.image-carousel--has-background-image .image-carousel__title {
  color: #ffffff;
}

.image-carousel--has-background-image .image-carousel__subtitle {
  color: rgba(226, 232, 240, 0.84);
}

.image-carousel--has-background-image .image-carousel__slider {
  position: relative;
}

.image-carousel--has-background-image .image-carousel__card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.18);
}

@media (max-width: 1100px) {
  .image-carousel__card {
    width: calc((100% - 3rem) / 3);
    width: calc((100cqi - 3rem) / 3);
  }
}

@media (max-width: 760px) {
  .image-carousel__card {
    width: calc((100% - 1.5rem) / 2);
    width: calc((100cqi - 1.5rem) / 2);
  }
  .image-carousel__inner {
    gap: 2rem;
  }
}

@media (max-width: 480px) {
  .image-carousel__card {
    width: 100%;
    width: 100cqi;
    aspect-ratio: 4 / 3;
  }
}

/* Lightbox Styles */
.image-carousel-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.95);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
  backdrop-filter: blur(8px);
}

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

.image-carousel-lightbox__close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  background: none;
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 10;
  transition:
    transform 0.2s ease,
    color 0.2s ease;
}

.image-carousel-lightbox__close:hover {
  transform: scale(1.1);
  color: #f8fafc;
}

.image-carousel-lightbox__content {
  position: relative;
  width: 90%;
  max-width: 1200px;
  height: 90%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.image-carousel-lightbox__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 0.5rem;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.image-carousel-lightbox.is-open .image-carousel-lightbox__img {
  transform: scale(1);
}
