/* The MTB east site header as drawn on the pages that aren't Next.js pages (the Sofa to Singletrack app and the games
   hub) -- see games/site-nav.js, which builds the markup and is the only place the link list lives on this side.
   Matches the website's SiteHeader.tsx: 64px row, #111111, Oswald 14px links, #e6530f on hover and for the current
   page, the real logo, the filled-orange "Enter a race" and the teal-outlined "Sign in" / "My Account". Every control
   is at least 44px tall. The desktop row (links + dropdown groups) shows from 1280px, the website's xl breakpoint;
   below that it's logo + "Enter a race" + a hamburger whose panel lists every link under group headings, as the
   website's MobileNav does. Dropdowns and the menu are <details>, so they open and close without any script. */

#mtbe-site-nav {
  position: sticky;
  top: 0;
  z-index: 999;
  background: #111111;
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-family: 'Oswald', 'Arial Narrow', sans-serif;
  font-size: 14px;
  text-transform: uppercase; /* the website's .font-display */
  letter-spacing: 0.01em;
  line-height: 1.2;
}
#mtbe-site-nav * { box-sizing: border-box; }
#mtbe-site-nav a { color: #ffffff; text-decoration: none; }
#mtbe-site-nav a:focus-visible,
#mtbe-site-nav summary:focus-visible { outline: 2px solid #e6530f; outline-offset: 2px; }
#mtbe-site-nav summary { list-style: none; cursor: pointer; user-select: none; -webkit-user-select: none; }
#mtbe-site-nav summary::-webkit-details-marker { display: none; }

#mtbe-site-nav .inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}

#mtbe-site-nav .home { flex-shrink: 0; display: flex; align-items: center; min-height: 44px; }
#mtbe-site-nav .home img { display: block; height: 44px; width: auto; }

/* ---- Desktop: top-level links and dropdown groups --------------------------------------------------------------- */
#mtbe-site-nav .links { display: none; align-items: center; gap: 4px; min-width: 0; }
#mtbe-site-nav .links > a,
#mtbe-site-nav .group > summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 2px;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
#mtbe-site-nav .links > a:hover,
#mtbe-site-nav .group > summary:hover,
#mtbe-site-nav .group[open] > summary,
#mtbe-site-nav a.current,
#mtbe-site-nav summary.current { color: #e6530f; }
#mtbe-site-nav .links > a.home-btn { margin-right: 8px; border: 1px solid rgba(255, 255, 255, 0.3); }
#mtbe-site-nav .links > a.home-btn:hover { border-color: #e6530f; }

#mtbe-site-nav .group { position: relative; }
#mtbe-site-nav .group > summary::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-left: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.15s;
}
#mtbe-site-nav .group[open] > summary::after { transform: translateY(1px) rotate(225deg); }
#mtbe-site-nav .dropdown { position: absolute; left: 0; top: 100%; padding-top: 4px; min-width: 190px; z-index: 1; }
#mtbe-site-nav .dropdown > div {
  background: #111111;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  padding: 4px 0;
}
#mtbe-site-nav .dropdown a { display: flex; align-items: center; min-height: 44px; padding: 0 16px; white-space: nowrap; transition: color 0.15s, background-color 0.15s; }
#mtbe-site-nav .dropdown a:hover { color: #e6530f; background: rgba(255, 255, 255, 0.05); }

/* ---- Right-hand actions ---------------------------------------------------------------------------------------- */
#mtbe-site-nav .actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
#mtbe-site-nav .btn-enter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 15px;
  background: #c4470d;
  border: 2px solid #c4470d;
  color: #ffffff;
  font-size: 13px;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background-color 0.15s;
}
#mtbe-site-nav .btn-enter:hover { background: #a13a0b; border-color: #a13a0b; }
#mtbe-site-nav .btn-account {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid #7ac5b3;
  color: #7ac5b3;
  white-space: nowrap;
  transition: background-color 0.15s, color 0.15s;
}
#mtbe-site-nav .btn-account:hover { background: #7ac5b3; color: #111111; }

/* ---- Phone and tablet: hamburger + full-width panel ------------------------------------------------------------- */
#mtbe-site-nav .menu > summary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
}
#mtbe-site-nav .bars { display: flex; flex-direction: column; justify-content: center; gap: 6px; width: 24px; }
#mtbe-site-nav .bars i { display: block; height: 2px; width: 24px; background: #ffffff; transition: transform 0.15s, opacity 0.15s; }
#mtbe-site-nav .menu[open] .bars i:nth-child(1) { transform: translateY(8px) rotate(45deg); }
#mtbe-site-nav .menu[open] .bars i:nth-child(2) { opacity: 0; }
#mtbe-site-nav .menu[open] .bars i:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

#mtbe-site-nav .panel {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  background: #111111;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
#mtbe-site-nav .panel > nav { max-width: 1280px; margin: 0 auto; padding: 8px 16px 16px; }
#mtbe-site-nav .panel ul { list-style: none; margin: 0; padding: 0; }
#mtbe-site-nav .panel > nav > ul > li { border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
#mtbe-site-nav .panel > nav > ul > li:last-child { border-bottom: 0; }
#mtbe-site-nav .panel li > a { display: flex; align-items: center; min-height: 48px; font-size: 16px; transition: color 0.15s; }
#mtbe-site-nav .panel li > a:hover { color: #e6530f; }
#mtbe-site-nav .panel .group-block { padding: 8px 0; }
#mtbe-site-nav .panel .heading { margin: 0; padding: 4px 0; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: rgba(255, 255, 255, 0.5); }
#mtbe-site-nav .panel .group-block li > a { padding-left: 12px; min-height: 44px; }
#mtbe-site-nav .panel .btn-account { display: inline-flex; margin-top: 12px; }

@media (min-width: 1280px) {
  #mtbe-site-nav .links { display: flex; }
  #mtbe-site-nav .actions > .btn-account { display: inline-flex; }
  #mtbe-site-nav .menu { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  #mtbe-site-nav * { transition: none !important; }
}
