<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css">

body {
    background-color: #fff0ec;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

header {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.9);
    border-bottom: 0.125rem solid #000;
    padding: 0.625rem 1.25rem;
    z-index: 1000;
    width: 100%;
    -webkit-box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
    font-family: 'Comfortaa', sans-serif;
}

.page_title h1 {
    font-size: 1.7rem;
    margin: 0;
}

.page_title a {
    color: black;
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: lighter;
}

.page_title a .latin-name {
    font-size: 1.5rem;
    color: rgba(0, 0, 0, 0.3);
}

.page_title a:hover {
    color: #ae031f;
}

/* Navigation styling */
nav {
    display: flex;
}

nav ul {
    list-style: none;
    margin: 0 1rem;
    padding: 0;
}

nav ul li {
    display: inline-block;
}

nav ul li a {
    color: black;
    text-decoration: none;
    padding: 0.625rem 0.7rem;
    cursor: pointer;
    display: inline-block;
    position: relative;
}

nav ul li a::after {
    content: '';
    position: absolute;
    top: 2.3rem;
    left: 0;
    width: 0;
    height: 0.063rem; /* Thickness of the underline */
    background-color: black; /* Color of the underline */
    transition: width 0.3s ease-in-out; /* Smooth transition for width */
}

nav ul li a:hover::after {
    width: 100%;
}

#language_filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

main {
    margin-top: 2rem;
    margin-bottom: 5rem;
    padding: 1.25rem;
    font-family: 'Comfortaa', sans-serif;
}

#homepage {
    position: relative;
    height: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: left;
    margin-top: 1.25rem;
    margin-bottom: 10%;
}

#homepage img {
    max-width: 30%;
    height: auto;
    display: block;
}

#homepage p {
    font-size: 0.9rem;
    padding: 0.625rem 1.25rem;
    padding-bottom: 10%;
    border-radius: 0.625rem;
    width: fit-content;
    text-align: left;
}


/* Responsive typography adjustments */
@media (max-width: 1200px) {
    header {
        padding: 1.625rem 1.25rem;
    }

    main {
        position: fixed;
    }

    #homepage img {
        max-width: 35%;
        margin-bottom: 0;
    }
}

@media (max-width: 992px) {
    header {
        display: block;
        text-align: center;
    }

    .page_title {
        margin-bottom: 1rem;
    }

    .page_title a .latin-name {
        color: rgba(0, 0, 0, 0.5);
    }

    nav {
        justify-content: center;
    }

    main {
        margin-top: 3rem;
    }

    #homepage img {
        max-width: 45%;
    }
}

@media (max-width: 768px) {
    header {
        padding: 1.625rem 1.25rem;
        flex-direction: column;
    }

    .page_title {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    nav ul {
        display: flex;
        justify-content: center;
    }

    nav ul li a {
        font-size: 1rem;
        padding: 0.5rem 1rem;
    }

    #homepage img {
        max-width: 50%;
    }

    #homepage p {
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    header {
        justify-content: center;
    }

    .page_title h1 {
        font-size: 1.3rem;
    }

    .page_title a .latin-name {
        font-size: 1.1rem;
    }

    nav {
        display: block;
    }

    nav ul li {
        margin-left: 0.4375rem;
    }

    nav ul li a {
        font-size: 0.875rem;
        padding: 0.4375rem 0.9375rem;
    }

    nav ul li a::after {
        top: 2rem;
    }

    #language_filter {
        justify-content: center;
    }

    #homepage img {
        max-width: 60%;
    }

    #homepage p {
        font-size: 0.7rem;
    }
}
