/* tfs-ticker: one-line headline bar for tfsnews.1088labs.com
 * Dark scheme. Every color and size is a custom property on #tfs-ticker,
 * so the site can restyle it without touching the rules below.
 */
#tfs-ticker {
  --tfs-bg: #0e1116;
  --tfs-fg: #e6e8eb;
  --tfs-muted: #9aa3ad;
  --tfs-source: #f2c94c;
  --tfs-border: #232a33;
  --tfs-sep: #3a434e;
  --tfs-focus: #7cc4ff;
  --tfs-height: 36px;
  --tfs-font-size: 13px;
  --tfs-small: 11px;
  --tfs-font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  display: flex;
  align-items: stretch;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  height: var(--tfs-height);
  overflow: hidden;
  background: var(--tfs-bg);
  color: var(--tfs-fg);
  border-bottom: 1px solid var(--tfs-border);
  font-family: var(--tfs-font);
  font-size: var(--tfs-font-size);
  font-weight: 500;
  line-height: 1;
  color-scheme: dark;
}

#tfs-ticker:empty,
#tfs-ticker[hidden] { display: none; }

#tfs-ticker *,
#tfs-ticker *::before,
#tfs-ticker *::after { box-sizing: border-box; }

/* "Latest" label (no pulsing dot: items can be up to 24 hours old) */
#tfs-ticker .tfs-ticker__label {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px 0 12px;
  border-right: 1px solid var(--tfs-border);
  font-size: var(--tfs-small);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Scrolling area */
#tfs-ticker .tfs-ticker__viewport {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
}
#tfs-ticker .tfs-ticker__track {
  display: flex;
  flex: none;
  width: max-content;
  animation: tfs-scroll var(--tfs-duration, 90s) linear infinite;
  will-change: transform;
}
#tfs-ticker .tfs-ticker__group {
  display: flex;
  flex: none;
  margin: 0;
  padding: 0;
  list-style: none;
}
#tfs-ticker .tfs-ticker__item {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0 28px 0 0;
  white-space: nowrap;
}
#tfs-ticker .tfs-ticker__item::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 12px;
  width: 4px;
  height: 4px;
  margin-top: -2px;
  border-radius: 50%;
  background: var(--tfs-sep);
}
#tfs-ticker .tfs-ticker__link {
  display: inline-block;
  padding: 0 2px;
  line-height: var(--tfs-height);
  color: inherit;
  text-decoration: none;
}
#tfs-ticker .tfs-ticker__link:hover .tfs-ticker__title {
  text-decoration: underline;
  text-underline-offset: 3px;
}
#tfs-ticker .tfs-ticker__link:focus-visible {
  outline: 2px solid var(--tfs-focus);
  outline-offset: -5px;
  border-radius: 4px;
}
#tfs-ticker .tfs-ticker__src {
  color: var(--tfs-source);
  font-size: var(--tfs-small);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
/* Holds a real space so screen readers say "NPR Russia releases", plus a little extra air. */
#tfs-ticker .tfs-ticker__sep { padding-left: 4px; }

/* "Updated 7:05 AM CT" */
#tfs-ticker .tfs-ticker__updated {
  flex: none;
  display: flex;
  align-items: center;
  gap: 0.35em;
  padding: 0 12px 0 10px;
  border-left: 1px solid var(--tfs-border);
  color: var(--tfs-muted);
  font-size: var(--tfs-small);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Pause on hover and on keyboard focus */
#tfs-ticker:hover .tfs-ticker__track,
#tfs-ticker:focus-within .tfs-ticker__track { animation-play-state: paused; }

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

/* Phones: drop the word "Updated" so the headlines keep most of a 375 px screen */
@media (max-width: 480px) {
  #tfs-ticker .tfs-ticker__updated-word { display: none; }
  #tfs-ticker .tfs-ticker__label { padding: 0 8px 0 10px; }
  #tfs-ticker .tfs-ticker__updated { padding: 0 10px 0 8px; }
}

/* Reduced motion: no scrolling animation, a static row the reader can swipe or scroll */
@media (prefers-reduced-motion: reduce) {
  #tfs-ticker .tfs-ticker__track { animation: none; transform: none; }
  #tfs-ticker .tfs-ticker__viewport {
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    -webkit-mask-image: none;
    mask-image: none;
  }
  #tfs-ticker .tfs-ticker__group[aria-hidden="true"],
  #tfs-ticker .tfs-ticker__item[data-copy] { display: none; }
}

/* TFS tag (Oct 21 2026): a small gold IOWA label before the source name */
#tfs-ticker .tfs-ticker__tag {
  display: inline-block;
  padding: 0 0.35em;
  margin-right: 0.1em;
  border-radius: 2px;
  background: #CFA23A;
  color: #15171A;
  font-size: 0.72em;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.5;
  vertical-align: 0.1em;
}
