/* Explicit 700px photo/text layout. Use text-photo-700 on the section,
   text-photo-700__row on its two-column row, and text-photo-700__image on the photo container. */
:is(#main-content, body) .text-photo-700 > .text-photo-700__row,
:is(#main-content, body) .text-photo-700 > .wrapper,
:is(#main-content, body) .text-photo-700.ng_box_img_left > div:not(.button_center),
:is(#main-content, body) .text-photo-700.ng_box_img_right > div:not(.button_center) {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
}

:is(#main-content, body) .text-photo-700 .text-photo-700__image {
    display: block;
    width: 700px;
    max-width: 100%;
    min-width: 0;
    margin-inline: auto;
    position: relative;
}

:is(#main-content, body) .text-photo-700__image > picture {
    display: block;
    width: 100%;
}

:is(#main-content, body) .text-photo-700__image > picture > img,
:is(#main-content, body) .text-photo-700__image > img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}

@media (min-width: 1280px) {
    :is(#main-content, body) .text-photo-700 {
        padding-inline: 3rem;
    }
    :is(#main-content, body) .text-photo-700 > .text-photo-700__row,
:is(#main-content, body) .text-photo-700 > .wrapper,
:is(#main-content, body) .text-photo-700.ng_box_img_left > div:not(.button_center),
:is(#main-content, body) .text-photo-700.ng_box_img_right > div:not(.button_center) {
        grid-template-columns: minmax(0, 48rem) 700px;
        column-gap: 3rem;
    }
    :is(#main-content, body) .text-photo-700.ng_box_img_left > .text-photo-700__row,
    :is(#main-content, body) .text-photo-700.ng_box_img_left > div:not(.button_center) {
        grid-template-columns: 700px minmax(0, 48rem);
    }
}

/* Captions sit inside the image and do not alter vertical centering. */
:is(#main-content, body) .text-photo-700__image > p {
    position: absolute;
    inset: auto auto 1rem 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: calc(100% - 2rem);
    margin: 0;
    padding: 0.25rem 1rem;
    color: #fff;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 0.25rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    text-align: center;
    z-index: 1;
}

/* Very shallow panoramas still need room for legible captions on phones. */
@media (max-width: 767px) {
    :is(#main-content, body) .text-photo-700__image > picture > img,
    :is(#main-content, body) .text-photo-700__image > img {
        min-height: 10rem;
        object-fit: cover;
    }
}
