/* ============================================================
   MEDIAWEBGRAPHIC FOTOGALLERY
   HOME SLIDER + LIGHTBOX
   ============================================================ */


/* ============================================================
   HOME
   ============================================================ */

.mwg-fotogallery-home {
    width: 100%;
   /* background: #ffffff;*/
}

.mwg-fotogallery-home__title {
    margin: 0 0 14px;
}

.mwg-fotogallery-home__content {
    width: 100%;
}


/* ============================================================
   SLIDER
   ============================================================ */

.mwg-gallery-slider {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    margin-top: 30px;
}


/* ============================================================
   GALLERIA GUTENBERG -> SLIDER ORIZZONTALE
   ============================================================ */

.mwg-fotogallery-home__content
.mwg-gallery-slider
.wp-block-gallery {

    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;

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

    gap: 22px !important;

    margin: 0 !important;
    padding: 0 0 5px !important;

    overflow-x: auto !important;
    overflow-y: hidden !important;

    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;

    scrollbar-width: none;
    -ms-overflow-style: none;

    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
}

.mwg-fotogallery-home__content
.mwg-gallery-slider
.wp-block-gallery::-webkit-scrollbar {
    display: none;
}


/* ============================================================
   SINGOLA FOTO - DESKTOP
   ============================================================ */

/*
 * Desktop:
 * circa 3 fotografie visibili.
 *
 * Tutte hanno la stessa altezza.
 * La fotografia NON viene deformata.
 */

.mwg-fotogallery-home__content
.mwg-gallery-slider
.wp-block-gallery
figure.wp-block-image {

    position: relative;

    flex: 0 0 calc((100% - 44px) / 3) !important;

    width: calc((100% - 44px) / 3) !important;
    min-width: calc((100% - 44px) / 3) !important;
    max-width: calc((100% - 44px) / 3) !important;

    height: auto !important;
    aspect-ratio: 4 / 5;

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

    overflow: hidden;

    border-radius: 10px;

    scroll-snap-align: start;

    background: transparent !important;
}


.mwg-fotogallery-home__content
.mwg-gallery-slider
.wp-block-gallery
figure.wp-block-image > a {
    display: block;
    width: 100%;
    height: 100%;
    background: transparent !important;
}


/* ============================================================
   IMMAGINE
   ============================================================ */

.mwg-fotogallery-home__content
.mwg-gallery-slider
.wp-block-gallery
figure.wp-block-image img {

    display: block !important;

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

    min-width: 0 !important;
    max-width: 100% !important;

    object-fit: contain !important;
    object-position: center center !important;

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

    cursor: zoom-in;

    transition:
        transform .5s cubic-bezier(.2,.7,.2,1),
        filter .3s ease;
}


/* ============================================================
   HOVER FOTO
   ============================================================ */

@media (hover: hover) and (pointer: fine) {

    .mwg-fotogallery-home__content
    .mwg-gallery-slider
    .wp-block-gallery
    figure.wp-block-image:hover img {

        transform: none;
        filter: brightness(.94);
    }
}


/* ============================================================
   CONTROLLI SLIDER
   ============================================================ */

.mwg-gallery-slider__controls {

    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 10px;

    margin-top: 0;
}


.mwg-gallery-slider__arrow {

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 48px;
    height: 48px;

    padding: 0;

    border: 1px solid #b79a52;
    border-radius: 50%;

    background: #ffffff;
    color: #b79a52;

    font-size: 22px;
    line-height: 1;

    cursor: pointer;

    transition:
        background-color .25s ease,
        border-color .25s ease,
        color .25s ease,
        transform .25s ease,
        opacity .25s ease;
}


.mwg-gallery-slider__arrow:hover:not(:disabled) {

    background: #b79a52;
    border-color: #b79a52;
    color: #ffffff;

    transform: translateY(-2px);
}


.mwg-gallery-slider__arrow:disabled {

    opacity: .25;
    cursor: default;
    transform: none;
}


