/* 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 */
.xPageGallery { padding: 5px; }

.xPageGallery a {
    display: inline-block;
    padding: 5px;
    box-sizing: border-box;
}

.xPageGallery img { transition: transform .2s; }

.xPageGallery img:hover {
    z-index: 1;
    transform: scale(1.03);
}

.xPageGallery a img {
    object-fit: cover;
    width: 100%;
    aspect-ratio: 1/1;
    transition: transform .5s;
}

@media (max-width: 640px) {
    .xPageGallery a { width: 50%; }
}

@media (min-width: 640px) and (max-width: 900px) {
    .xPageGallery a { width: 33.333%; }
}

@media (min-width: 900px) and (max-width: 1160px) {
    .xPageGallery a { width: 25%; }
}

@media (min-width: 1160px) and (max-width: 1440px) {
    .xPageGallery a { width: 20%; }
}

@media (min-width: 1440px) {
    .xPageGallery a { width: 16.666%; }
}
/* <<< */