/**
 * Skeleton loading states for hero slider
 * Amazon-style shimmer loading placeholder
 */

/* Hide all slides except first before Slick initializes */
/* This overrides critical CSS that sets display:flex!important */
.hero-slider-wrapper .slick-slides:not(.slick-initialized) .slide-item {
  display: none !important;
}

.hero-slider-wrapper .slick-slides:not(.slick-initialized) .slide-item:first-child {
  display: block !important;
  width: 100%;
  height: 100%;
}

/* Base skeleton shimmer animation */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-gray-100) 0%,
    var(--color-gray-300) 20%,
    var(--color-gray-100) 40%,
    var(--color-gray-100) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 4px;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Dark mode skeleton (follows the .dark class, not the OS preference) */
.dark .skeleton {
  background: linear-gradient(
    90deg,
    var(--color-gray-800) 0%,
    var(--color-gray-700) 20%,
    var(--color-gray-800) 40%,
    var(--color-gray-800) 100%
  );
}

/* Hero slider skeleton placeholder */
.hero-skeleton {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 400px;
  overflow: hidden;
  border-radius: 0.5rem; /* rounded-lg */
}

@media (min-width: 768px) {
  .hero-skeleton {
    min-height: 600px;
  }
}

/* Main image skeleton */
.hero-skeleton__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Content overlay skeleton (bottom gradient area) */
.hero-skeleton__content {
  position: absolute;
  bottom: 2rem;
  left: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 10;
}

/* Title skeleton */
.hero-skeleton__title {
  width: 70%;
  max-width: 400px;
  height: 2.5rem;
}

@media (min-width: 640px) {
  .hero-skeleton__title {
    height: 3rem;
  }
}

/* Subtitle skeleton */
.hero-skeleton__subtitle {
  width: 50%;
  max-width: 300px;
  height: 1.25rem;
  margin-top: 0.5rem;
}

@media (min-width: 640px) {
  .hero-skeleton__subtitle {
    height: 1.5rem;
  }
}

/* Gradient overlay for skeleton (matches real slider gradient) */
.hero-skeleton__gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.7) 0%,
    rgba(0, 0, 0, 0.4) 20%,
    transparent 40%
  );
  pointer-events: none;
}

/* Hide skeleton once the first hero image has painted */
.hero-slider-wrapper.is-hero-ready .hero-skeleton {
  display: none;
}
