/* ============================================================
   CISSP Wiki — Toggleable Sidebar (Desktop + Mobile)
   Sidebar starts HIDDEN on all screen sizes.
   Hamburger ☰ is always visible to open/close it.
   ============================================================ */

/* ── Hamburger button — always visible ── */
.hamburger-btn {
  display: flex !important;
  position: fixed;
  top: .7rem;
  left: .7rem;
  z-index: 1100;
  background: #0f172a;
  color: white;
  border: none;
  border-radius: .5rem;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.3rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.4);
  transition: background .15s;
  line-height: 1;
}
.hamburger-btn:hover { background: #334155; }

/* ── Overlay backdrop ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1050;
  cursor: pointer;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* ── Sidebar: always starts HIDDEN (slide off-screen left) ── */
aside,
nav.sidebar,
.sidebar {
  transform: translateX(-270px) !important;
  transition: transform .3s cubic-bezier(.4,0,.2,1),
              box-shadow .3s ease !important;
  position: fixed !important;
  z-index: 1060 !important;
}

/* ── Sidebar OPEN state ── */
aside.sidebar-open,
nav.sidebar.sidebar-open,
.sidebar.sidebar-open {
  transform: translateX(0) !important;
  box-shadow: 6px 0 40px rgba(0,0,0,.5) !important;
}

/* ── Main content: always full width (sidebar overlays, not push) ── */
main,
.main,
#main {
  margin-left: 0 !important;
  padding-top: 4rem !important;   /* space for hamburger */
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* ── Inner content max-width: keep readable on desktop ── */
main > .max-w-4xl,
main > .max-w-3xl,
main > .max-w-5xl,
.main > .max-w-4xl,
.main > .max-w-3xl,
.main > .max-w-5xl {
  max-width: 56rem;
  margin-left: auto;
  margin-right: auto;
}

/* ── Tables: scroll horizontally instead of overflow ── */
table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Lesson nav buttons on small screens ── */
@media (max-width: 600px) {
  .lesson-nav,
  .nav-row {
    flex-direction: column !important;
    gap: .75rem !important;
  }
  .nav-btn,
  .nav-prev,
  .nav-next {
    width: 100% !important;
    justify-content: center !important;
    text-align: center !important;
  }
  .priority-chain { flex-wrap: wrap; }
  .section-card { padding: 1.1rem !important; }
  h1 { font-size: 1.35rem !important; }
  .quiz-card { padding: 1rem !important; }
}
