.photogallery_widget {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    margin: 0 -15px;
    align-items: stretch;
    justify-content: center;
    padding: 0.5em 0;
    flex-basis: fit-content;


}

.photogallery_widget_item_photo:hover {
    transform: scale(1) !important;
}

.photogallery_widget_item {
    width: calc(33.3% - 30px);
    border: 1px solid #54534a;
    padding: .3em;
    margin: 0 15px 15px;
    /* flex-grow: 1; */
    min-width: 280px;
    display: flex;
    flex-direction: column;
}

.photogallery_widget_item_photo {
    padding-bottom: 50%;
    background-size: cover;
    background-position: center;
    flex-grow: 1;
    display: block;
    margin-bottom: 0 !important;
}

.photogallery_widget_item_description {
    font-size: 16px;
    margin-top: 0.6em;
    flex-grow: 1;
}

.gallery_home.photogallery_widget .photogallery_widget_item_description {
    margin-top: 0.4em;
}

.photogallery_widget_item_category {
    font-size: 16px;
    display: flex;
    align-items: center;
    padding: 0.6em 0 0.3em;
}

.gallery_home.photogallery_widget .photogallery_widget_item {
    width: calc(50% - 3em);
    background: #e5e3db;
    text-decoration: none;
}

.gallery_home.photogallery_widget .photogallery_widget_item h3 {
    font-size: 2em !important;
    color: #54534a;
    text-align: center;
}

.gallery_home.photogallery_widget .photogallery_widget_item h3 i {
    font-size: .9em;
    color: #54534a;
    text-align: center;
    margin-right: 0.2em;
}

main a {
    text-decoration: underline;
}

.photogallery_widget_item_category .label {
    margin-right: 0.3em;
}

ul.media {
    max-height: 100%;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -ms-flex-direction: row;
    flex-direction: row;
    width: 100%;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-transition: 1s all ease;
    transition: 1s all ease;
    background: transparent;
    padding: 0;
    margin: 0;
    position: relative;
}

span.media_overlay {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
    -webkit-transition: 0.3s all ease;
    transition: 0.3s all ease;
    color: #ffffff;
    background: transparent;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 10px;
}

.media li {
    display: inline-block;
    position: relative;
    overflow: hidden;
    /* width: 33.3%; */
    height: 200px;
    /* max-height: 200px; */
    /* background-size: cover; */
    /* background-position: 50% 50%; */
    /* margin: 10px; */
    box-shadow: 0 5px 5px #00000042;
    flex-grow: 1;
}

.media li .thumb {
    display: block;
    position: relative;
    /* overflow: hidden; */
    width: 100%;
    /* padding-bottom: 100%; */
    -webkit-transition: .5s all ease;
    transition: .5s all ease;
    height: 100%;
    margin: 0;
    padding: 0;
}

.media li:hover .media_overlay,
.thumb:hover .media_overlay {
    opacity: .5;
    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
    background: var(--mr-color-accent-murky);
}

.gallery.lightbox .thumb:hover img {
    -webkit-transform: scale(1.05);
    transform: scale(1.05);
    cursor: pointer;
}

.grid .thumb:hover {
    /* -webkit-transform: scale(1.05); */
    /* transform: scale(1.01); */
    cursor: pointer;
    color: #0b9444;
    text-decoration: none;
}

.gallery_link {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    height: 100%;
    background: var(--mr-color-primary);
}

.media-wrapper {
    -ms-flex-item-align: end;
    align-self: flex-end;
    -webkit-box-flex: 2;
    -ms-flex-positive: 2;
    flex-grow: 2;
    width: 100%;
}

.main-about {
    -webkit-box-flex: 0;
    -ms-flex-positive: 0;
    flex-grow: 0;
    -webkit-box-align: center;
    -ms-flex-align: center;
    -ms-grid-row-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    padding-bottom: 50px;
}

.main-left {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
}


.media .btn {
    margin: 0;
    background: transparent;
}

@media (max-width: 991px) {
    .headline {
        font-size: 20px;
        line-height: 22px;
    }
}

