/* Gallery - Clean Masonry Layout
----------------------------------------------------- */

/* Gallery Section */
.gallery-section {
    padding: var(--spacing-lg) 0;
    margin: 0;
    width: 100%;
    background-color: transparent; /* remove cream backdrop around tiles */
    position: relative;
    overflow: hidden;
}

.gallery-section .container {
    padding: 0 var(--spacing-md);
    margin: 0 auto;
    max-width: 1200px;
    width: 100%;
}

.gallery-section .section-title {
    margin-bottom: var(--spacing-md);
}

.gallery-section .gallery-filters {
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

/* Gallery Grid - Simple Masonry */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    grid-auto-rows: 50px;
    gap: 12px;
    margin: 0;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

/* Gallery Items */
.gallery-item {
    position: relative;
    border-radius: 12px; /* rounded corners per design */
    overflow: hidden;
    cursor: pointer;
    box-shadow: none; /* remove outer glow boundary */
    transition: transform 0.3s ease;
    border: none; /* remove thin edge that can appear as cream line */
    background: transparent;
    width: 100%;
    height: auto;
    display: block;
    margin: 0;
    padding: 0;
}

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

.gallery-item img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
    border-radius: inherit; /* match container rounding */
    object-fit: cover;
    max-width: 100%;
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
}

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

/* Caption overlay */
.gallery-item .gallery-caption {
    position: absolute;
    left: 0; 
    right: 0; 
    bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0.3), transparent);
    color: #fff;
    font-size: 0.8rem;
    padding: 0.75rem 0.5rem 0.5rem;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    border-radius: 0 0 12px 12px; /* follow rounded container */
}

.gallery-item:hover .gallery-caption { 
    opacity: 1; 
    transform: translateY(0); 
}

.gallery-item .gallery-caption h3 {
    margin: 0 0 0.25rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
}

.gallery-item .gallery-caption p {
    margin: 0;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.3;
}

/* Responsive Design */
@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 8px;
    }
    
    .gallery-section .container {
        padding: 0 var(--spacing-sm);
    }
}

@media (min-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 14px;
    }
    
    .gallery-item .gallery-caption {
        padding: 1rem 0.75rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .gallery-item .gallery-caption h3 {
        font-size: 1rem;
    }
    
    .gallery-item .gallery-caption p {
        font-size: 0.85rem;
    }
}

@media (min-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 16px;
    }
}
