/* Navigation Styles */

/* Desktop Top Bar */
#desktop-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    padding: 1.5rem 2rem; /* Initial larger padding */
    transition: all 0.1s ease;
    transform: translateY(0);
    opacity: 1;
}

#desktop-nav.scrolled {
    padding: 0.4rem 2rem; /* Smaller padding on scroll */
    background: rgba(0, 0, 0, 0.8); /* Darker background on scroll */
}

#desktop-nav .nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

#desktop-nav .nav-logo {
    border-bottom: none;
    display: flex;
    align-items: center;
    line-height: 0;
    margin: 0; /* Removed margin */
    margin-right: auto; /* Push links to the right */
    transition: all 0.1s ease;
}

#desktop-nav .nav-logo img {
    height: 100px; /* Big initial logo */
    width: auto;
    display: block;
    transition: all 0.1s ease;
}

#desktop-nav.scrolled .nav-logo img {
    height: 50px; /* Smaller logo on scroll */
}

#desktop-nav ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
    gap: 2rem;
    align-items: center;
    flex: 0 1 auto; /* Don't take up all space */
}

/* Removed .nav-left and .nav-right styles as they are no longer used */

#desktop-nav ul li {
    padding: 0;
    margin: 0;
}

#desktop-nav ul li a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem; /* Slightly larger font initially */
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: none;
    transition: color 0.2s ease, font-size 0.1s ease;
    position: relative;
    padding-bottom: 5px;
}

#desktop-nav.scrolled ul li a {
    font-size: 0.9rem; /* Smaller font on scroll */
}

#desktop-nav ul li a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background-color: #fff;
    transition: width 0.3s ease;
}

#desktop-nav ul li a:hover::after,
#desktop-nav ul li a.active::after {
    width: 100%;
}

#desktop-nav ul li a:hover {
    color: #fff;
}

/* Mobile Menu Toggle (Hamburger) */
#mobile-menu-toggle {
    display: none; /* Hidden on desktop */
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10002;
    cursor: pointer;
    width: 30px;
    height: 25px;
    flex-direction: column;
    justify-content: space-between;
}

#mobile-menu-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: #fff;
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* Mobile Menu Overlay */
#mobile-menu-overlay {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10001;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: translateX(100%); /* Hidden to the right */
    transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1);
}

#mobile-menu-overlay.active {
    transform: translateX(0);
}

.mobile-menu-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.mobile-nav-logo img {
    width: 120px;
    margin-bottom: 2rem;
}

#mobile-menu-overlay ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

#mobile-menu-overlay ul li a {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 600;
    text-decoration: none;
    border-bottom: none;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.close-menu-bottom {
    margin-top: 2rem;
    cursor: pointer;
    color: #fff;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 0.8rem 2rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.close-menu-bottom:hover {
    background: rgba(255,255,255,0.1);
    border-color: #fff;
}

/* Intermediate Desktop Breakpoint to prevent wrapping */
@media screen and (min-width: 981px) and (max-width: 1350px) {
    #desktop-nav {
        padding: 0.8rem 1rem;
    }
    #desktop-nav .nav-logo img {
        height: 70px;
    }
    #desktop-nav ul {
        gap: 1rem;
    }
    #desktop-nav .nav-logo {
        margin: 0 1rem;
    }
    #desktop-nav ul li a {
        font-size: 0.9rem;
    }
    #desktop-nav.scrolled ul li a {
        font-size: 0.85rem;
    }
}

/* Responsive Breakpoints */
@media screen and (max-width: 980px) {
    #desktop-nav {
        display: none; /* Hide desktop nav on tablet/mobile */
    }
    
    #mobile-menu-toggle {
        display: flex; /* Show hamburger on tablet/mobile */
    }
}

/* Ensure desktop nav is always visible when an article is open */
body.is-article-visible #desktop-nav {
    transform: translateY(0) !important;
    opacity: 1 !important;
}

/* Add extra padding to wrapper when article is visible to prevent overlap with fixed header */
@media screen and (min-width: 981px) {
    body.is-layout-ready #wrapper {
        padding-top: 6rem !important;
        justify-content: flex-start; /* Align to top instead of center */
    }
}
