/**
 * justifiedGallery base styles + Extras for Elementor justified overrides.
 *
 * The base rules key off the `.justified-gallery` class that the library adds
 * to the container it initialises on. The Extras overrides let the library own
 * the row layout while each of our nested media wrappers fills the sized entry.
 */

/* justifiedGallery base */
.justified-gallery {
    width: 100%;
    position: relative;
    overflow: hidden;
}

.justified-gallery > a,
.justified-gallery > div,
.justified-gallery > figure {
    position: absolute;
    display: inline-block;
    overflow: hidden;
    opacity: 0.1;
    margin: 0;
    padding: 0;
}

.justified-gallery > a .jg-caption,
.justified-gallery > div .jg-caption,
.justified-gallery > figure .jg-caption {
    display: none;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    padding: 5px 8px;
    color: #ffffff;
    background-color: rgba(0, 0, 0, 0.6);
    font-size: 12px;
    line-height: 1.4;
}

.justified-gallery > a .jg-caption.jg-caption-visible,
.justified-gallery > div .jg-caption.jg-caption-visible,
.justified-gallery > figure .jg-caption.jg-caption-visible {
    display: block;
}

.justified-gallery .jg-filtered {
    display: none;
}

.justified-gallery .jg-spinner {
    position: absolute;
    bottom: 0;
    margin-left: -24px;
    padding: 10px 0;
    left: 50%;
    opacity: 0.5;
}

.justified-gallery .jg-spinner > span {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin: 0 4px;
    background-color: #000000;
    border-radius: 50%;
}

/* Extras: let justifiedGallery drive the layout of an existing EE gallery */
.ee-gallery.ee-gallery--justified {
    display: block;
    margin: 0;
}

.ee-gallery--justified .ee-gallery__item {
    position: absolute;
    width: auto;
    padding: 0;
    margin: 0;
}

.ee-gallery--justified .ee-gallery__media,
.ee-gallery--justified .ee-gallery__media-wrapper,
.ee-gallery--justified .ee-gallery__media__thumbnail {
    position: static;
    width: 100%;
    height: 100%;
    margin: 0;
    display: block;
}

/* Neutralise the library's inline per-image sizing; we cover via object-fit. */
.ee-gallery--justified .ee-gallery__media__thumbnail img {
    position: static !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    opacity: 1 !important;
    object-fit: cover;
}
