/* Joomla 6 replacement for the legacy JoomlaWorks Simple Image Gallery Classic layout. */
ul.zanelli-legacy-gallery {
    margin: 8px auto !important;
    padding: 8px 0 !important;
    list-style: none !important;
    clear: both;
    display: flex;
    flex-wrap: wrap;
    gap: 1px;
}

ul.zanelli-legacy-gallery li.zanelli-legacy-gallery__item {
    margin: 0;
    padding: 0;
    list-style: none !important;
    background: #fff;
}

ul.zanelli-legacy-gallery a.zanelli-legacy-gallery__link {
    display: block;
    padding: 0;
    margin: 0;
    border: 0;
    background: #000;
    position: relative;
    overflow: hidden;
}

ul.zanelli-legacy-gallery img.zanelli-legacy-gallery__image {
    display: block;
    padding: 0;
    margin: 0;
    border: 0;
    object-fit: cover;
    object-position: 50% 50%;
    transition: opacity .18s ease;
}

ul.zanelli-legacy-gallery a.zanelli-legacy-gallery__link:hover img,
ul.zanelli-legacy-gallery a.zanelli-legacy-gallery__link:focus img {
    opacity: .72;
}

ul.zanelli-legacy-gallery a.zanelli-legacy-gallery__link::after {
    content: "⌕";
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0,0,0,.62);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    opacity: 0;
    transition: opacity .18s ease;
    pointer-events: none;
}

ul.zanelli-legacy-gallery a.zanelli-legacy-gallery__link:hover::after,
ul.zanelli-legacy-gallery a.zanelli-legacy-gallery__link:focus::after {
    opacity: 1;
}

li.sigFreeClear {
    display: none !important;
}

.zlg-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.9);
    padding: 3rem 5rem;
}

.zlg-lightbox.is-open { display: flex; }
.zlg-lightbox__figure { margin: 0; max-width: 100%; max-height: 100%; }
.zlg-lightbox__image { display: block; max-width: 90vw; max-height: 86vh; width: auto; height: auto; }
.zlg-lightbox__close,
.zlg-lightbox__prev,
.zlg-lightbox__next {
    position: absolute;
    border: 0;
    background: rgba(0,0,0,.55);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 2rem;
    line-height: 1;
    min-width: 3rem;
    min-height: 3rem;
}
.zlg-lightbox__close { top: 1rem; right: 1rem; }
.zlg-lightbox__prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.zlg-lightbox__next { right: 1rem; top: 50%; transform: translateY(-50%); }

@media (max-width: 640px) {
    ul.zanelli-legacy-gallery { gap: 4px; }
    ul.zanelli-legacy-gallery li.zanelli-legacy-gallery__item { width: calc(50% - 2px); }
    ul.zanelli-legacy-gallery img.zanelli-legacy-gallery__image { width: 100% !important; height: auto !important; aspect-ratio: 5 / 4; }
    .zlg-lightbox { padding: 3rem 1rem; }
}

@media print {
    .zlg-lightbox { display: none !important; }
    ul.zanelli-legacy-gallery img.zanelli-legacy-gallery__image { width: 30% !important; height: auto !important; }
}
