/* popup */
.xGallery,
.xGallery .slider {
    height: 100%;
    white-space: nowrap;
}

.xGallery .slider .slide {
    text-align: center;
    position: relative;
    box-sizing: border-box;
    float: left;
    width: 100%;
    height: 100%;

    -webkit-touch-callout: none; /* iOS Safari */
    -webkit-user-select: none; /* Safari */
    -khtml-user-select: none; /* Konqueror HTML */
    -moz-user-select: none; /* Old versions of Firefox */
    -ms-user-select: none; /* Internet Explorer/Edge */
    user-select: none; /* Non-prefixed version, currently supported by Chrome, Edge, Opera and Firefox */
}

.fullscreen .xGallery .slider .slide { text-align: center; }

.xGallery .slider .slide img {
    max-width: 100vw;
    max-height: 100vh;
    vertical-align: middle;
}

.xGallery .slider .slide span {
    display: inline-block;
    padding: 0;
    margin: 0;
    width: 0px;
    height: 100vh;
    vertical-align: middle;
}

.xGallery .slider .slide.fade {
    position: absolute;
    top: 0;
    left: 0;
}
/* <<< */

/* !!! ako ima frame w .xGallery ne e neobhodimo da ima position: relative; overflow: hidden; */
.xGallery .frame {
    height: 100%;
    position: relative;
    overflow: hidden;
}

.xGallery .items { display: none; }

.xGallery a.close {
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    cursor: pointer;

    background-color: rgba(0,0,0,0.05);
}

.xGallery a.close hr {
    position: absolute;
    top: 19px;
    left: 20px;
    border: none;
    width: 24px;
    height: 2px;
    background-color: #999;

    pointer-events: none;
}

.xGallery a.close hr:first-child { transform: rotate(45deg); }

.xGallery a.close hr:last-child { transform: rotate(-45deg); }

.xGallery a.close:hover hr { background-color: #333; }

/* controls */
/*@media all and (max-width: 960px) {
    .xGallery a.left,
    .xGallery a.right { display: none; }
}*/

.xGallery a.left,
.xGallery a.right {
    position: absolute;
    top: 10%;
    width: 10%;
    height: 80%;
    cursor: pointer;
}

.xGallery a.left,
.xGallery a.left span { left: 0; }

.xGallery a.right,
.xGallery a.right span { right: 0; }

.xGallery a.left span,
.xGallery a.right span {
    position: absolute;
    top: 50%;
    width: 60px;
    height: 60px;
    margin-top: -30px;
    cursor: pointer;

    background-color: rgba(0,0,0,0.05);
}

.xGallery a.left hr,
.xGallery a.right hr {
    margin: 0;
    position: absolute;
    width: 12px;
    height: 2px;
    background-color: #999;
    border: none;

    pointer-events: none;
}

.xGallery a.left hr { left: 21px; }

.xGallery a.right hr { left: 26px; }

.xGallery a.left:hover hr,
.xGallery a.right:hover hr { background-color: #333; }

.xGallery a.left hr:first-child,
.xGallery a.right hr:last-child { transform: rotate(-45deg); }

.xGallery a.left hr:last-child,
.xGallery a.right hr:first-child { transform: rotate(45deg); }

.xGallery a.left hr:first-child,
.xGallery a.right hr:first-child { top: 24px; }

.xGallery a.left hr:last-child,
.xGallery a.right hr:last-child { top: 32px; }
/* <<< */

/* Page Gallery Plus */
gallery {
    display: block;
    position: relative;
    overflow: hidden;

    > picture img {
        aspect-ratio: 4/3;
    }
    
    picture {
        display: block;
        width: 100%;
        max-height: 70%;

        img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            cursor: pointer;
        }
    }

    set {
        position: absolute;
        top: 0;
        right: 0;
        height: 100%;
        max-width: 25.29%;
        background-color: #FFF;

        picture {
            padding: 0 0 3% 3%;
            box-sizing: border-box;

            img {
                width: 100%;
                height: 100%;
                aspect-ratio: 1/1;
                object-fit: cover;
            }
        }

        /* picture 3 */
        picture.plus{
            position: relative;
        }

        picture.plus::after {
            position: absolute;
            inset: 0;
            content: attr(data-text);
            display: flex;
            align-items: center;
            justify-content: center;
            background-color: #000A;
            color: #FFF;
            font-family: sans-serif;
            font-size: 24px;
            font-weight: 700;
            cursor: pointer;
            margin-left: 3%;

            /* cancel event on click */
            user-select: none;
            pointer-events: none;
        }
        /* <<< */

        /* all pictures after 3 item  */
        picture:nth-child(n+4) {
            display: none;
        }
    }
}