body {
    background-color: black;
}

.gallery {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.photo {
    position: relative;
    width: calc((100% - 60px) / 6);
    height: calc((100% - 60px) / 6);
    aspect-ratio: 1 / 1;
    cursor: pointer;
}

.carousel-badge {
    position: absolute;
    top: 8px;
    right: 6px;
    z-index: 20;
    background-color: white;
    padding: 8px;
    min-width: 36px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 100%;
    font-weight: 600;
    border: 1px solid black;
}

.photo > img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    z-index: 1;
    transition: .3s ease-in-out filter;
}

.photo > .label {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 5px 8px;
    z-index: 2;
    opacity: 0;
    transition: .3s ease-in-out opacity;
}

.photo:hover > img {
    filter: brightness(1.2);
}

.photo:hover > .label {
    opacity: 1;
}

.preview-area {
    position: fixed;
    top: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.9);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: .3s ease opacity;
}

.preview-area.show {
    opacity: 1;
    pointer-events: all;
}

.preview-area > .preview-image {
    max-width: 90vw;
    width: 100%;
    max-height: 90vh;
    height: 100%;
    object-fit: contain;
}

.preview-area > .preview-video {
    max-width: 90vw;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 0 25px;
}

.preview-area > .preview-image,
.preview-area > .preview-video {
    position: absolute;
    opacity: 0;
    transform: scale(0.9);
    transition: .3s ease opacity, .3s ease transform;
}

.preview-area > .preview-image.show,
.preview-area > .preview-video.show {
    opacity: 1;
    transform: scale(1);
}

.preview-area > .close-button,
.preview-area > .navigation-button {
    padding: 0;
    margin: 0;
    background: none;
    background-color: rgba(0, 0, 0, 0.7);
    border: 0;
    width: 60px;
    height: 60px;
    z-index: 9999;
}

.preview-area > .close-button > svg,
.preview-area > .navigation-button > svg {
    width: 40px;
    height: 40px;
    fill: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: .3s ease fill;
}

.preview-area > .close-button:hover > svg,
.preview-area > .navigation-button:hover > svg {
    fill: white;
}

.preview-area > .close-button {
    position: fixed;
    top: 20px;
    right: 20px;
}

.preview-area > .navigation-button.left {
    position: fixed;
    left: 20px;
    bottom: 20px;
}

.preview-area > .navigation-button.right {
    position: fixed;
    right: 20px;
    bottom: 20px;
}

@media screen and (max-width: 1700px) {
    .photo {
        width: calc((100% - 50px) / 5);
        height: calc((100% - 50px) / 5);
        aspect-ratio: 1 / 1;
    }
}

@media screen and (max-width: 1400px) {
    .photo {
        width: calc((100% - 40px) / 4);
        height: calc((100% - 40px) / 4);
        aspect-ratio: 1 / 1;
    }
}

@media screen and (max-width: 1000px) {
    .photo {
        width: calc((100% - 30px) / 3);
        height: calc((100% - 30px) / 3);
        aspect-ratio: 1 / 1;
    }
}

@media screen and (max-width: 700px) {
    .photo {
        width: calc((100% - 20px) / 2);
        height: calc((100% - 20px) / 2);
        aspect-ratio: 1 / 1;
    }
}

@media screen and (max-width: 500px) {
    .gallery {
        padding: 10px;
        margin: 0;
    }

    .photo {
        width: 100%;
    }

    .photo > .label {
        opacity: 1;
    }

    .preview-area > .close-button,
    .preview-area > .navigation-button {
        right: 10px;
    }
}