.mmgws-studio-gallery-widget {
    --mmgws-gap: 40px;
    --mmgws-slider-speed: 450ms;
    --mmgws-slider-width: 360px;
    --mmgws-slider-height: 240px;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
}

.mmgws-static-description {
    width: 260px;
    font-size: 11px;
    line-height: 1.2;
    color: #111;
    margin-left: auto;
    margin-right: 170px;
    margin-bottom: 18px;
}

.mmgws-static-description p {
    margin: 0;
}

.mmgws-studio-gallery {
    width: 100%;
}

/* Masonry view: no manual column count. The browser creates responsive columns from the media base width. */
.mmgws-studio-gallery-widget[data-mmgws-layout="masonry"] .mmgws-studio-gallery {
    column-width: 260px;
    column-gap: var(--mmgws-gap);
}

.mmgws-studio-gallery-widget[data-mmgws-layout="masonry"] .mmgws-gallery-item {
    display: inline-block;
    width: 100%;
    margin: 0 0 var(--mmgws-gap);
    break-inside: avoid;
    vertical-align: top;
}

/* Grid view: automatic responsive columns, without a column-count control. */
.mmgws-studio-gallery-widget[data-mmgws-layout="grid"] .mmgws-studio-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--mmgws-gap);
    align-items: start;
}

.mmgws-studio-gallery-widget[data-mmgws-layout="grid"] .mmgws-gallery-item {
    width: 100%;
    min-width: 0;
}

/* Subtle scattered layout for masonry only. */
.mmgws-studio-gallery-widget[data-mmgws-layout="masonry"] .mmgws-gallery-item:nth-child(4n + 1) {
    margin-top: 0;
}

.mmgws-studio-gallery-widget[data-mmgws-layout="masonry"] .mmgws-gallery-item:nth-child(4n + 2) {
    margin-top: 28px;
}

.mmgws-studio-gallery-widget[data-mmgws-layout="masonry"] .mmgws-gallery-item:nth-child(4n + 3) {
    margin-top: 8px;
}

.mmgws-studio-gallery-widget[data-mmgws-layout="masonry"] .mmgws-gallery-item:nth-child(4n + 4) {
    margin-top: 52px;
}

.mmgws-lightbox-trigger,
.mmgws-media-frame {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    text-align: left;
    overflow: hidden;
}

.mmgws-gallery-image img,
.mmgws-gallery-video video,
.mmgws-gallery-slider img,
.mmgws-gallery-slider video {
    display: block;
    max-width: 100%;
}

/* Image and video items keep their natural aspect ratio. */
.mmgws-gallery-image img,
.mmgws-gallery-video video {
    width: 100%;
    height: auto;
}

.mmgws-video-wrap {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.mmgws-open-lightbox-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 5;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 14px;
    line-height: 30px;
    cursor: pointer;
    text-align: center;
    padding: 0;
}

.mmgws-gallery-caption {
    font-size: 10px;
    line-height: 1.25;
    color: #111;
    margin-top: 6px;
}

/* Slider */
.mmgws-gallery-slider {
    position: relative;
    overflow: hidden;
    background: #d9d9d9;
    max-width: 100%;
}

/* Auto mode: active slide controls the slider height. */
.mmgws-gallery-slider.mmgws-slider-size-auto {
    width: 100%;
    height: auto;
    background: transparent;
}

.mmgws-gallery-slider.mmgws-slider-size-auto .mmgws-slider-track {
    position: relative;
    width: 100%;
    height: auto;
    overflow: hidden;
}

.mmgws-gallery-slider.mmgws-slider-size-auto .mmgws-slide {
    display: none;
    position: relative;
    inset: auto;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    transition: opacity var(--mmgws-slider-speed) ease;
}

.mmgws-gallery-slider.mmgws-slider-size-auto .mmgws-slide.is-active {
    display: block;
}

