/* ==========================================================================
   Deadline news ticker — slim bar above the navbar.
   Colours/fonts come from the site variables in style.css:
     --ink (bar), --paper (pill), --coral (urgent), --text-dim (separator),
     --line-dark (hairline), --body (Manrope).
   ========================================================================== */

/* The mobile menu in script.js is absolutely positioned at top:64px. It used
   to resolve against the fixed <header>; now that the ticker sits at the top
   of the header, anchor it to the nav row instead so it lands in the same spot. */
header.nav .nav-inner{position:relative;}

.ticker{
  background:var(--ink);
  border-bottom:1px solid var(--line-dark);
  color:#D7DBF0;
  font-family:var(--body);
  font-size:14.5px;
  font-weight:500;
  line-height:1;
  width:100%;
  overflow:hidden;
}
.ticker[hidden]{display:none;}

.ticker-viewport{overflow:hidden;width:100%;}

.ticker-track{
  display:flex;
  width:max-content;
  animation:ticker-scroll var(--ticker-duration,45s) linear infinite;
  will-change:transform;
}
.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-group{display:flex;align-items:center;flex:none;}

.ticker-item{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:9px 0;
  white-space:nowrap;
  color:inherit;
  text-decoration:none;
}
a.ticker-item:hover .ticker-text{color:var(--white);text-decoration:underline;text-underline-offset:3px;text-decoration-thickness:1px;}
a.ticker-item:focus-visible{outline-offset:-2px;border-radius:4px;}

.ticker-pill{
  display:inline-block;
  background:var(--paper);
  color:var(--ink);
  font-size:12px;
  font-weight:600;
  letter-spacing:0.01em;
  padding:4px 10px;
  border-radius:999px;
}
.ticker-item--urgent .ticker-pill{background:var(--coral);color:var(--ink);}

/* Soft-pulsing dot in front of urgent items (no harsh blinking). */
.ticker-dot{
  width:7px;height:7px;border-radius:50%;flex:none;
  background:var(--coral);
  animation:ticker-pulse 2.4s ease-in-out infinite;
}
@keyframes ticker-pulse{
  0%,100%{box-shadow:0 0 0 0 rgba(255,107,87,0.45);}
  50%{box-shadow:0 0 0 5px rgba(255,107,87,0);}
}

/* Thin diamond separator in the site's muted navy tint. */
.ticker-sep{
  width:5px;height:5px;flex:none;
  background:var(--text-dim);
  transform:rotate(45deg);
  margin:0 28px;
  border-radius:1px;
}

@media (max-width:640px){
  .ticker{font-size:14px;}
  .ticker-item{padding:8px 0;gap:8px;}
  .ticker-pill{font-size:11.5px;padding:3px 9px;}
  .ticker-sep{margin:0 20px;}
}

/* Reduced motion: no scrolling animation; the bar becomes sideways-scrollable.
   (style.css already shortens all animations globally — this turns the ticker's off entirely.) */
@media (prefers-reduced-motion:reduce){
  .ticker-viewport{
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
    padding:0 16px;
  }
  .ticker-viewport::-webkit-scrollbar{display:none;}
  .ticker-track{animation:none !important;transform:none !important;}
  .ticker-dot{animation:none !important;box-shadow:0 0 0 3px rgba(255,107,87,0.25);}
}
