/* Global styles: fonts, body, nav, header. Loaded on every page. */

@font-face {
    font-family: 'CMU Sans Serif';
    src: url('../fonts/cmunss.otf') format('opentype');
}
@font-face {
    font-family: 'CMU Serif Roman';
    src: url('../fonts/cmunrm.otf');
}
@font-face {
    font-family: 'Fredoka';
    src: url('../fonts/Fredoka.woff2') format('woff2');
    font-weight: 300 700;
}

body {
    font-family: 'CMU Sans Serif', sans-serif;
    margin: 0;
    padding: 0 5%;
}

html {
    overflow-x: hidden;
}

.nav-links {
    font-family: 'CMU Sans Serif', sans-serif;
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

nav {
    display: inline-block;
}

nav ul {
    padding-left: 0;
    margin-top: 0;
    margin-bottom: 0;
    list-style: none;
    display: flex;
    flex-direction: row;
    gap: 15px;
    align-items: center;
}

nav li {
    display: inline-block;
}

nav li a {
    color: #004de6;
    text-decoration: none;
    font-size: 18px;
    font-weight: 700;
    display: inline-block;
    padding-top: 10px;
    padding-right: 2px;
    padding-left: 2px;
    padding-bottom: 5px;
    margin-left: 7px;
    margin-right: 7px;
    border-bottom: 2px solid #4c9cf1;
    transition: color 0.3s ease;
}

header {
    text-align: right;
    margin-top: 50px;
    margin-bottom: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 20px 0;
}

header .blog-name {
    width: 35%;
    display: inline-block;
    text-align: left;
    font-size: 24px;
    font-family: 'Fredoka', sans-serif;
    font-weight: 500;
    padding-top: 10px;
}

header .blog-name a {
    color: #003409;
    text-decoration: none;
}

header li a:hover {
    color: black;
    border-bottom: 2px solid black;
    font-family: 'CMU Sans Serif', sans-serif;
}

#menu-icon {
    display: none;
    cursor: pointer;
}

#menu-icon span {
    display: block;
    width: 22px;
    height: 2px;
    background: #4c9cf1;
    margin: 5px 0;
}



@media (max-width: 760px) {
    header {
        display: block;
    }

    header .blog-name {
        display: block;
        width: 100%;
        padding-bottom: 10px;
    }

    nav {
        width: 100%;
    }
}

@media (max-width: 500px) {
    header {
        height: 35px;
        display: flex;
        align-items: center;
    }

    header .blog-name {
        display: inline-block;
        width: 70%;
    }

    nav {
        display: inline-block;
        width: 27%;
    }

    nav ul,
    nav:active ul {
        display: none;
        position: absolute;
        flex-direction: column;
        background: #fff;
        border: 1px solid #444;
        right: 50px;
        top: 60px;
        width: 30%;
        border-radius: 4px 0 4px 4px;
        z-index: 1;
    }

    nav li {
        text-align: left;
        display: block;
        padding: 0;
        margin: 0;
    }

    header li a {
        border-bottom: none;
    }

    header li a:hover {
        border-bottom: none;
    }

    nav:hover ul {
        display: flex;
    }

    #menu-icon {
        display: inline-block;
        margin-right: 10px;
        margin-top: 5px;
    }
}
