/**
 * .custom-modal の右上に表示する閉じるボタン(×)
 * JS（custom-modal-close.js）で動的に挿入される .custom-modal-close を装飾
 */

/* モーダル本体には close ボタンを配置する基準 */
.custom-modal {
    position: relative;
}

.custom-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: transparent;
    color: #1d3d82;
    cursor: pointer;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, color 0.2s ease;
    border-radius: 50%;
    z-index: 10;
}

.custom-modal-close:hover {
    background: rgba(29, 61, 130, 0.08);
}

.custom-modal-close:focus-visible {
    outline: 2px solid #1d3d82;
    outline-offset: 2px;
}

.custom-modal-close > span {
    font-size: 35px;
    font-weight: 300;
    line-height: 1;
    display: inline-block;
    transform: translateY(-1px);
}

@media screen and (max-width: 768px) {
    /* 親セレクタ .js-modal-overlay を挟んで specificity を上げて元スタイルを打ち消す */
    .js-modal-overlay .custom-modal {
        max-height: 80vh;
        overflow-y: auto;
    }
    .js-modal-overlay .custom-modal-close {
        top: 8px;
        right: 8px;
        width: 32px;
        height: 32px;
    }
    .js-modal-overlay .custom-modal-close > span {
        font-size: 28px;
    }
}
