/* Full-bleed viewport: the overflow-x guard for the 100vw pull lives in
   lunarcat_global.css (html { overflow-x: clip }). The slider is the clip
   window; the flex track inside slides horizontally via translateX. */
.lunarcat-home-slider {
  --card-w: min(900px, 82vw);
  position: relative;
  overflow: hidden;
  min-height: 380px;
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-bottom: calc(var(--space) * 4);
}

/* Side padding lets the first/last card center; adjacent cards peek into the
   gutters. JS sets translateX to bring the active card to center. The transition
   is gated on .is-ready so the initial centering (and the no-JS fallback, where
   the first card is already padding-centered) does not animate. */
.lunarcat-home-slider__track {
  position: relative;
  display: flex;
  gap: var(--space);
  padding: 0 calc((100vw - var(--card-w)) / 2);
  will-change: transform;
}

.lunarcat-home-slider.is-ready .lunarcat-home-slider__track {
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.lunarcat-home-slide {
  flex: 0 0 var(--card-w);
  position: relative;
  min-height: 380px;
  overflow: hidden;
  border-radius: 20px;
}

.lunarcat-home-slider.is-ready .lunarcat-home-slide {
  opacity: 0.55;
  transition: opacity 0.5s ease;
}

.lunarcat-home-slider.is-ready .lunarcat-home-slide.is-active {
  opacity: 1;
}

.lunarcat-home-slide__image-link {
  display: block;
  height: 100%;
}

.lunarcat-home-slide__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lunarcat-home-slide__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(5, 9, 18, 0.82) 0%, rgba(8, 13, 24, 0.5) 55%, rgba(5, 9, 18, 0.15) 100%);
}

/* Text overlays inside its own card; padded off the card's left edge. */
.lunarcat-home-slide__content {
  position: absolute;
  left: 48px;
  top: 50%;
  transform: translateY(-50%);
  max-width: 560px;
  z-index: 2;
  color: #f8fafc;
}

.lunarcat-home-slide__title {
  margin: 0 0 8px;
  font-size: clamp(2rem, 3.5vw, 3rem);
  line-height: 1.1;
  font-weight: 700;
}

.lunarcat-home-slide__description {
  margin: 0 0 14px;
  color: rgba(226, 232, 240, 0.96);
  font-size: var(--font-size-lg);
  max-width: 34ch;
}

/* Arrows sit on imagery, so they stay theme-independent in both modes. */
.lunarcat-home-slider__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(17, 17, 17, 0.45);
  color: #fff;
  cursor: pointer;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.3s ease;
}

.lunarcat-home-slider__nav-icon {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.lunarcat-home-slider__nav--next .lunarcat-home-slider__nav-icon {
  transform: rotate(180deg);
}

.lunarcat-home-slider__nav:hover:not(:disabled),
.lunarcat-home-slider__nav:focus-visible:not(:disabled) {
  transform: translateY(-50%) scale(1.1);
  border-color: rgba(255, 255, 255, 0.65);
  outline: none;
}

.lunarcat-home-slider__nav--prev {
  left: 34px;
}

.lunarcat-home-slider__nav--next {
  right: 34px;
}

.lunarcat-home-slider__nav:disabled,
.lunarcat-home-slider__nav.is-disabled {
  display: none;
}

.lunarcat-home-slider__dots {
  position: static;
  display: flex;
  align-items: center;
  gap: 0;
  justify-content: center;
  width: 100%;
  padding: 0;
  margin-top: 10px;
}

.lunarcat-home-slider__dot {
  all: unset;
  display: inline-block;
  /* 24px tap target; transparent border keeps the visible dot at 6px */
  width: 24px;
  height: 24px;
  border: 9px solid transparent;
  background-clip: padding-box;
  border-radius: 999px;
  background: rgba(74, 85, 104, 0.28);
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  opacity: 0.8;
  box-sizing: border-box;
}

.lunarcat-home-slider__dot.is-active {
  background: var(--color-accent);
  box-shadow: 0 0 8px var(--color-glow);
  opacity: 1;
}

[data-theme="dark"] .lunarcat-home-slider__dot {
  background: rgba(255, 255, 255, 0.16);
}

@media (max-width: 1024px) {
  .lunarcat-home-slider {
    --card-w: 90vw;
  }

  .lunarcat-home-slider,
  .lunarcat-home-slide {
    min-height: 380px;
  }
}

@media (max-width: 768px) {
  .lunarcat-home-slider {
    --card-w: 92vw;
    margin-bottom: calc(var(--space) * 2.5);
    min-height: 0;
  }

  /* Let the image drive the card height so nothing is cropped: full image,
     full width, natural aspect ratio. */
  .lunarcat-home-slide {
    min-height: 0;
  }

  .lunarcat-home-slide__image-link {
    height: auto;
  }

  .lunarcat-home-slide__image {
    height: auto;
    object-fit: contain;
  }

  .lunarcat-home-slide__content {
    left: 18px;
    right: 18px;
  }

  .lunarcat-home-slide__title {
    font-size: 1.5rem;
  }

  .lunarcat-home-slide__description {
    font-size: var(--font-size-sm);
  }

  .lunarcat-home-slider__nav {
    width: 36px;
    height: 36px;
  }

  .lunarcat-home-slider__nav--prev {
    left: 10px;
  }

  .lunarcat-home-slider__nav--next {
    right: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lunarcat-home-slider.is-ready .lunarcat-home-slider__track,
  .lunarcat-home-slider.is-ready .lunarcat-home-slide {
    transition: none;
  }
}
