.photos {
    margin: 64px 0;

    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.col1,
.col2 {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.row {
    display: grid;
    grid-template-columns: 306fr 196fr;
    gap: 24px;
}

.photos img {
    width: 100%;
    display: block;
    object-fit: cover;
    border-radius: 8px;
}

.col1 img:nth-child(1) {
    aspect-ratio: 526 / 196;
}

.col1 img:nth-child(2) {
    aspect-ratio: 526 / 306;
}

.col1 img:nth-child(3) {
    aspect-ratio: 526 / 526;
}

/* верхний ряд справа */

.row img:nth-child(1) {
    aspect-ratio: 306 / 306;
}

.row img:nth-child(2) {
    aspect-ratio: 196 / 306;
}

/* нижние */

.col2 > img:nth-of-type(1) {
    aspect-ratio: 526 / 416;
}

.col2 > img:nth-of-type(2) {
    aspect-ratio: 526 / 306;
}

@media (max-width: 768px) {
    .photos {
        display: flex;
        flex-direction: column;
        gap: 16px;
        margin: 40px 0;
    }

    .col1 {
        display: contents; /* "растворяем" div, его дети становятся прямыми детьми .photos */
    }

    .col2 {
        display: contents;
    }

    .row {
        order: 1;
        display: grid;
        grid-template-columns: 306fr 196fr; /* оригинальные пропорции */
        gap: 16px;
    }

    .row img {
        aspect-ratio: unset; /* убираем принудительный aspect-ratio */
    }

    .col1 img:nth-child(1) { order: 2; } /* img1 */
    .col1 img:nth-child(2) { order: 3; } /* img2 */
    .col1 img:nth-child(3) { order: 4; } /* img3 */

    .col2 > img:nth-of-type(1) { order: 5; } /* img6 */
    .col2 > img:nth-of-type(2) { order: 6; } /* img7 */

    .photos img {
        aspect-ratio: 16 / 10;
    }
}