/* Load after styles.css and palette.css. Only the navigation is restyled.
   The 18 x 10.4 px cuts follow the 30-degree geometry of the ticket surfaces.
   Clip decorative layers only: links, buttons and their focus rings stay intact. */
.nav-shell {
  --nav-cut: 18px;
  --nav-rise: 10.4px;
  --nav-surface: #030528f2;
  --nav-edge: #a8b8d552;
  position: relative;
  isolation: isolate;
  overflow: visible;
  flex-wrap: nowrap;
  border-color: transparent;
  border-radius: var(--button-radius, 5px);
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.nav-shell .brand { width: 218.5px; }
.nav-shell .brand img { width: 100%; height: auto; }

.nav-shell .desktop-nav {
  flex-wrap: nowrap;
  flex-shrink: 0;
  gap: 22px;
}

.desktop-nav a,
.nav-ticket {
  white-space: nowrap;
}

.nav-shell .nav-actions {
  flex-wrap: nowrap;
  flex-shrink: 0;
}

/* Leave room for the expanded navigation and the temporary palette control. */
@media (max-width: 1399px) {
  .nav-shell .desktop-nav { display: none; }
  .nav-shell .menu-toggle { display: grid; }
  .nav-shell .nav-actions { margin-left: auto; }
}

.nav-shell::before,
.nav-shell::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: var(--button-radius, 5px);
  clip-path: polygon(
    0 0,
    calc(100% - var(--nav-cut)) 0,
    100% var(--nav-rise),
    100% 100%,
    var(--nav-cut) 100%,
    0 calc(100% - var(--nav-rise))
  );
}

.nav-shell::before {
  z-index: -2;
  inset: -1px;
  background: var(--nav-edge);
}

.nav-shell::after {
  z-index: -1;
  inset: 0;
  background: var(--nav-surface);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.nav-shell .icon-button,
.nav-shell .button-icon,
.mobile-menu .icon-button,
.mobile-menu .button-icon {
  border-radius: var(--button-radius, 5px);
}

.nav-shell .icon-button:hover {
  border-color: #b8ceff40;
  background: #ffffff12;
}

.desktop-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 6px;
  width: 20px;
  height: 2px;
  background: var(--yellow);
  transform: skewX(-30deg);
  opacity: 0;
  pointer-events: none;
}

.desktop-nav a:hover::after,
.desktop-nav a.is-active::after,
.desktop-nav a:focus-visible::after {
  opacity: 1;
}

.nav-shell :is(a, button):focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 4px;
  border-radius: var(--button-radius, 5px);
}

/* The expanded menu continues the header surface instead of opening a modal. */
.site-header.is-menu-open .nav-shell::before,
.site-header.is-menu-open .nav-shell::after {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  clip-path: polygon(0 0,calc(100% - var(--nav-cut)) 0,100% var(--nav-rise),100% 100%,0 100%);
}

.mobile-menu {
  --focus: var(--yellow);
  position: relative;
  width: min(1340px,100%);
  max-width: none;
  max-height: calc(100dvh - 116px);
  margin: 0 auto;
  padding: 24px 28px 28px;
  overflow-y: auto;
  border: 1px solid #a8b8d552;
  border-top-color: #a8b8d52b;
  border-radius: 0 0 var(--button-radius,5px) var(--button-radius,5px);
  background: #030528;
  color: #f5f8ff;
  box-shadow: 0 18px 32px #00001c33;
  overscroll-behavior: contain;
  scroll-padding-block: 24px;
}

.mobile-menu:not([hidden]) {
  animation: navigation-open 180ms ease-out both;
}

.mobile-menu-top {
  margin-bottom: 16px;
  color: #bdc9e4;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.mobile-menu nav {
  grid-template-columns: 1fr;
  column-gap: 28px;
  margin-bottom: 24px;
}

.mobile-menu nav a {
  gap: 16px;
  padding: 12px 10px;
  min-height: 52px;
  font-size: 18px;
  line-height: 1.4;
  border-bottom-color: #a8b8d52b;
  border-radius: var(--button-radius, 5px);
}

.mobile-menu nav a span {
  flex-shrink: 0;
  color: #bdc9e4;
  font-size: 13px;
}

.mobile-menu > .button {
  width: fit-content;
}

.mobile-menu nav a:hover,
.mobile-menu nav a:focus-visible {
  background-color: #ffffff0e;
}

.mobile-menu :is(a, button):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
  border-radius: var(--button-radius, 5px);
}

@keyframes navigation-open {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 600px) {
  .mobile-menu nav { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (min-width: 981px) {
  .mobile-menu nav { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

@media (max-width: 767px) {
  .nav-shell .brand { width: 172.5px; }
  html { scroll-padding-top: calc(100px + env(safe-area-inset-top, 0px)); }

  .site-header {
    top: calc(12px + env(safe-area-inset-top, 0px));
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
  }

  .nav-shell {
    --nav-cut: 14px;
    --nav-rise: 8.1px;
  }

  .mobile-menu nav a {
    font-size: 20px;
    line-height: 1.4;
    min-height: 52px;
  }

  .mobile-menu {
    max-height: calc(100dvh - 96px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px));
    padding: 20px 18px 24px;
  }

  .mobile-menu > .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-menu:not([hidden]) { animation: none; }
}

@media (max-width: 420px) {
  .nav-shell { padding-left: 12px; padding-right: 8px; gap: 4px; }
  :root[data-palette-review="true"] .nav-shell .nav-actions { gap: 0; margin-left: auto; }
}

@media (max-width: 374px) {
  .nav-shell { padding-left: 8px; }
  .nav-shell .brand { width: 126.5px; }
}

@media (prefers-reduced-transparency: reduce) {
  .nav-shell {
    background: transparent;
    --nav-surface: #030528;
  }

  .nav-shell::after {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (forced-colors: active) {
  .nav-shell,
  .mobile-menu {
    background: Canvas;
    color: CanvasText;
    border-color: CanvasText;
  }

  .nav-shell::before,
  .nav-shell::after {
    display: none;
  }

  .nav-shell :is(a, button):focus-visible,
  .mobile-menu :is(a, button):focus-visible {
    outline-color: Highlight;
  }
}
