/*
 * Featured-items ticker (November 20, 2026).
 *
 * One scrolling row of featured links, restored after the November 3
 * accessibility pass made it static. It meets WCAG 2.2.2 with a pause button,
 * and pauses on mouse hover and keyboard focus. Only the first list is
 * exposed; the copies that make the loop seamless are aria-hidden and their
 * links are tabindex="-1", so they can be clicked but never focused.
 *
 * yr-marquee-20261120.js starts the motion. Without the script the row stays
 * still and the button stays hidden. With prefers-reduced-motion the row
 * becomes a centred, wrapped list that never moves.
 *
 * Per-site values come from custom properties on the section:
 *   --yr-marquee-fg    pause icon colour (the links' colour)
 *   --yr-marquee-gap   horizontal padding on each link
 */
/* --yr-marquee-fade: where the fade before the pause icon begins, from the
   right edge. The script reads it to keep a focused link clear of the fade. */
.yr-marquee { --yr-marquee-fade: 84px; position: relative; overflow: hidden; }
@media (max-width: 480px) { .yr-marquee { --yr-marquee-fade: 72px; } }
.yr-marquee-viewport { overflow: hidden; overflow: clip; }
.yr-marquee-track { display: flex; width: max-content; }
.yr-marquee-list {
  display: flex; flex: none; align-items: center;
  margin: 0; padding: 6px 0; list-style: none;
}
.yr-marquee-list li { display: flex; flex: none; align-items: center; }
.yr-marquee-list a {
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 0 var(--yr-marquee-gap, 22px);
  white-space: nowrap; text-decoration: none;
}
.yr-marquee-list a:focus-visible {
  outline: 2px solid currentColor; outline-offset: -2px; border-radius: 6px;
}
.yr-marquee-sep { flex: none; line-height: 1; }

/* Running: the row fades out just before the pause icon. */
.yr-marquee.is-live .yr-marquee-viewport {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - var(--yr-marquee-fade)), transparent calc(100% - 44px));
  mask-image: linear-gradient(90deg, #000 calc(100% - var(--yr-marquee-fade)), transparent calc(100% - 44px));
}
/* A bare icon: no box, border or label. The 44px button is transparent. */
.yr-marquee-toggle {
  /* Above the masked row, which paints as its own layer later in the tree. */
  position: absolute; z-index: 1; top: 50%; right: max(6px, env(safe-area-inset-right));
  display: grid; place-items: center; width: 44px; height: 44px;
  margin: -22px 0 0; padding: 0; border: 0; border-radius: 10px;
  background: transparent; color: var(--yr-marquee-fg, #fff);
  opacity: .7; cursor: pointer; transition: opacity .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.yr-marquee-toggle[hidden] { display: none; }
.yr-marquee-toggle:hover, .yr-marquee-toggle:focus-visible { opacity: 1; }
.yr-marquee-toggle:focus { outline: none; }
.yr-marquee-toggle:focus-visible { outline: 2px solid var(--yr-marquee-fg, #fff); outline-offset: -8px; }
.yr-marquee-toggle svg { display: block; width: 12px; height: 12px; fill: currentColor; }
.yr-marquee-toggle .yr-marquee-play,
.yr-marquee-toggle[aria-pressed="true"] .yr-marquee-pause { display: none; }
.yr-marquee-toggle[aria-pressed="true"] .yr-marquee-play { display: block; }

@media (prefers-reduced-motion: reduce) {
  .yr-marquee-track { display: block; width: auto; }
  .yr-marquee-list {
    flex-wrap: wrap; justify-content: center; gap: 0 4px;
    max-width: 1120px; margin: 0 auto; padding: 10px clamp(10px, 4vw, 30px);
  }
  .yr-marquee-list li { flex: 0 1 auto; min-width: 0; max-width: 100%; }
  .yr-marquee-list[aria-hidden="true"], .yr-marquee-sep, .yr-marquee-toggle { display: none; }
  .yr-marquee-list a {
    padding: 0 clamp(8px, 2vw, var(--yr-marquee-gap, 22px));
    white-space: normal; text-align: center; text-wrap: balance;
  }
}
