/*
 * Marquee band (SPEC §2.14). Values from tokens.css only.
 *
 * HTML contract (decorative: hidden from assistive tech, SPEC §2.14)
 *   <div class="marquee" aria-hidden="true">
 *     <div class="marquee__track" lang="en">
 *       <span class="marquee__text"
 *         data-text="SUN MUSIC OFFICIAL GOLF CHANNEL"></span>
 *       … 4 copies in all (the space after each is padding) …
 *
 * The words are generated content (::before, from data-text), not DOM
 * text: green-50 on the page background is about 1.1:1, which WCAG 1.4.3
 * allows for pure decoration, but axe would report DOM text. Without CSS
 * the band is empty, which is fine for decoration.
 *     </div>
 *   </div>
 *
 * Full bleed: the page places it straight after the team band and before
 * the YouTube intro (SPEC §3.1 row 4), with no gap on either side; the band
 * runs from the grass edge to the photo edge. The line box reaches past the
 * band (into the grass above, under the photo below), where the capitals
 * have no ink. Overflow is clipped sideways only.
 *
 * Scroll (ASSUMPTION, Q18): the track moves one phrase (a quarter of its 4
 * copies) per --duration-marquee, right to left, forever. Three copies are
 * always in view, enough for viewports up to 3 phrases wide (3864 at the
 * PC size). Static as drawn under prefers-reduced-motion, and hidden in
 * print. No JS. No states: the band is not interactive.
 */

.marquee {
  display: flow-root; /* the track's negative margins stay inside */
  overflow-x: clip;
  color: var(--color-green-50);
}

.marquee__track {
  display: flex;
  inline-size: max-content;
  margin-block: calc(-1 * var(--marquee-trim-start))
    calc(-1 * var(--marquee-trim-end));
  margin-inline-start: var(--marquee-start);
  font-family: var(--font-en);
  font-size: var(--text-marquee-size);
  font-style: italic;
  font-weight: var(--font-weight-bold);
  line-height: var(--text-marquee-lh);
}

/* The space after each copy is padding, so the loop never depends on
   whitespace in the markup. */
.marquee__text {
  flex: none;
  padding-inline-end: var(--marquee-space);
  white-space: nowrap;
}

.marquee__text::before {
  content: attr(data-text);
}

@media (prefers-reduced-motion: no-preference) {
  .marquee__track {
    animation: marquee var(--duration-marquee) linear infinite;
  }
}

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

/* PC: the 5px rule under the text, and a 1px stroke on the letters */
@media (width >= 1200px) {
  .marquee {
    border-block-end: var(--marquee-rule) solid var(--color-green-50);
  }

  .marquee__track {
    -webkit-text-stroke: var(--marquee-stroke) var(--color-green-50);
  }
}

@media print {
  .marquee {
    display: none;
  }
}
