body {
    background: #070510;
}

.container {
    display: inline-flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    overflow-x: auto;
    white-space: nowrap;
    margin: 10% auto;
    width: 100%;
    min-width: 400px;
    max-height: 400px;
}

.grid-container {
    /* https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_flexible_box_layout/Basic_concepts_of_flexbox */
    display: inline-flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 20px;
    width: 100%;
    min-width: 400px;
    scroll-snap-type: x mandatory;
    position: relative;
}

.grid-container::-webkit-scrollbar {
    display: none;
}

.grid-item {
    position: relative;
    flex: 0 0 calc((100% / 3) - 20px);
    scroll-snap-align: start;
    margin-right: 20px;
    margin-bottom: 20px;
    text-align: center;
    transition: transform 0.3s;
    /* Set position to relative for containing */
    position: relative;
    display: flex; /* Add display flex */
    justify-content: center; /* Center horizontally */
    align-items: flex-end; /* Align to the bottom */
}

.grid-item:hover {
    transform: scale(1.1);
}

.grid-item:hover .caption {
    visibility: visible;
    opacity: 1;
}

.grid-item img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    transform: scale(1.0);
}

.caption {
    position: absolute;
    bottom: -12%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    color: white;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s, opacity 0.3s ease-in-out;
}

#backBtn, #nextBtn {
    position: absolute; /* Position relative to the container */
    top: 35%; /* Position halfway down */
    transform: translateY(-30%); /* Center vertically */
    width: 50px; /* Adjust as needed */
    height: 50px; /* Adjust as needed */
    cursor: pointer;
}

#backBtn {
    left: 0; /* Position on the left */
}

#nextBtn {
    right: 0; /* Position on the right */
}

@media screen and (max-width: 768px) {
    #backBtn, #nextBtn {
        width: 0px;
        visibility: hidden;
    }
}