/* ============================================================
   FOOTER SLIDER: PULSANTE + FRECCE
   ============================================================ */

.mwg-gallery-slider__footer {

    display: flex;
    align-items: center;
    justify-content: flex-end;

    width: 100%;
    gap: 12px;

    margin-top: 18px;
}


/*
 * Con massimo tre immagini le frecce vengono nascoste dal JS
 * e il pulsante della Fotogallery rimane centrato.
 */
.mwg-gallery-slider__footer--senza-frecce {
    justify-content: center;
}


.mwg-fotogallery-home__button-wrapper {

    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;

    gap: 10px;

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


.mwg-fotogallery-home__button {

    display: inline-flex !important;
    align-items: center;
    justify-content: center;

    min-height: 48px;
    padding: 0 23px !important;

    border: 1px solid #b79a52 !important;
    border-radius: 999px;

    background: #ffffff !important;
    color: #b79a52 !important;

    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: .075em;
    text-transform: uppercase;
    text-decoration: none !important;
    white-space: nowrap;

    box-shadow: 0 7px 20px rgba(0, 0, 0, .05);

    transition:
        background-color .25s ease,
        border-color .25s ease,
        color .25s ease,
        transform .25s ease,
        box-shadow .25s ease;
}


.mwg-fotogallery-home__button:hover {

    background: #b79a52 !important;
    border-color: #b79a52 !important;
    color: #ffffff !important;

    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(183, 154, 82, .20);
}


.mwg-gallery-slider__controls {

    margin-left: 0;
}


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

.mwg-gallery-lightbox {

    position: fixed;
    inset: 0;

    z-index: 999999;

    visibility: hidden;
    opacity: 0;

    pointer-events: none;

    transition:
        opacity .3s ease,
        visibility .3s ease;
}


.mwg-gallery-lightbox--open {

    visibility: visible;
    opacity: 1;

    pointer-events: auto;
}


.mwg-gallery-lightbox__backdrop {

    position: absolute;
    inset: 0;

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

    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}


.mwg-gallery-lightbox__dialog {

    position: absolute;
    inset: 0;

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

    padding: 55px 90px;
}


.mwg-gallery-lightbox__image-wrapper {

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

    width: 100%;
    height: 100%;

    min-width: 0;
}


.mwg-gallery-lightbox__image {

    display: block !important;

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

    max-width: 92vw !important;
    max-height: 88vh !important;

    object-fit: contain !important;

    box-shadow: 0 20px 60px rgba(0, 0, 0, .30);
}


/* ============================================================
   CHIUSURA LIGHTBOX - STILE ORO
   ============================================================ */

.mwg-gallery-lightbox button.mwg-gallery-lightbox__close {

    position: absolute;

    top: 18px;
    right: 28px;

    z-index: 1001;

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

    width: 48px;
    height: 48px;

    padding: 0 !important;

    border: 1px solid rgba(211,187,114,.85) !important;
    border-radius: 50% !important;

    background: rgba(0,0,0,.34) !important;
    background-image: none !important;

    color: #d3bb72 !important;

    font-size: 32px !important;
    font-weight: 300 !important;
    line-height: 1 !important;

    cursor: pointer;

    box-shadow: 0 8px 24px rgba(0,0,0,.18) !important;
    outline: none !important;

    opacity: 1 !important;

    transition:
        background-color .25s ease,
        border-color .25s ease,
        color .25s ease,
        transform .25s ease,
        box-shadow .25s ease;
}


.mwg-gallery-lightbox button.mwg-gallery-lightbox__close:hover,
.mwg-gallery-lightbox button.mwg-gallery-lightbox__close:focus,
.mwg-gallery-lightbox button.mwg-gallery-lightbox__close:active {

    background: #b79a52 !important;
    background-image: none !important;

    border-color: #d3bb72 !important;

    color: #111111 !important;

    transform: scale(1.04);

    box-shadow: 0 10px 28px rgba(183,154,82,.28) !important;
}


/* ============================================================
   FRECCE LIGHTBOX - STILE ORO
   ============================================================ */

.mwg-gallery-lightbox button.mwg-gallery-lightbox__nav {

    position: absolute;

    top: 50%;

    z-index: 1001;

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

    width: 52px;
    height: 52px;

    padding: 0 !important;

    border: 1px solid rgba(211,187,114,.85) !important;
    border-radius: 50% !important;

    background: rgba(0,0,0,.34) !important;
    background-image: none !important;

    color: #d3bb72 !important;

    font-size: 23px !important;
    line-height: 1 !important;

    cursor: pointer;

    box-shadow: 0 8px 24px rgba(0,0,0,.16) !important;
    outline: none !important;

    opacity: 1 !important;

    transform: translateY(-50%);

    transition:
        background-color .25s ease,
        border-color .25s ease,
        color .25s ease,
        box-shadow .25s ease;
}


.mwg-gallery-lightbox button.mwg-gallery-lightbox__nav:hover,
.mwg-gallery-lightbox button.mwg-gallery-lightbox__nav:focus,
.mwg-gallery-lightbox button.mwg-gallery-lightbox__nav:active {

    background: #b79a52 !important;
    background-image: none !important;

    border-color: #d3bb72 !important;

    color: #111111 !important;

    box-shadow: 0 10px 28px rgba(183,154,82,.26) !important;
}


.mwg-gallery-lightbox__nav--prev {
    left: 25px;
}


.mwg-gallery-lightbox__nav--next {
    right: 25px;
}


/* Blocca lo scroll della pagina quando la lightbox è aperta */

html.mwg-gallery-lightbox-open,
html.mwg-gallery-lightbox-open body {
    overflow: hidden;
}


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

@media screen and (max-width: 1024px) {

    .mwg-fotogallery-home__content
    .mwg-gallery-slider
    .wp-block-gallery {

        gap: 18px !important;
    }


    .mwg-fotogallery-home__content
    .mwg-gallery-slider
    .wp-block-gallery
    figure.wp-block-image {

        flex: 0 0 calc((100% - 18px) / 2) !important;

        width: calc((100% - 18px) / 2) !important;
        min-width: calc((100% - 18px) / 2) !important;
        max-width: calc((100% - 18px) / 2) !important;

        height: auto !important;
    }


    .mwg-gallery-lightbox__dialog {
        padding: 55px 65px;
    }
}


/* ============================================================
   MOBILE
   ============================================================ */

@media screen and (max-width: 767px) {

    .mwg-gallery-slider {
        margin-top: 22px;
    }


    .mwg-fotogallery-home__content
    .mwg-gallery-slider
    .wp-block-gallery {

        gap: 14px !important;
    }


    /*
     * Mostriamo circa 1,15 fotografie.
     * In questo modo l'utente capisce immediatamente
     * che la gallery può essere trascinata.
     */

    .mwg-fotogallery-home__content
    .mwg-gallery-slider
    .wp-block-gallery
    figure.wp-block-image {

        flex: 0 0 86% !important;

        width: 86% !important;
        min-width: 86% !important;
        max-width: 86% !important;

        height: auto !important;

        border-radius: 8px;
    }


    .mwg-gallery-slider__controls {

        margin-top: 0;
    }


    .mwg-gallery-slider__arrow {

        width: 44px;
        height: 44px;

        font-size: 20px;
    }


    .mwg-gallery-slider__footer {

        gap: 9px;
        margin-top: 14px;
    }


    .mwg-fotogallery-home__button {

        min-height: 44px;
        padding: 0 16px !important;

        font-size: 11px;
        letter-spacing: .055em;
    }


    .mwg-gallery-lightbox__dialog {

        padding: 58px 12px;
    }


    .mwg-gallery-lightbox__image {

        max-width: 94vw !important;
        max-height: 82vh !important;
    }


    .mwg-gallery-lightbox__nav {

        width: 44px;
        height: 44px;

        font-size: 19px;

        background: rgba(0,0,0,.40);
    }


    .mwg-gallery-lightbox__nav--prev {
        left: 7px;
    }


    .mwg-gallery-lightbox__nav--next {
        right: 7px;
    }


    .mwg-gallery-lightbox__close {

        top: 7px;
        right: 7px;
    }
}


/* ============================================================
   MOBILE PICCOLO
   ============================================================ */

@media screen and (max-width: 480px) {

    .mwg-fotogallery-home__content
    .mwg-gallery-slider
    .wp-block-gallery
    figure.wp-block-image {

        height: auto !important;
    }
}
/* ============================================================
   DISATTIVA LIGHTBOX NATIVA WORDPRESS
   La Fotogallery utilizza già la lightbox MWG personalizzata
   ============================================================ */

/* Overlay lightbox Gutenberg */
.wp-lightbox-overlay {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}


/* Pulsante nativo "ingrandisci" sulle immagini Gutenberg */
.mwg-fotogallery-home
.wp-lightbox-container > button {
    display: none !important;
}


/* Sicurezza aggiuntiva per i controlli WordPress */
.wp-lightbox-close-button,
.wp-lightbox-navigation-button,
.wp-lightbox-navigation-button-prev,
.wp-lightbox-navigation-button-next {
    display: none !important;
}
/* ============================================================
   MOSAICO HOME FOTOGALLERY
   2 immagini grandi + 3 immagini inferiori
   ============================================================ */

.mwg-gallery-mosaic {
    width: 100%;
    max-width: 1200px;

    margin: 0 auto;
    padding: 0;
}


.mwg-gallery-mosaic__grid {
    display: grid;

    grid-template-columns:
        repeat(6, minmax(0, 1fr));

    gap: 8px;

    width: 100%;
}


/* ============================================================
   ELEMENTI
   ============================================================ */

.mwg-gallery-mosaic__item {
    position: relative;

    display: block;

    overflow: hidden;

    background: #f3f1ec;

    text-decoration: none;
}


/*
 * PRIME DUE FOTO
 */

.mwg-gallery-mosaic__item--1,
.mwg-gallery-mosaic__item--2 {

    grid-column: span 3;

    aspect-ratio: 4 / 5;
}


/*
 * TRE FOTO INFERIORI
 */

.mwg-gallery-mosaic__item--3,
.mwg-gallery-mosaic__item--4,
.mwg-gallery-mosaic__item--5 {

    grid-column: span 2;

    aspect-ratio: 4 / 4.6;
}


/* ============================================================
   IMMAGINE
   ============================================================ */

.mwg-gallery-mosaic__image {

    display: block;

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

    object-fit: cover;
    object-position: center;

    transition:
        transform .7s cubic-bezier(.2,.65,.25,1),
        filter .4s ease;
}


/* ============================================================
   HOVER EDITORIALE
   ============================================================ */

@media (hover: hover) and (pointer: fine) {

    .mwg-gallery-mosaic__item:hover
    .mwg-gallery-mosaic__image {

        transform: scale(1.025);

        filter: brightness(.92);
    }
}


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

@media screen and (max-width: 1024px) {

    .mwg-gallery-mosaic {
        padding: 0 18px;
    }

}


/* ============================================================
   MOBILE
   ============================================================ */

@media screen and (max-width: 767px) {

    .mwg-gallery-mosaic {
        padding: 0 12px;
    }


    .mwg-gallery-mosaic__grid {

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

        gap: 6px;
    }


    .mwg-gallery-mosaic__item--1 {

        grid-column: span 2;

        aspect-ratio: 4 / 5;
    }


    .mwg-gallery-mosaic__item--2,
    .mwg-gallery-mosaic__item--3,
    .mwg-gallery-mosaic__item--4,
    .mwg-gallery-mosaic__item--5 {

        grid-column: span 1;

        aspect-ratio: 4 / 5;
    }

}


/* ============================================================
   OVERRIDE FINALE CONTRO STILI GLOBALI DEL TEMA / ELEMENTOR
   ============================================================ */

.mwg-gallery-lightbox button.mwg-gallery-lightbox__close,
.mwg-gallery-lightbox button.mwg-gallery-lightbox__nav {
    -webkit-appearance: none !important;
    appearance: none !important;
}

.mwg-gallery-lightbox button.mwg-gallery-lightbox__close:hover,
.mwg-gallery-lightbox button.mwg-gallery-lightbox__close:focus,
.mwg-gallery-lightbox button.mwg-gallery-lightbox__close:active,
.mwg-gallery-lightbox button.mwg-gallery-lightbox__nav:hover,
.mwg-gallery-lightbox button.mwg-gallery-lightbox__nav:focus,
.mwg-gallery-lightbox button.mwg-gallery-lightbox__nav:active {
    background-color: #b79a52 !important;
    border-color: #d3bb72 !important;
    color: #111111 !important;
}

/* ============================================================
   CATALOGO PDF - PAGINA SINGOLA FOTOGALLERY
   ============================================================ */

.mwg-fotogallery-pdf {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;

    width: 100%;
    max-width: 1180px;

    margin: 42px auto;
    padding: 24px 26px;

    border: 1px solid rgba(183, 154, 82, .42);
    border-radius: 12px;

    background:
        linear-gradient(
            135deg,
            rgba(183, 154, 82, .07),
            rgba(255, 255, 255, .94) 42%,
            rgba(183, 154, 82, .04)
        );

    box-shadow:
        0 14px 38px rgba(0, 0, 0, .055);
}


.mwg-fotogallery-pdf__info {
    display: flex;
    align-items: center;
    gap: 16px;

    min-width: 0;
}


.mwg-fotogallery-pdf__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 58px;

    width: 58px;
    height: 58px;

    border-radius: 50%;

    background: #b79a52;
    color: #ffffff;

    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .12em;

    box-shadow:
        0 8px 22px rgba(183, 154, 82, .24);
}


