/* Gallery Section */
.gallery-heading {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 5vw, 3rem);
    text-align: center;
    color: #2c3e50;
    margin: 3rem 0 2rem;
    padding: 0 2rem;
    text-decoration: underline;
}

.gallery-container {
    columns: 3 320px;
    column-gap: 1.5rem;
    padding: 0 2rem 4rem;
    max-width: 1200px;
    margin: 0 auto;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #d4d4d4;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover {
    transform: translateY(-5px);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: all 300ms cubic-bezier(0.455, 0.03, 0.515, 0.955);
}

.gallery-item:hover img {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    transform: scale(1.1);
}

/* Fullscreen Modal */
.gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.gallery-modal.active {
    opacity: 1;
    visibility: visible;
}

.gallery-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    animation: scaleUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-modal-img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.gallery-modal-content p {
    padding: 1rem;
    text-align: center;
    font-family: 'Times New Roman', Times, serif;
    color: #000000;
    border-bottom: none;
    background: #ffffff;
    font-size: 1rem;
    border-radius: 8px;
}

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

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    .gallery-container {
        columns: 2 240px;
        padding: 0 1rem 2rem;
    }
}

@media (max-width: 480px) {
    .gallery-container {
        columns: 2;
    }
    
    .gallery-item {
        margin-bottom: 1rem;
    }
}