/* Major regions */
nav {
    font-weight: 400;
    padding: 10px;
    position: fixed;
    z-index: 5;
    top: 0px;
    width: 100%;
    height: 50px;
    background-color: white;
    text-align: center;
    transition: box-shadow 0.3s;
}
nav img,
nav ul {
    display: inline-block;
    z-index: 6;
}
nav #logo {
    border: none;
}
nav img {
    z-index: 50;
    height: 125px;
    width: 125px;
    transition: width 0.3s, height 0.3s;
}
nav ul {
    vertical-align: top;
    list-style-type: none;
    text-align: left;
    min-width: 150px;
}
nav.floating {
    box-shadow: 3px 3px 12px rgba(12, 12, 12, 0.5);
}
nav.floating img {
    height: 50px;
    width: 50px;
}
nav li {
    position: relative;
    margin-left: 85px;
    display: inline-block;
    transition: border-bottom 0.3s;
}
nav li ul {
    position: absolute;
    z-index: 5;
    text-align: center;
    top: 100%;
    left: 0;
    background-color: white;
    width: 100%;
    margin: 0px;
    padding: 5px 4px;
    border-radius: 3px;
    transition: opacity 0.3s;
    opacity: 0;
    pointer-events: none;
}
nav li:hover ul {
    pointer-events: auto;
    opacity: 1;
    box-shadow: 0px 6px 6px 0px rgba(12, 12, 12, 0.3);
}
nav li ul li {
    display: inline-block;
    margin: 0 3px;
    width: min-content;
    padding-top: 15px;
}

nav li a {
    color: inherit;
    text-decoration: none;
    position: relative;
}
nav li a:hover {
    text-decoration: underline;
}
nav li a:hover::after {
    transform: scaleX(1);
    visibility: visible;
}
nav li a::after {
    cursor: default;
    pointer-events: none;
    transform: scaleX(0);
    width: 100%;
    content: '';
    position: absolute;
    z-index: 2;
    left: 0%;
    bottom: 0px;
    height: 2px;
    background-color: black;
    transition: transform 0.2s ease-in-out;
}

#nav-list-button {
    width: 40px;
    height: 40px;
    display: none;
    text-align: initial;
}

body.nav-open nav #nav-list-button > span:last-child {
    transform: translateY(-10px) rotate(45deg);
}

body.nav-open nav #nav-list-button > span:nth-child(2) {
    opacity: 0;
}

body.nav-open nav #nav-list-button > span:first-child {
    transform: translateY(10px) rotate(-45deg);
}
body.nav-open nav > ul {
    overflow-x: hidden;
    overflow-y: auto;
    pointer-events: all;
    opacity: 1;
    background-color: white;
}
body.nav-open {
    overflow: hidden;
}
.banner-inputs {
    display: inline-block;
    margin-bottom: 10px;
}

@media (max-width:350px){
    /*use navbar button if very small*/
    
    /* nav list button, menu*/
    nav > ul {
        position: absolute;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: space-evenly;
        opacity: 0;
        pointer-events: none;
        top: 100%;
        left: 0;
        margin: auto 0px;
        z-index: -1;
        padding: 100px 0px;
        width: 100vw;
        height: calc(100vh - 50px);
    }
    nav ul li ul {
        position: relative;
        top: 0;
        left: 0;
        opacity: 1;
        pointer-events: all;
        display: flex;
    }
    #nav-list-button {
        display: block;
        position: relative;
        float: right;
        margin-right: 30px;
        line-height: 9px;
        cursor: pointer;
        /* Account for top padding */
        margin-top: -5px;
        text-align: center;
    }
    #nav-list-button > span {
        height: 5px;
        width: 35px;
        transition: transform 0.2s ease, opacity 0.2s ease;
        background-color: #666;
        display: inline-block;
    }
    nav img {
        float: left;
        margin-left: 30px;
    }
    nav li {
        margin-top: 5px;
        width: max-content;
        text-align: center;
        margin-left: 0px;
        margin-bottom: 10px;
    }
    body > nav ~ section > h1.small {
        /* 10 px for nav bar top padding */
        top: 5px;
        margin: 0px auto;
        width: min-content;
        position: sticky;
        position: -webkit-sticky;
        z-index: 10;
    }
    nav li:hover ul {
        pointer-events: auto;
        opacity: 1;
        box-shadow: none;
    }
    nav > ul > div > li:first-of-type {
        margin-top: 15px;
    }
    body.nav-open .banner {
        display: flex;
        z-index: 10;
        top: 60px;
        min-height: 50px;
        height: auto;
        width: 100vw;
        position: fixed;
        align-items: center;
        justify-content: center;
        flex-wrap: nowrap;
    }
    /*reformat banner to fit narrow screen*/
    body.nav-open .banner > span {
        width: 50%;
        margin: 0px;
        margin-left: 2.5%;
    }
    body.nav-open .banner-inputs {
        width: 40%;
        margin: 0px;
        margin-left: 5%;
        margin-right: 2.5%;
    }
    body.nav-open .banner-inputs > input {
        margin: 5px 0px;
        width: 100%;
    }

    #navbar-ul > div {
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
    }

    body.nav-open nav > ul > div > li { 
        overflow-x: scroll;/*ideally never needed, but should prevent content being hidden*/
        overflow-y: auto;
    }

    #navbar-ul a {
        text-decoration: underline;
        text-decoration-color: #66666666;
    }
}

@media (max-width: 1050px){
    #navbar-large {
        display: none;
    }
    #navbar-small {
        display: inherit;
    }
    nav li {
        margin-left: 30px
    }
}

@media (max-width: 550px){
    nav li {/* additional shrinking */
        font-size: 15px;
        margin-left: 8px;
    }
}

@media (min-width: 1050px){
    #navbar-large {
        display: inherit;
    }
    #navbar-small {
        display: none;
    }
    body > nav {
        display: flex;
        justify-content: center;
    }
    body > nav ~ section > h1 + p {
        margin-top: 20px;
    }
    
    nav:not(.floating) + .banner {
        transform: translate(0px);
    }
    nav.floating + .banner {
        transform: translateY(-50px);
    }

}

@media (max-width: 1276px){
    nav ul {
        font-size: 20px;
    }
    nav img {
        height: 100px;
        width: 100px;
    }
}

@media (min-width: 1276px){
    nav ul {
        margin: 0px 5px;
    }
}