.mwg-fotogallery-pdf__text {
    display: flex;
    flex-direction: column;
    gap: 4px;

    min-width: 0;
}


.mwg-fotogallery-pdf__eyebrow {
    color: #9b8243;

    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;

    letter-spacing: .16em;
}


.mwg-fotogallery-pdf__title {
    color: #1c1c1c;

    font-size: clamp(18px, 2vw, 24px);
    font-weight: 500;
    line-height: 1.2;
}


.mwg-fotogallery-pdf__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 11px;

    flex: 0 0 auto;

    min-height: 50px;

    padding: 0 23px;

    border: 1px solid #b79a52;
    border-radius: 999px;

    background: transparent;

    color: #806b36 !important;

    font-size: 12px;
    font-weight: 600;
    line-height: 1;

    letter-spacing: .10em;
    text-transform: uppercase;
    text-decoration: none !important;

    transition:
        background-color .25s ease,
        border-color .25s ease,
        color .25s ease,
        transform .25s ease,
        box-shadow .25s ease;
}


.mwg-fotogallery-pdf__arrow {
    font-size: 17px;
    line-height: 1;

    transition:
        transform .25s ease;
}


.mwg-fotogallery-pdf__button:hover,
.mwg-fotogallery-pdf__button:focus {
    background: #b79a52;
    border-color: #b79a52;

    color: #ffffff !important;

    transform: translateY(-1px);

    box-shadow:
        0 10px 26px rgba(183, 154, 82, .20);
}


