/* Mobile nav - pure CSS, no Tailwind layers, outside sticky container */

/* Header cleanup on mobile */
@media (max-width: 767px) {
  .topbar-wrapper {
    display: block;
    position: static;
    background: none;
    border: none;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}

/* Mobile slide-out menu (outside .topbar-wrapper, so no stacking-context trap) */
@media (max-width: 767px) {
  #nav {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    flex-wrap: nowrap !important;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    max-width: 85vw;
    background-color: var(--canvas);
    padding: 16px 20px 24px 20px;
    gap: 0;
    z-index: 9999;
    box-shadow: 4px 0 24px rgba(0,0,0,0.12);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    visibility: hidden;
    overflow-y: auto;
  }

  #nav[data-open="true"] {
    transform: translateX(0);
    visibility: visible;
  }

  #nav a {
    display: block;
    width: 100%;
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    font-size: 16px;
    color: var(--text);
    text-decoration: none;
  }

  #nav a[data-active="true"] {
    font-weight: 600;
    padding-left: 10px;
    border-left: 3px solid var(--orange);
    color: var(--orange);
  }

  #nav a:last-child {
    border-bottom: 0;
  }

  .nav-brand-top {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 24px 0 20px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
  }

  /* Backdrop */
  #navBackdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(0,0,0,0.35);
  }

  #navBackdrop.show {
    display: block;
  }

  html.nav-open,
  body.nav-open {
    overflow: hidden;
  }
}

/* Desktop: hide mobile nav elements */
@media (min-width: 768px) {
  #nav {
    display: none !important;
  }
  #navBackdrop {
    display: none !important;
  }
  .hamburger-icon {
    display: none !important;
  }
}

/* Hamburger icon - visible only on mobile */
@media (max-width: 767px) {
  #hamburgerBtn {
    display: inline-flex !important;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 24px;
    height: 24px;
    cursor: pointer;
  }
  .hamburger-icon span {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: var(--text);
  }
}
