/* MDM 0.3.10 — Ambito esclusivo: Foto/Photos nel rendering Elementor 2027.
 * Masonry tramite colonne: niente celle bianche o ritagli forzati. */
main#main-content.mdmx-photo-page.mdmx-elementor-surface .mdmx-gallery-wrap .mdmx-masonry {
    display: block !important;
    width: min(1500px, 100%) !important;
    max-width: 100% !important;
    margin-inline: auto !important;
    columns: 4 !important;
    column-gap: 15px !important;
    column-fill: balance;
}
main#main-content.mdmx-photo-page.mdmx-elementor-surface .mdmx-gallery-wrap .mdmx-masonry > .mdmx-photo-frame {
    box-sizing: border-box !important;
    display: inline-block !important;
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    min-height: 0 !important;
    aspect-ratio: auto !important;
    grid-column: auto !important;
    grid-row: auto !important;
    break-inside: avoid !important;
    -webkit-column-break-inside: avoid !important;
    margin: 0 0 15px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 14px;
    background: transparent !important;
    overflow: hidden;
    vertical-align: top;
    line-height: 0;
    text-align: left;
    cursor: zoom-in;
    box-shadow: 0 8px 24px rgba(5, 45, 86, .14);
}
main#main-content.mdmx-photo-page.mdmx-elementor-surface .mdmx-gallery-wrap .mdmx-masonry > .mdmx-photo-frame[hidden] {
    display: none !important;
}
main#main-content.mdmx-photo-page.mdmx-elementor-surface .mdmx-gallery-wrap .mdmx-masonry > .mdmx-photo-frame > img {
    box-sizing: border-box;
    display: block !important;
    position: static !important;
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    aspect-ratio: auto !important;
    object-fit: contain !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    transform: none;
}
main#main-content.mdmx-photo-page.mdmx-elementor-surface .mdmx-photo-frame:hover {
    transform: translateY(-2px);
}
main#main-content.mdmx-photo-page.mdmx-elementor-surface .mdmx-photo-frame:hover > img,
main#main-content.mdmx-photo-page.mdmx-elementor-surface .mdmx-photo-frame:focus-visible > img {
    transform: scale(1.012);
}
main#main-content.mdmx-photo-page.mdmx-elementor-surface .mdmx-photo-frame .mdmx-photo-zoom {
    line-height: 1;
}
@media(max-width:1080px) {
    main#main-content.mdmx-photo-page.mdmx-elementor-surface .mdmx-gallery-wrap .mdmx-masonry {columns: 3 !important;column-gap: 12px !important;}
    main#main-content.mdmx-photo-page.mdmx-elementor-surface .mdmx-gallery-wrap .mdmx-masonry > .mdmx-photo-frame {margin-bottom: 12px !important;}
}
@media(max-width:700px) {
    main#main-content.mdmx-photo-page.mdmx-elementor-surface .mdmx-gallery-wrap .mdmx-masonry {columns: 2 !important;column-gap: 9px !important;}
    main#main-content.mdmx-photo-page.mdmx-elementor-surface .mdmx-gallery-wrap .mdmx-masonry > .mdmx-photo-frame {margin-bottom: 9px !important;border-radius: 9px;}
}
@media(max-width:400px) {
    main#main-content.mdmx-photo-page.mdmx-elementor-surface .mdmx-gallery-wrap .mdmx-masonry {columns: 1 !important;}
}
/* Lightbox autonome: non dipende dall'inizializzazione della vecchia galleria. */
.mdm0310-viewer[hidden] {display: none !important;}
.mdm0310-viewer {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483000 !important;
    display: flex;
    flex-direction: column;
    background: rgba(3, 14, 32, .96);
    color: white;
    font-family: inherit;
    box-sizing: border-box;
}
.mdm0310-viewer, .mdm0310-viewer * {box-sizing: border-box;}
.mdm0310-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: 58px;
    padding: 8px max(14px, env(safe-area-inset-right)) 8px max(14px, env(safe-area-inset-left));
    flex-shrink: 0;
}
.mdm0310-actions {display: flex; align-items: center; gap: 8px;}
.mdm0310-viewer button {
    appearance: none;
    color: #fff;
    background: rgba(255,255,255,.13);
    border: 1px solid rgba(255,255,255,.32);
    border-radius: 9px;
    min-width: 42px;
    min-height: 42px;
    padding: 6px 12px;
    font: inherit;
    font-size: 19px;
    line-height: 1.1;
    cursor: pointer;
}
.mdm0310-viewer button:hover,.mdm0310-viewer button:focus-visible {background:rgba(255,255,255,.27);outline-offset:2px;}
.mdm0310-stage {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding: 12px 65px 20px;
    position: relative;
    overscroll-behavior: contain;
    touch-action: pan-x pan-y pinch-zoom;
}
.mdm0310-photo {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    margin: auto;
    box-shadow: 0 10px 35px rgba(0,0,0,.45);
    cursor: zoom-in;
}
.mdm0310-viewer.is-zoomed .mdm0310-photo {
    max-width: none !important;
    max-height: none !important;
    cursor: zoom-out;
}
.mdm0310-nav {
    position: absolute;
    z-index: 2;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 52px;
    padding: 0 !important;
    font-size: 34px !important;
}
.mdm0310-prev {left: 8px;}
.mdm0310-next {right: 8px;}
.mdm0310-error {padding: 12px; font-size: 15px; text-align: center;}
.mdm0310-error[hidden] {display: none !important;}
@media(max-width:650px) {
    .mdm0310-bar {height: 52px;padding: 4px 9px;}
    .mdm0310-viewer button {min-width: 38px;min-height: 38px;padding: 6px 9px;font-size: 16px;}
    .mdm0310-stage {padding: 8px 44px 12px;}
    .mdm0310-nav {width: 35px;height: 45px;font-size: 27px !important;}
    .mdm0310-prev {left: 3px;} .mdm0310-next {right: 3px;}
}
@media(prefers-reduced-motion: reduce) {
    main#main-content.mdmx-photo-page.mdmx-elementor-surface .mdmx-photo-frame,
    main#main-content.mdmx-photo-page.mdmx-elementor-surface .mdmx-photo-frame > img {transition: none !important;}
}
