.news .gallery-grid.wedding-elegant-v2 {
    position: relative;
    width: 100%;
    /*
     * PHP уже вычислил итоговое соотношение
     * ширины к высоте всей галереи.
     */
    aspect-ratio: var(--gg-ratio);
    margin: 10px 0;
    padding: 0;
    overflow: hidden;
}


/* ==========================================================
   ITEM
   ========================================================== */

.news .gallery-grid.wedding-elegant-v2 .gallery-item {
    position: absolute;
    box-sizing: border-box;
    overflow: hidden;
    margin: 0;
    padding: 0;
    background: #1a1a1a;
    cursor: default;
}


/* ==========================================================
   IMAGE
   ========================================================== */

.news .gallery-grid.wedding-elegant-v2 .gallery-item img {
    display: block;

    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    object-fit: cover;
    filter: brightness(0.93);
    transition:
        filter 0.3s ease,
        transform 0.3s ease;
}


/* ==========================================================
   HOVER
   ========================================================== */

.news .gallery-grid.wedding-elegant-v2 .gallery-item:hover {
    z-index: 4;

    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.4);
}


.news .gallery-grid.wedding-elegant-v2 .gallery-item:hover img {
    filter: brightness(1);
}


/* ==========================================================
   MOBILE
   ========================================================== */

@media screen and (max-width: 995px) {

    .wedding-photos.-show-mobile .common_photo-block {
        display: block;
    }

    .news .gallery-grid.wedding-elegant-v2 {
        position: relative;
        width: 100%;
        height: auto !important;
        aspect-ratio: auto !important;
        overflow: visible;
        margin: 10px 0;
        padding: 0;
    }

    .news .gallery-grid.wedding-elegant-v2 .gallery-item {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        width: auto !important;
        height: auto !important;
        margin: 0 0 8px 0;
        padding: 0;
        overflow: hidden;
        box-sizing: border-box;
    }

    .news .gallery-grid.wedding-elegant-v2 .gallery-item img {
        display: block;
        height: auto !important;
        width: auto !important; 
        max-width: 100% !important;
        object-fit: contain;
        margin: 0;
        padding: 0;
    }

    .news .gallery-grid.wedding-elegant-v2 .gallery-item:last-child {
        margin-bottom: 0;
    }
}






/* ==========================================================
   WEDDING ELEGANT V2
   PHP MASONRY
   NO JAVASCRIPT
   ========================================================== */

.gallery-grid.wedding-elegant-v2 {
    position: relative;
    width: 100%;

    /*
     * PHP уже вычислил итоговое соотношение
     * ширины к высоте всей галереи.
     */
    aspect-ratio: var(--gg-ratio);
    margin: 10px 0;
    padding: 0;
    overflow: hidden;
}


/* ==========================================================
   ITEM
   ========================================================== */

.gallery-grid.wedding-elegant-v2 .gallery-item {
    position: absolute;
    box-sizing: border-box;
    overflow: hidden;
    margin: 0;
    padding: 0;
    background: #1a1a1a;
    cursor: default;
}


/* ==========================================================
   IMAGE
   ========================================================== */

.gallery-grid.wedding-elegant-v2 .gallery-item img {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    object-fit: cover;
    filter: brightness(0.93);
    transition:
        filter 0.3s ease,
        transform 0.3s ease;
}


/* ==========================================================
   HOVER
   ========================================================== */

.gallery-grid.wedding-elegant-v2 .gallery-item:hover {
    z-index: 4;

    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.4);
}


.gallery-grid.wedding-elegant-v2 .gallery-item:hover img {
    filter: brightness(1);
}


/* ==========================================================
   MOBILE
   ========================================================== */

@media screen and (max-width: 995px) {

    .wedding-photos.-show-mobile .common_photo-block {
        display: block;
    }

    .gallery-grid.wedding-elegant-v2 {
        position: relative;
        width: 100%;
        height: auto !important;
        aspect-ratio: auto !important;
        overflow: visible;
        margin: 10px 0;
        padding: 0;
    }

    .gallery-grid.wedding-elegant-v2 .gallery-item {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        width: auto !important;
        height: auto !important;
        margin: 0 0 8px 0;
        padding: 0;
        overflow: hidden;
        box-sizing: border-box;
    }

    .gallery-grid.wedding-elegant-v2 .gallery-item img {
        display: block;
        width: auto !important; 
        height: auto !important;
        max-width: 100% !important;
        object-fit: cover;
        margin: 0;
        padding: 0;
    }

    .gallery-grid.wedding-elegant-v2 .gallery-item:last-child {
        margin-bottom: 0;
    }
}