/* ========================================
   MASONRY GALLERY SECTION STYLES
   ======================================== */

.gallery-section {
    margin: 4rem 0;
}

.gallery-section h2 {
    color: var(--primary-text-color);
    font-family: var(--font-family-custom);
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    margin-bottom: 1rem;
    position: relative;
    text-align: left;
    font-weight: normal;
    line-height: 1.3;
}

.gallery-section h2::after {
    content: '';
    position: absolute;
    bottom: -0.75rem;
    left: 0;
    width: 80px;
    height: 2px;
    background-color: var(--accent-color);
}

.gallery-section p {
    color: var(--secondary-text-color);
    line-height: 1.7;
    margin-bottom: 3rem;
    font-size: 1.1rem;
    font-weight: normal;
    max-width: 800px;
}

/* Masonry Gallery Layout */
.gallery-grid {
    columns: 4;
    column-gap: 1.5rem;
    margin: 2rem 0;
}

/* Gallery Items */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    break-inside: avoid;
    display: inline-block;
    width: 100%;
    margin-bottom: 1.5rem;
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(6, 148, 59, 0.25);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.4s ease;
    border-radius: var(--border-radius);
}

.gallery-item:hover img {
    transform: scale(1.08);
}

/* Gallery Overlay */
.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    color: white;
    padding: 2rem 1.5rem 1.5rem;
    transform: translateY(100%);
    transition: transform 0.4s ease;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

.gallery-overlay span {
    font-size: 1rem;
    font-weight: 500;
    font-family: var(--font-family-custom);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Gallery Item Aspect Ratios - Natural Flow */
.gallery-item--large {
    /* Large items will naturally take more space in masonry */
}

.gallery-item--wide {
    /* Wide items will span more columns naturally */
}

.gallery-item--tall {
    /* Tall items will naturally be taller in masonry */
}

.gallery-item:not(.gallery-item--large):not(.gallery-item--wide):not(.gallery-item--tall) {
    /* Standard items flow naturally */
}

/* Responsive Masonry Gallery */
@media (max-width: 1200px) {
    .gallery-grid {
        columns: 3;
        column-gap: 1.25rem;
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        columns: 2;
        column-gap: 1rem;
    }
    
    .gallery-item {
        margin-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        columns: 1;
        column-gap: 0;
    }
    
    .gallery-item {
        margin-bottom: 0.75rem;
    }
    
    .gallery-overlay {
        padding: 1.5rem 1rem 1rem;
    }
    
    .gallery-overlay span {
        font-size: 0.9rem;
    }
}