/* ui/css/nav.css
   Top navigation, tools dropdown, hamburger, mobile menu. Markup: ui/parts/nav.php.
   Loaded: every page. Registered in core/assets.php. */

/* ═══════════════════════════════════════════════════════════════════════════════
   NAVIGATION
═══════════════════════════════════════════════════════════════════════════════ */
.tz-nav {
    /* Sticky (in flow) instead of fixed: content never slides under the bar on any template. */
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--nav-h);
    background: rgba(8,8,15,0.6);
    border-bottom: 1px solid transparent;
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    transition: background var(--t-normal), border-color var(--t-normal);
}

.tz-nav.scrolled {
    background: var(--bg-nav);
    border-color: var(--border);
}

/* WP Admin Bar offset - pushes nav down when admin bar visible */
body.admin-bar .tz-nav { top: 32px; }
body.admin-bar .nav-mobile { top: calc(var(--nav-h) + 32px); }
@media screen and (max-width: 782px) {
    body.admin-bar .tz-nav { top: 46px; }
    body.admin-bar .nav-mobile { top: calc(var(--nav-h) + 46px); }
}

.nav-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.03em;
    flex-shrink: 0;
    color: var(--text-primary);
}

/* Brand lockup image (markup: tz_logo_html() in core/helpers.php). Height drives the size. */
.nav-logo-img { display: block; height: 34px; width: auto; max-width: none; }
.nav-logo-img--footer { height: 38px; }
@media (max-width: 480px) {
    .nav-logo-img { height: 30px; }
    .nav-logo-img--footer { height: 34px; }
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    justify-content: center;
}

.nav-link {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--t-fast), background var(--t-fast);
    position: relative;
}

.nav-link:hover, .nav-link.active, .nav-link.is-active {
    color: var(--text-primary);
    background: var(--bg-hover);
}

/* Tools dropdown */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color var(--t-fast), background var(--t-fast);
}

.nav-dropdown-toggle:hover { color: var(--text-primary); background: var(--bg-hover); }

.nav-dropdown-toggle svg {
    width: 14px;
    height: 14px;
    transition: transform var(--t-fast);
}

.nav-dropdown:hover .nav-dropdown-toggle svg { transform: rotate(180deg); }

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 300px;
    background: #12121f;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-50%) translateY(-8px);
    transition: opacity var(--t-fast), transform var(--t-fast), visibility var(--t-fast);
    box-shadow: var(--shadow-lg);
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown-menu.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: all var(--t-fast);
}

.nav-dropdown-item:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-dropdown-item-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--border);
    color: var(--text-primary);
}
.nav-dropdown-item-text { flex: 1; min-width: 0; }

.nav-dropdown-item-text strong { display: block; font-weight: 600; color: var(--text-primary); font-size: 0.875rem; }
.nav-dropdown-item-text span { font-size: 0.75rem; color: var(--text-muted); }

.nav-badge-live {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    background: var(--green-light);
    color: var(--green);
    border-radius: var(--radius-full);
    letter-spacing: 0.05em;
}

.nav-badge-soon {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    background: rgba(139,92,246,0.12);
    color: var(--purple);
    border-radius: var(--radius-full);
    letter-spacing: 0.05em;
}

.nav-cta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.nav-login-btn {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--t-fast);
}
.nav-login-btn:hover { color: var(--text-primary); }

/* Hamburger */
.nav-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 6px;
    cursor: pointer;
}

.nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: all var(--t-normal);
}

.nav-hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.active span:nth-child(2) { opacity: 0; }
.nav-hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav */
.nav-mobile {
    display: none;
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 16px;
    z-index: 999;
    flex-direction: column;
    gap: 4px;
    max-height: calc(100vh - var(--nav-h));
    overflow-y: auto;
}

.nav-mobile.open { display: flex; }

.nav-mobile-link {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--t-fast);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-mobile-link:hover { color: var(--text-primary); background: var(--bg-hover); }
.nav-mobile-cta { margin-top: 8px; width: 100%; }

.nav-mobile-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

/* Nav is sticky and in normal flow, so pages need no manual offset. */
.page-wrap, .hero-full { padding-top: 0; }

@media (max-width: 900px) {
    .nav-links { display: none; }
    .nav-hamburger { display: flex; }
    .nav-cta .nav-login-btn { display: none; }
    .nav-inner { gap: 12px; }
    .nav-cta { margin-left: auto; }
}
