/* モーダル背景 */
.image-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.image-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* モーダル画像 - 高さを固定、横幅は比率に応じて変動 */
.modal-image {
    height: 60vh;                    /* PC版：高さを固定 */
    width: auto;                      /* 横幅は自動（アスペクト比保持） */
    max-width: 90%;                   /* 横幅の上限 */
    object-fit: contain;              /* 画像全体を表示 */
    animation: zoomIn 0.3s ease;
}

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

/* 閉じるボタン */
.close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    font-weight: bold;
    color: #f1f1f1;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close:hover {
    color: #37ff00;
}

/* モーダル対応画像にカーソルポインター */
.modal-img {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.modal-img:hover {
    opacity: 0.8;
}

/* タブレット版 */
@media (max-width: 768px) {
    .modal-image {
        height: 50vh;                 /* タブレット：50vh */
        max-width: 90%;
    }

    .close {
        top: 10px;
        right: 15px;
        font-size: 28px;
    }
}

/* スマホ版 */
@media (max-width: 480px) {
    .modal-image {
        height: 40vh;                 /* スマホ：40vh */
        max-width: 95%;
    }

    .close {
        top: 8px;
        right: 12px;
        font-size: 24px;
    }
}