.mwg-fotogallery-pdf__button:hover
.mwg-fotogallery-pdf__arrow,
.mwg-fotogallery-pdf__button:focus
.mwg-fotogallery-pdf__arrow {
    transform: translate(2px, -2px);
}


/* ============================================================
   CATALOGO PDF - TABLET / MOBILE
   ============================================================ */

@media screen and (max-width: 767px) {

    .mwg-fotogallery-pdf {
        flex-direction: column;
        align-items: stretch;

        gap: 20px;

        margin: 30px auto;
        padding: 20px;

        border-radius: 10px;
    }


    .mwg-fotogallery-pdf__badge {
        flex-basis: 50px;

        width: 50px;
        height: 50px;
    }


    .mwg-fotogallery-pdf__button {
        width: 100%;
    }
}

/* ============================================================
   PULSANTE PDF NELL'ANTEPRIMA HOME / LOOP
   ============================================================ */

.mwg-fotogallery-home__pdf-button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;

    min-height: 48px;
    padding: 0 23px !important;

    border: 1px solid #b79a52 !important;
    border-radius: 999px;

    background: #b79a52 !important;
    color: #ffffff !important;

    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: .075em;
    text-transform: uppercase;
    text-decoration: none !important;
    white-space: nowrap;

    box-shadow: 0 7px 20px rgba(183, 154, 82, .18);

    transition:
        background-color .25s ease,
        border-color .25s ease,
        color .25s ease,
        transform .25s ease,
        box-shadow .25s ease;
}

