@charset "utf-8";
/* CSS Document */
/*〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓
モーダル
〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓*/

/* <!-- モーダル -->
<div class="modal-open">
    <div>モーダル起動対象</div>
</div>
<!-- モーダル -->
<div class="modal-container">
    <!-- モーダル内容 -->
    <div class="modal-body">
        <!-- 閉じる -->
        <div class="modal-close"><span>閉じる</span></div>
        <!-- /閉じる -->
        <div class="modal-content">
            <p>モーダルの内容</p>
        </div>
    </div>
</div>
<!-- /モーダル --> */

.modal-container {
    opacity: 0;
    visibility: hidden;
    /* 初期状態で非表示 */
    position: fixed;
    top: 0;
    left: 0;
    padding: 6rem;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    z-index: 9999;
    transition: 0.3s;
    overflow-y: scroll;
    box-sizing: border-box;
    /* overflowスクロールバーカスタム */
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.3) rgba(0, 0, 0, 0.1);
}

/* overflowスクロールバーカスタム */
.modal-container::-webkit-scrollbar {
    width: 0.8rem;
    background-color: rgba(0, 0, 0, 0.1);
}

.modal-container::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.3);
}

.modal-container.active {
    opacity: 1;
    visibility: visible;
    /* activeクラスが付与されたときに表示 */
}

/* 閉じるボタン */
.modal-close {
    cursor: pointer;
    position: absolute;
    top: 0;
    right: 0;
    font-size: 0;
    background-color: #000;
    border-radius: 999px;
    width: 4.2rem;
    aspect-ratio: 1/1;
    transform: translate(40%, -40%);
}

.modal-close::after,
.modal-close::before {
    content: "";
    display: block;
    position: absolute;
    width: 50%;
    height: 1px;
    background-color: #fff;
    top: 50%;
    left: 50%;
    margin: auto;
}

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

.modal-close::before {
    transform: translate(-50%, 50%) rotate(-45deg);
}

@media screen and (max-width: 480px) {
    .modal-container {
        padding: 2rem;
        scrollbar-width: none;
    }

    .modal-container::-webkit-scrollbar {
        width: 0;
    }

    /* 閉じるボタン */
    .modal-close {
        width: 3.2rem;
    }
}

/*--------------------*/
/* モーダルの中身 */
.modal-body {
    position: relative;
    background: #fff;
    padding: 3rem;
    width: 90%;
    margin: 3rem auto;
    box-sizing: border-box;
}

.modal-body .modal-content {
    margin: auto;
}

@media screen and (max-width: 480px) {
    .modal-body {
        padding: 2rem;
        width: 96%;
        margin: 1rem auto;
    }
}
