/* Gallery Specific Styles */

.gallery-hero {
    background: linear-gradient(135deg, var(--primary-mist) 0%, var(--primary-sand) 100%);
    padding: 5rem 0 3rem;
    text-align: center;
}

.page-title {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-clay);
    margin-bottom: 1rem;
}

.page-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 300;
}

/* Gallery Filters */
.gallery-filters {
    background: white;
    padding: 2rem 0;
    position: sticky;
    top: 76px;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--primary-mist);
    color: var(--text-primary);
    padding: 0.7rem 1.5rem;
    border: 2px solid transparent;
    border-radius: 24px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    font-size: 0.95rem;
}

.filter-btn:hover {
    background: var(--primary-sand);
    border-color: var(--primary-earth);
}

.filter-btn.active {
    background: var(--primary-earth);
    color: white;
    border-color: var(--primary-earth);
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 3rem 0;
}

.gallery-item {
    position: relative;
    border-radius: 12px;
    cursor: pointer;
    aspect-ratio: 4/3;
    background: var(--primary-mist);
}

.gallery-item img {
    border-radius: 12px;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

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

.gallery-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 60%);
    opacity: 0;
    transition: opacity var(--transition-base);
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
    z-index: 1;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-caption {
    color: white;
    font-size: 1rem;
    font-weight: 500;
}

/* Masonry Layout Variation */
.gallery-grid.masonry {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    grid-auto-rows: 20px;
}

.gallery-grid.masonry .gallery-item {
    aspect-ratio: auto;
}

.gallery-grid.masonry .gallery-item:nth-child(3n+1) {
    grid-row-end: span 12;
}

.gallery-grid.masonry .gallery-item:nth-child(3n+2) {
    grid-row-end: span 15;
}

.gallery-grid.masonry .gallery-item:nth-child(3n+3) {
    grid-row-end: span 10;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    animation: scaleIn 0.3s ease;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-caption {
    color: white;
    text-align: center;
    padding: 1rem;
    font-size: 1.1rem;
    margin-top: 1rem;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    font-size: 2rem;
    padding: 1rem 1.2rem;
    cursor: pointer;
    transition: var(--transition-base);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-close {
    top: 2rem;
    right: 2rem;
}

.lightbox-prev {
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
}

/* Filter Animation */
.gallery-item.filter-hidden {
    animation: filterOut 0.3s ease forwards;
}

.gallery-item.filter-visible {
    animation: filterIn 0.5s ease forwards;
}

@keyframes filterOut {
    to {
        opacity: 0;
        transform: scale(0.8);
    }
}

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

/* Responsive Gallery */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .lightbox-prev,
    .lightbox-next {
        padding: 0.8rem 1rem;
        font-size: 1.5rem;
    }
    
    .lightbox-close {
        top: 1rem;
        right: 1rem;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 2rem;
    }
    
    .filter-buttons {
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}
