.header-nav {
  max-width: 1780px;
  margin: 0 auto;
  padding: 0 24px 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}
.header-nav a {
  font-size: 0.74rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.header-nav a:hover,
.header-nav a[aria-current="page"] { color: var(--nav-highlight, var(--accent)); }
nav a[href].nav-wind { color: #22d3ee; }
nav a[href].nav-solar { color: #fbbf24; }
nav a[href].nav-nuclear { color: #a78bfa; }
.header-nav a.nav-contact {
  padding: 4px 10px;
  border: 1px solid currentColor;
  border-radius: 6px;
  color: var(--text);
  line-height: 1.4;
  white-space: nowrap;
}
.header-nav a.nav-contact:hover,
.header-nav a.nav-contact[aria-current="page"] { color: var(--nav-highlight, var(--accent, var(--text))); }

/* Mobile navigation is enhanced only after the menu has been mounted. */
.mobile-nav-toggle, .mobile-nav-fallback-brand, .mobile-nav-placeholder { display: none; }
.mobile-site-menu:not([open]) { display: none; }
.mobile-site-menu {
  --menu-bg: #0f172a;
  --menu-text: #e2e8f0;
  --menu-muted: #94a3b8;
  --menu-line: rgba(148,163,184,.2);
  --menu-active: rgba(56,189,248,.1);
  --menu-wind: #22d3ee;
  --menu-solar: #fbbf24;
  --menu-nuclear: #a78bfa;
  --menu-flood: #2dd4bf;
  box-sizing: border-box;
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  width: min(360px, calc(100% - 24px));
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--menu-line);
  background: var(--menu-bg);
  color: var(--menu-text);
  font-family: Inter, system-ui, sans-serif;
  box-shadow: -16px 0 60px rgba(0,0,0,.2);
}
.mobile-site-menu[open] { display: flex; flex-direction: column; }
.mobile-site-menu::backdrop { background: rgba(2,6,23,.48); backdrop-filter: blur(3px); }
html[data-theme="light"] .mobile-site-menu {
  --menu-bg: #ffffff;
  --menu-text: #0f172a;
  --menu-muted: #475569;
  --menu-line: rgba(15,23,42,.12);
  --menu-active: #eef6fc;
  --menu-wind: #0e7490;
  --menu-solar: #92400e;
  --menu-nuclear: #6d28d9;
  --menu-flood: #0f766e;
}
.mobile-nav-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--menu-line); flex-shrink: 0; }
.mobile-nav-heading h2 { margin: 0; color: var(--menu-text); font-size: 15px; font-weight: 650; line-height: 1.3; }
.mobile-nav-close { display: grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px; padding: 0; border: 1px solid var(--menu-line); border-radius: 10px; background: transparent; color: var(--menu-text); font: 26px/1 system-ui, sans-serif; cursor: pointer; }
.mobile-nav-links { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 10px 12px; flex: 1; }
.mobile-nav-links a { display: flex; align-items: center; min-height: 44px; padding: 10px 14px; border-radius: 8px; color: var(--menu-text); font-size: 14px; font-weight: 500; line-height: 1.35; text-decoration: none; }
.mobile-nav-links a:hover, .mobile-nav-links a[aria-current="page"] { background: var(--menu-active); color: var(--menu-text); text-decoration: none; }
.mobile-nav-links a[aria-current="page"] { font-weight: 700; box-shadow: inset 3px 0 var(--menu-link-accent, #0ea5e9); }
.mobile-nav-links a[href="/wind-farms"] { --menu-link-accent: var(--menu-wind); color: var(--menu-link-accent); }
.mobile-nav-links a[href="/solar"] { --menu-link-accent: var(--menu-solar); color: var(--menu-link-accent); }
.mobile-nav-links a[href="/nuclear"] { --menu-link-accent: var(--menu-nuclear); color: var(--menu-link-accent); }
.mobile-nav-links a[href="/flood"] { --menu-link-accent: var(--menu-flood); color: var(--menu-link-accent); }
.mobile-nav-theme { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px max(16px, env(safe-area-inset-bottom)); border-top: 1px solid var(--menu-line); color: var(--menu-muted); font-size: 13px; flex-shrink: 0; }
.mobile-nav-close:focus-visible, .mobile-nav-toggle:focus-visible, .mobile-nav-links a:focus-visible { outline: 2px solid #0ea5e9; outline-offset: 2px; }
body.mobile-nav-open { overflow: hidden !important; }

@media (max-width: 900px) {
  html .mobile-nav-shell { position: sticky !important; top: 0; z-index: 10000; background: var(--bg, #0a0e1a); }
  html .mobile-nav-header:has(> .theme-toggle) { grid-template-columns: minmax(0,1fr) 52px 44px; }
  html .mobile-nav-header > .theme-toggle { grid-column: 2; grid-row: 1; display: inline-flex; align-items: center; justify-content: center; position: static; min-width: 0; width: 52px; min-height: 44px; padding: 8px 4px; border-radius: 6px; background: transparent; color: var(--text, #e2e8f0); border: 1px solid var(--border, var(--line-soft, rgba(148,163,184,.25))); box-shadow: none; font: 500 12px/1 Inter,system-ui,sans-serif; }
  html .mobile-nav-header:has(> .theme-toggle) > .mobile-nav-toggle { grid-column: 3; }
  html .mobile-nav-source { display: none !important; }
  html .mobile-nav-header { display: grid !important; grid-template-columns: minmax(0,1fr) 44px; align-items: center; gap: 12px; padding: 14px 16px; }
  html .mobile-nav-header > :first-child { grid-column: 1; min-width: 0; }
  html .mobile-nav-fallback-brand { display: block; color: var(--text, #e2e8f0); text-decoration: none; font-weight: 700; }
  html .mobile-nav-header > .mobile-nav-standalone-action { grid-column: 1 / -1; width: fit-content; }
  html .mobile-nav-header > .mobile-nav-toggle { grid-column: 2; grid-row: 1; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--border, var(--line-soft, rgba(148,163,184,.3))); border-radius: 10px; background: transparent; color: var(--text, #e2e8f0); cursor: pointer; }
  html .mobile-nav-header > .mobile-nav-placeholder { grid-column: 2; grid-row: 1; display: block; width: 44px; height: 44px; }
  html .mobile-nav-header .brand h1, html .mobile-nav-header .brand .brand-title { font-size: 1.12rem; line-height: 1.25; }
  html .mobile-nav-header .brand p { font-size: 10px; letter-spacing: .1em; line-height: 1.4; }
  html .mobile-nav-actions { grid-column: 1 / -1; display: flex !important; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; width: 100%; min-width: 0; margin: 0; }
  html .mobile-nav-actions > .back-btn, html .mobile-nav-actions > .share-wrap { width: auto; flex: 1 1 130px; }
  html .mobile-nav-actions > .back-btn, html .mobile-nav-actions > .share-wrap > .share-btn { min-height: 40px; padding: 8px 10px; font-size: 12px; white-space: nowrap; }
  html .mobile-nav-actions > .share-wrap > .share-btn { width: 100%; }
  html .mobile-nav-actions > .last-updated { flex-basis: 100%; width: 100%; order: 3; font-size: 11px; }
  html .mobile-nav-actions:empty { display: none !important; }
}

nav a[href].nav-flood { color: #2dd4bf; }
nav a[href].nav-weather { color: #a5c8ff; }
html[data-theme="light"] nav a.nav-wind { color: #0e7490; }
html[data-theme="light"] nav a.nav-solar { color: #92400e; }
html[data-theme="light"] nav a.nav-nuclear { color: #6d28d9; }
html[data-theme="light"] nav a.nav-flood { color: #0f766e; }
html[data-theme="light"] nav a.nav-weather { color: #1d4ed8; }
.mobile-nav-links a.nav-weather { --menu-link-accent: #a5c8ff; color: var(--menu-link-accent); }
html[data-theme="light"] .mobile-nav-links a.nav-weather { --menu-link-accent: #1d4ed8; }
