/* ═══════════════════════════════════════════════════════════════
   Dancefloor — Mobile Navigation
   Drop this file into css/ and add:
     <link rel="stylesheet" href="css/mobile-nav.css"/>
   to every page that has the topnav (after main.css & brand.css)
   ═══════════════════════════════════════════════════════════════ */

/* ── Hamburger button (hidden on desktop) ───────────────────── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.15s;
  flex-shrink: 0;
  margin-left: auto;
  gap: 5px;
  -webkit-tap-highlight-color: transparent;
}
.nav-hamburger:hover,
.nav-hamburger:focus-visible {
  background: rgba(255,255,255,0.07);
  outline: none;
}

/* The three bars */
.nav-hamburger .bar {
  display: block;
  width: 20px;
  height: 2px;
  background: rgba(255,255,255,0.75);
  border-radius: 2px;
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1),
              opacity   0.2s ease,
              width     0.2s ease;
  transform-origin: center;
}

/* X state when open */
.nav-hamburger[aria-expanded="true"] .bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-hamburger[aria-expanded="true"] .bar:nth-child(2) {
  opacity: 0;
  width: 0;
}
.nav-hamburger[aria-expanded="true"] .bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Backdrop overlay ───────────────────────────────────────── */
.mobile-nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 199;
  opacity: 0;
  transition: opacity 0.25s ease;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.mobile-nav-backdrop.visible {
  opacity: 1;
}

/* ── Drawer panel ───────────────────────────────────────────── */
.mobile-nav-drawer {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(300px, 85vw);
  background: #1a1714;
  border-left: 0.5px solid rgba(255,255,255,0.08);
  z-index: 200;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.mobile-nav-drawer.open {
  transform: translateX(0);
}

/* Drawer header */
.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 16px;
  border-bottom: 0.5px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.mobile-nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.3px;
  color: rgba(240,236,230,0.95);
}
.mobile-nav-logo span { color: #CC5500; }
.mobile-nav-close {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.6);
  font-size: 18px;
  line-height: 1;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.mobile-nav-close:hover { background: rgba(255,255,255,0.1); }

/* Drawer scroll area */
.mobile-nav-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0 24px;
  -webkit-overflow-scrolling: touch;
}

/* Section labels */
.mobile-nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  padding: 16px 20px 6px;
}
.mobile-nav-section-label:first-child {
  padding-top: 8px;
}

/* Nav links in drawer */
.mobile-nav-body a,
.mobile-nav-body button {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 400;
  color: rgba(240,236,230,0.75);
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, color 0.12s;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.mobile-nav-body a:hover,
.mobile-nav-body button:hover {
  background: rgba(255,255,255,0.05);
  color: rgba(240,236,230,1);
}
.mobile-nav-body a.active,
.mobile-nav-body a.mobile-active {
  color: #CC5500;
  background: rgba(204,85,0,0.08);
  font-weight: 500;
}
.mobile-nav-body a .mn-icon,
.mobile-nav-body button .mn-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.7;
}

/* Upload CTA in drawer */
.mobile-nav-body a.mobile-upload-cta {
  margin: 12px 16px;
  width: calc(100% - 32px);
  padding: 12px 16px;
  background: #CC5500;
  color: #fff;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  justify-content: center;
  transition: opacity 0.15s;
}
.mobile-nav-body a.mobile-upload-cta:hover {
  background: #CC5500;
  opacity: 0.88;
  color: #fff;
}

/* Auth buttons in drawer */
.mobile-nav-auth {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mobile-nav-auth a,
.mobile-nav-auth button {
  justify-content: center;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
}
.mobile-nav-auth .auth-primary {
  background: #CC5500;
  color: #fff;
  border: none;
}
.mobile-nav-auth .auth-primary:hover {
  background: #CC5500;
  opacity: 0.88;
  color: #fff;
}
.mobile-nav-auth .auth-secondary {
  background: transparent;
  border: 0.5px solid rgba(255,255,255,0.15);
  color: rgba(240,236,230,0.7);
}
.mobile-nav-auth .auth-secondary:hover {
  background: rgba(255,255,255,0.05);
  color: rgba(240,236,230,1);
}
.mobile-nav-auth .auth-signout {
  background: transparent;
  border: 0.5px solid rgba(255,255,255,0.1);
  color: rgba(240,236,230,0.5);
  font-size: 13px;
}

/* Divider in drawer */
.mobile-nav-divider {
  height: 0.5px;
  background: rgba(255,255,255,0.07);
  margin: 8px 0;
}

/* User info strip at bottom of drawer */
.mobile-nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-top: 0.5px solid rgba(255,255,255,0.07);
  margin-top: auto;
  flex-shrink: 0;
}
.mobile-nav-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(204,85,0,0.2);
  color: #CC5500;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
.mobile-nav-user-info { flex: 1; min-width: 0; }
.mobile-nav-username {
  font-size: 13px;
  font-weight: 500;
  color: rgba(240,236,230,0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mobile-nav-handle {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
}

/* ── Responsive: show hamburger, hide desktop links ─────────── */
@media (max-width: 768px) {
  /* Show the hamburger */
  .nav-hamburger { display: flex; }

  /* Hide desktop nav links and nav-right */
  .topnav-inner .nav-links { display: none !important; }
  .topnav-inner #nav-right { display: none !important; }

  /* Show the backdrop and drawer */
  .mobile-nav-backdrop { display: block; }
  .mobile-nav-drawer { display: flex; }

  /* Give the topnav-inner a bit more breathing room */
  .topnav-inner {
    padding-right: 8px;
  }
}

/* Keep desktop behaviour entirely unchanged */
@media (min-width: 769px) {
  .nav-hamburger { display: none !important; }
  .mobile-nav-backdrop { display: none !important; }
  .mobile-nav-drawer { display: none !important; }
}

/* ── Prevent body scroll when drawer is open ────────────────── */
body.mobile-nav-open {
  overflow: hidden;
}

/* ── Focus trap — visible ring inside dark drawer ───────────── */
.mobile-nav-drawer *:focus-visible {
  outline: 2px solid #CC5500;
  outline-offset: 2px;
  border-radius: 4px;
}