.mwg-fotogallery-home__pdf-button:hover,
.mwg-fotogallery-home__pdf-button:focus {
    background: #ffffff !important;
    border-color: #b79a52 !important;
    color: #b79a52 !important;

    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(183, 154, 82, .18);
}

.mwg-fotogallery-home__pdf-button span {
    font-size: 15px;
    line-height: 1;
}

@media screen and (max-width: 767px) {

    .mwg-fotogallery-home__button-wrapper {
        gap: 8px;
    }

    .mwg-fotogallery-home__pdf-button {
        min-height: 44px;
        padding: 0 16px !important;

        font-size: 11px;
        letter-spacing: .055em;
    }
}

/* ============================================================
   ANTEPRIMA HOME / LOOP - NASCONDI FRECCE ACCANTO AL PDF
   ============================================================ */

/*
 * Quando nel footer è presente il pulsante "CATALOGO PDF",
 * le frecce dello slider non vengono mostrate.
 * Lo swipe su mobile resta comunque disponibile.
 */
.mwg-gallery-slider__footer:
has(.mwg-fotogallery-home__pdf-button)
.mwg-gallery-slider__controls {
    display: none !important;
}

/*
 * Con le frecce nascoste il gruppo pulsanti rimane centrato.
 */
.mwg-gallery-slider__footer:
has(.mwg-fotogallery-home__pdf-button) {
    justify-content: center !important;
}