@media (max-width: 380px) {
    .media li {
        width: 50%;
    }

    .media li:last-of-type {
        width: 100%;
    }

    .media li:last-of-type .btn {
        width: 100%;
    }
}

/*==================   Thumbnail    ======================*/
.thumb-wrap {
    display: block;
    position: relative;
    border-radius: 50%;
}

.thumb-wrap img {
    width: 100%;
    height: auto;
    -webkit-transition: 0.5s all ease;
    transition: 0.5s all ease;
}

.thumb-wrap .thumb_overlay {
    position: absolute;
    left: 0;
    top: 50%;
    right: 0;
    bottom: 0;
    opacity: 0;
    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
    -webkit-transition: 0.3s all ease;
    transition: 0.3s all ease;
    color: #fff;
    background: #02c6bc;
    text-align: center;
    height: 74px;
    margin-top: -37px;
    display: block;
    background: #02c6bc;
    padding: 10px 5px;
}

.lt-ie9 .thumb-wrap .thumb_overlay {
    background: none;
    -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='#FF02C6BC', endColorstr='#FF02C6BC')";
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FF02C6BC', endColorstr='#FF02C6BC');
    zoom: 1;
}

@media (max-width: 1499px) {
    .thumb-wrap .thumb_overlay h4 {
        font-size: 20px;
        line-height: 24px;
    }

    .thumb-wrap .thumb_overlay h4+* {
        margin-top: 0;
    }
}

@media (min-width: 1499px) {
    .thumb-wrap .thumb_overlay {
        height: 140px;
        margin-top: -70px;
        padding: 40px 10px;
    }
}

.thumb-wrap .thumb_overlay h2,
.thumb-wrap .thumb_overlay h3,
.thumb-wrap .thumb_overlay h4,
.thumb-wrap .thumb_overlay h5,
.thumb-wrap .thumb_overlay h6,
.thumb-wrap .thumb_overlay .link {
    color: #fff;
}

.thumb-wrap .thumb_overlay h2 a:hover,
.thumb-wrap .thumb_overlay h3 a:hover,
.thumb-wrap .thumb_overlay h4 a:hover,
.thumb-wrap .thumb_overlay h5 a:hover,
.thumb-wrap .thumb_overlay h6 a:hover,
.thumb-wrap .thumb_overlay .link a:hover {
    color: #191c1c;
}

.thumb-wrap:hover .thumb_overlay {
    opacity: 1;
    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
}

.lt-ie9 .thumb-wrap:hover .thumb_overlay:before {
    display: block;
}

.thumb {
    display: block;
    position: relative;
    -webkit-transition: all .2s ease-in-out;
    transition: all .2s ease-in-out;
    /* box-shadow: 0 10px 10px #00000021; */
    /* margin-bottom: 1em; */
    text-decoration: none;
    /* border: 1px solid #54534a; */
    /* padding: 0.3em; */
    background: #f3f3f3;
    overflow: hidden;
}

.gallery-media {
    display: block;
    position: relative;
    background: #f3f3f3;
    overflow: hidden;
}

.gallery-media img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb.video .thumb_overlay {
    display: none;
}

.filter-button-group {
    padding: 2vw 0;
    /*    display:-webkit-box;
    display:-ms-flexbox;
    display:flex;
     white-space:nowrap; 
    -webkit-box-pack:  center;
        -ms-flex-pack:  center;
            justify-content:  center;*/
    /* flex-wrap: wrap; */
}

.filter-button-group button.btn {
    /* padding: 1em 2em; */
    background: transparent;
    outline: 0;
    /* max-width: 100px; */
    width: 100%;
    /* height: 60px; */
    margin-bottom: 0;
    border-bottom: 1px solid transparent;
    border-radius: 0;
    font-size: 1rem;
    border: 0;
    /* padding: .5rem 1rem; */
    vertical-align: middle;
    display: inline-block;
    vertical-align: baseline;
    line-height: 1;
    transform: translateY(0.15rem);
    color: grey;
}

