/* ============================================================
   Ticker — бегущая строка (live + news) — только home.html
   Phase 1a
   ============================================================ */

.ticker {
  overflow: hidden;
  background: var(--surface-2-glass);
  border-bottom: 1px solid var(--border-soft);
  border-left: 3px solid transparent;
  position: relative;
  height: 36px;
  display: flex;
  align-items: center;
}

/* Красная кромка только когда есть живой эфир */
.ticker--live {
  border-left-color: var(--live);
}

/* Fade-out edges */
.ticker::before,
.ticker::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 48px;
  z-index: 2;
  pointer-events: none;
}

.ticker::before {
  left: 0;
  background: linear-gradient(to right, var(--surface-2-glass), transparent);
}

.ticker::after {
  right: 0;
  background: linear-gradient(to left, var(--surface-2-glass), transparent);
}

/* ---------- Track (animating wrapper) ---------- */
.ticker__track {
  display: flex;
  width: max-content;
  animation: ticker-scroll 38s linear infinite;
  will-change: transform;
}

.ticker:hover .ticker__track,
.ticker:focus-within .ticker__track {
  animation-play-state: paused;
}

@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(calc(-1 * var(--ticker-w, 50%))); }
}

/* ---------- Inner (one of two copies) ---------- */
.ticker__inner {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 0;
}

/* ---------- Items ---------- */
.ticker__item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-4);
  height: 36px;
  font-size: var(--fs-xs);
  text-decoration: none;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color var(--dur-fast);
}

.ticker__item:hover,
.ticker__item:focus-visible {
  color: var(--text);
  outline: none;
  background: var(--accent-weak);
}

.ticker__item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* Live item */
.ticker__item--live {
  color: var(--text);
}

.ticker__dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: var(--r-full);
  background: var(--live);
  flex-shrink: 0;
  animation: live-pulse 1.6s var(--ease-standard) infinite;
}

.ticker__live-label {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--live);
  letter-spacing: 0.05em;
}

.ticker__name {
  font-weight: 600;
  color: var(--text);
}

.ticker__sep-text {
  color: var(--text-faint);
}

.ticker__title {
  color: var(--text-muted);
  max-width: 28ch;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* News item */
.ticker__item--news .ticker__icon {
  color: var(--c-telegram);
  flex-shrink: 0;
}

/* Video item */
.ticker__item--video .ticker__icon {
  color: var(--c-youtube, #ff0000);
  flex-shrink: 0;
}

/* Custom event item */
.ticker__item--event .ticker__icon {
  color: var(--text-faint);
  flex-shrink: 0;
}

.ticker__date {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-faint);
  letter-spacing: var(--tracking-meta);
  flex-shrink: 0;
}

.ticker__text {
  color: var(--text-muted);
  max-width: 40ch;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Voxel divider between items ---------- */
.ticker__divider {
  display: inline-block;
  width: 4px;
  height: 4px;
  background: var(--border-strong);
  flex-shrink: 0;
  margin-inline: var(--space-2);
  transform: rotate(45deg);
}

/* ---------- prefers-reduced-motion — no scroll, just overflow ---------- */
@media (prefers-reduced-motion: reduce) {
  .ticker {
    overflow-x: auto;
    overflow-y: hidden;
    height: auto;
    min-height: 36px;
  }

  .ticker::before,
  .ticker::after {
    display: none;
  }

  .ticker__track {
    animation: none;
    width: auto;
  }

  /* Hide duplicate copy */
  .ticker__inner + .ticker__inner {
    display: none;
  }
}
