/* The site menu (the same links on every page) and a page's own "On this page" bar. Loaded after
   home.css or styles.css on each page; main.js opens the menu on phones and marks the bar's section. */
.nav { background: var(--bg); } /* solid: nothing shows through the menu or the bar under it */
/* The pages on styles.css look like the home page's daisyUI menu: semibold links, a plain "Sign in" */
.nav-inner .nav-links { gap: 28px; }
.nav-inner .nav-links a { font-size: 14px; font-weight: 600; color: var(--text); }
.nav-inner .nav-links a:hover { color: var(--accent-text); }
.nav-inner .nav-signin { border-color: transparent; }
.nav-inner .nav-signin:hover { background: var(--panel-2); border-color: transparent; }
.nav-links a[aria-current="page"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent-mark); }
.nav-links .menu-only { display: none; }
.nav-menu { display: none; width: 40px; height: 40px; flex: none; place-items: center; padding: 0; border: 1px solid var(--line-2); border-radius: var(--r); background: transparent; color: var(--text); cursor: pointer; }
.nav-menu svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.nav-menu[aria-expanded="true"] { background: var(--panel-2); }

@media (max-width: 760px) {
  .nav-menu { display: grid; }
  .nav .nav-signin { display: none; }
  .nav-links { display: none !important; }
  .nav.open .nav-links {
    display: flex !important; flex-direction: column; gap: 2px; position: absolute; left: 0; right: 0; top: 100%; margin: 0;
    padding: 8px 16px 16px; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .5);
  }
  .nav.open .nav-links a { display: flex; justify-content: flex-start; padding: 12px 8px; font-size: 17px; color: var(--text); height: auto; min-height: 0; border-radius: var(--r); }
  .nav.open .nav-links a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--accent-mark); background: var(--panel); }
  .nav.open .nav-links .menu-only { display: flex; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 16px; border-radius: 0; }
}

/* On this page: sticks under the site menu */
.subnav { position: sticky; top: var(--nav-h, 64px); z-index: 20; margin-top: 48px; background: var(--bg); border-block: 1px solid var(--line); }
.subnav .wrap { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-block: 8px; }
.subnav .wrap::-webkit-scrollbar { display: none; }
.subnav a { flex: none; padding: 7px 12px; border-radius: 999px; font-size: 14.5px; color: var(--muted); text-decoration: none; white-space: nowrap; transition: color .15s, background .15s; }
.subnav a:hover { color: var(--text); }
.subnav a[aria-current="true"] { color: var(--text); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-2); }
main section[id] { scroll-margin-top: calc(var(--nav-h, 64px) + 64px); }

/* "Skip to content", the first thing a keyboard reaches (scripts/build-site.mjs adds it to every page with
   this menu); hidden above the page until it has focus */
.skip-link { position: absolute; left: 16px; top: -100px; z-index: 100; padding: 10px 14px; border-radius: var(--r); background: var(--accent); color: var(--accent-ink); font-size: 15px; font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 12px; }

/* A quick cross-fade from page to page (Chrome, Edge, Safari 18.2+; others just change page) */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
