<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: 7rem;
    margin-bottom: 10rem;
    padding: 0 8rem;
    font-family: 'Comfortaa', sans-serif;
}

/* Collection styling */
.images-grid {
    padding: 0 10rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10.625rem, 1fr));
    gap: 1rem;
}

.grid-item {
    display: flex;
    align-items: flex-end;  /* Align the image to the bottom */
    justify-content: center; /* Center the image horizontally */
    position: relative;
    width: 90%;
}

.grid-item img {
    width: 100%;
    display: block;
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Apply transition to box-shadow */
}

.grid-item a:hover img {
    transform: translateY(-0.625rem);
    box-shadow: -0.3125rem 0.3125rem 0.0625rem rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
    cursor: pointer;
}


/* Modal styling */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9); /* Transparent black background */
}

.modal-content {
    position: relative;
    margin: auto;
    padding: 0;
    width: 100%;
    max-width: 80%; /* Limit max width for the image */
    text-align: center;
}

.modal-container {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 80%;
    margin: auto;
}

#modal-image {
    width: 100%;
    max-height: 80vh;
    object-fit: contain;
    margin-top: 5rem;
}

.painting-title,
.painting-details {
    color: white;
    font-size: 1.1rem;
    margin-top: 1rem;
    text-align: center;
}

.painting-details {
    margin-top: 0;
}

.close {
    position: absolute;
    right: 2rem;
    color: white;
    font-size: 3rem;
    cursor: pointer;
}

.navigation {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
}

.arrow {
    color: white;
    font-size: 3rem;
    cursor: pointer;
    padding: 0 2rem;
}

.arrow:hover {
    color: #ddd; /* Change color on hover */
}



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

    .images-grid {
        padding: 0 5rem;
    }

    #modal-image {
        max-height: 75vh;
    }

    .painting-title,
    .painting-details {
        font-size: 1rem;
    }
}

@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;
    }
}

@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;
    }

    main {
        margin-top: 2rem;
    }

    .arrow {
        display: none;
    }

    .close {
        right: 0rem;
    }
}

@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;
    }

    main {
        padding: 0;
    }

    .grid-item {
        width: 100%;
    }

    #modal-image {
        max-height: 75vh;
    }

    .painting-title,
    .painting-details {
        font-size: 0.9rem;
    }
}

