body {
    font-family: Arial, Helvetica, sans-serif;
    margin: 0;
    flex-direction: column;
    min-height: 100vh;
}

body, nav ul, footer .f-icons, footer .f-links, .grid {
    display: flex;
}



/* NAV */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    height: 3rem;
    background-color: orange;
    z-index: 5;
}

nav > a { /* Logo */
    display: inline-block;
    position: absolute;
    left: 0;
    padding: 0.25rem 0.5rem;
    height: 2.5rem;
}
nav > a img {
    height: 100%;
}

nav > img, nav input { /* Menuicon */
    position: absolute;
    top: 0.25rem;
    right: 0.5rem;
    width: 2.5rem;
    height: 2.5rem;
}
nav input {
    opacity: 0;
    z-index: 7;
    cursor: pointer;
}

nav ul { /* List of links */
    position: fixed;
    top: 3rem;
    width: 100%;
    height: 0%;
    margin: 0;
    padding: 0;
    flex-direction: column;
    align-items: center;
    list-style-type: none;
    background-color: transparent; /* Add fade transition on mobile*/
    color: transparent;
    transition: 0.3s;
    pointer-events: none;
}
nav input:checked ~ ul { 
    height: 100%;
    background-color: orange;
    color: white;
    transition: 0.2s;
    pointer-events: auto;
}

nav ul a { /* Links in list*/
    display: inline-block;
    padding: 0 2rem;
    font-size: 1.2rem;
    line-height: 3rem;
    color: inherit;
    text-decoration: none;
    text-transform: uppercase;
}

nav .navclose, nav input:checked ~ .navmenu {
    display: none;
}
nav input:checked ~ .navclose {
    display: block;
}



/* HEADER */
header {
    margin-top: 3rem;
    text-align: center;
}
header > div {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    position: relative;
    aspect-ratio: 3.125; /* 2000/640 = 25:8 */
}
header img {
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.5s;
    z-index: 2;
}
header input:checked + img {
    opacity: 1;
    transition: none;
    z-index: 1;
}

header input, header div div {
    display: none;
}



/* FOOTER */
footer {
    background-color: orange;
    color: white;
    line-height: 1.5rem;
    padding: 1rem 2.5rem;
}
footer p, h3, h4, footer div{
    margin: 0 0 0.5rem;
}
footer a {
    display: inline-block;
    margin: 0 0.25rem;
    flex-shrink: 1;
    color: white;
}

footer section {
    max-width: 20.25rem;
    margin: 0 auto;
}

footer img {
    width: 100%;
}

footer .f-icons {
    justify-content: center;
}
footer .f-links {
    justify-content: space-evenly;
}



/* MAIN */
main {
    width: 100%;
    max-width: 82rem;
    margin: 0 auto;
    flex-grow: 1;
}
main section {
    margin: 2rem 1rem;
}

main article > img {
    width: 100%;
    margin: 1rem 0;
}

main article > p {
    margin: 1rem 0 2rem;
    line-height: 1.5rem;
}

.row img {
    width: 100%;
    margin: 0 0 1rem;
}
.row p {
    margin: 0 0 2rem;
    line-height: 1.5rem;
}

h1, h2 {
    margin: 0;
}

main ul {
    margin: 0;
    padding-left: 1rem;
}
main li {
    margin: 0.25rem 0;
    line-height: 1.5rem;
}



/* GRID */
.grid {
    flex-wrap: wrap;
    justify-content: space-around;
    text-align: center;
}

.grid img, .grid p {
    margin: 0;
}

.grid a {
    margin: 0.75rem;
    color: inherit;
    text-decoration: none;
}

nav ul a:hover {
    background-color: #FFF5;
    transition: background 0.2s;
}
.grid a:hover {
    opacity: 0.6;
}
footer .f-icons a:hover {
    filter: brightness(1.2);
}
footer .f-icons a, .grid a {
    transition: 0.2s;
}



@media only screen and (min-width: 60rem) {

    /* NAV */
    nav .navmenu, nav input:checked ~ .navclose, nav input {
        display: none;
    }

    nav ul {
        display: flex;
        position: static;
        height: 100%;
        flex-direction: row;
        justify-content: center;
        opacity: 1;
        pointer-events: auto;
        transition: none;
        background-color: transparent;
        color: white;
    }



    /* HEADER */
    header input, header div div {
        display: block;
        width: 1rem;
        height: 1rem;
    }
    header input {
        margin: 0 0 0.5rem 0;
        opacity: 0;
        z-index: 4;
    }
    header div div {
        margin: 0 0.25rem 0.5rem -1rem; /* Negative margin to overlap radio buttons */
        border-radius: 50%;
        background-color: orange;
        transition: 0.2s;
        z-index: 3;
    }
    header div input:checked + img + div {
        background-color: orangered;
    }



    /* FOOTER */
    footer section {
        display: flex;
        justify-content: space-between;
        max-width: 80rem;
        margin: 0 auto;
    }
    footer .f-links {
        flex-direction: column;
        align-items: flex-end;
    }



    /* FLOAT */
    .float-left, .float-right, .row img {
        width: 40rem;
    }
    .float-left {
        float: left;
        margin: 0 1rem 0 0;
    }
    .float-right {
        float: right;
        margin: 0 0 0 1rem;
    }

    .row {
        display: flex;
    }
    .row img {
        margin: 0 1rem 1rem 0;
        height: 100%; /* Work-around, image gets squished otherwise */
    }

}