.filter-button-group button.btn:not(.is-checked):hover {
    cursor: pointer;
    border-bottom: 1px solid rgb(84 83 74);
    color: black;
    /* background: #f6c13d75; */
    border-bottom: 1px solid black;
}

.filter-button-group .btn.is-checked {
    /* background-color: rgb(246 193 61); */
    /* font-weight: bold; */
    color: rgb(0 0 0) !important;
    border-bottom: 1px solid black;
}

.filter-btn {
    width: -webkit-fit-content;
    width: -moz-fit-content;
    width: fit-content;
    margin: 0px 10px;
    display: inline-block;
}

.thumbnail {
    display: block;
    /* padding: 4px; */
    /* margin-bottom: 25px; */
    line-height: 1.42857143;
    /* background-color: #fff; */
    /* border: 1px solid #ddd; */
    /* border-radius: 4px; */
    -webkit-transition: all .2s ease-in-out;
    transition: all .2s ease-in-out;
    width: 100%;
    background-color: #fff;
    border-radius: 4px;
    margin: auto;
    overflow: hidden;
}

.grid-item {
    margin-top: 0 !important;
    margin-bottom: 0;
    padding: 15px;
    overflow: hidden;
}

@media (min-width: 576px) {
    .gallery.isotope-ready .col-sm-6 {
        width: 50%;
    }
}

@media (min-width: 768px) {
    .gallery.isotope-ready .col-md-4 {
        width: 33.3333%;
    }

    .gallery.isotope-ready .col-md-3 {
        width: 25%;
    }
}

/* The gallery overlay */
#galleryOverlay {
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    opacity: 0;
    z-index: 100000;
    background-color: #222;
    background-color: rgba(0, 0, 0, 0.8);
    overflow: hidden;
    display: none;
    -moz-transition: opacity 1s ease;
    -webkit-transition: opacity 1s ease;
    transition: opacity 1s ease;
}

/* This class will trigger the animation */
#galleryOverlay.visible {
    opacity: 1;
}

#gallerySlider {
    height: 100%;
    left: 0;
    top: 0;
    width: 100%;
    white-space: nowrap;
    position: absolute;
    -moz-transition: left 0.4s ease;
    -webkit-transition: left 0.4s ease;
    transition: left 0.4s ease;
}

#gallerySlider .placeholder {
    background: url("../images/preloader.gif") no-repeat center center;
    height: 100%;
    line-height: 1px;
    text-align: center;
    width: 100%;
    display: inline-block;
    position: relative;
}

/* The before element moves the
 * image halfway from the top */
#gallerySlider .placeholder:before {
    content: "";
    display: inline-block;
    height: 50%;
    width: 1px;
    margin-right: -1px;
}

#gallerySlider .placeholder .iframe-wrap,
#gallerySlider .placeholder .img_caption {
    display: inline-block;
    /* max-height: 100%; */
    /* max-width: 100%; */
    vertical-align: middle;
    text-align: center;
}

#gallerySlider .placeholder .iframe-wrap {
    width: 1280px;
}

#gallerySlider .placeholder .iframe-wrap .iframe {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
}

#gallerySlider .placeholder .iframe-wrap .iframe iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#gallerySlider.rightSpring {
    -moz-animation: rightSpring 0.3s;
    -webkit-animation: rightSpring 0.3s;
}

#gallerySlider.leftSpring {
    -moz-animation: leftSpring 0.3s;
    -webkit-animation: leftSpring 0.3s;
}

/* Firefox Keyframe Animations */
@-moz-keyframes rightSpring {
    0% {
        margin-left: 0px;
    }

    50% {
        margin-left: -30px;
    }

    100% {
        margin-left: 0px;
    }
}

@-moz-keyframes leftSpring {
    0% {
        margin-left: 0px;
    }

    50% {
        margin-left: 30px;
    }

    100% {
        margin-left: 0px;
    }
}

/* Safari and Chrome Keyframe Animations */
@-webkit-keyframes rightSpring {
    0% {
        margin-left: 0px;
    }

    50% {
        margin-left: -30px;
    }

    100% {
        margin-left: 0px;
    }
}

