/*
    * Project : 'Filterable Gallery with Lightbox'
    * Built by : 'Gulshan Songara'
*/

/*--====== Global Variables ======--*/
:root {
    --box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.gallery_item {
    cursor: pointer;
}

/* when the gallery_item has 'show' class */
.gallery_item.show {
    animation: fadeIn 0.4s ease-in;
}

.overflow_hide {
    overflow: hidden;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

/* when the gallery_item has 'hide' class */
.gallery_item.hide {
    display: none;
}

.gallery_item img {
    transition: transform 0.3s ease;
}

.gallery_item:hover img {
    transform: scale(1.1);
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 995;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    overflow-x: hidden;
    overflow-y: auto;
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.3s ease, opacity 0.3s ease;
}

/* when the lightbox is open */
.lightbox.open {
    pointer-events: all;
    visibility: visible;
    opacity: 1;
}

.lightbox_wrapper {
    display: grid;
    place-items: center;
    min-height: calc(100% - 3rem);
    margin: 1.5rem;
}

@media (max-width: 575.98px) {
    .lightbox_wrapper {
        margin: 0.5rem;
        min-height: calc(100% - 1rem);
    }
}

.lightbox_content {
    box-shadow: var(--box-shadow);
    max-width: 700px;
    width: 100%;
    border-radius: 10px;
    text-align: center;
    overflow: hidden;
    transform: scale(0);
    transition: transform 0.5s ease;
}

/* when Lightbox is open then lightbox-content will... */
.lightbox.open .lightbox_content {
    transform: scale(1);
}

/* lightbox-close-btn */
.lightbox_close {
    position: absolute;
    top: 3vh;
    right: 3vw;
    z-index: 999;
    width: 40px;
    height: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
}

.lightbox_close span {
    width: 100%;
    height: 3px;
    margin-top: -1.5px;
    margin-bottom: -1.5px;
    background-color: #ddd;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.lightbox_close:hover span {
    opacity: 1;
}

.lightbox_close span:first-child {
    transform: rotate(45deg);
}

.lightbox_close span:last-child {
    transform: rotate(-45deg);
}

#video-iframe {
    display: none;
    width: 100%;
    height: 450px;
}

#video-iframe.show {
    display: block;
}

.lightbox_img, .lightbox_video {
    display: none;
}

.lightbox_img.show, .lightbox_video.show {
    display: block;
}

iframe.lightbox_video {
    width: 100%;
    height: 450px;
}