/**
 * @file
 * Marquee slideshow styles.
 *
 * Four rows of auto-scrolling content images with alternating scroll
 * direction. Items are duplicated in the markup so that a -50% translateX
 * creates a seamless infinite loop.
 */

/* ---------------------------------------------------------------------------
   Container
   --------------------------------------------------------------------------- */

.marquee-slideshow {
  overflow: hidden;
  height: 690px;
  background-color: #222222;
}

@media (max-width: 991px) {
  .marquee-slideshow {
    height: 514px;
  }
}

/* ---------------------------------------------------------------------------
   Row
   --------------------------------------------------------------------------- */

.marquee-row {
  overflow: hidden;
  white-space: nowrap;
  padding: 0.25rem 0;
}

/* ---------------------------------------------------------------------------
   Track – the moving strip inside each row
   --------------------------------------------------------------------------- */

.marquee-row:nth-child(2) .marquee-row__track {
  animation-delay: -30s;
}

.marquee-row:nth-child(3) .marquee-row__track {
  animation-delay: -80s;
}

.marquee-row:nth-child(4) .marquee-row__track {
  animation-delay: -115s;
}

.marquee-row__track {
  display: inline-flex;
  gap: 0.75rem;
  animation-duration: 138s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.marquee-row--left .marquee-row__track {
  animation-name: marquee-scroll-left;
}

.marquee-row--right .marquee-row__track {
  animation-name: marquee-scroll-right;
}

/* Pause animation on hover for the entire row. */
.marquee-row:hover .marquee-row__track {
  animation-play-state: paused;
}

/* ---------------------------------------------------------------------------
   Keyframes
   --------------------------------------------------------------------------- */

@keyframes marquee-scroll-left {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@keyframes marquee-scroll-right {
  from {
    transform: translateX(-50%);
  }
  to {
    transform: translateX(0);
  }
}

/* ---------------------------------------------------------------------------
   Item
   --------------------------------------------------------------------------- */

.marquee-row__item {
  position: relative;
  display: block;
  flex-shrink: 0;
  width: 249px;
  border-radius: 0;
  overflow: hidden;
  text-decoration: none;
  color: #fff;
}

.marquee-row__item img {
  display: block;
  width: 100%;
  aspect-ratio: 14 / 9;
  object-fit: cover;
  object-position: top;
}

/* ---------------------------------------------------------------------------
   Overlay (title + badge on hover)
   --------------------------------------------------------------------------- */

.marquee-row__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0.75rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.25s ease;
  white-space: normal;
}

.marquee-row__item:hover .marquee-row__overlay,
.marquee-row__item:focus .marquee-row__overlay {
  opacity: 1;
}

.marquee-row__overlay-title {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
  color: #fff;
}

.marquee-row__overlay-badge {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.8);
}

/* ---------------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------------- */

/* Tablet: show only 3 rows. */
@media (max-width: 991px) {
  .marquee-row:nth-child(n+4) {
    display: none;
  }
}

/* Mobile: show only 2 rows, 75% height, larger items. */
@media (max-width: 767px) {
  .marquee-slideshow {
    height: 513px;
  }

  .marquee-row:nth-child(n+3) {
    display: none;
  }

  .marquee-row__item {
    width: 381px;
  }
}

/* ---------------------------------------------------------------------------
   Accessibility – prefers-reduced-motion
   --------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .marquee-row__track {
    animation-play-state: paused;
  }
}
