/* TOP BAR shared by every page: logo + FNR on the left, an optional cart, and a three-line menu on the right.
   Self-contained (literal colours) so it looks the same on pages that do not load styles.css. */
nav.topbar{
  position:sticky;
  top:0;
  z-index:2000;
  background:#050505;
  border-bottom:1px solid #292929;
  /* Leave room for the phone's clock and battery in the installed app. */
  padding-top:env(safe-area-inset-top,0px);
  font-family:Arial,Helvetica,sans-serif;
  line-height:1.4;
}

nav.topbar .shell{
  width:min(1100px,calc(100% - 32px));
  margin:0 auto;
}

nav.topbar a{text-decoration:none}

nav.topbar .topbar-inner{
  min-height:64px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.topbar-brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:900;
  font-size:20px;
  letter-spacing:3px;
  color:#f2bf4a;
}

.topbar-brand .brand-mark,
.topbar-brand img{
  width:34px;
  height:34px;
}

.topbar-right{
  display:flex;
  align-items:center;
  gap:10px;
}

.menu-toggle{
  flex:0 0 auto;
  width:48px;
  height:44px;
  display:inline-flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:5px;
  padding:0;
  background:transparent;
  border:1px solid #f2bf4a;
  cursor:pointer;
}

.menu-toggle span{
  display:block;
  width:22px;
  height:2px;
  background:#fff;
  transition:transform .2s,opacity .2s;
}

.menu-toggle.is-open span:nth-child(1){transform:translateY(7px) rotate(45deg)}
.menu-toggle.is-open span:nth-child(2){opacity:0}
.menu-toggle.is-open span:nth-child(3){transform:translateY(-7px) rotate(-45deg)}

.site-menu[hidden]{display:none!important}

/* The bar now carries the status-area space itself, so the page does not add it a second time. */
@media (display-mode: standalone){
  body:has(> nav.topbar){padding-top:0}
}

.site-menu{
  position:absolute;
  left:0;
  right:0;
  top:100%;
  background:#0a0a0a;
  border-bottom:1px solid #f2bf4a;
  box-shadow:0 18px 40px rgba(0,0,0,.6);
  max-height:calc(100vh - 70px - env(safe-area-inset-top,0px));
  overflow-y:auto;
}

.site-menu-inner{
  display:grid;
  gap:0;
  padding-top:6px;
  padding-bottom:12px;
}

.site-menu-inner > a,
.site-menu-inner > .menu-link{
  display:flex;
  align-items:center;
  min-height:52px;
  border:0;
  border-bottom:1px solid #1d1d1d;
  background:transparent;
  color:#e6e6e6;
  font:inherit;
  font-size:13px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:1.5px;
  text-align:left;
  cursor:pointer;
}

.site-menu-inner > a[hidden]{display:none!important}
.site-menu-inner > a:hover,
.site-menu-inner > .menu-link:hover{color:#f2bf4a}

.menu-group-label{
  padding:14px 0 4px;
  color:#f2bf4a;
  font-size:10px;
  font-weight:900;
  letter-spacing:2px;
  text-transform:uppercase;
}

.site-menu .menu-auth{
  padding:14px 0;
  border-bottom:1px solid #1d1d1d;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}

.site-menu .menu-auth .topbar-btn{
  min-height:48px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0 10px;
  border:1px solid #f2bf4a;
  background:transparent;
  color:#fff;
  font:inherit;
  font-size:12px;
  font-weight:800;
  letter-spacing:1px;
  text-transform:uppercase;
  cursor:pointer;
}

.site-menu .menu-auth .topbar-btn.primary{background:#f2bf4a;color:#080808}
.site-menu .menu-who{grid-column:1/-1;color:#a7a7a7;font-size:12px;overflow-wrap:anywhere}

/* The home page keeps its own sign-in block inside the menu (ids used by its sign-in script). */
.site-menu #member-auth{
  padding:14px 0;
  border-bottom:1px solid #1d1d1d;
}

.site-menu #guest-auth{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px !important;
}

.site-menu #guest-auth .btn{
  width:100%;
  min-height:48px;
  padding:0 10px;
  justify-content:center;
}

.site-menu #member-authenticated{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

@media (min-width:821px){
  .site-menu{
    left:auto;
    right:max(16px,calc((100vw - 1100px) / 2));
    width:340px;
    border:1px solid #f2bf4a;
  }
}

/* Pages that had their own old top bar keep it only as a hidden holder for the buttons their scripts use. */
body > nav.legacy-nav-hidden{display:none!important}
