.gallery {
                    display: grid;
                    grid-template-columns: repeat(4, 1fr);
                    gap: 10px;
                    padding: 20px;
                }
        
.gallery-item {
    position: relative;
    height: 200px;
    background-color: #ddd;
    overflow: hidden;
}
        
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
        
.gallery-item .overlay {
    display: none;
    /* オーバーレイを非表示に */
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px;
    text-align: center;
}
        
.gallery-item .text {
    font-size: 16px;
}

/* モーダルのスタイル（index-2.html と同じ場合は共通化可能） */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
    margin: 15% auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80%;
    max-width: 700px;
}

.modal-content img {
    width: 100%;
    height: auto;
}

#caption {
    margin-top: 20px;
    color: #fff;
    text-align: center;
    font-size: 18px;
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}
/* ホバー効果を無効化 */
@media (hover: hover) and (pointer: fine) {
    .gallery-item:hover img {
        transform: none;
    }

    .gallery-item:hover .overlay {
        opacity: 1;
    }
}

/* タッチデバイス（SP）用のスタイル */
@media (hover: none) {
    .gallery-item .overlay {
        opacity: 1;
    }
}