/* Navigation overlay: scrolls when taller than the screen, centred when it fits, two columns when wide. */
html.nav-open, html.nav-open body { overflow: hidden; }
#main-navigation {
  display: block !important;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
#main-navigation > div {
  box-sizing: border-box;
  min-height: 100%;
  width: max-content;
  max-width: 100%;
  margin: 0 auto;
  display: grid;
  align-content: center;
  align-items: start;
  gap: 3rem;
  padding: max(5rem, calc(env(safe-area-inset-top) + 4rem)) 1.5rem max(3rem, calc(env(safe-area-inset-bottom) + 2rem));
}
#main-navigation a[role="menuitem"] {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding-block: 0.25rem;
  min-width: 0;
}
#main-navigation a[role="menuitem"] > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#main-navigation a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 0.3em;
  text-decoration-thickness: 2px;
}
#main-navigation a.nav-new::after {
  content: "new";
  margin-left: 0.6em;
  padding: 0.1em 0.45em;
  font-size: 0.45em;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid currentColor;
  border-radius: 999px;
  opacity: 0.7;
}
/* Side by side on wide screens and on phones held sideways, where height is scarce. */
@media (min-width: 768px), (orientation: landscape) and (min-width: 560px) {
  #main-navigation > div { grid-auto-flow: column; column-gap: clamp(3rem, 8vw, 6rem); }
}
@media (max-height: 520px) {
  #main-navigation > div { gap: 2rem; padding-top: 4.5rem; }
  #main-navigation ul.text-2xl { font-size: 1.25rem; line-height: 1.6; }
  #main-navigation a[role="menuitem"] { min-height: 40px; }
}
