﻿body {
}

:root {
    --display-buttons: flex;
}

.gallery-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
}

.gallery-container button {
    display: var(--display-buttons);
    align-items: center;
    border: none;
    background-color: rgba(0, 0, 0, .25);
    font-size: 1.5rem;
}

.gallery-container button:hover {
    background-color: rgba(0, 0, 0, .5);
}

#gallery {
    display: flex;
    max-width: 80vw;
    width: 70%;
    height: 60vh;
    --hover-width: 90vw; /* variable to dynamically control the hovering width */
}

#gallery div {
    width: 50vw; /* smaller collapsed size */
    overflow: hidden;
    transition: width 0.4s ease;
}

#gallery img {
    height: 100%;
}

#gallery div:hover {
    width: var(--hover-width); /* fallback is 90vw */
}

@media (max-width: 768px) {
    h1 {
        margin-bottom: 2rem;
    }

    .gallery-container {
        margin-top: 3rem;
        margin-bottom: 3rem;
    }

    #gallery {
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        width: 100vw;
        max-width: 100vw;
        height: 60vw; /*give each image the same height*/

        scrollbar-width: auto;
    }

    #gallery::-webkit-scrollbar {
        height: 8px;
    }

    #gallery::-webkit-scrollbar-track {
        background: transparent;
    }

    #gallery::-webkit-scrollbar-thumb {
        background-color: white;
        border-radius: 4px;
    }

    #gallery div {
        flex: 0 0 34vw; /* change the vw value to make more or less pictures appear simultaneously. 100vw = 1, 50vw = 2, 34vw = 3, etc.*/
        scroll-snap-align: start;
    }

    #gallery img {
        width: 100%;
        object-fit: cover;  /* Crops and fills evenly */
    }

    .gallery-container button {
        display: none !important;
    }
}

@keyframes scroll-left {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}