/* ============================================================
   TITOLO AUTOMATICO DELLE IMMAGINI FOTOGALLERY
   ============================================================ */

/*
 * Base comune.
 */
.mwg-fotogallery-image-title {
    display: block;

    width: 100%;

    box-sizing: border-box;

    margin: 0;

    font-size: 10px;
    font-weight: 600;
    line-height: 1.25;

    letter-spacing: .14em;
    text-transform: uppercase;
    text-align: center;
}


/* ============================================================
   HOME / LOOP
   ============================================================ */

/*
 * Nelle anteprime il titolo usa una sottile fascia scura,
 * così resta leggibile sia su sfondi chiari sia su sfondi scuri.
 */
.mwg-fotogallery-home__content
.mwg-fotogallery-image-title {
    flex: 0 0 auto;

    padding: 7px 8px 6px;

    color: #e4cf8c;

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

    text-shadow:
        0 1px 2px rgba(0, 0, 0, .35);
}


/*
 * La scheda resta verticale ma ora è composta da:
 * immagine + piccola fascia titolo.
 */
.mwg-fotogallery-home__content
.mwg-gallery-slider
.wp-block-gallery
figure.wp-block-image {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;

    overflow: hidden;
}


/*
 * Immagine diretta nel figure.
 */
.mwg-fotogallery-home__content
.mwg-gallery-slider
.wp-block-gallery
figure.wp-block-image > img {
    flex: 1 1 auto;

    width: 100% !important;
    height: auto !important;
    min-height: 0;

    object-fit: contain !important;
    object-position: center center !important;
}