.mmgws-gallery-slider.mmgws-slider-size-auto img,
.mmgws-gallery-slider.mmgws-slider-size-auto video {
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* Fixed mode: slider keeps selected width and height. */
.mmgws-gallery-slider.mmgws-slider-size-fixed {
    width: var(--mmgws-slider-width);
    height: var(--mmgws-slider-height);
}

.mmgws-gallery-slider.mmgws-slider-size-fixed .mmgws-slider-track {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 1px;
    overflow: hidden;
}

.mmgws-gallery-slider.mmgws-slider-size-fixed .mmgws-slider-track,
.mmgws-gallery-slider.mmgws-slider-size-fixed .mmgws-slide,
.mmgws-gallery-slider.mmgws-slider-size-fixed .mmgws-slide .mmgws-lightbox-trigger,
.mmgws-gallery-slider.mmgws-slider-size-fixed .mmgws-slide .mmgws-video-wrap {
    height: 100%;
}

.mmgws-gallery-slider.mmgws-slider-size-fixed .mmgws-slide {
    position: absolute;
    inset: 0;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    z-index: 0;
    transition: opacity var(--mmgws-slider-speed) ease, transform var(--mmgws-slider-speed) ease;
}

.mmgws-gallery-slider.mmgws-slider-size-fixed .mmgws-slide.is-active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    z-index: 1;
}

.mmgws-gallery-slider.mmgws-slider-size-fixed img,
.mmgws-gallery-slider.mmgws-slider-size-fixed video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mmgws-transition-slide.mmgws-slider-size-fixed .mmgws-slide {
    transform: translateX(24px);
}

.mmgws-transition-slide.mmgws-slider-size-fixed .mmgws-slide.is-prev {
    transform: translateX(-24px);
}

.mmgws-transition-slide.mmgws-slider-size-fixed .mmgws-slide.is-active {
    transform: translateX(0);
}

.mmgws-transition-fade .mmgws-slide {
    transform: none;
}

.mmgws-slider-btn {
    --mmgws-slider-arrow-bg: rgba(218, 207, 185, 0.9);
    --mmgws-slider-arrow-color: #111;
    --mmgws-slider-arrow-hover-bg: var(--mmgws-slider-arrow-bg);
    --mmgws-slider-arrow-hover-color: var(--mmgws-slider-arrow-color) !important;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    min-width: 34px;
    min-height: 28px;
    border: 0 !important;
    background: var(--mmgws-slider-arrow-bg) !important;
    color: var(--mmgws-slider-arrow-color) !important;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    z-index: 6;
    padding: 4px 8px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    text-decoration: none;
    transition: background-color 180ms ease, color 180ms ease, opacity 180ms ease;
}

.mmgws-slider-btn:hover,
.mmgws-slider-btn:focus {
    background: var(--mmgws-slider-arrow-hover-bg) !important;
    color: var(--mmgws-slider-arrow-hover-color) !important;
    outline: none;
    box-shadow: none;
    text-decoration: none;
}

.mmgws-slider-btn svg,
.mmgws-slider-btn i,
.mmgws-lightbox-nav svg,
.mmgws-lightbox-nav i,
.mmgws-lightbox-close svg,
.mmgws-lightbox-close i {
    display: block;
    width: 1em;
    height: 1em;
    fill: currentColor;
}

.mmgws-control-icon-fallback {
    display: block;
    line-height: 1;
}

.mmgws-slider-prev {
    left: 8px;
}

.mmgws-slider-next {
    right: 8px;
}

.mmgws-credit {
    margin-top: 32px;
    font-size: 11px;
    line-height: 1.4;
    color: #777;
    text-align: center;
}

/* Lightbox */
.mmgws-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.92);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 50px 70px;
}

.mmgws-lightbox.is-open {
    display: flex;
}

.mmgws-lightbox-content {
    width: 100%;
    max-width: 1100px;
    max-height: 90vh;
    text-align: center;
}

.mmgws-lightbox-media img,
.mmgws-lightbox-media video {
    max-width: 100%;
    max-height: 82vh;
    width: auto;
    height: auto;
    display: inline-block;
}

.mmgws-lightbox-media video {
    background: #000;
}

.mmgws-lightbox-caption {
    color: #fff;
    font-size: 13px;
    line-height: 1.4;
    margin-top: 12px;
}

