.hiperall-justified-gallery {
    width: 100%;
    position: relative;
    overflow: hidden;
    line-height: 0;
    --hiperall-jg-radius: 12px;
}

/* Required layout rules for Justified Gallery.
   The library calculates the exact position and dimensions
   of every entry and image with inline styles. */
.hiperall-justified-gallery > .hiperall-jg-item {
    position: absolute;
    display: inline-block;
    overflow: hidden;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: var(--hiperall-jg-radius);
    box-sizing: border-box;
    text-decoration: none;
    line-height: 0;
    background: #f1f1f1;
    opacity: 0;
    visibility: hidden;
}

.hiperall-justified-gallery > .hiperall-jg-item.jg-entry-visible {
    opacity: 1;
    visibility: visible;
}

.hiperall-justified-gallery > .hiperall-jg-item > img {
    position: absolute;
    top: 50%;
    left: 50%;
    display: block;
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    object-fit: fill;
    vertical-align: middle;
}

.hiperall-justified-gallery.hiperall-jg-hover-zoom .hiperall-jg-item img {
    transition: transform .35s ease;
}

.hiperall-justified-gallery.hiperall-jg-hover-zoom .hiperall-jg-item:hover img {
    transform: scale(1.045);
}

.hiperall-justified-gallery .hiperall-jg-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px 12px;
    color: #fff;
    background: linear-gradient(transparent, rgba(0,0,0,.78));
    font-size: 14px;
    line-height: 1.3;
    box-sizing: border-box;
}

.hiperall-jg-empty {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border: 1px dashed #bbb;
    background: #fafafa;
    color: #555;
    text-align: center;
}

/* Lightweight built-in lightbox. */
.hiperall-jg-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background: rgba(0,0,0,.88);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}

.hiperall-jg-lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

.hiperall-jg-lightbox img {
    display: block;
    max-width: min(94vw, 1600px);
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,.45);
}

.hiperall-jg-lightbox button {
    position: absolute;
    top: 18px;
    right: 22px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.14);
    color: #fff;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

body.hiperall-jg-no-scroll {
    overflow: hidden !important;
}

/* Load More */
.hiperall-jg-load-more-wrap {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 24px;
}

.hiperall-jg-load-more {
    appearance: none;
    border: 0;
    border-radius: 999px;
    padding: 12px 24px;
    background: #e51b16;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition: transform .2s ease, opacity .2s ease, background-color .2s ease;
}

.hiperall-jg-load-more:hover {
    transform: translateY(-1px);
    background: #c91511;
}

.hiperall-jg-load-more:disabled {
    cursor: wait;
    opacity: .65;
    transform: none;
}

.hiperall-jg-load-more.has-error {
    background: #333;
}
