.photo-gallery {
    color: #f5f5f7;
}

.gallery__title {
    font-size: 30px;
    font-weight: 700;
    margin: 0 0 18px;
}

/* МОЗАИКА — десктоп */
.gallery-mosaic {
    display: grid;
    /* grid-template-columns: 1.7fr 1.4fr 1.7fr; */
    /* grid-template-columns: repeat(3, 1fr); */
    /* grid-template-rows: 190px 190px 190px; */
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 280px;
    grid-template-areas:
        'i1 i2 i3'
        'i1 i4 i3'
        'i5 i4 i6';
    gap: 5px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    width: 95%;
    border-radius: 18px;
    cursor: pointer;
    background: #111;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
    transform: translateY(0);
    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.gallery-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 35px rgba(0, 0, 0, 0.5);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Привязка к областям сетки */
.gallery-item--1 {
    grid-area: i1;
} /* высокая левая, 2 ряда */
.gallery-item--2 {
    grid-area: i2;
} /* верхний центр */
.gallery-item--3 {
    grid-area: i3;
} /* высокая правая, 2 ряда */
.gallery-item--4 {
    grid-area: i4;
} /* центр, 2 нижних ряда */
.gallery-item--5 {
    grid-area: i5;
} /* нижний левый */
.gallery-item--6 {
    grid-area: i6;
} /* нижний правый */

.gallery-mosaic.gallery-2 {
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

#galleryMore.active {
    display: grid;
    opacity: 1;
}

.show-more-btn-wrap {
    display: flex;
    justify-content: center;
    margin: 0 auto;
    margin-top: 20px;
}

.show-more-btn:hover {
    background: #1e9e25;
}
/* Адаптив — планшет */
@media (max-width: 1024px) {
    .gallery-mosaic {
        grid-template-columns: repeat(1, 1fr);
        /* grid-template-rows: 180px 180px 180px; */
        grid-template-areas:
            'i1 i2'
            'i1 i4'
            'i5 i3';
    }
    .gallery-item {
        width: auto;
    }
    .gallery-item--6 {
        /* display: none; */
    } /* можно убрать 1 фото на планшете, если хочешь */
    #galleryMore.active {
        margin-top: 20px;
    }
}

/* Адаптив — мобилка */
@media (max-width: 768px) {
    .photo-gallery {
        padding: 28px 10px;
    }

    .gallery__title {
        font-size: 22px;
        margin-bottom: 14px;
    }

    .gallery-mosaic {
        grid-template-columns: 1fr;
        grid-template-rows: none;
        grid-template-areas: none;
        gap: 20px;
    }

    .gallery-item,
    .gallery-item--1,
    .gallery-item--2,
    .gallery-item--3,
    .gallery-item--4,
    .gallery-item--5,
    .gallery-item--6 {
        grid-area: auto;
        /* height: 190px; */
        margin: 0;
    }
}

/* ЛАЙТБОКС */
.gallery-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease;
    z-index: 1000;
    padding: 16px;
}

.gallery-lightbox.is-active {
    opacity: 1;
    visibility: visible;
}

.lightbox__img {
    max-width: 92vw;
    max-height: 92vh;
    border-radius: 14px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
}

.lightbox__close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: none;
    border: none;
    color: #fff;
    font-size: 40px;
    line-height: 1;
    cursor: pointer;
}
