/* =========================================================
   El Vanta — Navigation Drawer
   ---------------------------------------------------------
   Hamburger button (top-left, fixed) toggles a blue drawer
   that slides in from the left. Logout sits pinned to the
   bottom via flex + margin-top: auto.

   Depends on base.css for: CSS variables, reduced-motion
   global. Loaded on every page since the nav partial itself
   is included in base.html.

   NOTE: --radius-sm now lives in base.css. The .messages
   flash-message styling moved to base.css — it's a global
   concern, not nav-specific.
   ========================================================= */

:root {
    --nav-text: #F5F6F7;
    --nav-width: 260px;
}

/* Hamburger button */
.nav-toggle {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1100;
    width: 40px;
    height: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: var(--color-navy);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 0;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--nav-text);
    border-radius: 1px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* The drawer itself */
.nav-drawer {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--nav-width);
    background: var(--color-navy);
    color: var(--nav-text);
    z-index: 1050;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    padding: 80px 24px 24px;
}

.nav-drawer.open {
    transform: translateX(0);
}

.nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-links a {
    display: block;
    padding: 10px 12px;
    color: var(--nav-text);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
}

.nav-links a:hover,
.nav-links a:focus-visible {
    background: rgba(255, 255, 255, 0.1);
}

/* Pin logout to the bottom of the drawer */
.nav-logout {
    margin-top: auto;
}

.nav-logout button {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--nav-text);
    font-size: 1rem;
    cursor: pointer;
}

.nav-logout button:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Dark overlay behind the drawer */
.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1040;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.nav-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
    .nav-toggle span,
    .nav-drawer,
    .nav-overlay {
        transition: none;
    }
}