/* ギャラリーモーダル用CSS */

/* ギャラリー一覧のキャプション */
.gallery-item {
    display: flex !important;
    flex-direction: column;
}

.gallery-title {
    margin: 0 !important;
    padding: 8px 4px;
    font-size: 14px;
    line-height: normal !important;
}

/* モーダルオーバーレイ */
.gallery-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s;
}

.gallery-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* モーダルコンテンツ */
.gallery-modal__content {
    position: relative;
    margin: auto;
    padding: 0;
    max-width: 90%;
    max-height: 90vh;
    animation: zoomIn 0.3s;
}

.gallery-modal__image {
    width: 100%;
    height: auto;
    max-height: 90vh;
    object-fit: contain;
}

/* 閉じるボタン */
.gallery-modal__close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    transition: 0.3s;
    background: none;
    border: none;
    padding: 0;
    width: 50px;
    height: 50px;
    line-height: 50px;
    text-align: center;
}

.gallery-modal__close:hover,
.gallery-modal__close:focus {
    color: #bbb;
}

/* 前へ・次へボタン */
.gallery-modal__prev,
.gallery-modal__next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    padding: 16px;
    color: white;
    font-weight: bold;
    font-size: 30px;
    transition: 0.3s;
    user-select: none;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    z-index: 10001;
}

.gallery-modal__prev {
    left: 0;
    border-radius: 0 3px 3px 0;
}

.gallery-modal__next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.gallery-modal__prev:hover,
.gallery-modal__next:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* キャプション */
.gallery-modal__caption {
    text-align: center;
    color: #fff;
    padding: 10px 0;
    font-size: 20px;
}

/* アニメーション */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomIn {
    from { transform: scale(0.8); }
    to { transform: scale(1); }
}

/* レスポンシブ */
@media (max-width: 768px) {
    .gallery-modal__close {
        top: 10px;
        right: 20px;
        font-size: 30px;
    }
    
    .gallery-modal__prev,
    .gallery-modal__next {
        font-size: 20px;
        padding: 10px;
    }
    
    .gallery-modal__content {
        max-width: 95%;
    }

    .gallery-modal__caption {
        font-size: 16px;
    }
}
