/* Project catalogue and case photos only. Original files and lightboxes stay intact. */
#ts-project-photos .articles-page__cover {
    display: block;
    width: 100%;
    height: auto !important;
    aspect-ratio: 4 / 3 !important;
    padding: 0 !important;
    background: #e6e4dc;
}

#ts-project-photos .articles-page__cover img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: scale-down !important;
    object-position: center !important;
}

#ts-project-photos.ts-project-detail .article__post figure:has(img) {
    width: 100% !important;
    max-width: 800px !important;
    min-width: 0;
    height: auto !important;
    margin-inline: auto !important;
}

#ts-project-photos.ts-project-detail .article__post figure:has(img) a:has(img),
#ts-project-photos.ts-project-detail .article__post figure:has(img) picture {
    display: block;
    width: 100%;
    height: auto !important;
    max-height: none !important;
}

#ts-project-photos.ts-project-detail .article__post figure img {
    display: block;
    width: 100% !important;
    height: auto !important;
    max-width: none !important;
    max-height: none !important;
    aspect-ratio: 4 / 3 !important;
    object-fit: scale-down !important;
    object-position: center !important;
    background: #e6e4dc;
}

#ts-project-photos.ts-project-detail :is(
    .pl-gallery, .lipetsk-photos, .mw-grid, .krasnodon-photos,
    .zakh-photos, .otradnoe-case__photos, .ac-gallery, .kbha-photos,
    .orlovo-gallery, .stal-photos, .kc-grid, .aprb-story,
    .aprb-gallery, .ic-case__gallery, .stm-grid, .persp-gallery,
    .articles-page__grid
) {
    width: 100%;
    max-width: 960px;
    margin-inline: auto;
    gap: 24px;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-items: start;
}

@media (max-width: 760px) {
    #ts-project-photos.ts-project-detail :is(
        .pl-gallery, .lipetsk-photos, .mw-grid, .krasnodon-photos,
        .zakh-photos, .otradnoe-case__photos, .ac-gallery, .kbha-photos,
        .orlovo-gallery, .stal-photos, .kc-grid, .aprb-story,
        .aprb-gallery, .ic-case__gallery, .stm-grid, .persp-gallery,
        .articles-page__grid
    ) {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}
