
/* =========================================================
   MUZEJA GALERIJA
   Compact thumbnail grid
   ========================================================= */


/* FILTERI */

.mg-filters {
    display: flex;
    flex-wrap: wrap;

    gap: 8px;

    margin:
        0 0
        18px;
}

.mg-filter {
    appearance: none;

    padding:
        7px
        13px;

    border:
        1px solid
        #ddd2c9;

    border-radius: 999px;

    background: #fff;

    color: #536a78;

    font-size: 12px;
    font-weight: 700;

    cursor: pointer;
}

.mg-filter.active {
    border-color: #8d2531;

    background: #8d2531;

    color: #fff;
}


/* =========================================================
   DESKTOP PHOTO GRID
   ========================================================= */

.museumx-gallery-stage
.svgm-museum-grid {

    display: grid !important;

    grid-template-columns:
        repeat(
            5,
            minmax(0, 1fr)
        ) !important;

    gap: 14px !important;

    width: 100% !important;

    column-count: initial !important;

    align-items: start !important;
}


/* IMAGE ITEM */

.museumx-gallery-stage
.svgm-museum-item {

    display: block !important;

    width: 100% !important;

    height: auto !important;
    min-height: 0 !important;

    margin: 0 !important;
    padding: 0 !important;

    overflow: hidden !important;

    border:
        1px solid
        rgba(100,75,58,.08)
        !important;

    border-radius: 12px !important;

    background:
        #f6f2ee
        !important;

    box-shadow:
        0 3px 11px
        rgba(55,42,34,.045)
        !important;

    break-inside: auto !important;
}


/* =========================================================
   THUMBNAIL FRAME

   ALL photos have equal small frames.
   Landscape and portrait photos are NOT cropped.
   ========================================================= */

.museumx-gallery-stage
.mg-open,
.museumx-gallery-stage
.mg-open:hover,
.museumx-gallery-stage
.mg-open:focus,
.museumx-gallery-stage
.mg-open:active {

    appearance: none !important;
    -webkit-appearance: none !important;

    position: relative !important;

    display: flex !important;

    align-items: center !important;
    justify-content: center !important;

    width: 100% !important;

    height: auto !important;
    min-height: 0 !important;

    aspect-ratio:
        4 / 3 !important;

    margin: 0 !important;
    padding: 0 !important;

    overflow: hidden !important;

    border: 0 !important;
    border-radius: 0 !important;

    outline: 0 !important;

    background:
        #f7f3ef
        !important;

    background-image:
        none !important;

    box-shadow:
        none !important;

    color: inherit !important;

    line-height: 0 !important;

    text-decoration:
        none !important;

    cursor:
        zoom-in !important;
}


/* Remove theme button overlays */

.museumx-gallery-stage
.mg-open::before,

.museumx-gallery-stage
.mg-open::after,

.museumx-gallery-stage
.mg-open:hover::before,

.museumx-gallery-stage
.mg-open:hover::after {

    content:
        none !important;

    display:
        none !important;
}


/* PHOTO */

.museumx-gallery-stage
.mg-open img,

.museumx-gallery-stage
.mg-open:hover img {

    display: block !important;

    width: 100% !important;
    height: 100% !important;

    min-height: 0 !important;

    max-width: 100% !important;
    max-height: 100% !important;

    margin: 0 !important;
    padding: 0 !important;

    object-fit:
        contain !important;

    object-position:
        center !important;

    aspect-ratio:
        auto !important;

    background:
        transparent !important;

    border:
        0 !important;

    box-shadow:
        none !important;

    transform:
        none !important;
}


/* DESKTOP subtle hover */

@media (hover:hover) {

    .museumx-gallery-stage
    .mg-open img {

        transition:
            transform .25s ease,
            opacity .25s ease
            !important;
    }


    .museumx-gallery-stage
    .mg-open:hover img {

        transform:
            scale(1.018)
            !important;

        opacity:
            .96 !important;
    }

}


/* ZOOM */

.mg-zoom {

    position: absolute;

    right: 7px;
    bottom: 7px;

    width: 29px;
    height: 29px;

    display: grid;

    place-items: center;

    border-radius: 50%;

    background:
        rgba(255,255,255,.94);

    color:
        #721b26;

    font-size: 18px;

    line-height: 1;

    box-shadow:
        0 2px 8px
        rgba(0,0,0,.10);
}


/* OPTIONAL CAPTION */

.svgm-museum-item
figcaption {

    padding:
        10px
        11px
        12px;

    background: #fff;
}

.svgm-museum-item
figcaption strong {

    display: block;

    color: #315267;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: 14px;
}

.svgm-museum-item
figcaption p {

    margin:
        3px 0 0;

    color: #748894;

    font-size: 11px;
    line-height: 1.4;
}


/* EMPTY */

.mg-front-empty {

    padding:
        35px
        20px;

    border:
        1px dashed
        #d8cdc3;

    border-radius: 14px;

    text-align: center;
}

.mg-front-empty strong,
.mg-front-empty span {

    display: block;
}

.mg-front-empty strong {

    color: #315267;

    font-family:
        Georgia,
        serif;

    font-size: 19px;
}

.mg-front-empty span {

    margin-top: 5px;

    color: #7d8f99;
}


/* =========================================================
   LIGHTBOX
   ========================================================= */

.mg-lightbox {

    position: fixed;

    inset: 0;

    z-index: 999999;

    display: none;

    align-items: center;
    justify-content: center;

    padding:
        60px
        75px;

    background:
        rgba(15,18,20,.95);
}

