/* =====================================================================
   NAV MENU BUTTON, phones only (Edwin's choice, 2026-10-12).

   Six top navs wrapped their links onto two or three rows on a phone, so a
   44px tap box per row would have pushed every page down 26 to 138px. Under
   768 those links now sit behind one Menu button and open as a list of 44px
   rows. From 768 up nothing here applies and the bar is exactly as before.

   Wiring, per page: the header carries data-nav-menu, the row data-nav-menu-
   inner, the links nav data-nav-menu-panel and an id the button's
   aria-controls names. The button ships hidden and /assets/js/nav-menu.js
   shows it. Without script the links stay in the bar and stay tappable, as
   44px rows from each page's phone tap floor block, so the bar is taller
   than it was (26 to 83px at 390) but nothing is hidden.
   No new tokens: lines and type come from the page's own nav.
   tests/nav-menu-button-20261012.test.mjs holds every nav to it.
   ===================================================================== */
.nav-menu-btn { display: none; }

@media (max-width: 767px) {
  .nav-menu-ready .nav-menu-btn:not([hidden]) {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    min-width: 44px;
    margin-left: auto;
    padding: 0 2px;
    background: none;
    border: 0;
    color: inherit;
    cursor: pointer;
  }
  .nav-menu-bars { display: grid; gap: 4px; width: 18px; }
  .nav-menu-bars i { display: block; height: 1.5px; background: currentColor; }
  .nav-menu-ready [data-nav-menu-inner] { flex-wrap: wrap; }
  .nav-menu-ready [data-nav-menu-panel] { display: none; }
  .nav-menu-ready.is-open [data-nav-menu-panel] {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0;
    flex: 1 0 100%;
    order: 10;
    padding: 4px 0 10px;
    animation: nav-menu-in 160ms ease both;
  }
  .nav-menu-ready.is-open [data-nav-menu-panel] > a {
    display: flex;
    align-items: center;
    min-height: 44px;
    /* currentColor, not --line: --line is 8 percent black in both schemes and
       vanishes on the dark pages (/b/, /c/v2/, /g/). The --line line first is
       only the fallback for a browser without color-mix. */
    border-top: 1px solid var(--line);
    border-top: 1px solid color-mix(in srgb, currentColor 18%, transparent);
  }
  .nav-menu-ready.is-open [data-nav-menu-panel] > a:first-child { border-top: 0; }
  .nav-menu-ready.is-open [data-nav-menu-panel] > select { align-self: flex-start; margin-top: 8px; min-height: 44px; }
}
@keyframes nav-menu-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .nav-menu-ready.is-open [data-nav-menu-panel] { animation: none; }
}
