/**
 * EmbedPress Pro — Google Photos Grid / Masonry / Justify album modes and the
 * photo lightbox. Moved verbatim from the free plugin's embedpress.css.
 */

.ep-google-photos-gallery-grid .ose-google-photos,
.ep-google-photos-gallery-masonary .ose-google-photos,
.ep-google-photos-gallery-justify .ose-google-photos {
    height: 100% !important;
    max-height: 100% !important;
}

/* Leons style */
/* Basic styling */
.photos-gallery-grid, .photos-gallery-masonry, .photos-gallery-justify {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 3px;
}

.photos-gallery-grid .photo-item, .photos-gallery-masonary .photo-item {
    width: 100%;
    height: 200px;
    background-color: #f1efef;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    text-align: center;
}


/* masonary */

.photos-gallery-masonary {
    columns: 250px;
    gap: 3px;
    position: relative;
    width: 100%;
}

.photos-gallery-masonary .photo-item {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    margin-bottom: 3px;
    cursor: pointer;
}

.photos-gallery-masonary .photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* grid */


.photos-gallery-grid {
    display: grid;
    gap: 3px;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    position: relative;
}

.photos-gallery-grid .photo-item {
    border-radius: 10px;
    text-align: center;
    height: 280px;
    cursor: pointer;
}

.photos-gallery-grid .photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* justify */
/* .photos-gallery-justify {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 3px;
}

.photos-gallery-justify .photo-item {
    flex: 1 0 auto;
    width: auto;
    height: 250px;

}

.photos-gallery-justify .photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
} */


.photos-gallery-justify {
    display: flex;
    flex-wrap: wrap;
}

.photos-gallery-justify .photo-item {
    cursor: pointer;
    height: auto;
}

.photos-gallery-justify .photo-item:hover {
    opacity: 0.9;
}

.photos-gallery-justify .photo-item img {
    user-select: none;
    width: 100%;
    vertical-align: middle;
}

.photos-gallery-justify::after {
    content: "";
    flex-grow: 99999;
    min-width: calc(100vw / 4);
}

@media (max-width: 460px) {
    .photos-gallery-justify {
        flex-direction: column;
    }

    .photos-gallery-justify .photo-item {
        width: 100% !important;
    }
}



/* Popup styles */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    /* Must sit above Elementor popups (default modal z-index 9999) so the
       gallery lightbox is visible when the gallery is inside a popup. */
    z-index: 999999;
    transition: 0.5s ease;

}

.popup-overlay .popup {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    background-color: transparent;
    display: flex !important;
    justify-content: center;
    align-items: center;
    color: black;
}

.popup-overlay .close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    color: white;
    font-size: 30px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0a0a;
    border-radius: 50%;
}

.popup-overlay .prev-btn,
.popup-overlay .next-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 30px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: 0.2s;
    display: flex;
}

.popup-overlay:hover .prev-btn, .popup-overlay:hover .next-btn {
    opacity: 1;
    visibility: visible;

}

.popup-overlay .prev-btn {
    left: 10px;
}

.popup-overlay .next-btn {
    right: 10px;
}

.popup-overlay img#popup-image {
    width: 100%;
    height: auto;
    max-height: 100vh;
}

.popup-overlay .prev-btn:hover,
.popup-overlay .next-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}


@media (max-width: 1024px) {

    .photos-gallery-grid .photo-item {
        width: 100%;
        height: 150px !important;
    }


    /* masonary */

    .photos-gallery-masonary {
        columns: 200px !important;
    }

    /* grid */


    .photos-gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    }

}

@media (max-width: 767px) {

    .popup-overlay .prev-btn,
    .popup-overlay .next-btn {
        font-size: 20px;
        padding: 5px;
    }
}
