/* ============================================================
   Mobile Nav (burger + drawer)
   Adds a mobile-only burger menu and slide-in drawer.
   Namespaced with .mn- to avoid conflicts with Bootstrap.
   ============================================================ */

/* ---- Burger button (hidden on desktop, fixed top-right on mobile) ---- */
.mn-burger {
  display: none;
  position: fixed;
  top: 14px;
  right: 18px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  padding: 0;
  /* Above Bootstrap navbar (z-index: 1030) and modal layers */
  z-index: 10000;
  transition: background 0.2s ease, border-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.mn-burger:hover { background: rgba(255, 255, 255, 0.06); }
.mn-burger:focus-visible {
  outline: 2px solid #f5f5f5;
  outline-offset: 2px;
}

.mn-bars {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 14px;
}
.mn-bars span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: #f5f5f5;
  border-radius: 2px;
  transition: transform 0.35s cubic-bezier(.4, .0, .2, 1),
              opacity 0.2s ease,
              top 0.35s cubic-bezier(.4, .0, .2, 1);
}
.mn-bars span:nth-child(1) { top: 0; }
.mn-bars span:nth-child(2) { top: 6px; }
.mn-bars span:nth-child(3) { top: 12px; }

.mn-burger.is-open .mn-bars span:nth-child(1) {
  top: 6px;
  transform: rotate(45deg);
}
.mn-burger.is-open .mn-bars span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.mn-burger.is-open .mn-bars span:nth-child(3) {
  top: 6px;
  transform: rotate(-45deg);
}

/* ---- Backdrop ---- */
.mn-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 9990;
}
.mn-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* ---- Drawer ---- */
.mn-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: min(360px, 88vw);
  background: #1a1a1a;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(.4, .0, .2, 1);
  z-index: 9995;
  display: flex;
  flex-direction: column;
  padding: 88px 28px 28px;
  overflow-y: auto;
}
.mn-drawer.is-open { transform: translateX(0); }

.mn-section-label {
  font-family: 'Atkinson Hyperlegible Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8a8a8a;
  margin: 0 0 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mn-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  list-style: none;
  margin: 0 0 32px;
  padding: 0;
}
.mn-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 4px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-family: 'Atkinson Hyperlegible Mono', ui-monospace, monospace;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: normal;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: padding 0.2s ease, color 0.2s ease;
  min-height: 44px;
}
.mn-links a:hover,
.mn-links a:focus-visible {
  padding-left: 10px;
  color: #f5f5f5;
  outline: none;
}
.mn-links a .mn-arrow {
  font-family: 'Atkinson Hyperlegible Mono', ui-monospace, monospace;
  font-size: 16px;
  opacity: 0.4;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.mn-links a:hover .mn-arrow,
.mn-links a:focus-visible .mn-arrow {
  transform: translateX(4px);
  opacity: 1;
}

/* Lock body scroll when drawer is open */
body.mn-drawer-open { overflow: hidden; }

/* ---- Mobile breakpoint ---- */
@media (max-width: 768px) {
  .mn-burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  /* Hide the existing inline "Legacy Tracks" nav-link in the navbar on mobile */
  .navbar .nav-link { display: none; }
}
