:root {
  --ticker-duration: 20s;
  --ticker-top: 85px;
  --ticker-height: 48px;
}

.news-ticker {
  position: fixed; /* place it on top of the page */
  top: var(--ticker-top); /* right after header */
  left: 0;
  right: 0;
  height: var(--ticker-height);
  display: flex;
  align-items: center;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  overflow: hidden;
  margin: 0; /* fixed element does not need margin */
}

/* ensure content below isn't hidden by ticker: add top padding to hero section */
.hero {
  padding-top: calc(var(--ticker-top) + var(--ticker-height));
}

.news-ticker .ticker-track {
  display: inline-block;
  white-space: nowrap;
  padding: 8px 12px;
  animation: ticker-scroll var(--ticker-duration) linear infinite;
  will-change: transform;
}

.news-ticker .ticker-item {
  display: inline-block;
  margin: 0 12px;
  font-weight: 600;
  color: #222;
  font-size: 16px;
}

.news-ticker .ticker-sep {
  margin: 0 8px;
  color: #888;
}

/* pause on hover or when class added (for touch) */
.news-ticker:hover .ticker-track,
.news-ticker.ticker-paused .ticker-track {
  animation-play-state: paused;
}

/* Hero image rules: full-width, natural height but limit max height */
.hero-media {
  width: 100%;
  height: auto; /* show full image, not forced viewport height */
  max-height: 950px;
  display: block;
  object-fit: cover;
}

.hero-content {
  padding: 48px 24px;
}

.hero-copy h1 {
  font-size: 2.5rem;
  margin: 0 8px;
}

.hero-tagline {
  font-size: 1.125rem;
}

/* animation: move left by50% (requires duplicated content in markup) */
@keyframes ticker-scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* Mobile adjustments */
@media (max-width: 768px) {
  :root {
    --ticker-duration: 30s;
    --ticker-top: 70px;
    --ticker-height: 44px;
  }
  .hero {
    padding-top: calc(var(--ticker-top) + var(--ticker-height));
  }
  .news-ticker .ticker-item {
    font-size: 14px;
    margin: 0 8px;
  }
  .hero-media {
    max-height: 480px;
  }
  .hero-content {
    padding: 24px 16px;
  }
  .hero-copy h1 {
    font-size: 1.6rem;
  }
  .hero-tagline {
    font-size: 1rem;
  }
}

@media (max-width: 420px) {
  :root {
    --ticker-duration: 40s;
    --ticker-top: 60px;
    --ticker-height: 40px;
  }
  .hero {
    padding-top: calc(var(--ticker-top) + var(--ticker-height));
  }
  .news-ticker .ticker-item {
    font-size: 13px;
    margin: 0 6px;
  }
  .hero-copy h1 {
    font-size: 1.4rem;
  }
}