/*
 * Immagine racchiusa in un link.
 */
.mwg-fotogallery-home__content
.mwg-gallery-slider
.wp-block-gallery
figure.wp-block-image > a {
    flex: 1 1 auto;

    width: 100%;
    height: auto !important;
    min-height: 0;

    overflow: hidden;

    background: transparent !important;
}


.mwg-fotogallery-home__content
.mwg-gallery-slider
.wp-block-gallery
figure.wp-block-image > a > img {
    width: 100% !important;
    height: 100% !important;

    object-fit: contain !important;
    object-position: center center !important;
}


/*
 * Compatibilità con il contenitore lightbox Gutenberg.
 */
.mwg-fotogallery-home__content
.mwg-gallery-slider
.wp-block-gallery
figure.wp-block-image > .wp-lightbox-container {
    flex: 1 1 auto;

    width: 100%;
    height: auto !important;
    min-height: 0;

    overflow: hidden;
}


.mwg-fotogallery-home__content
.mwg-gallery-slider
.wp-block-gallery
figure.wp-block-image > .wp-lightbox-container img {
    width: 100% !important;
    height: 100% !important;

    object-fit: contain !important;
    object-position: center center !important;
}


/* ============================================================
   PAGINA SINGOLA FOTOGALLERY
   ============================================================ */

/*
 * Nella pagina della collezione lo sfondo è chiaro:
 * titolo oro scuro, pulito e ben separato dalla foto.
 */
.mwg-fotogallery-content
figure.wp-block-image
.mwg-fotogallery-image-title {
    padding: 8px 6px 10px;

    color: #7d6934;

    background: #ffffff;

    border-bottom:
        1px solid rgba(183, 154, 82, .18);
}


/*
 * Lascia un minimo di respiro tra le righe della gallery.
 */
.mwg-fotogallery-content
figure.wp-block-image {
    margin-bottom: 8px !important;
}


/* ============================================================
   MOBILE
   ============================================================ */

@media screen and (max-width: 767px) {

    .mwg-fotogallery-image-title {
        font-size: 9px;
        letter-spacing: .11em;
    }


    .mwg-fotogallery-home__content
    .mwg-fotogallery-image-title {
        padding: 6px 5px 5px;
    }

}



/* ============================================================
   PAGINA SINGOLA FOTOGALLERY - COMPATIBILITÀ ELEMENTOR
   ============================================================ */

/*
 * Se la singola Fotogallery viene impaginata con Elementor
 * Theme Builder, potrebbe non esistere il wrapper
 * .mwg-fotogallery-content del template PHP del plugin.
 *
 * La classe body .single-fotogallery è invece generata da
 * WordPress e permette di mantenere lo stile dei titoli.
 */
body.single-fotogallery
figure.wp-block-image
.mwg-fotogallery-image-title {
    display: block !important;

    width: 100% !important;

    box-sizing: border-box;

    margin: 0 !important;
    padding: 8px 6px 10px !important;

    color: #7d6934 !important;
    background: #ffffff !important;

    border-bottom:
        1px solid rgba(183, 154, 82, .18);

    font-size: 10px !important;
    font-weight: 600 !important;
    line-height: 1.25 !important;

    letter-spacing: .14em !important;
    text-transform: uppercase !important;
    text-align: center !important;
}


body.single-fotogallery
figure.wp-block-image {
    overflow: visible;
}


@media screen and (max-width: 767px) {

    body.single-fotogallery
    figure.wp-block-image
    .mwg-fotogallery-image-title {
        font-size: 9px !important;
        letter-spacing: .11em !important;
    }

}

