@charset "utf-8";

.modal.gallery-modal {
    display: block !important;   /* 配置は常に維持 */

    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    
    width: auto !important;
    height: auto !important;

    padding: 0;
    box-sizing: border-box;
    
    /* 初期状態：透明でクリック不可 */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.gallery-modal-position {
    max-width: max-content;
    margin: auto;
    width: 100%;
    min-height: 100%;
    padding: 25px 15px;
    box-sizing: border-box;

    display: flex;
    align-items: center;
    justify-content: center;
}

/* 表示された時 */
.modal.gallery-modal.show {
    opacity: 1 !important;
    visibility: visible;
    pointer-events: auto; /* クリックを有効にする */
}

/* 中身の中央寄せ設定 */
.modal-dialog {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: calc(100% - 1rem);
}

body.modal-open {
    overflow: hidden !important;
    padding-right: 0 !important;
}

.modal-backdrop.fade.show {
    z-index: 9999;
}

.gallery-cate-box section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.gallery-cate-article {
    overflow: hidden;
}

.gallery-cate-box .btn01 {
    max-width: none;
    text-align: center;
    overflow: hidden;
}

.gallery-cate-box .btn01 p {
    word-break: keep-all;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.firstBox:nth-of-type(n+2) {
    display: none;
}

.gallery-box section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.modalBtn {
    width: 100%;
    max-width: none !important;
}

.gallery-img {
    cursor: pointer;
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
}

.gallery-img>img {
    width: 100%;
    height: 100% !important;
    object-fit: cover;
    transition: all.3s;
}

.gallery-img:hover>img {
    transform: scale(1.05);
}

.gallery-img>img+.noImg,
.gallery-modal-img>img+.noImg {
    display: none;
}

.webgene-pagination {
    grid-column: 1/3;
}

.gallery-modal {
    padding: 25px 15px;
}

.modal-area {
    max-width: 800px;
    width: 100%;
    margin: auto;
    max-height: 100%;
    padding: 25px 15px;
    box-sizing: border-box;
    background: url(/system_panel/uploads/images/body_bg.jpg) no-repeat center top /cover;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-area::-webkit-scrollbar {
    width: 12px;
}

.modal-area::-webkit-scrollbar-thumb {
    background: var(--secondary);
}

.modal-area::-webkit-scrollbar-track {
    background: var(--white);
}

.gallery-modal-img {
    width: 100%;
}

.gallery-modal-tit {
    margin: 20px 0 0;
}

.gallery-modal-txt {
    margin: 20px 0 0;
}

.gallery-modal .pdf {
    margin: 20px auto 0;
    text-align: center;
}

.modal-close-btn.btn01 {
    margin: 25px auto 0;
    text-align: center;
    background: var(--white);
    color: var(--primary);
    border: none;
    cursor: pointer;
    filter: drop-shadow(0 2px 6px rgba(16, 16, 16, .16));
}

.modal-close-btn.btn01:hover {
    background: var(--primary);
    color: var(--white);
}

@supports (-webkit-touch-callout: none) {
  .modal-close-btn.btn01:hover {
    background: var(--white);
    color: var(--primary);
  }
}

.modal-backdrop {
    z-index: 999999999;
}

.gallery-btn01 {
    padding: 5px;
    max-width: 250px;
    width: 100%;
    display: block;
    font-size: clamp(16px, 15.029px + 0.259vw, 20px);
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--secondary);
    background: var(--tertiary);
    border: 1px solid var(--secondary);
    position: relative;
    transition: all .3s;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .16));
}

.gallery-btn01-box {
    padding: 14px 10px 13px;
    text-align: center;
    border: 1px solid var(--secondary);
}

.gallery-btn01:hover {
    color: var(--white);
    background: var(--secondary);
}

.gallery-btn01:hover .gallery-btn01-box {
    border: 1px solid var(--tertiary);
}

.gallery-btn01.is-active {
    color: var(--white);
    background: var(--secondary);
    border: 1px solid var(--secondary);
}

.gallery-btn01.is-active .gallery-btn01-box {
    border: 1px solid var(--tertiary);
}


/* ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ */
/* ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ */
@media screen and (min-width: 576px) {

    .gallery-cate-box section {
        grid-template-columns: repeat(3, 1fr);
    }

    .gallery-box section {
        grid-template-columns: repeat(3, 1fr);
    }


    .webgene-pagination {
        grid-column: 1/4;
    }

    /*===========================================================

    ===========================================================*/

}

/* min-width: 576px ここまで */


/* ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ */
/* ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ */
@media screen and (min-width: 768px) {

    .gallery-cate-box section {
        grid-template-columns: repeat(4, 1fr);
    }

    .gallery-box section {
        gap: 25px;
    }

    .gallery-modal {
        padding: 45px 15px;
    }

    /* .modal-area {
        padding: 45px 35px;
    } */

    .gallery-modal-position {
        padding: 45px 15px;
    }

    .modal-area {
        max-height: calc(100dvh - 90px);
        padding: 45px 35px;
    }

    .gallery-modal-tit {
        margin: 40px 0 0;
    }

    .gallery-modal-txt {
        margin: 40px 0 0;
    }

    .gallery-modal .pdf {
        margin: 40px auto 0;
    }

    .modal-close-btn.btn01 {
        margin: 50px auto 0;
    }

    /*===========================================================

    ===========================================================*/

}

/* min-width: 768px ここまで */


/* ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ */
/* ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ */
@media screen and (min-width: 1024px) {

    .gallery-cate-box section {
        grid-template-columns: repeat(5, 1fr);
    }

    /*===========================================================

    ===========================================================*/

}

/* min-width: 1024px ここまで */