@-webkit-keyframes leftSpring {
    0% {
        margin-left: 0px;
    }

    50% {
        margin-left: 30px;
    }

    100% {
        margin-left: 0px;
    }
}

/* Arrows */
#prevArrow,
#nextArrow {
    border: none;
    text-decoration: none;
    background: url("../images/arrows.png") no-repeat;
    opacity: 0.5;
    cursor: pointer;
    position: absolute;
    width: 43px;
    height: 58px;
    top: 50%;
    margin-top: -29px;
    -moz-transition: opacity 0.2s ease;
    -webkit-transition: opacity 0.2s ease;
    transition: opacity 0.2s ease;
}

#prevArrow:hover,
#nextArrow:hover {
    opacity: 1;
}

#prevArrow {
    background-position: left top;
    left: 40px;
}

#nextArrow {
    background-position: right top;
    right: 40px;
}

#nextArrow:before {
    content: '';
    display: block;
    width: 1em;
    height: 1em;
    color: white;
    background-color: currentColor;
    -webkit-mask: url('https://static.mrwebsites.ca/icon/fa/solid/chevron-right.svg') no-repeat center / contain;
    mask: url('https://static.mrwebsites.ca/icon/fa/solid/chevron-right.svg') no-repeat center / contain;
}

#prevArrow:before {
    content: '';
    display: block;
    width: 1em;
    height: 1em;
    color: white;
    background-color: currentColor;
    -webkit-mask: url('https://static.mrwebsites.ca/icon/fa/solid/chevron-left.svg') no-repeat center / contain;
    mask: url('https://static.mrwebsites.ca/icon/fa/solid/chevron-left.svg') no-repeat center / contain;
}

.gallery_caption {
    background: #ffffffbd;
    font-size: 16px;
    padding: 9px 9px 12px;
    transform: translate(0px, 100%);
    position: absolute;
    bottom: 0;
    width: 100%;
    color: black;
    transition: .3s all ease;
    max-height: 50%;
    z-index: 9;
}

.filter-button-group button.btn:focus {
    /* box-shadow: 0 10px 10px #00000026; */
}

.slideshow_caption span {
    display: inline-block;
    position: relative;
    min-height: 2em;
    line-height: 2em;
    font-size: 0.9em;
    width: -webkit-fill-available;
    white-space: normal;
}

#gallerySlider .placeholder .img_caption img {
    max-height: calc(100vh - 3em);
    /* height: 90%; */
    max-width: 100vw;
    display: flex;
    margin: auto;
}

.media li .thumb img {
    object-fit: cover;
    width: 100%;
    height: 100%;
    /* max-height: 200px; */
    transition: .5s all ease;
}

.images_icon::before {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    background-color: currentColor;
    -webkit-mask: url('https://static.mrwebsites.ca/icon/fa/solid/image.svg') no-repeat center / contain;
    mask: url('https://static.mrwebsites.ca/icon/fa/solid/image.svg') no-repeat center / contain;
}

section#gallery {
    background: var(--mr-color-accent-hazy);
    /* background-image: url('/images/bg_sky.jpg'); */
    /* background-size: cover; */
    /* background-position: center; */
    /* padding: 2vw 0 4vw; */
}

span.media_overlay:after {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    font-size: 1.3rem;
    text-shadow: 0 0 11px black;
    color: rgb(208 223 189);
    background-color: currentColor;
    -webkit-mask: url('https://static.mrwebsites.ca/icon/fa/solid/magnifying-glass.svg') no-repeat center / contain;
    mask: url('https://static.mrwebsites.ca/icon/fa/solid/magnifying-glass.svg') no-repeat center / contain;
}

/*
* @subsection   Thumb
*/
.thumb>img {
    width: 100%;
}

.thumb__overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    display: inline-block;
    width: 90px;
    height: 90px;
    line-height: 90px;
    text-align: center;
    font-size: 40px;
    border-radius: 50%;
    color: #fff;
    background: rgba(33, 150, 243, 0.95);
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.1);
    transition: .3s all ease;
    opacity: 0;
    -webkit-transform: translate(-50%, 100%);
    transform: translate(-50%, 100%);
}

