/* Shared site header (nav.topnav): one-line brand, and a menu button that
   replaces the link row when it doesn't fit. Paired with /site-nav.js.
   Linked after each page's inline <style>; colours come from the page so the
   light pages and the dark park pages both work. */

.topnav { gap: 12px; }
.topnav-brand { white-space: nowrap; flex-shrink: 0; }
.topnav-links { min-width: 0; }
.topnav-links a { white-space: nowrap; flex-shrink: 0; }

/* Without JS the row scrolls sideways instead of being cut off. */
.topnav:not(.nav-js) .topnav-links { overflow-x: auto; scrollbar-width: none; }
.topnav:not(.nav-js) .topnav-links::-webkit-scrollbar { display: none; }

/* ----- Menu button ----- */
.topnav .nav-toggle { display: none; }
.topnav.nav-collapsed .nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; width: 44px; height: 44px; margin: 0 -8px 0 auto; padding: 0;
  background: none; border: 0; border-radius: 8px; cursor: pointer;
}
.topnav.nav-collapsed .nav-toggle:focus-visible { outline: 2px solid currentColor; outline-offset: -2px; }
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block; width: 22px; height: 2px; border-radius: 2px;
  background: currentColor; transition: transform .2s, background-color .2s;
}
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before,
.nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -7px; }
.nav-toggle-bars::after { top: 7px; }
.topnav.nav-open .nav-toggle-bars { background-color: transparent; }
.topnav.nav-open .nav-toggle-bars::before { transform: translateY(7px) rotate(45deg); }
.topnav.nav-open .nav-toggle-bars::after { transform: translateY(-7px) rotate(-45deg); }

/* ----- Collapsed links: dropdown panel under the bar ----- */
.topnav.nav-collapsed .topnav-links {
  display: none;
  position: absolute; top: 100%; left: 0; right: 0;
  flex-direction: column; gap: 2px;
  padding: 8px 12px 12px;
  background: var(--nav-menu-bg); /* opaque copy of the bar colour, set by site-nav.js */
  border-bottom: inherit;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.14);
  max-height: calc(100vh - 56px);
  max-height: calc(100dvh - 56px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.topnav.nav-collapsed.nav-open .topnav-links { display: flex; }
.topnav.nav-collapsed .topnav-links a {
  display: block;
  padding: 12px 14px; border-radius: 8px;
  font-size: 15px; line-height: 1.3;
}

@media (max-width: 600px) {
  .topnav.nav-collapsed { padding-left: 16px; padding-right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { transition: none; }
}