.mg-lightbox.open {

    display: flex;
}

.mg-lightbox-inner {

    max-width: 1450px;

    max-height: 100%;

    text-align: center;
}

.mg-lightbox-inner img {

    display: block;

    width: auto !important;
    height: auto !important;

    max-width:
        100% !important;

    max-height:
        calc(100vh - 180px)
        !important;

    margin: auto;

    object-fit:
        contain !important;

    border-radius: 6px;

    box-shadow:
        0 15px 50px
        rgba(0,0,0,.35);
}

.mg-lightbox-text {

    padding-top: 11px;

    color: #fff;
}

.mg-lightbox-text strong {

    display: block;

    font-family:
        Georgia,
        serif;

    font-size: 17px;
}

.mg-lightbox-text p {

    margin:
        4px 0 0;

    color:
        rgba(255,255,255,.72);

    font-size: 12px;
}


/* CONTROLS */

.mg-close,
.mg-prev,
.mg-next {

    position: fixed;

    border: 0;

    color: #fff;

    background:
        rgba(255,255,255,.12);

    cursor: pointer;
}

.mg-close {

    top: 20px;
    right: 22px;

    width: 46px;
    height: 46px;

    border-radius: 50%;

    font-size: 30px;
}

.mg-prev,
.mg-next {

    top: 50%;

    width: 48px;
    height: 68px;

    margin-top: -34px;

    border-radius: 10px;

    font-size: 35px;
}

.mg-prev {
    left: 20px;
}

.mg-next {
    right: 20px;
}


/* =========================================================
   LAPTOP
   ========================================================= */

@media (max-width: 1250px) {

    .museumx-gallery-stage
    .svgm-museum-grid {

        grid-template-columns:
            repeat(
                4,
                minmax(0,1fr)
            ) !important;
    }

}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 900px) {

    .museumx-gallery-stage
    .svgm-museum-grid {

        grid-template-columns:
            repeat(
                3,
                minmax(0,1fr)
            ) !important;

        gap:
            11px !important;
    }

}


/* =========================================================
   PHONE
   ========================================================= */

@media (max-width: 620px) {

    .museumx-gallery-stage
    .svgm-museum-grid {

        grid-template-columns:
            repeat(
                2,
                minmax(0,1fr)
            ) !important;

        gap:
            8px !important;
    }


    .museumx-gallery-stage
    .svgm-museum-item {

        border-radius:
            9px !important;
    }


    .mg-zoom {

        width: 27px;
        height: 27px;

        right: 5px;
        bottom: 5px;

        font-size: 16px;
    }


    .mg-filters {

        flex-wrap: nowrap;

        overflow-x: auto;

        padding-bottom: 4px;
    }


    .mg-filter {

        flex:
            0 0 auto;
    }


    .mg-lightbox {

        padding:
            65px
            10px
            80px;
    }


    .mg-lightbox-inner img {

        max-height:
            calc(100vh - 170px)
            !important;
    }


    .mg-prev,
    .mg-next {

        top: auto;

        bottom: 16px;

        width: 52px;
        height: 48px;

        margin: 0;
    }


    .mg-prev {

        left:
            calc(50% - 62px);
    }


    .mg-next {

        right:
            calc(50% - 62px);
    }

}



/* =========================================================
   MUZEJA LIGHTBOX POGAS - BEIGE / WHITE
   ========================================================= */

.mg-lightbox .mg-close,
.mg-lightbox .mg-prev,
.mg-lightbox .mg-next,
.mg-lightbox .mg-close:hover,
.mg-lightbox .mg-prev:hover,
.mg-lightbox .mg-next:hover,
.mg-lightbox .mg-close:focus,
.mg-lightbox .mg-prev:focus,
.mg-lightbox .mg-next:focus,
.mg-lightbox .mg-close:active,
.mg-lightbox .mg-prev:active,
.mg-lightbox .mg-next:active {

    appearance: none !important;
    -webkit-appearance: none !important;

    border:
        1px solid
        rgba(255,255,255,.42)
        !important;

    outline: none !important;

    background:
        rgba(248,243,237,.94)
        !important;

    background-color:
        rgba(248,243,237,.94)
        !important;

    background-image:
        none !important;

    color:
        #721b26
        !important;

    box-shadow:
        0 4px 18px
        rgba(0,0,0,.18)
        !important;

    text-decoration:
        none !important;

    opacity: 1 !important;

    transition:
        background .2s ease,
        transform .2s ease,
        box-shadow .2s ease
        !important;
}


/* Hover nedaudz gaišāks */

.mg-lightbox .mg-close:hover,
.mg-lightbox .mg-prev:hover,
.mg-lightbox .mg-next:hover {

    background:
        #fffaf5
        !important;

    color:
        #721b26
        !important;

    transform:
        scale(1.04);

    box-shadow:
        0 5px 20px
        rgba(0,0,0,.24)
        !important;
}


/* Noņemam tēmas dekoratīvos pseudo elementus */

.mg-lightbox .mg-close::before,
.mg-lightbox .mg-close::after,
.mg-lightbox .mg-prev::before,
.mg-lightbox .mg-prev::after,
.mg-lightbox .mg-next::before,
.mg-lightbox .mg-next::after {

    content: none !important;

    display: none !important;
}


/* Aizvēršanas poga */

.mg-lightbox .mg-close {

    border-radius:
        50% !important;
}


/* Bultiņas */

.mg-lightbox .mg-prev,
.mg-lightbox .mg-next {

    border-radius:
        12px !important;
}

