/* ギャラリーページのヒーローセクション調整 */
.hero {
    height: auto; /* 高さを自動調整 */
    min-height: 20vh;
    padding: 3rem 0;
}

.hero::after {
    display: none; /* グラデーションを非表示に */
}

.hero h2,
.hero p {
    text-shadow: none;
}

/* ギャラリーのグリッドレイアウト */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px 0; /* 上下のみパディング */
}

.grid-item {
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    overflow: hidden; /* 画像のはみ出しを防ぐ */
    background-color: #fff;
    text-align: left;
    transition: transform 0.3s, box-shadow 0.3s;
}

.grid-item img {
    width: 100%;
    height: 220px; /* 高さを固定 */
    object-fit: cover;
}

.grid-item h3,
.grid-item p {
    padding: 0 15px;
    margin: 10px 0 0;
}

.grid-item p {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
    margin-bottom: 15px;
}

/* --- Gallery Modal --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none; /* Initially hidden */
    justify-content: center;
    align-items: center;
    z-index: 30000; /* Higher than the reserve button */
    padding: 20px;
    box-sizing: border-box;
}

.modal-overlay.active {
    display: flex; /* Show modal */
}

.modal-content {
    position: relative;
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: zoomIn 0.3s ease;
}

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

#modalImage {
    max-width: 100%;
    max-height: 75vh; /* Limit image height */
    object-fit: contain;
    border-radius: 4px;
}

.modal-caption {
    padding-top: 15px;
    text-align: center;
    color: #333;
}

#modalTitle {
    margin: 0 0 5px 0;
    font-size: 1.2rem;
}

#modalDesc {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2.5rem;
    color: #333;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.2s;
    z-index: 1;
}

.modal-close:hover {
    transform: scale(1.2);
}


/* Make grid items clickable */
.grid-item {
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block; /* To make the whole area a link */
}

.grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.15);
}

