/**
 * Category Marquee — GeneratePress Luxe
 *
 * Infinite horizontal scroll of product category cards.
 * Pure CSS animation — no JS needed for the scroll itself.
 * Two identical .luxe-marquee__set elements create the seamless loop.
 *
 * @package GP_Luxe
 */

/* =========================================================================
   1. Marquee container
   ========================================================================= */

.luxe-marquee {
  --_duration: var(--luxe-marquee-duration, 40s);
  --_direction: var(--luxe-marquee-direction, normal);
  --_gap: var(--luxe-space-5);

  position: relative;
  overflow: hidden;
  width: 100%;
  padding: var(--luxe-space-8) 0;
}

/* Gradient fade at edges for polish */
.luxe-marquee::before,
.luxe-marquee::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 80px;
  z-index: 2;
  pointer-events: none;
}

.luxe-marquee::before {
  left: 0;
  background: linear-gradient(to right, var(--luxe-white, #fafafa), transparent);
}

.luxe-marquee::after {
  right: 0;
  background: linear-gradient(to left, var(--luxe-white, #fafafa), transparent);
}

/* =========================================================================
   2. Marquee track — holds two identical sets side by side
   ========================================================================= */

.luxe-marquee__track {
  display: flex;
  width: max-content;
  animation: luxeMarqueeScroll var(--_duration) linear infinite;
  animation-direction: var(--_direction);
}

/* Pause on hover variant */
.luxe-marquee--pause-hover:hover .luxe-marquee__track {
  animation-play-state: paused;
}

/* =========================================================================
   3. Marquee set — one complete copy of all cards
   ========================================================================= */

.luxe-marquee__set {
  display: flex;
  gap: var(--_gap);
  padding-right: var(--_gap); /* gap between set copies */
  flex-shrink: 0;
}

/* =========================================================================
   4. Category card — overlay style (default)
   ========================================================================= */

.luxe-marquee__card {
  position: relative;
  display: block;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 2px;
  text-decoration: none;
  color: var(--luxe-white);
  background: var(--luxe-black);
}

.luxe-marquee__card-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  opacity: 0.88;
}

.luxe-marquee__card:hover .luxe-marquee__card-img {
  transform: scale(1.06);
  opacity: 0.7;
}

@media (prefers-reduced-motion: reduce) {
  .luxe-marquee__card:hover .luxe-marquee__card-img {
    transform: none;
  }
}

/* Placeholder when no thumbnail */
.luxe-marquee__card-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, #553B2D 0%, #311603 100%);
}

/* Overlay text on top of image */
.luxe-marquee__card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--luxe-space-5);
  background: linear-gradient(
    to top,
    rgba(49, 22, 3, 0.65) 0%,
    rgba(49, 22, 3, 0.10) 50%,
    transparent 100%
  );
}

.luxe-marquee__card-name {
  display: block;
  font-family: var(--luxe-font-serif);
  font-size: var(--luxe-text-lg);
  font-weight: 300;
  letter-spacing: var(--luxe-tracking-tight);
  line-height: var(--luxe-leading-tight);
  color: var(--luxe-white);
}

.luxe-marquee__card-count {
  display: block;
  margin-top: var(--luxe-space-1);
  font-family: var(--luxe-font-sans);
  font-size: var(--luxe-text-xs);
  font-weight: 400;
  letter-spacing: var(--luxe-tracking-wider);
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

/* =========================================================================
   5. Category card — text-below variant
   ========================================================================= */

.luxe-marquee--text-below .luxe-marquee__card {
  background: transparent;
  color: var(--luxe-black);
}

.luxe-marquee--text-below .luxe-marquee__card-img {
  aspect-ratio: 3 / 4;
  height: auto;
  border-radius: 2px;
}

.luxe-marquee--text-below .luxe-marquee__card-text {
  padding: var(--luxe-space-3) 0 0;
}

.luxe-marquee--text-below .luxe-marquee__card-name {
  color: var(--luxe-black);
  font-size: var(--luxe-text-md);
}

.luxe-marquee--text-below .luxe-marquee__card-count {
  color: var(--luxe-mid-grey);
}

.luxe-marquee--text-below .luxe-marquee__card-placeholder {
  aspect-ratio: 3 / 4;
  height: auto;
}

/* =========================================================================
   6. Keyframes
   ========================================================================= */

@keyframes luxeMarqueeScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* =========================================================================
   7. Responsive
   ========================================================================= */

@media (max-width: 768px) {
  .luxe-marquee::before,
  .luxe-marquee::after {
    width: 40px;
  }
}
