/* =============================================
   nav.css — Shared header + mobile navigation
   ============================================= */

/* ----- Header ----- */
.header {
    border-bottom: 1px solid var(--border);
    height: 69px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--s-6);
    position: sticky;
    top: 0;
    background: var(--background);
    z-index: 100;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

[data-theme="dark"] .header {
    background: var(--background);
    border-bottom-color: var(--border);
}

/* ----- Logo ----- */
.logo-container {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    text-decoration: none;
    color: inherit;
}

.logo-icon {
    width: 32px;
    height: 32px;
    margin-right: var(--s-3);
}

.logo-icon-light { display: block; }
[data-theme="dark"] .logo-icon-light { display: none; }
.logo-icon-dark  { display: none; }
[data-theme="dark"] .logo-icon-dark  { display: block; }

.logo-text {
    font-size: 16px;
    font-weight: 400;
    color: var(--foreground);
}

/* ----- Desktop nav ----- */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    justify-content: center;
}

.nav-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: var(--r-sm);
    transition: color 0.2s, background 0.2s;
    white-space: nowrap;
}
.nav-link:hover  { color: var(--foreground); background: var(--card-bg); }
.nav-link.active { color: var(--foreground); }

/* ----- Header actions ----- */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--s-2);
}

/* ----- Theme toggle ----- */
.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    background: transparent;
    transition: background 0.2s;
}
.theme-toggle:hover { background: var(--smoke); }
[data-theme="dark"] .theme-toggle:hover { background: var(--night-700); }
.theme-toggle svg { width: 18px; height: 18px; stroke: var(--foreground); }
.theme-toggle-sun { display: none; }
[data-theme="dark"] .theme-toggle-moon { display: none; }
[data-theme="dark"] .theme-toggle-sun  { display: flex; }

/* =============================================
   Hamburger button (mobile only ≤768px)
   ============================================= */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: var(--r-sm);
    padding: 0;
    transition: background 0.2s;
}
.hamburger-btn:hover { background: var(--smoke); }
[data-theme="dark"] .hamburger-btn:hover { background: var(--night-700); }

.hamburger-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--foreground);
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
    transform-origin: center;
}

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

/* =============================================
   Mobile menu panel
   ============================================= */
.mobile-menu {
    position: fixed;
    top: 69px;
    left: 0;
    width: 100%;
    background: var(--background);
    border-bottom: 1px solid var(--border);
    z-index: 99;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.mobile-menu.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.mobile-nav {
    display: flex;
    flex-direction: column;
}
.mobile-nav-link {
    font-size: 18px;
    font-weight: 500;
    color: var(--foreground);
    text-decoration: none;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}
.mobile-nav-link:last-child { border-bottom: none; }
.mobile-nav-link:hover { background: var(--smoke); }
[data-theme="dark"] .mobile-nav-link:hover { background: var(--night-700); }

/* =============================================
   Responsive breakpoints for nav
   ============================================= */
@media (max-width: 768px) {
    .nav-menu { display: none; }
    .hamburger-btn { display: flex; }
}

@media (max-width: 414px) {
    .header {
        padding: 0 16px;
        height: 60px;
    }
    .logo-icon { width: 28px; height: 28px; margin-right: 8px; }
    .logo-text { font-size: 14px; }
    .theme-toggle { width: 32px; height: 32px; }
    .mobile-menu { top: 60px; }
}
