/*
 * Journey album photos must be visible in full. Covers and collection cards
 * retain their intentional crops; these rules apply only inside a journey album.
 */
.jtp-journey-gallery .jtp-gallery__item,
.jtp-journey-gallery .jtp-gallery figure {
    display: grid;
    place-items: center;
    background: #112f26;
}

.jtp-journey-gallery .jtp-gallery__item img,
.jtp-journey-gallery .jtp-gallery figure img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transform: none;
}

.jtp-journey-gallery .jtp-gallery__item::after {
    background: linear-gradient(180deg, rgba(8, 27, 20, 0) 58%, rgba(8, 27, 20, 0.08) 100%);
}

.jtp-journey-gallery .jtp-gallery__item:hover img {
    transform: none;
    filter: saturate(1.04);
}

/*
 * Keep the original photograph wholly visible in the full-screen viewer.
 * A few theme/Jetpack image rules load after the gallery and force a natural
 * image height, making tall photos spill out of the stage. Logical sizing
 * with explicit max bounds wins that cascade without affecting card crops.
 */
.jtp-gallery-lightbox__stage {
    display: grid !important;
    place-items: center !important;
    block-size: min(66dvh, 640px) !important;
    max-block-size: calc(100dvh - 170px) !important;
    min-block-size: 0 !important;
    overflow: hidden !important;
}

.jtp-gallery-lightbox__stage > .jtp-gallery-lightbox__image {
    display: block !important;
    inline-size: auto !important;
    block-size: auto !important;
    max-inline-size: 100% !important;
    max-block-size: 100% !important;
    margin: auto !important;
    object-fit: contain !important;
    object-position: center !important;
    transform: none !important;
}

@media (max-width: 700px) {
    .jtp-gallery-lightbox__stage {
        block-size: min(60dvh, 540px) !important;
        max-block-size: calc(100dvh - 156px) !important;
    }
}
