@charset "UTF-8";

:root{
    --close-btn-size:45px;
}

/**
 * モーダル用スタイル
 * modal.css
 */

/* モーダル背景 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal.active {
    display: block;
}

/* モーダルコンテンツのラッパー */
.modal-wrapper {
    min-height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* モーダルコンテンツ */
.modal-content {
    background: var(--base-color);
    border-radius: 12px;
    max-width: 1024px;
    width: 90%;
    position: relative;
    top: 0;
    text-align: center;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ★ 動画がない場合のスタイル */
.modal-content.no-video {
    height: auto;
    max-height: 90vh;
    overflow-y: visible;
}

.modal-content.no-video .modal-wrapper {
    overflow: visible;
}

.modal-content.no-video #modal-container {
   height:90vh;
}

/* 閉じるボタン */
.close-btn {
    position: sticky;
    top: 8px;
    right: 0;
    float: right;
    font-family: sans-serif;
    font-size: 1.5em;
    font-weight:800;
    background: rgba(255, 255, 255, 0.7);
    border: none;
    cursor: pointer;
    z-index: 10;
    width: var(--close-btn-size);
    height: var(--close-btn-size);
    border-radius: 50%;
}

.close-btn:hover {
    background: rgba(200, 200, 200, 0.7);
}

/* モーダル内コンテナ */
#modal-container {
    position: relative;
    top: calc(var(--close-btn-size) * -1.2);
    clear: both;
    padding-top: 10px;
    padding-bottom: 20px;
    height : 100%;
}

#modal-texts{
    width: 30%;
    max-height:90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: 0;
    padding: 10px 0 20px;
}

#modal-texts h3{
    font-size: 1.5em;
    font-weight: 800;
    /* text-transform: uppercase; */
    margin: auto;
}

#modal-texts p{
    font-size: 1em;
    font-weight: 600;
    padding: 0 20px;
    margin: 0;
}

#modal-link{
    list-style-type: none;
    display: flex;
    justify-content: center;
    margin: 0 auto;
    padding: 0;
}

#modal-link li{
    display: inline-block;
}

#modal-link img{
    width: 50px;
    height: 50px;
    margin:0 10px;
    border-radius: 2px;
    filter: invert(19%) sepia(20%) saturate(0%) hue-rotate(215deg) brightness(105%) contrast(103%);
}

.hidden {
    display: none;
}

/* モーダル画像 */
#modal-images{
    width: 70%;
    display: flex;
    margin: 0 auto;
}

.modal-content img {
    width: 50%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 10px;
    margin-bottom: 15px;
}

#modal-images.modal-singleimg img{
    width: 90%;
    max-width:fit-content;
    height: fit-content;
    border-radius: 10px;
    margin: auto;
}

.modal-content.no-video img {
    max-height: 85vh;
}

.modal-content .fd-column img{
    width: 95%;
    margin-top: 10px;
}

/* Youtube埋め込み用 */
#modal-video{
    width: calc(100% - 28px);
    margin: 0 8px 20px 20px;
}

#modal-video.hidden{
    display: none;
    position: relative;
    bottom: 30px;
    margin: 0;
}

/* ローディング用 */
#modal-loading {
    margin: 10px auto;
    position: relative;
    bottom: 20px;
}


/* WebKit系ブラウザ用スクロールバー */
.modal-content::-webkit-scrollbar {
    width: 12px;
}

.modal-content::-webkit-scrollbar-track {
    background: #ffffff;
    border-radius: 6px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 6px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Firefox用スクロールバー */
.modal-content html {
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

/* レスポンシブ対応 */
@media (max-width: 480px) {
    #modal-images{
        flex-direction: column;
        align-items: center;
    }
    #modal-images img {
        width:100%;
    }
}

@media (max-width: 780px) {
    .modal-wrapper {
        padding: 10px;
        align-items: flex-start;
    }

    .modal-content {
        max-width: 100%;
        padding: 5px;
        border-radius: 8px;
        max-height: none;
        margin: 20px 0;
    }
    
    /*　動画がない場合のレスポンシブ表示 */
    .modal-content.no-video {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-content.no-video .modal-wrapper {
        overflow:scroll;
    }

    #modal-container{
        flex-direction: column;
    }
    
    #modal-texts{
        width: 95%;
        margin: 0 auto;
    }
    
    #modal-images{
        width: 95%;
        margin: 0 auto;
    }

    #modal-video{
        width: 100%;
        margin: 0 auto 20px;
    }

    .modal-content.no-video #modal-container {
        height:auto;
        max-height: auto;
    }
}

/* iOS Safariの慣性スクロール対応 */
@supports (-webkit-touch-callout: none) {
    .modal {
        -webkit-overflow-scrolling: touch;
    }
}