@charset "utf-8";

/* youtube-modal.css */
/* --- Modal base --- */
.video-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    /* 生成直後にフェードイン */
    opacity: 0;
    transition: opacity .3s ease;
}

.video-modal.is-open {
    opacity: 1;
}

.video-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .75);
}

.video-modal__dialog {
    position: relative;
    width: min(80vw, 1200px);
    aspect-ratio: 16 / 9;
    /* 16:9 でリサイズ */
    background: #000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
    overflow: hidden;
}

/* iframe を完全フィット */
.video-modal__frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* 右上の閉じるボタン */
/* 右上固定 */
.video-modal__close {
    position: fixed;
    top: 40px;
    right: 40px;
    z-index: 10000;
    width: 44px;
    height: 44px;
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
}

/* 2本の白線で “×” を描画 */
.video-modal__close::before,
.video-modal__close::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 80px;
    /* 線の長さ（ボタン比） */
    height: 1px;
    /* 線の太さ */
    background: #fff;
    border-radius: 2px;
    transform-origin: 50% 50%;
    transform: translate(-50%, -50%) rotate(45deg);
}

.video-modal__close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.video-modal__close:hover {
    background: transparent;
}

.video-modal__close:focus {
    outline: none;
    box-shadow: none;
}

/* iOS のセーフエリアに対応（このブロックは上記の後に置く） */
@supports (top: env(safe-area-inset-top)) {
    .video-modal__close {
        top: calc(env(safe-area-inset-top) + 40px);
        right: calc(env(safe-area-inset-right) + 40px);
    }
}


/* モーダル表示中は背景スクロール禁止 */
body.is-video-modal-open {
    overflow: hidden;
}



@media screen and (max-width:1199px) and (min-width:601px) {

    /* --- Modal base --- */
    .video-modal {
        position: fixed;
        inset: 0;
        z-index: 9999;
        display: grid;
        place-items: center;
        /* 生成直後にフェードイン */
        opacity: 0;
        transition: opacity .3s ease;
    }


    .video-modal__dialog {
        position: relative;
        width: min(calc(100vw - 80px), 1200px);
        aspect-ratio: 16 / 9;
        /* 16:9 でリサイズ */
        background: #000;
        box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
        overflow: hidden;
    }


    /* 右上の閉じるボタン */
    /* 右上固定 */
    .video-modal__close {
        position: fixed;
        top: 30px;
        right: 30px;
        z-index: 10000;
        width: 44px;
        height: 44px;
        appearance: none;
        -webkit-appearance: none;
        border: 0;
        border-radius: 50%;
        background: transparent;
        cursor: pointer;
    }

    /* 2本の白線で “×” を描画 */
    .video-modal__close::before,
    .video-modal__close::after {
        content: "";
        position: absolute;
        left: 50%;
        top: 50%;
        width: 55px;
        /* 線の長さ（ボタン比） */
        height: 1px;
        /* 線の太さ */
        background: #fff;
        border-radius: 2px;
        transform-origin: 50% 50%;
        transform: translate(-50%, -50%) rotate(45deg);
    }

    .video-modal__close::after {
        transform: translate(-50%, -50%) rotate(-45deg);
    }

    .video-modal__close:hover {
        background: transparent;
    }

}

@media screen and (max-width:600px) {

    .video-modal__dialog {
        position: relative;
        width: 100vw;
        aspect-ratio: 16 / 9;
        /* 16:9 でリサイズ */
        background: #000;
        box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
        overflow: hidden;
    }

    /* 右上の閉じるボタン */
    /* 右上固定 */
    .video-modal__close {
        position: fixed;
        top: 14px;
        right: 14px;
        z-index: 10000;
        width: 44px;
        height: 44px;
        appearance: none;
        -webkit-appearance: none;
        border: 0;
        border-radius: 50%;
        background: transparent;
        cursor: pointer;
    }

    /* 2本の白線で “×” を描画 */
    .video-modal__close::before,
    .video-modal__close::after {
        content: "";
        position: absolute;
        left: 50%;
        top: 50%;
        width: 38px;
        /* 線の長さ（ボタン比） */
        height: 1px;
        /* 線の太さ */
        background: #fff;
        border-radius: 2px;
        transform-origin: 50% 50%;
        transform: translate(-50%, -50%) rotate(45deg);
    }

    .video-modal__close::after {
        transform: translate(-50%, -50%) rotate(-45deg);
    }

    .video-modal__close:hover {
        background: transparent;
    }
}