/* ticker.css - the learnings ticker (WI-8).
   A broadcast-style crawl of takeaways pulled from across the aired library.
   The animated track is aria-hidden and built from a duplicated item array so
   the scroll is seamless; an sr-only <ul> carries the same content for AT and
   for prefers-reduced-motion users (who get a static, wrapped list instead). */

.ticker {
  position: relative;
  background:
    linear-gradient(90deg, var(--bg) 0%, transparent 4%, transparent 96%, var(--bg) 100%),
    var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: stretch;
}

/* "LEARNINGS" channel slug pinned to the left, like a news lower-third. */
.ticker__label {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 clamp(1rem, 3vw, 1.75rem);
  background: var(--ember);
  color: #000;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  z-index: 2;
}
.ticker__label::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #000;
  animation: ticker-blink 1.4s steps(1) infinite;
}
@keyframes ticker-blink { 50% { opacity: 0.25; } }

.ticker__viewport {
  position: relative;
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
}

/* The moving track. Duplicated content (2x) lets a -50% translate loop seamlessly. */
.ticker__track {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
  will-change: transform;
  animation: ticker-scroll 60s linear infinite;
  padding: 0.85rem 0;
}
.ticker:hover .ticker__track,
.ticker:focus-within .ticker__track {
  animation-play-state: paused;
}
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.ticker__item {
  display: inline-flex;
  align-items: center;
  font-size: 0.875rem;
  color: var(--white);
  padding: 0 clamp(1.25rem, 3vw, 2.25rem);
}
.ticker__item b {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--violet);
  margin-right: 0.6rem;
}
.ticker__sep {
  color: var(--ember);
  opacity: 0.6;
  font-size: 0.7rem;
}

/* Static fallback: shown to reduced-motion users, hidden otherwise.
   It is a real, readable wrapped list (not sr-only) so the content is never
   lost to people who disable animation. */
.ticker__static { display: none; }

@media (prefers-reduced-motion: reduce) {
  .ticker { display: block; }
  .ticker__label {
    padding: 0.6rem clamp(1rem, 4vw, 2rem);
    justify-content: flex-start;
  }
  .ticker__viewport { display: none; }
  .ticker__static {
    display: grid;
    gap: 0.6rem;
    padding: var(--space-16) clamp(1rem, 4vw, 2rem);
    list-style: none;
  }
  .ticker__static li {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--white);
    padding-left: var(--space-16);
    border-left: 2px solid var(--violet);
  }
}
