/* Header and navigation styles (uses tokens from style.css) */
.site-header{
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-height);
  display:flex;
  align-items:center;
  z-index:1300;
  background: linear-gradient(90deg,var(--brand-dark),var(--brand-mid));
  box-shadow: 0 2px 10px rgba(0,0,0,0.45);
  backdrop-filter: blur(6px);
}
.page-center{ max-width: 1100px; margin: 0 auto; width:100%; }
header{ background: transparent; height: auto; }
#headerbar{ position: relative; width: 100%; display:flex; align-items:center; }
.topbar{ margin: 0; padding: 0; list-style: none; display:flex; gap:28px; align-items:center; }
.topbar li{ margin:0; }
.topbar a, .button_side a{ color: var(--muted); text-shadow: 0 1px 0 rgba(0,0,0,0.5); font-weight:700; }
.topbar a:hover, .button_side a:hover{ color: var(--accent-gold); }
.hamburger{ font-size: 1.8em; display: none; padding-left: 10px; color: var(--muted); }
#topbar_logo img{ height: calc(var(--header-height) - 16px); width: calc(var(--header-height) - 16px); object-fit:contain; }
#sidebar_logo img{ height: calc(var(--header-height) - 24px); width: calc(var(--header-height) - 24px); object-fit:contain; }
/* spacing for logo placement */
#topbar_logo { margin-right: 120px; }
#topbar_logo img { margin-top: 10px; margin-bottom: 5px; }
#sidebar_logo img { margin-left: 30px; margin-top: 5px; margin-right: 5px; }

/* Off-canvas sidebar */
.close-sidebar{ font-size:1.6em; }

/* Ensure header does not show white background on page-center wrapper */
.page-center > header *{ background: transparent !important; }

/* Desktop layout */
@media(min-width:971px){
  .hamburger{ display:none; }
  .sidebar-main{ display:none !important; }
  /* hide the toggle input and sidebar logo on desktop */
  .sidebar-toggle { display: none !important; }
  #sidebar_logo { display: none !important; }
  .sidebar-overlay { display: none !important; opacity: 0 !important; pointer-events: none !important; }
}

/* visually-hidden utility used for accessible hiding */
.visually-hidden { position:absolute !important; height:1px; width:1px; overflow:hidden; clip:rect(1px, 1px, 1px, 1px); white-space:nowrap; border:0; padding:0; margin:-1px; }

/* ensure the checkbox is visually hidden (but focusable) across breakpoints */
.sidebar-toggle { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
/* Mobile layout */
@media(max-width:970px){
  #mega-menu{ display:none; }
  .hamburger{ display:inline-block; }
  #topbar_logo{ display:none; }
  #sidebar_logo{ display:inline-block; }
  /* reduce the header height on mobile and ensure main uses the smaller top margin */
  header{ height:54px; }
  /* checkbox-driven toggle: default hide sidebar & overlay off-screen */
  .sidebar-toggle { display: none; }
  /* mobile off-canvas sidebar: fixed panel that overlays content when opened */
  .sidebar-main {
    position: fixed;
    top: 0px;
    left: 0;
    width: 200px;
    height: 100vh;
    transform: translateX(-110%);
    transition: transform 240ms ease-in-out;
    z-index: 1300;
    display: block !important;
    box-shadow: 2px 0 8px rgba(0,0,0,0.16);
    background: linear-gradient(180deg, rgb(4 33 22) 250px, rgba(255, 255, 255, 0.01));
    overflow: auto;
  }

  .sidebar-toggle:checked ~ .sidebar-main {
    transform: translateX(0) !important;
  }

  .sidebar-toggle:checked ~ .sidebar-overlay {
    opacity: 1 !important;
    pointer-events: auto !important;
    display: block !important;
  }
}

/* Login / registration forms styling */
.auth-card{
  max-width:420px;
  margin:70px auto 40px auto;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border-radius:10px;
  padding:28px;
  box-shadow: 0 6px 30px rgba(0,0,0,0.45);
  color: var(--muted);
}
.auth-card h1{ font-family: 'Ubuntu Condensed', Arial, Sans-serif; font-size:1.6rem; color:var(--muted); margin:0 0 14px 0; }
.auth-card label{ display:block; margin-top:10px; color:#cfe8da; font-size:0.95rem; }
.auth-card input[type="text"], .auth-card input[type="password"], .auth-card input[type="email"]{
  width:100%; padding:10px 12px; margin-top:6px; border-radius:6px; border:1px solid rgba(255,255,255,0.06); background: rgba(255,255,255,0.02); color:var(--muted);
}
.auth-card .submit{ display:inline-block; margin-top:18px; padding:10px 18px; background:var(--accent-gold); color:#111; border-radius:8px; font-weight:800; text-decoration:none; border:0; cursor:pointer; }
.auth-card .submit:hover{ filter:brightness(0.95); }
.auth-help{ font-size:0.9rem; color:#bdd6c6; margin-top:12px; }

/* small helper tweaks */
a.brand-link{ color:var(--muted); font-weight:700; text-decoration:none; }

/* Additional header & navigation helpers moved from base.html */
.topbar { height: var(--header-height); }
.topbar > li { list-style: none; margin-right: 40px; display: inline-block; }
.topbar a { text-decoration: none; }
.sidebar { padding: 10px; margin: 0; }
.sidebar > li { list-style: none; margin-bottom: 10px; }
.sidebar a { text-decoration: none; }
.close-sidebar { cursor: pointer; padding-right: 0px; padding-top: 0px; font-size: 2em; color: var(--muted); text-align: left; }
.button_top { font-family: "Ubuntu Condensed", Arial, Sans-serif; font-size: 1.2rem; text-transform: uppercase; padding-top: 12px; color: #cfe8da; font-weight: 600; }
.button_top a:link, .button_top a:visited { color: var(--muted); margin-bottom: 0px; }
.button_top a:hover { color: var(--accent-gold); }
.button_side { font-family: "Ubuntu", Arial, Sans-serif; font-size: 1.2rem; text-transform: uppercase; padding: 5px; margin-right: 10px; }
.button_side a:link, .button_side a:visited { color: var(--muted); }
.button_side a:hover { color: var(--accent-gold); }

/* header account block: username and small logout stacked */
.header-account{ display:flex; flex-direction:column; align-items:flex-start; margin-left:8px }
.header-username-link{ color:var(--muted); font-weight:700; text-decoration:none }
.header-username-link:hover{ color:var(--accent-gold) }
.header-logout-small{ font-size:0.5rem; color:var(--muted); opacity:0.9; margin-top:4px; text-decoration:none }
.header-logout-small:hover{ color:var(--accent-gold) }
