/* popup */
.mgGallery,
.mgGallery .slider { height: 100%; }

.mgGallery .slider .slide {
    text-align: center;
    position: relative;
    box-sizing: border-box;
    float: left;
    width: 100%;
    height: 100%;
}

.fullscreen .mgGallery .slider .slide { text-align: center; }

.mgGallery .slider .slide img {
    max-width: 100vw;
    max-height: 100vh;
    vertical-align: middle;
}

.mgGallery .slider .slide span {
    display: inline-block;
    padding: 0;
    margin: 0;
    width: 0px;
    height: 100vh;
    vertical-align: middle;
}

.mgGallery .slider .slide.fade {
    position: absolute;
    top: 0;
    left: 0;
}

/* *** */

/* !!! ako ima frame w .mgGallery ne e neobhodimo da ima position: relative; overflow: hidden; */
.mgGallery .frame {
    height: 100%;
    position: relative;
    overflow: hidden;
}

.mgGallery .items { display: none; }

.mgGallery a.close {
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 50px;
    cursor: pointer;

    background-color: rgba(0,0,0,0.05);
}

.mgGallery a.close hr {
    position: absolute;
    top: 17px;
    left: 18px;
    border: none;
    width: 24px;
    height: 2px;
    background-color: #999;

    pointer-events: none;
}

.mgGallery a.close hr:first-child { transform: rotate(45deg); }

.mgGallery a.close hr:last-child { transform: rotate(-45deg); }

.mgGallery a.close:hover hr { background-color: #333; }

/* controls */
@media all and (max-width: 959.999px) {
    .mgGallery a.left,
    .mgGallery a.right { display: none; }
}

@media (min-width: 960px)
{
    .mgGallery a.left,
    .mgGallery a.right {
        position: absolute;
        top: 10%;
        width: 10%;
        height: 80%;
        cursor: pointer;
    }

    .mgGallery a.left,
    .mgGallery a.left span { left: 0; }

    .mgGallery a.right,
    .mgGallery a.right span { right: 0; }

    .mgGallery a.left span,
    .mgGallery a.right span {
        position: absolute;
        top: 50%;
        width: 60px;
        height: 60px;
        margin-top: -30px;
        cursor: pointer;

        background-color: rgba(0,0,0,0.05);
    }

    .mgGallery a.left hr,
    .mgGallery a.right hr {
        margin: 0;
        position: absolute;
        width: 12px;
        height: 2px;
        background-color: #999;
        border: none;

        pointer-events: none;
    }

    .mgGallery a.left hr { left: 21px; }

    .mgGallery a.right hr { left: 26px; }

    .mgGallery a.left:hover hr,
    .mgGallery a.right:hover hr { background-color: #333; }

    .mgGallery a.left hr:first-child,
    .mgGallery a.right hr:last-child { transform: rotate(-45deg); }

    .mgGallery a.left hr:last-child,
    .mgGallery a.right hr:first-child { transform: rotate(45deg); }

    .mgGallery a.left hr:first-child,
    .mgGallery a.right hr:first-child { top: 24px; }

    .mgGallery a.left hr:last-child,
    .mgGallery a.right hr:last-child { top: 32px; }
}
/* *** */

.mgPageGallery { padding: 5px; }

.mgPageGallery a {
    display: inline-block;
    padding: 5px;
    box-sizing: border-box;
}

.mgPageGallery img {
    object-fit: cover;
    width: 100%;
    aspect-ratio: 1 / 1;
    transition: transform .5s;
}

.mgPageGallery img:hover {
    z-index: 1;
    transform: scale(1.05);
}

@media (max-width: 639.999px) {
    .mgPageGallery a { width: 50%; }
}

@media (min-width: 640px) and (max-width: 899.999px) {
    .mgPageGallery a { width: 33.333%; }
}

@media (min-width: 900px) and (max-width: 1159.999px) {
    .mgPageGallery a { width: 25%; }
}

@media (min-width: 1160px) and (max-width: 1439.999px) {
    .mgPageGallery a { width: 20%; }
}

@media (min-width: 1440px) {
    .mgPageGallery a { width: 16.666%; }
}

.videos iframe {
    width: 100%;
    aspect-ratio: 9 / 6;
    border: none;
}