/* ============================================================
   Shared Mobile Sidebar (slide-out navigation) styling.
   Loaded after each page's own stylesheet so it overrides the
   older duplicated .sidenav rules. Mobile-only: the sidenav is
   triggered by the hamburger, which is hidden on desktop.
   ============================================================ */

:root {
  --sidenav-accent: #e0b24c;
  --sidenav-bg-top: #1c1c1c;
  --sidenav-bg-bottom: #0d0d0d;
}

/* ---- Dimming backdrop behind the panel ---- */
.overlay {
  display: none;                 /* toggled to block via inline JS */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1050;                 /* above the fixed navbar (z 1000) */
  background-color: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

/* Ensure tapping the backdrop closes the menu (some pages disabled this) */
#navOverlay {
  pointer-events: auto;
}

/* ---- The sliding panel ---- */
.sidenav {
  height: 100%;
  width: 0;                      /* open width set inline by JS */
  max-width: 86vw;
  position: fixed;
  z-index: 1100;                 /* full-height drawer, above navbar + overlay */
  top: 0;
  left: 0;
  margin-top: 0;                 /* override older margin-top so it starts at the top */
  background: linear-gradient(180deg, var(--sidenav-bg-top), var(--sidenav-bg-bottom));
  box-shadow: 4px 0 28px rgba(0, 0, 0, 0.5);
  overflow-x: hidden;
  overflow-y: auto;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 8px 0 28px;
  -webkit-overflow-scrolling: touch;
}

.sidenav::-webkit-scrollbar {
  width: 6px;
}

.sidenav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 3px;
}

/* ---- Section headings (wrapped in their own <ul>) ---- */
.sidenav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidenav ul:first-of-type {
  border-top: none;
}

.sidenav ul p,
.sidenav p {
  margin: 18px 0 6px;
  padding: 0 22px;
  color: var(--sidenav-accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

/* ---- Menu items ---- */
.sidenav li {
  display: block;
  margin: 0;
  height: auto;
  width: 100%;
  font-size: inherit;
  list-style: none;
}

.sidenav a {
  display: flex;
  align-items: center;
  padding: 13px 22px;
  font-size: 15px;
  line-height: 1.2;
  color: #cfcfcf;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.sidenav a:hover,
.sidenav a:focus {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.07);
  border-left-color: var(--sidenav-accent);
}

/* ---- Close button: sticky so it stays visible while the menu scrolls ---- */
.sidenav .closebtn {
  position: sticky;
  top: 8px;
  z-index: 3;
  width: 38px;
  height: 38px;
  margin: 0 16px 4px auto;       /* right-aligned (auto left margin) */
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  line-height: 1;
  color: #cfcfcf;
  border: none;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
}

.sidenav .closebtn:hover,
.sidenav .closebtn:focus {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.16);
  border-left-color: transparent;
}
