/* Shared navigation + layout (avilosoamaze.github.io) */

.site-nav {
    width: 100%;
    max-width: 1100px;
    margin-bottom: 1rem;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.65rem;
    flex-wrap: wrap;
    padding: 0.65rem 1rem;
    min-width: 0;
    max-width: 100%;
    background: var(--bg-card, #16161d);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.nav-brand {
    color: var(--text, #e8e8ec);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    letter-spacing: -0.02em;
    flex-shrink: 0;
}

.nav-brand:hover {
    color: var(--accent, #e63946);
}

.nav-right {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    flex-wrap: wrap;
    flex: 1 1 auto;
    min-width: 0;
}

.nav-top-links {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    flex-wrap: wrap;
}

.nav-top-links a {
    color: var(--text-muted, #8b8b9a);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.4rem 0.65rem;
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease;
}

.nav-top-links a:hover {
    color: var(--text, #e8e8ec);
    background: rgba(255, 255, 255, 0.06);
}

.nav-top-links a[aria-current="page"] {
    color: var(--accent, #e63946);
}

.nav-dropdown {
    position: relative;
    flex-shrink: 0;
}

.nav-dropdown summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.65rem;
    min-width: 2.5rem;
    min-height: 2.5rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
    border-radius: 8px;
    color: var(--text, #e8e8ec);
    font-family: inherit;
}

.nav-dropdown summary::-webkit-details-marker {
    display: none;
}

/* Hamburger icon (3 lines) */
.nav-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 20px;
    height: 14px;
    pointer-events: none;
}

.nav-hamburger span {
    display: block;
    height: 2px;
    width: 100%;
    background: currentColor;
    border-radius: 1px;
}

.nav-dropdown summary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-menu {
    position: absolute;
    left: auto;
    right: 0;
    top: calc(100% + 0.35rem);
    min-width: 200px;
    width: max-content;
    max-width: min(92vw, 280px);
    margin: 0;
    padding: 0.35rem 0;
    list-style: none;
    background: var(--bg-card, #16161d);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    z-index: 100;
    box-sizing: border-box;
}

.nav-menu li a {
    display: block;
    padding: 0.55rem 1rem;
    color: var(--text, #e8e8ec);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
}

.nav-menu li a:hover,
.nav-menu li a[aria-current="page"] {
    background: rgba(230, 57, 70, 0.15);
    color: var(--accent, #e63946);
}

@media (max-width: 768px) {
    .nav-top-links {
        display: none;
    }

    .nav-inner {
        gap: 0.5rem;
    }

    /* Only hamburger in .nav-right — pin it to the far right of the bar */
    .nav-right {
        justify-content: flex-end;
    }
}

@media (max-width: 480px) {
    .nav-inner {
        flex-direction: row;
        align-items: center;
        padding: 0.55rem 0.75rem;
    }

    /* Menu opens from the right edge of the button; cap width to viewport */
    .nav-menu {
        left: auto;
        right: 0;
        width: min(92vw, 280px);
        max-width: calc(100vw - 1.5rem);
        min-width: 180px;
    }

    .site-nav {
        max-width: 100%;
        box-sizing: border-box;
    }
}
