/*ギャラリー個別ぺージ
===============================================*/
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    transition: opacity .3s;
}

.modal.is-active {
    display: flex;
}





.modal-close {
    position: absolute;
    bottom: 0;
    right: clamp(0.625rem, 0.294rem + 1.47vw, 1rem);
    /*10,16-360,768*/
    font-size: clamp(1.5rem, 1.038rem + 2.05vw, 2.5rem);
    /*24,40-360,1140*/
    color: #888;
    background: transparent;
    border: none;
    cursor: pointer;
    line-height: 1;
    z-index: 1;
}

.call-modal {
    display: inline-block;
}

/* .call-modal:hover {
    background: #005fa3;
} */

/* iframeのサイズ調整 */


/*サイズ*/
body {
    margin: 0;
    padding: 0;
}

.modal-inner {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 1040px;
    max-height: 990px;
}

iframe#modal-iframe {
    display: block;
    background: #fff;
    border-radius: 8px;
    width: calc(100vw - 10vw);
    max-width: 883px;
    max-height: 893px;
    aspect-ratio: 100 / 95;
    position: relative;
}

.height_smallimage iframe#modal-iframe {
    /*小画像のないギャラリーのA要素にはクラス smallimage　をつける*/
    aspect-ratio: 100 / 72;
}

/* ---------- モーダルコンテンツ ---------- */
.modal-content {
    width: calc(100% - (clamp(0.625rem, 0.294rem + 1.47vw, 1rem) * 2));
    /*10,16-360,768*/
    margin: clamp(0.625rem, 0.294rem + 1.47vw, 1rem) clamp(0.625rem, 0.294rem + 1.47vw, 1rem) 0 clamp(0.625rem, 0.294rem + 1.47vw, 1rem);
    font-size: 0;
    container-type: inline-size;

    /*10,16-360,768 3つ*/
    .big-image {
        img {
            width: 100%;
            padding-bottom: clamp(0.625rem, 0.294rem + 1.47vw, 1rem);
            /*10,16-360,768*/
            margin: 0;
            font-weight: normal;
        }
    }

    .small-images {
        display: flex;

        a {
            width: calc((100% - (clamp(0.625rem, 0.294rem + 1.47vw, 1rem) * 2)) / 3);
            margin-right: clamp(0.625rem, 0.294rem + 1.47vw, 1rem);

            /*10,16-360,768*/
            img {
                width: 100%;
            }
        }
    }

    .small-images a:last-child {
        margin-right: 0;
    }

    h3 {
        width: 90%;
        padding-left: 1em;
        position: absolute;
        bottom: 0.5em;
        left: 0;
        margin: 0;
        font-size: clamp(10px, 4cqw, 14px);
        font-weight: 400;
        line-height: 1em;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        overflow: hidden;
        max-height: 2em;
        margin-bottom: 0.2em;
    }
}

/**********************************************/
/* タブレット・PC（通常） */
@media (min-width: 768px) {
    iframe#modal-iframe {
        max-height: calc(100vh - 10vh);
        aspect-ratio: 100 / 95;
    }
}

/* タブレット・PC（ウィンドウが極端に横長＝高さが狭い場合） */
/* ← ここを 900px にしています */
@media (min-width: 768px) and (max-height: 900px) {
    iframe#modal-iframe {
        /* border: rgb(56, 53, 242) 5px solid; */
        width: calc(100vh - 10vh);
        max-width: 100vw;
    }
}


/**以下2つ　背景スクロール対策*/
html:has(dialog[open]) {
    overflow: hidden;
}

html:has(.modal.is-active) {
    overflow: hidden;
}