/* Header section */
.navbar {
    display: flex;
    align-items: center; 
    background-color: var(--background);
    position: fixed;
    top: 0;
    left: 0;
    right: 0; 
    padding: 0.75rem 4rem; 
    box-sizing: border-box; /* Forces the padding inside the width */
    z-index: 1024;
}

.logo {
    width: 40px;
}

/* Navigation section */
.navigation {
    background-color: var(--background);
    display: flex;
    font-size: 1.25rem;
    padding: 1rem 3vw ;
    margin-left: 5rem;
}

/* 1. THE DIRECT CHILD FIX */
/* Only targets the main top-level UL, protecting the dropdown */
.navigation > ul {
    list-style-type: none;
    display: flex;
    gap: 3vw;
    align-items: center; /* Keeps the dropdown toggle perfectly centered */
}

/* Target the main top-level links */
.navigation > ul > li > a.nav-link {
    text-decoration: none;
    color: var(--text-color);
    margin: .5rem;
    padding: .5rem 1rem;
    border: 1px solid transparent;
}

.navigation > ul > li > a.nav-link:hover {
    background-color: var(--box-line-color);
    color: var(--text-color);
    border-color: transparent;
    box-shadow: none;
}
/* End of main navigation */

/* The parent container */
.nav-directory {
    position: relative;
    display: flex;
    align-items: center;
}

/* The hidden dropdown */
.sub-nav {
    display: none; 
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--background);
    border: var(--border-box); 
    list-style-type: none;
    padding: 0;
    margin: 0;
    min-width: 180px; 
    z-index: 50; 
}

.sub-nav li {
    border-bottom: var(--border-box);
}

.sub-nav li:last-child {
    border-bottom: none;
}

.sub-nav a {
    display: block;
    margin: 0; 
    padding: .75rem 1rem; 
    border: none;
    text-decoration: none;
    color: var(--subtitle-color);
}

.sub-nav a:hover {
    border: none;
    background-color: var(--box-line-color);
    color: var(--text-color);
}

.sub-nav.show {
    display: block;
}

/* The toggle button */
.nav-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    margin-left: -0.5rem; 
    padding: 0.5rem;
    display: flex;
    align-items: center;
    transition: transform 0.1s linear; 
}

.nav-toggle img {
    transition: transform 0.15s linear, opacity 0.15s linear; 
}

.nav-toggle:hover {
    transform: translateY(1px); 
}

.nav-toggle.open img {
    transform: rotate(180deg);
    opacity: 0.6; 
}
/* End of navigation */

/* Hamburger menu */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    margin-left: auto;
    padding: 0;
}

.hamburger img {
    width: 50px;
    height: 50px;
}

.hamburger.active + .navigation {
    display: flex;
}

.hamburger.active + .navigation.mobile-menu {
    display: flex;
}

.navigation.mobile-menu {
    display: flex;
    position: absolute; 
    top: 100%; 
    left: -.5rem;
    width: 100%;
    flex-direction: column;
    background: var(--background);
}

.navigation.mobile-menu ul {
    flex-direction: column;
    gap: 0;
    width: 100%;
}

.navigation.mobile-menu ul li {
    border-bottom: var(--border-box);
    width: 100%;
}

.navigation.mobile-menu ul li a {
    display: block;
    padding: .5rem;
    width: 100%;
    font-size: 1.125rem;
}
/* End of header */

/* Footer section */
.footer-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    margin: 5rem;
}

.footer-logo img {
    height: 50px;
}

.footer-navigation {
    list-style-type: none;
    display: flex;
    gap: 1rem;
}

.footer-navigation a {
    text-decoration: none;
    color: var(--text-color)
}

.footer-navigation a:hover {
    box-shadow: none;
}

.footer-links {
    list-style-type: none;
    display: flex;
    margin-left:5rem;
    gap: 3rem;
}

.footer-links img {
    height: 50px;
}

.copyright {
    text-align: center;
    margin-bottom: 5rem;
    color: var(--subtitle-color);

}
/* end of footer */

/* Responsive design */
@media (max-width: 1024px) {
    /* Navigation */
    .navigation {
        padding: 1rem 2vw;
        margin-left: 0rem;
    }

    .navigation ul {
        gap: 2vw;
    }

    /* Footer section */
    .footer-container {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        margin: 5rem;
    }

    .footer-logo img {
        height: 33px;
    }

    .footer-navigation {
        gap: .75rem;
        margin-left: 3rem;
    }

    .footer-navigation a {
        font-size: .75rem;
    }

    .footer-links {
        margin-left:3.5rem;
        gap: 2rem;
    }

    .footer-links img {
        height: 40px;
    }

    .copyright {
        font-size: .875rem;
    }
    
}

@media (max-width: 768px) {
    /* Header section */
    .navbar {
        padding: 0.75rem 1.5rem; 
    }

    .logo {
        width: 40px;
    }

    .nav-toggle {
        display: none;
    }

    .sub-nav {
        position: relative; 
        display: block !important;
        width: 100%;
        border: none;
    }

    .sub-nav a {
        font-size: 1rem; 
        padding: .5rem 1rem !important; 
        color: var(--subtitle-color);
        border-left: var(--border-box);
    }

    .hamburger {
        display: block;
    }

    .navigation {
        display: none;
    }

    .navigation.mobile-menu {
        display: flex;
    }

    /* Footer section */
    .footer-container {
        display: flex;
        flex-direction: column;
        /* text-align: center; */
    }

    .footer-logo img {
        height: 45px;
    }

    .footer-navigation {
        margin: 2.5rem 0;
    }

    .footer-links {
        gap: 3rem;
        margin: 0;
    }

    .footer-links img {
        height: 50px;
    }

    .copyright {
        text-align: left;
        margin-left: 10vw;
    }
}

@media (max-width: 480px) {
    /* Footer section */
    .footer-logo {
        margin-top: 2rem;
    }

    .footer-container {
        display: flex;
        flex-direction: column;
        margin:5vw;
    }

    .copyright {
        text-align: left;
        margin-left: 5vw;
        font-size: 1rem;
    }
}
/* End of responsive */
