/* top-nav container*/
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

.top-nav {
    position: fixed;
    display: flex;
    align-items: center;
    /*justify-content: flex-start;*/
    flex-wrap: nowrap;
    /*gap: 0.5rem;*/
    top: 0; left: 0; right: 0;
    height: 3.5rem;
    /*background: rgb(255, 255, 255);*/
    background: #5c5ca8;
    justify-content: space-evenly;
    /*box-shadow: 0 2px 4px rgba(0,0,0,0.1);*/
    z-index: 100;
}

/* hide hamburger by default */
.hamburger {
    display: none;
    flex-direction: column; justify-content: space-around;
    width: 1.5rem; height:1.25rem; cursor: pointer;
    margin-left: 0.5rem;
}

.hamburger span {
    display: block; height: 3px; background: #fff;
    border-radius: 2px;
}

/* nav-menu sits inline on desktop */
.nav-menu {
    display: flex; align-items: normal; gap: 1rem;
}

.top-nav .settings-btn {
    margin-left: auto;
    margin-right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
}


/* nav-btn container */
.nav-btn {
    height: 3.5rem;
    flex: none;
    display: block;
    padding: 0 2rem;      /* control the clickable region here */
    border: none;
    background: none;
    font: inherit;
    cursor: pointer;
    text-align: center;
    transition:all 0.3s ease-in-out;
}

.nav-btn a{
    font-family: Rockwell;
    font-size: 1.5rem;
    color: #ffffff;
    display: block;
    padding: 0 5px 0 5px;
    margin: 0 0 0;
    text-decoration: none;
    position: relative;
    &::before {
        content: "";
        position: absolute;
        width: 100%;
        height: 3px;
        bottom: -10px;
        left: 0px;
        background-color: #ffffff;
        visibility: hidden;
        transform: scale(0, 0);
        transition: all 0.2s ease-in-out;
    }
}


.nav-btn:hover {
    background: #5c5ca8;
    a {
        color: #ffffff;
        &::before {
            visibility: visible;
            transform: scale(1, 1);
        }
    }
}
.nav-btn.active {
    a {
        color: #ffffff;
        &::before {
            content: "";
            position: absolute;
            width: 100%;
            height: 3px;
            bottom: -10px;
            left: 0px;
            background-color: #ffffff;
            visibility: visible;
            transform: scale(1, 1);
            transition: none; /* no easing */
        }
    }
}


/* dropdown container */
.dropdown {
    position: relative;
}


/* hide dropdown by default */
.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-radius: 0 0 0.5rem 0.5rem;
    border: 1px solid #5c5ca8;

    /* auto width based on longest item */
    width: max-content;
    min-width: 100%;       /* optional: at least as wide as the button */

    /* keep text/items left-aligned */
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
}



/* make each item full-width block */
.dropdown-content .nav-btn {
    border: 1px solid #6c6c6c;
    width: 100%;          /* now 100% of the container’s width (the max) */
    padding: 0.75rem 1rem;
    text-align: left;     /* left-align the text */

    &:hover {
        a {
            color: #ffffff;
        }
        background-color: #5c5ca8;
    }

    a {
        color: #000000;
        display: block;
        text-align: left;
    }
}

/* show on hover */
@media (min-width: 769px) {
    .dropdown:hover .dropdown-content {
        display: block;
    }
}




/* for mobile (small screen sizes) */
@media (max-width: 1100px) {
    .top-nav {
        padding: 0rem 0rem;
    }


    /* show hamburger, hide normal menu */
    .hamburger { display: flex; }
    .nav-menu {
        position: absolute;
        top: 3.5rem; left: 0;
        flex-direction: column;
        width: 100%; background: #5c5ca8;
        overflow: hidden;
        max-height: 0;
        transition: max-height 0.3s ease-out;
    }

    /* when open, expand */
    .nav-menu.open { max-height: 500px; /* big enough for all buttons */ }

    /* style each button full-width */
    .nav-menu .nav-btn {
        width: 100%; text-align: left;
        padding: 1rem;
        border-bottom: 1px solid rgba(255,255,255,0.2);
    }
    .dropdown-content { position: static; border:none; width:100%; }
    .dropdown-content .nav-btn { border:none; }



    .nav-btn {
        padding: 1rem 1rem;      /* control the clickable region here */
    }

    .nav-btn a {
        font-size: 1rem;
    }

    /* show on “open” class for *any* width */
    .dropdown.open .dropdown-content {
        display: block;
    }
}
