.webtopus-mansory-gallery-wrap {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.webtopus-mansory-gallery-wrap *,
.webtopus-mansory-gallery-wrap *::before,
.webtopus-mansory-gallery-wrap *::after {
    box-sizing: border-box;
}

.webtopus-mansory-gallery {
    --webtopus-mansory-columns: 3;
    --webtopus-mansory-gap: 16px;
    display: block;
    position: relative;
    width: 100%;
    max-width: 100%;
    min-height: 1px;
}

.webtopus-mansory-gallery-item {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    margin: 0;
    overflow: hidden;
    will-change: transform;
    transition: transform 0.25s ease;
}

.webtopus-mansory-gallery:not(.webtopus-mansory-ready) .webtopus-mansory-gallery-item {
    position: relative;
    transform: none !important;
    margin-bottom: var(--webtopus-mansory-gap);
}

.webtopus-mansory-gallery-link {
    display: block;
    width: 100%;
    line-height: 0;
    text-decoration: none;
    cursor: zoom-in;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.webtopus-mansory-gallery-img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    line-height: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.webtopus-hover-zoom .webtopus-mansory-gallery-item:hover .webtopus-mansory-gallery-img {
    transform: scale(1.04);
}

.webtopus-hover-opacity .webtopus-mansory-gallery-item:hover .webtopus-mansory-gallery-img {
    opacity: 0.78;
}

.webtopus-mansory-empty {
    padding: 16px;
    border: 1px dashed currentColor;
    text-align: center;
    opacity: 0.75;
}

@media (max-width: 1024px) {
    .webtopus-mansory-gallery {
        --webtopus-mansory-columns: 2;
    }
}

@media (max-width: 767px) {
    .webtopus-mansory-gallery {
        --webtopus-mansory-columns: 1;
    }
}

.webtopus-mansory-lightbox {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2147483647;
    display: none;
    align-items: center;
    justify-content: center;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    background: rgba(0, 0, 0, 0.88);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    overscroll-behavior: contain;
    touch-action: none;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.webtopus-mansory-lightbox.is-open {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.webtopus-mansory-lightbox img {
    display: block;
    max-width: min(100%, 1200px);
    max-height: calc(100vh - 72px);
    max-height: calc(100dvh - 72px);
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
    user-select: none;
    -webkit-user-select: none;
}

.webtopus-mansory-lightbox-close {
    position: absolute;
    top: max(10px, env(safe-area-inset-top));
    right: max(10px, env(safe-area-inset-right));
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 34px;
    line-height: 40px;
    cursor: pointer;
}

.webtopus-mansory-lightbox-close:hover,
.webtopus-mansory-lightbox-close:focus {
    background: rgba(255, 255, 255, 0.25);
    outline: none;
}

html.webtopus-mansory-lightbox-open-html,
body.webtopus-mansory-lightbox-open {
    overflow: hidden !important;
    overscroll-behavior: none;
}

body.webtopus-mansory-lightbox-open {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
}

@media (max-width: 767px) {
    .webtopus-mansory-lightbox {
        padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    }

    .webtopus-mansory-lightbox img {
        max-width: 100%;
        max-height: calc(100vh - 84px);
        max-height: calc(100dvh - 84px);
    }
}
