/* イベント・ヒトコトモノ・建築実例詳細：SP本文画像の縦横サイズ統一 */
@media only screen and (max-width: 767px) {
    body.single-event #event-main__content__body figure.itoko-content-figure--landscape,
    body.single-event #event-main__content__body figure.itoko-content-figure--portrait,
    body.single-gallery #gallery-content figure.itoko-content-figure--landscape,
    body.single-gallery #gallery-content figure.itoko-content-figure--portrait,
    body.single-gallery #gallery-content .pb-lg figure.wp-block-image,
    body.single-gallery #gallery-content .pb-lg figure.aligncenter {
        position: relative;
        left: auto !important;
        width: var(--itoko-viewport-width, 100vw) !important;
        max-width: var(--itoko-viewport-width, 100vw) !important;
        margin-left: calc((100% - var(--itoko-viewport-width, 100vw)) / 2) !important;
        margin-right: calc((100% - var(--itoko-viewport-width, 100vw)) / 2) !important;
        transform: none !important;
    }

    body.single-event #event-main__content__body img.itoko-content-image--landscape,
    body.single-gallery #gallery-content img.itoko-content-image--landscape,
    body.single-gallery #gallery-content .pb-lg figure.wp-block-image img:not(.itoko-content-image--portrait),
    body.single-gallery #gallery-content .pb-lg figure.aligncenter img:not(.itoko-content-image--portrait) {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    body.single-event #event-main__content__body img.itoko-content-image--portrait,
    body.single-gallery #gallery-content img.itoko-content-image--portrait {
        display: block !important;
        width: 66.6667% !important;
        max-width: 66.6667% !important;
        height: auto !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    body.single-event #event-main__content__body figure.itoko-content-figure--landscape > a,
    body.single-event #event-main__content__body figure.itoko-content-figure--portrait > a,
    body.single-gallery #gallery-content figure.itoko-content-figure--landscape > a,
    body.single-gallery #gallery-content figure.itoko-content-figure--portrait > a {
        display: block;
        width: 100%;
    }

    body.single-event #event-main__content__body figure.itoko-content-figure--portrait figcaption,
    body.single-gallery #gallery-content figure.itoko-content-figure--portrait figcaption {
        width: 66.6667%;
        margin-left: auto;
        margin-right: auto;
    }

    body.single-event #event-main__content__body figure.itoko-content-figure--landscape figcaption,
    body.single-gallery #gallery-content figure.itoko-content-figure--landscape figcaption {
        width: var(--itoko-original-content-width, calc(100% - 40px));
        margin-left: auto;
        margin-right: auto;
    }

    body.single-gallery #gallery-content,
    body.single-gallery #gallery-content > .container {
        background-color: #fff;
    }

    body.single-gallery,
    body.single-gallery #gallery-content,
    body.single-gallery #gallery-content > .container,
    body.single-gallery #gallery-content .container > .pb-lg {
        overflow-x: hidden;
        max-width: 100vw;
    }
}

/* 建築実例詳細：SP本文枠を全幅化し、文章だけに左右余白を残す */
@media only screen and (max-width: 991px) {
    body.single-gallery #gallery-content > .container {
        width: 100% !important;
        max-width: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    body.single-gallery #gallery-content > .container > .pb-lg {
        box-sizing: border-box;
        width: 100% !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
    }

    body.single-gallery #gallery-content .pb-lg .wp-block-columns {
        flex-direction: column !important;
    }

    body.single-gallery #gallery-content .pb-lg .wp-block-columns > .wp-block-column {
        width: 100% !important;
        max-width: 100% !important;
        flex-basis: 100% !important;
    }

    body.single-gallery #gallery-content .pb-lg figure {
        position: static !important;
        left: auto !important;
        box-sizing: border-box;
        width: calc(100% + 40px) !important;
        max-width: none !important;
        margin-left: -20px !important;
        margin-right: -20px !important;
        transform: none !important;
    }

    body.single-gallery #gallery-content .pb-lg figure img.itoko-server-image--landscape,
    body.single-gallery #gallery-content .pb-lg figure img.itoko-content-image--landscape,
    body.single-gallery #gallery-content .pb-lg figure.wp-block-image img:not(.itoko-content-image--portrait),
    body.single-gallery #gallery-content .pb-lg figure.aligncenter img:not(.itoko-content-image--portrait) {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        height: auto !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    body.single-gallery #gallery-content .pb-lg > img.itoko-server-image--landscape,
    body.single-gallery #gallery-content .pb-lg > img.itoko-content-image--landscape {
        display: block !important;
        width: calc(100% + 40px) !important;
        max-width: none !important;
        height: auto !important;
        margin-left: -20px !important;
        margin-right: -20px !important;
    }

    body.single-gallery #gallery-content .pb-lg .img_uneven,
    body.single-gallery #gallery-content .pb-lg .img_equal_horizon,
    body.single-gallery #gallery-content .pb-lg .img_equal_vertical {
        display: block !important;
        width: 100% !important;
    }

    body.single-gallery #gallery-content .pb-lg .img_uneven > div,
    body.single-gallery #gallery-content .pb-lg .img_equal_horizon > div,
    body.single-gallery #gallery-content .pb-lg .img_equal_vertical > div {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    body.single-gallery #gallery-content .pb-lg figure.itoko-content-figure--landscape figcaption {
        box-sizing: border-box;
        width: calc(100% - 40px) !important;
        max-width: none !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 0;
        padding-right: 0;
    }
}
