/* The shared top bar, every page (markup: scripts/lib/site-nav.mjs; behaviour: js/nav.js). One source:
   site/public/css/nav.css (scripts/site-nav.mjs copies it beside the gallery's own files).
   The room's own pieces: the paper pill the logo sits on, round ink for where you are, 44 px targets.
   Wide: logo, a paper bar of five links, the account icon. Under 840 px: logo, Menu, the account icon,
   and Menu opens the same four links on a paper card. Light only, as the site is. */

.sbar { display: flex; align-items: center; gap: 8px; }
.sbar > * { flex: none; }

/* the logo: home, from every page */
.sbar .sbar-logo { display: inline-flex; align-items: center; min-height: 44px; margin: 0 auto 0 0; padding: 3px 14px 3px 12px; border-radius: 999px; background: var(--paper, #FBFAF7); box-shadow: 0 8px 22px -14px rgba(20, 19, 26, 0.45); text-decoration: none; transition: background-color 0.3s, box-shadow 0.3s; }
.sbar .sbar-logo:hover { background: #fff; }
.sbar .sbar-logo .brand-logo { display: block; width: 160px; height: 38px; }
/* the home page, at the top of its hero: the logo stands on the wall (site.js makes the bar solid as you scroll) */
.sbar.nav:not(.solid) .sbar-logo { background: transparent; box-shadow: none; }

/* the links: one paper bar, the page you are on in ink */
.sbar-links { display: flex; align-items: center; gap: 2px; border-radius: 999px; background: rgba(251, 250, 247, 0.94); box-shadow: 0 8px 20px -12px rgba(30, 20, 40, 0.5); }
.sbar-link { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 16px; border-radius: 999px; color: var(--ink, #14131A); font: 600 15px/1 var(--text, system-ui, sans-serif); letter-spacing: -0.005em; text-decoration: none; white-space: nowrap; transition: background-color 0.2s, color 0.2s; }
.sbar-link:hover { background: #fff; }
.sbar-link[aria-current] { background: var(--ink, #14131A); color: #fff; }
.sbar-ext { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: 0.55; }
.sbar-link:focus-visible, .sbar-menu:focus-visible, .sbar .sbar-acct:focus-visible, .sbar .sbar-logo:focus-visible { outline: 3px solid var(--ink, #14131A); outline-offset: 2px; }

/* your account: the same round button everywhere, rightmost (each area's own script fills in your initial) */
.sbar .sbar-acct { display: inline-grid; place-items: center; width: 44px; height: 44px; margin: 0; border-radius: 50%; color: var(--ink, #14131A); text-decoration: none; box-shadow: 0 8px 20px -12px rgba(30, 20, 40, 0.5); }
.sbar .sbar-acct:not(.in) { background: rgba(251, 250, 247, 0.94); }
.sbar .sbar-acct:not(.in):hover { background: #fff; }
.sbar .sbar-acct svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }

/* Menu: only on narrow screens, and only once js/nav.js runs (without it the links stay in the bar) */
.sbar-menu { display: none; align-items: center; gap: 6px; height: 44px; min-width: 44px; padding: 0 16px 0 13px; border: 0; border-radius: 999px; background: rgba(251, 250, 247, 0.94); color: var(--ink, #14131A); font: 600 15px/1 var(--text, system-ui, sans-serif); cursor: pointer; box-shadow: 0 8px 20px -12px rgba(30, 20, 40, 0.5); -webkit-tap-highlight-color: transparent; }
.sbar-menu:hover { background: #fff; }
.sbar-burger { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.sbar-burger path { transition: transform 0.3s var(--ease-out, ease), opacity 0.2s; transform-origin: 12px 12px; }
.sbar-menu[aria-expanded="true"] .sbar-l1 { transform: translateY(5px) rotate(45deg); }
.sbar-menu[aria-expanded="true"] .sbar-l2 { opacity: 0; }
.sbar-menu[aria-expanded="true"] .sbar-l3 { transform: translateY(-5px) rotate(-45deg); }
.sbar-scrim { display: none; }

@media (max-width: 839px) {
  .sbar.sbar-js .sbar-menu { display: inline-flex; }
  .sbar.sbar-js .sbar-links { display: none; }
  /* open: the four links on a paper card under the bar, the page dimmed and still behind it */
  .sbar.sbar-open { z-index: 80; }
  .sbar.sbar-open .sbar-menu { background: var(--ink, #14131A); color: #fff; }
  .sbar.sbar-js.sbar-open .sbar-links { display: flex; flex-direction: column; align-items: stretch; gap: 2px; position: fixed; z-index: 2; top: var(--sbar-top, 72px); left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); max-height: calc(100vh - var(--sbar-top, 72px) - 16px); max-height: calc(100dvh - var(--sbar-top, 72px) - 16px); overflow-y: auto; overscroll-behavior: contain; padding: 8px; border-radius: 28px; background: var(--paper, #FBFAF7); box-shadow: 0 30px 60px -28px rgba(20, 19, 26, 0.55), 0 0 0 1px rgba(20, 19, 26, 0.06); animation: sbar-in 0.32s var(--ease-out, ease) both; }
  .sbar.sbar-open .sbar-link { justify-content: space-between; height: 58px; padding: 0 20px; border-radius: 20px; font: 800 22px/1 var(--display, system-ui, sans-serif); letter-spacing: -0.02em; }
  .sbar.sbar-open .sbar-link::after { content: ""; width: 9px; height: 9px; border: solid currentColor; border-width: 2px 2px 0 0; transform: rotate(45deg); opacity: 0.4; margin-right: 4px; }
  .sbar.sbar-open .sbar-link:has(.sbar-ext)::after { display: none; }
  .sbar.sbar-open .sbar-ext { width: 14px; height: 14px; margin-left: auto; margin-right: 2px; }
  .sbar.sbar-open .sbar-link:hover { background: #F3F1EC; }
  .sbar.sbar-open .sbar-link[aria-current] { background: var(--ink, #14131A); color: #fff; }
  .sbar.sbar-open .sbar-scrim { display: block; position: fixed; inset: 0; z-index: 1; background: rgba(20, 19, 26, 0.32); animation: sbar-fade 0.25s ease both; }
  .sbar.sbar-open > :not(.sbar-scrim):not(.sbar-links) { position: relative; z-index: 3; }
}
/* the narrowest phones (320 to 359 px): the word Menu goes, the icon stays, so nothing crowds */
@media (max-width: 359px) {
  .sbar .sbar-logo { padding: 3px 8px; }
  .sbar-menu { padding: 0 11px; }
  .sbar-menu-word { display: none; }
  .sbar { gap: 6px; }
}
html.sbar-lock, html.sbar-lock body { overflow: hidden; }
@keyframes sbar-in { from { opacity: 0; transform: translateY(-8px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes sbar-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .sbar-burger path, .sbar-link, .sbar .sbar-logo { transition: none; }
  .sbar.sbar-open .sbar-links, .sbar.sbar-open .sbar-scrim { animation: none; }
}
