/* =========================================================
   WildGallery
   ========================================================= */

/* Gallery grid */

.wildgallery {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
}

.wildgallery-link {
    display: block;
    max-width: 300px;
    text-decoration: none;
}

.wildgallery-link img {
    display: block;
    max-width: 300px;
    max-height: 300px;
    width: auto;
    height: auto;
    cursor: zoom-in;
}


/* =========================================================
   Lightbox overlay
   ========================================================= */

.wildgallery-lightbox {
    position: fixed !important;
    inset: 0 !important;

    z-index: 2147483000 !important;

    display: none !important;
    align-items: center !important;
    justify-content: center !important;

    box-sizing: border-box !important;

    width: 100vw !important;
    height: 100vh !important;

    padding: 40px 80px !important;

    background: rgba(0, 0, 0, 0.92) !important;
}

.wildgallery-lightbox.is-open {
    display: flex !important;
}


/* Full-size image */

.wildgallery-lightbox-image {
    position: relative !important;
    z-index: 2147483001 !important;

    display: block !important;

    max-width: calc(100vw - 160px) !important;
    max-height: calc(100vh - 80px) !important;

    width: auto !important;
    height: auto !important;

    margin: 0 !important;
    padding: 0 !important;

    object-fit: contain !important;
}


/* =========================================================
   Lightbox controls
   ========================================================= */

.wildgallery-lightbox-close,
.wildgallery-lightbox-prev,
.wildgallery-lightbox-next {
    all: unset !important;

    position: fixed !important;
    z-index: 2147483647 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    box-sizing: border-box !important;

    width: 56px !important;
    height: 56px !important;

    margin: 0 !important;
    padding: 0 !important;

    border: 1px solid rgba(255, 255, 255, 0.7) !important;
    border-radius: 6px !important;

    background: rgba(0, 0, 0, 0.75) !important;
    color: #ffffff !important;

    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 38px !important;
    font-weight: 400 !important;
    line-height: 1 !important;

    text-align: center !important;
    text-decoration: none !important;

    opacity: 1 !important;
    visibility: visible !important;

    cursor: pointer !important;

    user-select: none !important;
    -webkit-user-select: none !important;
}

.wildgallery-lightbox-close {
    top: 20px !important;
    right: 20px !important;
}

.wildgallery-lightbox-prev {
    top: 50% !important;
    left: 20px !important;

    transform: translateY(-50%) !important;
}

.wildgallery-lightbox-next {
    top: 50% !important;
    right: 20px !important;

    transform: translateY(-50%) !important;
}

.wildgallery-lightbox-close:hover,
.wildgallery-lightbox-prev:hover,
.wildgallery-lightbox-next:hover,
.wildgallery-lightbox-close:focus,
.wildgallery-lightbox-prev:focus,
.wildgallery-lightbox-next:focus {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: #ffffff !important;
}


/* Prevent page scrolling while lightbox is open */

body.wildgallery-lightbox-open {
    overflow: hidden !important;
}


/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 600px) {

    .wildgallery {
        gap: 0.75rem;
    }

    .wildgallery-link {
        width: calc(50% - 0.375rem);
        max-width: none;
    }

    .wildgallery-link img {
        width: 100%;
        max-width: none;
        max-height: none;
        height: auto;
    }

    .wildgallery-lightbox {
        padding: 60px 12px !important;
    }

    .wildgallery-lightbox-image {
        max-width: calc(100vw - 24px) !important;
        max-height: calc(100vh - 120px) !important;
    }

    .wildgallery-lightbox-close,
    .wildgallery-lightbox-prev,
    .wildgallery-lightbox-next {
        width: 46px !important;
        height: 46px !important;

        font-size: 32px !important;
    }

    .wildgallery-lightbox-close {
        top: 10px !important;
        right: 10px !important;
    }

    .wildgallery-lightbox-prev {
        left: 10px !important;
    }

    .wildgallery-lightbox-next {
        right: 10px !important;
    }
}