/**
 * Section: Marquee
 *
 * Full-bleed pink strip. The track holds two identical lists and slides by
 * half its width, so the loop never shows a seam. Each list is at least the
 * viewport wide, so a short list still fills the strip.
 */

.marquee {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--brand-accent);
  color: var(--white);
  padding-block: var(--space-xs);
  padding-inline: 0;
  overflow: hidden;
}

.marquee-window {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee-scroll var(--duration-marquee) linear infinite;
}

.marquee-group {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-around;
  gap: var(--space-xl);
  min-width: 100vw;
  margin: 0;
  padding: 0 var(--space-xl) 0 0;
  list-style: none;
  white-space: nowrap;
}

.marquee-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xl);
  font-weight: var(--weight-strong);
  font-size: var(--text-body);
  letter-spacing: 0.02em;
}

.marquee-heart {
  flex-shrink: 0;
  width: var(--icon-size);
  height: var(--icon-size);
  fill: var(--brand-sun);
  stroke: var(--brand-sun);
}

.marquee:hover .marquee-track,
.marquee:focus-within .marquee-track,
.marquee.is-paused .marquee-track {
  animation-play-state: paused;
}

/* Pause button, added by the script. Sits over the right end of the strip
   on a pink fade so the sliding text passes under it. */
.marquee-toggle {
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0;
  display: grid;
  place-items: center;
  width: calc(var(--tap-target) + var(--space-s));
  padding: 0;
  border: 0;
  background: linear-gradient(to right, transparent, var(--brand-accent) 35%);
  color: var(--white);
  cursor: pointer;
}

/* `display: grid` above outranks the user agent's [hidden] rule. */
.marquee-toggle[hidden] {
  display: none;
}

.marquee-toggle .icon {
  width: var(--tap-target);
  height: var(--tap-target);
  padding: var(--space-2xs);
  border: var(--border-hair) solid currentColor;
  border-radius: var(--radius-pill);
  transition: background-color var(--duration-fast) var(--ease-out);
}

.marquee-toggle:hover .icon {
  background: var(--brand-accent-hover);
}

.marquee-toggle:focus-visible {
  outline: none;
}

.marquee-toggle:focus-visible .icon {
  outline: 3px solid var(--white);
  outline-offset: 2px;
}

.marquee-icon-play,
.marquee-toggle[aria-pressed="true"] .marquee-icon-pause {
  display: none;
}

.marquee-toggle[aria-pressed="true"] .marquee-icon-play {
  display: block;
}

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

/* Reduced motion: one still list, wrapped and centred. */
@media (prefers-reduced-motion: reduce) {
  .marquee {
    padding-inline: var(--space-gutter);
  }

  .marquee-track {
    width: 100%;
    animation: none;
  }

  .marquee-group {
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-2xs) var(--space-m);
    width: 100%;
    min-width: 0;
    padding: 0;
    white-space: normal;
  }

  .marquee-item {
    gap: var(--space-m);
  }

  .marquee-group[aria-hidden="true"],
  .marquee-toggle {
    display: none;
  }
}