.thumb:hover .thumb__overlay {
    -webkit-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
    opacity: 1;
}

.gallery_categories_inner h3 {
    margin: 0 0 0.15em;
    text-transform: uppercase;
    font-size: 1em;
}

.lt-ie9 .thumb-wrap:hover .thumb_overlay:before {
    display: block;
}

.thumb {
    display: block;
    position: relative;
    -webkit-transition: all .2s ease-in-out;
    transition: all .2s ease-in-out;
}

.thumb.video .thumb_overlay {
    display: none;
}

.filter-button-group {
    padding: 0;
    /*    display:-webkit-box;
    display:-ms-flexbox;
    display:flex;
     white-space:nowrap; 
    -webkit-box-pack:  center;
        -ms-flex-pack:  center;
            justify-content:  center;*/
    display: flex;
    flex-direction: row;
    gap: 1rem;
    justify-content: center;
    margin: 0 2em;
    flex-grow: 1;
}

.filter-button-group button.btn {
    padding: 0;
    background: transparent;
    outline: 0;
    /* max-width: 100px; */
    width: 100%;
    /* height: 60px; */
    margin-bottom: 0;
    /* white-space: nowrap; */
    margin-bottom: 1rem;
    border-bottom: 1px solid transparent;
    text-align: left;
    white-space: nowrap;
}

.filter-button-group button.btn:hover {
    cursor: pointer;
    opacity: .9;
}

.filter-button-group .btn.is-checked {
    font-weight: bold;
    color: #ffffff;
    /* background: #017c36; */
}

.filter-btn {
    width: -webkit-fit-content;
    width: -moz-fit-content;
    width: fit-content;
    margin: 0;
    display: inline-block;
}

.thumb:hover .gallery_caption {
    position: absolute;
    bottom: 0;
    width: 100%;
    transform: translate(0px, 0%);
}

.gallery_caption p:last-of-type {
    margin-bottom: 0;
}

.pswp__dynamic-caption {
    font-size: 1.2rem !important;
}

.gallery_wrapper {
    display: flex;
    flex-direction: column;
    /* flex-wrap: wrap; */
}

.gallery_categories {
    width: 100%;
    min-width: 210px;
    flex-grow: 1;
    position: sticky;
    top: 109px;
    z-index: 9999;
    background: white;
    padding-top: 1rem;
}

.gallery_wrapper .gallery {
    width: 100%;
    flex-grow: 1;
}

.gallery_categories_inner {
    position: sticky;
    top: calc(120px);
    display: flex;
    align-items: center;
    border-bottom: 2px solid #cddcb7;
    /* overflow: hidden; */
}

