/* =================================================================
   Department ticker — a slowly moving strip of every department name,
   under the home hero. The whole strip is a toggle button
   (js/components/ticker.js, WCAG 2.2.2 Pause, Stop, Hide):
   aria-pressed="true" holds it still. The track holds the list twice so
   the loop is seamless; it moves toward the reading direction.
   ================================================================= */

.ticker {
  --focus-ring-color: var(--color-amber);

  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  padding-block: 1.6rem;
  background: var(--color-ink);
  color: var(--color-paper);
  cursor: pointer;
}

.ticker:focus-visible { outline-offset: -0.4rem; }

.ticker__track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: ticker-scroll 60s linear infinite;
}

[dir="rtl"] .ticker__track { animation-name: ticker-scroll-rtl; }

.ticker[aria-pressed="true"] .ticker__track { animation-play-state: paused; }

.ticker__item {
  display: inline-flex;
  align-items: center;
  gap: 2.4rem;
  padding-inline-end: 2.4rem;
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: var(--font-weight-semibold);
  white-space: nowrap;
}

/* Separator: the logo's leaf, drawn as a rounded diamond */
.ticker__item::after {
  content: '';
  width: 1rem;
  height: 1rem;
  border-radius: 0 0.8rem;
  background: var(--color-leaf);
}

.ticker__state {
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0;
  display: flex;
  align-items: center;
  padding-inline: 2.4rem 1.6rem;
  background: linear-gradient(to left, var(--color-ink) 60%, transparent);
  color: var(--color-amber);
}
[dir="rtl"] .ticker__state { background: linear-gradient(to right, var(--color-ink) 60%, transparent); }

.ticker__state-icon { width: 1.8rem; height: 1.8rem; }
.ticker__state-icon--play { display: none; }
.ticker[aria-pressed="true"] .ticker__state-icon--pause { display: none; }
.ticker[aria-pressed="true"] .ticker__state-icon--play { display: block; }

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

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

/* Reduced motion: the strip stands still (the script also disables the toggle) */
@media (prefers-reduced-motion: reduce) {
  .ticker__track,
  [dir="rtl"] .ticker__track { animation: none; }
  .ticker { cursor: default; }
}
