nav {
    color: var(--main);
    padding-bottom: .5rem;
    padding-top: .5rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}
nav ul {
    display: flex;
    justify-content: space-evenly;
    list-style-type: none;
    padding-left: 0;
}
nav li {
    min-width: 7em;
    position: relative;
    text-align: center;
}
nav a {
    color: inherit;
    display: block;
    text-decoration: none;
    transition: .3s;
}
nav a:hover {
    color: var(--dark);
}
a[href*="parent-"] {
    cursor: pointer;
    pointer-events: none;
}
nav ul ul {
    background-color: var(--main);
    border: 1px solid var(--light);
    color: var(--light);
    display: block;
    left: 50%; /*THIS AND THE TRANSFORM LINE CENTRE THE DROPDOWN BELOW THE PARENT*/
    margin-left: -9999px;
    min-width: 20rem;
    padding-left: 0;
    padding-top: 2rem;
    position: absolute;
    transform: translateX(-50%);
    z-index: 1;
}
nav li.sfHover ul {
    margin-left: 0;
}
nav ul ul li {
    padding: .75rem;
}
nav ul ul li:last-of-type {
    padding-bottom: 3rem;
}
#menubutton,
[for="menubutton"] {
    display: none;
}
@media only screen and (max-width: 580px) {
    [for="menubutton"] {
        background-image: url(../graphics/hamburgerOpen.png);
        background-repeat: no-repeat;
        cursor: pointer;
        display: block;
        height: 36px;
        position: absolute;
        right: 16px;
        text-decoration: none;
        top: 5px;
        width: 36px;
        z-index: 20;
    }
    #menubutton:checked+[for="menubutton"] {
        background-image: url(../graphics/hamburgerClose.png);
        height: 42px;
        left: unset;
        position: fixed;
        right: 60px;
        top: 20px;
        width: 41px;
    }
    nav {
        flex-direction: column;
        height: 0;
        overflow: hidden;
        padding: 0;
        transition: width .3s;
        width: 0;
    }
    #menubutton:checked+label+nav {
        background-color: var(--main);
        color: var(--light);
        left: 0;
        min-height: 250%;
        position: absolute;
        top: 0;
        width: 100%;
        z-index: 15;
    }
    #menubutton:checked+label+nav>ul {
        display: block;
        margin-top: 3rem;
        padding-left: 1rem;        
    }
    #menubutton:checked+label+nav ul ul {
        background-color: var(--main);
        display: block!important;/*NECESSARY TO OVERRIDE SUPERFISH*/
        left: 0;
        margin-left: 0;
        padding-top: 0; 
        position: static;
        transform: none; 
        visibility: visible!important;/*NECESSARY TO OVERRIDE SUPERFISH*/
    }
    nav li,
    nav ul ul li {
        padding-bottom: 2rem;
        text-align: left;
    }
    nav ul ul li:last-of-type {
        padding-bottom: 0;
    }
    nav ul ul li {
        padding-left: 2rem;
    }
    .sf-sub-indicator {
        display: none;
    }
}