.gallerywidget .gallery_caption * {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


@media (max-width: 991px) {
    .gallery_categories {
        top: 50px;
    }

}

@media (max-width: 767px) {
    .gallery_wrapper {
        flex-direction: column;
    }

    .gallery_wrapper .gallery {
        width: 100%;
    }

    .filter-button-group {

        /* flex-direction: row; */

    }

    .filter-btn {
        /* padding: .3rem 1rem; */
    }

    .gallery_categories {
        width: 100%;
        max-width: none;
    }

    .filter-button-group button.btn {
        /* margin: 0; */
    }
}

/* STW 2026 feature overrides */
.gallery_caption {
    color: #f4f1e8;
}

.filter-button-group .btn {
    border-radius: 999px;
}

/* Theme-aware category filters */
.gallery_categories {
    --mr-gallery-filter-surface: var(--mr-color-surface, #fff);
    --mr-gallery-filter-text: var(--mr-color-body-dark, var(--mr-color-text, #222));
    --mr-gallery-filter-heading: var(--mr-color-heading-dark, var(--mr-gallery-filter-text));
    --mr-gallery-filter-border: var(--mr-widget-border-color, rgba(0, 0, 0, .14));
    position: relative;
    top: auto;
    z-index: 2;
    margin-bottom: var(--mr-gallery-filter-gap, clamp(.75rem, 2vw, 1.25rem));
    padding: clamp(.75rem, 2vw, 1rem);
    color: var(--mr-gallery-filter-text);
    background: var(--mr-gallery-filter-surface);
    border: 1px solid var(--mr-gallery-filter-border);
}

.gallery_categories_inner {
    position: static;
    display: flex;
    align-items: center;
    gap: clamp(.75rem, 2vw, 1.5rem);
    border: 0;
}

.gallery_categories_inner h3 {
    flex: 0 0 auto;
    margin: 0;
    color: var(--mr-gallery-filter-heading);
    font-family: var(--mr-font-accent, inherit);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .09em;
    line-height: 1.2;
}

.gallery_categories .filter-button-group {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: .5rem;
    margin: 0;
}

.gallery_categories .filter-btn {
    margin: 0;
}

.gallery_categories .filter-button-group button.btn {
    width: auto;
    min-height: 2.25rem;
    margin: 0;
    padding: .5rem .85rem;
    color: var(--mr-gallery-filter-text);
    background: transparent;
    border: 1px solid var(--mr-gallery-filter-border);
    border-radius: var(--mr-button-radius, 999px);
    font: inherit;
    font-size: .875rem;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    transition: color .2s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.gallery_categories .filter-button-group button.btn:hover,
.gallery_categories .filter-button-group button.btn:focus-visible {
    color: var(--mr-tone-link-color, var(--mr-color-primary));
    background: var(--mr-tone-outline-hover-bg, var(--mr-color-primary-hazy, rgba(0, 0, 0, .06)));
    border-color: var(--mr-tone-border-hover-color, var(--mr-color-primary));
    opacity: 1;
}

.gallery_categories .filter-button-group button.btn:focus-visible {
    outline: 2px solid var(--mr-tone-link-color, var(--mr-color-primary));
    outline-offset: 2px;
}

.gallery_categories .filter-button-group .btn.is-checked {
    color: var(--mr-color-primary-contrast, #fff) !important;
    background: var(--mr-color-primary);
    border-color: var(--mr-color-primary);
    box-shadow: 0 3px 10px color-mix(in srgb, var(--mr-color-primary) 24%, transparent);
}

@media (max-width: 575px) {
    .gallery_categories_inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .gallery_categories .filter-button-group {
        width: 100%;
    }
}

/* Unified gallery component */
.mrws-gallery {
    --mrws-gallery-active-columns: 1;
    container-type: inline-size;
    width: 100%;
}

.mrws-gallery__items {
    width: 100%;
}

.mrws-gallery__viewport {
    position: relative;
}

.mrws-gallery--grid .mrws-gallery__items {
    display: grid;
    grid-template-columns: repeat(var(--mrws-gallery-active-columns), minmax(0, 1fr));
    gap: var(--mrws-gallery-gap, 20px);
}

.mrws-gallery .mrws-gallery__item {
    min-width: 0;
    margin: 0;
    padding: 0;
    overflow: visible;
}

.mrws-gallery .mrws-gallery__media {
    position: relative;
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
    padding: 0;
    overflow: hidden;
    color: inherit;
    background: var(--mr-color-surface, #f3f3f3);
    /* border-radius: var(--mr-widget-border-radius, 16px); */
    text-decoration: none;
}

.mrws-gallery--grid .mrws-gallery__media {
    aspect-ratio: var(--mrws-gallery-aspect, 4 / 3);
}

.mrws-gallery__media img {
    display: block;
    width: 100%;
    max-width: none;
}

.mrws-gallery--grid .mrws-gallery__media img,
.mrws-gallery--scroll .mrws-gallery__media img {
    height: 100%;
    object-fit: cover;
}

.mrws-gallery--masonry .mrws-gallery__items,
.mrws-gallery--rows .mrws-gallery__items,
.mrws-gallery--packery .mrws-gallery__items {
    display: block;
}

.mrws-gallery--masonry .mrws-gallery__item {
    width: calc((100% - ((var(--mrws-gallery-active-columns) - 1) * var(--mrws-gallery-gap, 20px))) / var(--mrws-gallery-active-columns));
    margin-bottom: var(--mrws-gallery-gap, 20px);
}

.mrws-gallery--packery .mrws-gallery__item {
    width: calc((100% - ((var(--mrws-gallery-active-columns) - 1) * var(--mrws-gallery-gap, 20px))) / var(--mrws-gallery-active-columns));
}

.mrws-gallery--masonry .mrws-gallery__media img,
.mrws-gallery--packery .mrws-gallery__media img {
    height: auto;
}

.mrws-gallery--rows .mrws-gallery__item {
    width: min(100%, var(--mrws-gallery-row-item-width, 300px));
    height: var(--mrws-gallery-item-height, 200px);
}

.mrws-gallery--rows .mrws-gallery__media,
.mrws-gallery--rows .mrws-gallery__media img {
    width: 100%;
    height: 100%;
}

.mrws-gallery--rows .mrws-gallery__media img {
    object-fit: cover;
}

.mrws-gallery--scroll .mrws-gallery__items {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--mrws-gallery-gap, 20px);
    padding-block: .25rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: none;
    scrollbar-width: thin;
}

.mrws-gallery--scroll-snap .mrws-gallery__items {
    scroll-snap-type: x proximity;
}

.mrws-gallery--scroll .mrws-gallery__items:focus-visible {
    outline: 2px solid var(--mr-color-primary, currentColor);
    outline-offset: 3px;
}

.mrws-gallery--scroll-fade.is-scrollable .mrws-gallery__items {
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 1.25rem, #000 calc(100% - 1.25rem), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 1.25rem, #000 calc(100% - 1.25rem), transparent);
}

.mrws-gallery--scroll .mrws-gallery__item {
    flex: 0 0 auto;
    height: var(--mrws-gallery-item-height, 200px);
    scroll-snap-align: none;
}

.mrws-gallery--scroll-snap .mrws-gallery__item {
    scroll-snap-align: start;
}

.mrws-gallery--scroll .mrws-gallery__media {
    width: auto;
    height: 100%;
}

.mrws-gallery--scroll .mrws-gallery__media img {
    width: auto;
    min-width: min(75cqw, 18rem);
}

.mrws-gallery__scroll-nav {
    position: absolute;
    inset: 50% 0 auto;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    transform: translateY(-50%);
}

.mrws-gallery__scroll-button {
    display: grid;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    place-items: center;
    color: var(--mr-color-primary-contrast, #fff);
    background: var(--mr-color-primary, rgba(0, 0, 0, .78));
    border: 0;
    border-radius: 50%;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .22);
    cursor: pointer;
    pointer-events: auto;
}

.mrws-gallery__scroll-button:disabled {
    visibility: hidden;
}

.mrws-gallery .gallery_caption {
    position: absolute;
    inset: auto 0 0;
    z-index: 1;
    padding: clamp(.7rem, 2cqw, 1rem);
    color: var(--mr-color-primary-contrast, #f4f1e8);
    background: var(--mr-gradient-gallery-caption, linear-gradient(180deg, transparent, rgba(0, 0, 0, .78)));
    transform: none;
    font-weight: 700;
}

.mrws-gallery .gallery_caption span {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.mrws-gallery__item.is-filtered-out {
    display: none;
}

.mrws-gallery__empty {
    padding: clamp(1.25rem, 4cqw, 2.5rem);
    color: var(--mr-tone-text-color, var(--mr-color-text));
    background: var(--mr-tone-control-surface, var(--mr-color-surface, #f6f5f0));
    border: 1px dashed var(--mr-tone-border-color, rgba(0, 0, 0, .2));
    text-align: center;
}

@container (min-width: 30rem) {
    .mrws-gallery__items {
        --mrws-gallery-active-columns: 2;
    }
}

@container (min-width: 52rem) {
    .mrws-gallery__items {
        --mrws-gallery-active-columns: var(--mrws-gallery-columns, 3);
    }
}

@media (prefers-reduced-motion: reduce) {
    .mrws-gallery *,
    .mrws-gallery *::before,
    .mrws-gallery *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
