/* gallery.css - Updated for Simplified Layout */
.gallery-section {
    padding: calc(var(--header-height) + var(--space-xl)) 0 var(--space-xxl);
    background-color: var(--secondary-light);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-md);
    margin-top: var(--space-xl);
}

.gallery-item {
    height: 250px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    position: relative;
    box-shadow: 0 8px 25px var(--shadow-light);
    transition: var(--transition-normal);
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px var(--shadow-medium);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-normal);
}

.gallery-item:hover img {
    transform: scale(1.12);
}

.gallery-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(255, 0, 127, 0.4));
    opacity: 0;
    transition: var(--transition-normal);
}

.gallery-item:hover::after {
    opacity: 1;
}

.gallery-filters {
    display: flex;
    justify-content: center;
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.gallery-filter {
    padding: 10px 20px;
    background: var(--primary-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition-normal);
    font-weight: var(--font-weight-medium);
}

.gallery-filter.active,
.gallery-filter:hover {
    background: var(--accent-pink);
    color: white;
    border-color: var(--accent-pink);
}

.gallery-loading {
    text-align: center;
    padding: var(--space-xl);
    display: none;
}

.gallery-loading.active {
    display: block;
}

.gallery-no-results {
    text-align: center;
    padding: var(--space-xxl) var(--space-lg);
    display: none;
}

.gallery-no-results.active {
    display: block;
}

.gallery-no-results i {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

/* Mobile Optimizations for Gallery - 3 IMAGES PER ROW */
@media (max-width: 768px) {
    .gallery-section {
        padding: calc(var(--header-height) + var(--space-lg)) 0 var(--space-xl);
    }

    /* 3 columns for tablets and larger phones */
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr); /* Changed to 3 columns */
        gap: 6px; /* Smaller gap */
        margin-top: var(--space-lg);
    }
    
    .gallery-item {
        height: 110px; /* Smaller height for 3 columns */
        border-radius: var(--radius-md);
    }

    .gallery-filters {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: var(--space-sm);
        margin-bottom: var(--space-lg);
        gap: var(--space-xs);
        -webkit-overflow-scrolling: touch;
    }

    .gallery-filter {
        padding: 8px 14px;
        font-size: 13px;
        white-space: nowrap;
        flex-shrink: 0;
    }
}

@media (max-width: 480px) {
    .gallery-section {
        padding: calc(var(--header-height) + var(--space-md)) 0 var(--space-lg);
    }

    /* 3 columns for mobile phones */
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 columns on mobile */
        gap: 4px; /* Even smaller gap */
    }
    
    .gallery-item {
        height: 100px; /* Adjusted height for mobile */
        border-radius: var(--radius-sm);
    }

    .gallery-filters {
        gap: 4px;
        padding-bottom: 10px;
        margin-bottom: var(--space-md);
    }

    .gallery-filter {
        padding: 6px 10px;
        font-size: 11px;
        border-radius: var(--radius-md);
    }

    .gallery-loading {
        padding: var(--space-lg);
    }

    .gallery-no-results {
        padding: var(--space-xl);
    }

    .gallery-no-results i {
        font-size: 2.5rem;
    }
}

/* Extra small screens (below 360px) */
@media (max-width: 360px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr); /* Still 3 columns */
        gap: 3px;
    }
    
    .gallery-item {
        height: 90px; /* Smaller for very small screens */
    }

    .gallery-filter {
        padding: 5px 8px;
        font-size: 10px;
    }
}

/* Desktop hover effects only */
@media (hover: hover) {
    .gallery-item:hover {
        transform: translateY(-8px);
        box-shadow: 0 15px 35px var(--shadow-medium);
    }
    
    .gallery-item:hover img {
        transform: scale(1.12);
    }
    
    .gallery-item:hover::after {
        opacity: 1;
    }
}

/* Touch device adjustments */
@media (hover: none) {
    .gallery-item:active {
        transform: scale(0.98);
    }
    
    .gallery-item {
        cursor: pointer;
    }
}