/* メインコンテンツのスタイル */
main {
    padding-top: 80px; /* ヘッダーの高さ分の余白 */
    min-height: calc(100vh - 80px);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
}

.content h1 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #2c5530;
    font-weight: bold;
}

.subtitle {
    text-align: center;
    color: #5d6c72;
    margin-bottom: 2rem;
    font-size: 1.2rem;
    line-height: 1.6;
}

.title {
    text-align: center;
    color: #2c5530;
    margin-top: 100px;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 2rem 0;
    margin: 0 5px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    aspect-ratio: 4/3;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item .caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    padding: 1rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .caption {
    transform: translateY(0);
}

/* モーダルスタイル */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.modal img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

.close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.prev, .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 2rem;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s ease;
}

.prev:hover, .next:hover {
    background: rgba(0, 0, 0, 0.8);
}

.prev {
    left: 20px;
}

.next {
    right: 20px;
}

.modal-caption {
    color: white;
    text-align: center;
    margin-top: 1rem;
    font-size: 1.2rem;
    padding: 0 20px;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .content h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }

    .text {
        margin-top: 50px;
    }
    
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .prev, .next {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    
    .prev {
        left: 10px;
    }
    
    .next {
        right: 10px;
    }
    
    .close {
        top: -35px;
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .content {
        padding: 40px 15px;
    }
    
    .content h1 {
        font-size: 1.8rem;
    }
    
    .gallery {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .gallery-item .caption {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
    
    .modal-content {
        max-width: 95%;
        max-height: 95%;
    }
}

/* タブレットサイズの調整 */
@media (max-width: 1024px) and (min-width: 769px) {
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 25px;
    }
}

/* 高解像度ディスプレイ用 */
@media (min-width: 1200px) {
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 30px;
    }
}