/* =====================================================================
   AURORA — Fitness sidebar navigation
   Replaces the cramped 18-item top navbar with a grouped left rail.
   Desktop: fixed rail, content shifted right. Mobile (<992px): the rail
   slides in as an off-canvas drawer behind a slim top bar + backdrop.
   Self-contained (no Bootstrap-offcanvas dependency — fitness is on BS 5.0.2).
   ===================================================================== */

:root {
  --af-sidebar-w: 244px;
  --af-topbar-h: 60px;
}

/* ---- Skip link (a11y) ------------------------------------------------ */
.af-skip {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 1100;
  background: var(--af-gold);
  color: var(--af-blue);
  padding: 10px 16px;
  border-radius: 0 0 var(--af-r-sm) 0;
  font-weight: 600;
}
.af-skip:focus { left: 0; }

/* ---- The rail -------------------------------------------------------- */
.af-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--af-sidebar-w);
  display: flex;
  flex-direction: column;
  background: var(--af-navy-grad);
  color: #dfe6f2;
  z-index: 1045;
  box-shadow: var(--af-shadow-md);
  transition: transform var(--af-t) ease, visibility var(--af-t) ease;
}

.af-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  text-decoration: none !important;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.af-sidebar__brand img { width: 46px; height: auto; }
.af-sidebar__brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.af-sidebar__brand-text strong { font-size: 15px; font-weight: 700; letter-spacing: .02em; }
.af-sidebar__brand-text small {
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--af-gold);
}

/* Scrollable nav column */
.af-sidebar__scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 10px 12px 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .25) transparent;
}
.af-sidebar__scroll::-webkit-scrollbar { width: 7px; }
.af-sidebar__scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .18);
  border-radius: 100px;
}

.af-nav__section {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--af-gold);
  opacity: .95;
  padding: 6px 12px 4px;
  margin-top: 14px;
}
.af-nav__section:first-child { margin-top: 4px; }

.af-nav__link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 12px;
  margin: 1px 0;
  border: 0;
  background: transparent;
  border-radius: var(--af-r-sm);
  color: #cdd6e6 !important;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  text-decoration: none !important;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.af-nav__link i {
  width: 20px;
  text-align: center;
  font-size: 15px;
  color: var(--af-silver);
  flex: none;
  transition: color .15s ease;
}
.af-nav__link:hover {
  background: rgba(255, 255, 255, .08);
  color: #fff !important;
}
.af-nav__link:hover i { color: #fff; }

.af-nav__link.is-active {
  background: rgba(255, 199, 44, .14);
  color: #fff !important;
  box-shadow: inset 3px 0 0 var(--af-gold);
}
.af-nav__link.is-active i { color: var(--af-gold); }

/* Keyboard focus must be visible on the dark rail (the global navy focus
   ring composites to navy-on-navy here). Gold on navy is ~7.6:1. */
.af-sidebar__brand:focus-visible,
.af-nav__link:focus-visible {
  outline: 3px solid var(--af-gold);
  outline-offset: -3px;
}

/* Pinned "Connect" block (external + social links) */
.af-sidebar__connect {
  flex: none;
  padding: 6px 12px 4px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.af-social {
  display: flex;
  gap: 8px;
  padding: 8px 6px 6px;
}
.af-social a {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .1);
  color: #e8eefb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.af-social a:hover { background: var(--af-gold); color: var(--af-blue); }
.af-social a:focus-visible { outline: 3px solid var(--af-gold); outline-offset: 2px; }

/* Pinned footer (login / logout) */
.af-sidebar__footer {
  flex: none;
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.af-sidebar__footer form { margin: 0; }

/* ---- Main content shell --------------------------------------------- */
.af-shell {
  margin-left: var(--af-sidebar-w);
  min-height: 100vh;
}

/* ---- Mobile top bar + backdrop (hidden on desktop) ------------------ */
.af-topbar {
  display: none;
  align-items: center;
  gap: 12px;
  height: var(--af-topbar-h);
  padding: 0 14px;
  background: var(--af-navy-grad);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 1040;
  box-shadow: var(--af-shadow-sm);
}
.af-topbar__toggle {
  border: 0;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: var(--af-r-sm);
  font-size: 18px;
  cursor: pointer;
}
.af-topbar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff !important;
  text-decoration: none !important;
  font-weight: 700;
  letter-spacing: .01em;
}
.af-topbar__brand img { width: 34px; height: auto; }

.af-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 23, 51, .5);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--af-t) ease, visibility var(--af-t) ease;
  z-index: 1044;
}

/* ---- Responsive: collapse to drawer under lg (992px) ---------------- */
@media (max-width: 991.98px) {
  .af-topbar { display: flex; }
  .af-shell { margin-left: 0; }
  /* visibility:hidden (not just transform) so the closed drawer's links
     leave the tab order + accessibility tree; it animates via the
     transition on .af-sidebar and flips visible instantly when opening. */
  .af-sidebar { transform: translateX(-100%); visibility: hidden; }
  .af-sidebar.is-open { transform: translateX(0); visibility: visible; }
  .af-backdrop.is-open { opacity: 1; visibility: visible; }
  body.af-nav-open { overflow: hidden; }
}