.mmgws-lightbox-close {
    --mmgws-lightbox-control-bg: transparent;
    --mmgws-lightbox-control-color: #fff;
    --mmgws-lightbox-control-hover-bg: var(--mmgws-lightbox-control-bg);
    --mmgws-lightbox-control-hover-color: var(--mmgws-lightbox-control-color) !important;
    position: fixed;
    top: 22px;
    right: 28px;
    min-width: 38px;
    min-height: 38px;
    border: 0 !important;
    background: var(--mmgws-lightbox-control-bg) !important;
    color: var(--mmgws-lightbox-control-color) !important;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    z-index: 3;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    text-decoration: none;
    transition: background-color 180ms ease, color 180ms ease, opacity 180ms ease;
}

.mmgws-lightbox-close:hover,
.mmgws-lightbox-close:focus {
    background: var(--mmgws-lightbox-control-hover-bg) !important;
    color: var(--mmgws-lightbox-control-hover-color) !important;
    outline: none;
    box-shadow: none;
    text-decoration: none;
}

.mmgws-lightbox-nav {
    --mmgws-lightbox-control-bg: transparent;
    --mmgws-lightbox-control-color: #fff;
    --mmgws-lightbox-control-hover-bg: var(--mmgws-lightbox-control-bg);
    --mmgws-lightbox-control-hover-color: var(--mmgws-lightbox-control-color) !important;
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    min-width: 46px;
    min-height: 60px;
    border: 0 !important;
    background: var(--mmgws-lightbox-control-bg) !important;
    color: var(--mmgws-lightbox-control-color) !important;
    font-size: 42px;
    line-height: 1;
    cursor: pointer;
    z-index: 3;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    text-decoration: none;
    transition: background-color 180ms ease, color 180ms ease, opacity 180ms ease;
}

.mmgws-lightbox-nav:hover,
.mmgws-lightbox-nav:focus {
    background: var(--mmgws-lightbox-control-hover-bg) !important;
    color: var(--mmgws-lightbox-control-hover-color) !important;
    outline: none;
    box-shadow: none;
    text-decoration: none;
}

.mmgws-lightbox-prev {
    left: 22px;
}

.mmgws-lightbox-next {
    right: 22px;
}

body.mmgws-lightbox-open {
    overflow: hidden;
}

@media (max-width: 1024px) {
    .mmgws-studio-gallery-widget {
        --mmgws-gap: 32px;
    }

    .mmgws-studio-gallery-widget[data-mmgws-layout="masonry"] .mmgws-studio-gallery {
        column-width: 230px;
    }

    .mmgws-static-description {
        margin-right: 90px;
    }
}

@media (max-width: 767px) {
    .mmgws-studio-gallery-widget {
        --mmgws-gap: 22px;
    }

    .mmgws-static-description {
        width: 100%;
        max-width: 100%;
        margin: 0 0 28px;
        font-size: 12px;
        line-height: 1.35;
    }

    .mmgws-studio-gallery-widget[data-mmgws-layout="masonry"] .mmgws-studio-gallery {
        column-width: 170px;
    }

    .mmgws-studio-gallery-widget[data-mmgws-layout="masonry"] .mmgws-gallery-item:nth-child(n) {
        margin-top: 0;
    }

    .mmgws-gallery-slider.mmgws-slider-size-fixed {
        max-width: 100%;
    }

    .mmgws-lightbox {
        padding: 45px 18px;
    }

    .mmgws-lightbox-nav {
        font-size: 34px;
        min-width: 34px;
    }

    .mmgws-lightbox-prev {
        left: 6px;
    }

    .mmgws-lightbox-next {
        right: 6px;
    }
}

@media (max-width: 480px) {
    .mmgws-studio-gallery-widget[data-mmgws-layout="masonry"] .mmgws-studio-gallery {
        column-width: 100%;
    }

    .mmgws-studio-gallery-widget[data-mmgws-layout="grid"] .mmgws-studio-gallery {
        grid-template-columns: 1fr;
    }
}


/* Removed frontend video lightbox overlay icon. */
.mmgws-open-lightbox-btn {
    display: none !important;
}

/* Keep control hover colors controlled by widget settings, never Elementor/theme red defaults. */
.mmgws-slider-btn:hover,
.mmgws-slider-btn:focus,
.mmgws-lightbox-nav:hover,
.mmgws-lightbox-nav:focus,
.mmgws-lightbox-close:hover,
.mmgws-lightbox-close:focus {
    color: var(--mmgws-slider-arrow-hover-color, inherit);
    text-decoration: none;
}
