/*
 * Keep the source page fully hidden behind the split lightbox.
 * A transparent overlay lets the original feed image bleed through and
 * looks like a second, vertically shifted copy of the opened photo.
 */
#image-modal-overlay {
    background: rgba(0, 0, 0, .985);
    background-image: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

/*
 * Profile-media originals are separate from the circular avatar crop.
 * Keep the natural image ratio in feed cards and the split lightbox.
 */
.post-card.dx-mobile-post.is-profile-media-post .profile-original-media-content,
.post-card.dx-mobile-post.is-profile-media-post .profile-original-media-content .post-tile-gallery,
.post-card.dx-mobile-post.is-profile-media-post .profile-original-media-content .post-tile-grid,
.post-card.dx-mobile-post.is-profile-media-post .profile-original-media-content .post-tile-grid.tiles-1,
.post-card.dx-mobile-post.is-profile-media-post .profile-original-media-content .tile-item {
    display: block;
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    aspect-ratio: auto;
    overflow: visible;
}

.post-card.dx-mobile-post.is-profile-media-post .profile-original-media-content .tile-item {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #050608;
}

.post-card.dx-mobile-post.is-profile-media-post .profile-original-media-content img.parsed-post-image,
.post-card.dx-mobile-post.is-profile-media-post .profile-original-media-content .post-tile-grid .parsed-post-image,
.post-card.dx-mobile-post.is-profile-media-post .profile-original-media-content .tile-item > img {
    display: block;
    flex: 0 1 auto;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 82vh;
    aspect-ratio: auto;
    object-fit: contain;
    object-position: center;
    transform: none;
    clip-path: none;
    border-radius: 0;
}

#image-modal-overlay .lightbox-image-viewport {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

#image-modal-overlay .lightbox-image-viewport > #image-modal-img,
#image-modal-overlay .lightbox-left-pane > #image-modal-img,
#image-modal-overlay #image-modal-img.is-profile-media-original {
    position: relative;
    display: block;
    flex: 0 1 auto;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: auto;
    object-fit: contain;
    object-position: center;
    background: transparent;
    clip-path: none;
    border-radius: 0;
}
