/* CLS Prevention: reserve space for JS-injected header */
#site-header {
  min-height: 92px; /* top-bar ~28px + nav 64px */
}

/* FOUC Prevention */
html:not(.loaded) body {
  opacity: 0;
}
html.loaded body {
  opacity: 1;
  transition: opacity 0.2s ease-in-out;
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* Mega-menu positioning */
.mega-menu {
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}
.nav-item:hover .mega-menu,
.mega-menu:hover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Dropdown positioning */
.dropdown-menu {
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}
.nav-item:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Mobile nav slide */
.mobile-nav {
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
}
.mobile-nav.open {
  transform: translateX(0);
}

/* Mobile accordion */
.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-in-out;
}
.accordion-content.open {
  max-height: 1000px;
}

/* Sticky header shadow on scroll */
.header-scrolled {
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
}

/* Custom scrollbar for mobile nav */
.mobile-nav::-webkit-scrollbar {
  width: 4px;
}
.mobile-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

/* Sponsor ticker marquee */
@keyframes sponsor-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.sponsor-ticker-track {
  display: flex;
  width: max-content;
  animation: sponsor-scroll 60s linear infinite;
}
.sponsor-ticker-track:hover {
  animation-play-state: paused;
}
.sponsor-ticker-item {
  flex-shrink: 0;
}
.sponsor-ticker-item img {
  filter: grayscale(1);
  opacity: 0.5;
  transition: filter 0.3s ease, opacity 0.3s ease;
}
.sponsor-ticker-item:hover img {
  filter: grayscale(0);
  opacity: 1;
}

/* News article content styling */
.news-content p {
  margin-bottom: 1rem;
  line-height: 1.75;
}
.news-content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
  margin: 1.5rem 0;
}
.news-content figure {
  margin: 1.5rem 0;
}
.news-content figcaption {
  text-align: center;
  font-size: 0.875rem;
  color: #6b7280;
  margin-top: 0.5rem;
}
.news-content h2, .news-content h3 {
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}
.news-content ul, .news-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}
.news-content li {
  margin-bottom: 0.25rem;
}
.news-content a {
  color: #DD3333;
  text-decoration: underline;
}
.news-content a:hover {
  color: #b82929;
}

/* Leaflet map container */
.leaflet-container {
  z-index: 1;
}
