/* layout.css — Nav, footer, containers — mobile first */

body {
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg);
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.02;
    color: var(--obsidian);
    letter-spacing: -0.02em;
    text-wrap: balance;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

a { color: var(--accent); transition: color 0.15s; }
a:hover { color: var(--accent-dark); }

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--s2);
}

.main-content {
    flex: 1;
    padding: var(--s4) 0;
}

/* ═══ NAV ═══ */
.nav {
    background: var(--obsidian);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px var(--s2);
    max-width: var(--max-width);
    margin: 0 auto;
}

/* Logo */
.nav-logo {
    display: inline-flex;
    align-items: center;
    line-height: 1;
    transition: opacity 0.15s;
}
.nav-logo:hover { opacity: 0.88; }

.nav-logo-svg {
    height: 34px;
    width: auto;
    display: block;
}

/* Hamburger — mobile only */
.nav-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    z-index: 200;
}

.hamburger-line {
    display: block;
    width: 22px;
    height: 2px;
    background: rgba(255,255,255,0.8);
    border-radius: 2px;
    transition: all 0.2s ease;
}

.nav-hamburger.hidden {
    visibility: hidden;
    pointer-events: none;
}

/* Desktop nav — hidden on mobile */
.nav-desktop {
    display: none;
}

/* Nav links base */
.nav-links {
    display: flex;
    gap: var(--s4);
    align-items: center;
}

.nav-links a {
    color: rgba(255,255,255,0.6);
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.15s;
}
.nav-links a:hover { color: white; }

.nav-cta {
    background: var(--obsidian-green) !important;
    color: white !important;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: background 0.2s;
}
.nav-cta:hover { background: var(--obsidian-hover) !important; }

/* ═══ AVATAR + DROPDOWN ═══ */
.nav-user-menu {
    position: relative;
}

.nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    color: #D8A25E;
    font-family: var(--font-heading);
    font-size: 0.875rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-transform: uppercase;
    transition: background 0.15s;
    border: 1.5px solid rgba(255,255,255,0.15);
}

.nav-avatar:hover {
    background: rgba(255,255,255,0.18);
}

.nav-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 200px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 300;
    overflow: hidden;
    animation: dropdownIn 0.15s ease;
}

.nav-dropdown.active {
    display: block;
}

@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.nav-dropdown-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text) !important;
    text-align: left;
    transition: background 0.1s;
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
}

.nav-dropdown-item:hover {
    background: var(--bg);
    color: var(--obsidian) !important;
}

.nav-dropdown-logout {
    color: var(--error) !important;
}

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

/* ═══ MOBILE OVERLAY ═══ */
.nav-close { display: none; }
.nav-menu  { display: none; }

.nav-menu.active {
    display: flex;
    position: fixed;
    inset: 0;
    background: var(--obsidian);
    z-index: 190;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.nav-menu.active .nav-close {
    display: block;
    position: absolute;
    top: 16px;
    right: 20px;
    color: rgba(255,255,255,0.6);
    font-size: 1.75rem;
    cursor: pointer;
    z-index: 210;
    line-height: 1;
    padding: 8px;
}
.nav-menu.active .nav-close:hover { color: white; }

.nav-menu .nav-links {
    flex-direction: column;
    align-items: center;
    gap: var(--s4);
}

.nav-menu .nav-links a {
    font-size: 1.25rem;
    color: rgba(255,255,255,0.8);
}
.nav-menu .nav-links a:hover { color: white; }

.nav-menu .nav-cta { font-size: 1.125rem; padding: 12px 24px; }

.nav-logout-btn {
    color: rgba(255,255,255,0.6);
    font-family: var(--font-body);
    font-size: 1.25rem;
    font-weight: 500;
    cursor: pointer;
}
.nav-logout-btn:hover { color: white; }

/* ═══ FOOTER ═══ */
.footer {
    background: var(--obsidian);
    color: rgba(255,255,255,0.4);
    padding: var(--s5) 0;
    font-size: 0.8125rem;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--s3);
}

.footer-top {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--s3);
    padding-bottom: var(--s3);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: var(--s3);
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--s1);
    text-align: center;
}

.footer-brand {
    font-family: var(--font-heading);
    font-size: 1.375rem;
    font-weight: 700;
    color: rgba(255,255,255,0.78);
}

.footer-links { display: flex; gap: var(--s3); }
.footer a { color: rgba(255,255,255,0.4); }
.footer a:hover { color: white; }

.footer-tech {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.25);
}

/* ═══ RESPONSIVE ═══ */

@media (min-width: 768px) {
    h1 { font-size: 3rem; }
    h2 { font-size: 2.125rem; }

    .container { padding: 0 var(--s3); }
    .main-content { padding: var(--s5) 0; }

    .nav-inner { padding: 10px var(--s3); }
    .nav-logo-svg { height: 38px; }

    /* Hide mobile, show desktop */
    .nav-hamburger { display: none; }
    .nav-menu { display: none !important; }
    .nav-desktop { display: block; }

    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
    }
}

@media (min-width: 1024px) {
    h1 { font-size: 4rem; }
    h2 { font-size: 2.5rem; }
    .nav-inner { padding: 10px var(--s4); }
    .nav-logo-svg { height: 42px; }
}
