/* --- Page Banner --- */
.page-banner.gallery-banner {
    background: url('https://images.unsplash.com/photo-1534438327276-14e5300c3a48?q=80&w=2070&auto=format&fit=crop') no-repeat center center/cover;
}

/* --- Filter Buttons --- */
.gallery-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 40px;
}

.filter-btn {
    background: transparent;
    color: var(--text-light);
    border: 2px solid #444;
    padding: 8px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 1rem;
    transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
}

/* --- Masonry Grid Layout --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    grid-auto-rows: 250px;
    gap: 15px;
}

.gallery-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
}

/* Creating masonry varying sizes */
.gallery-item.tall {
    grid-row: span 2;
}

.gallery-item.wide {
    grid-column: span 2;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 87, 34, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.gallery-overlay i {
    font-size: 3rem;
    color: #fff;
}

@media (max-width: 768px) {
    .gallery-item.wide {
        grid-column: span 1;
        /* Reset on mobile */
    }
}

/* --- Lightbox / Modal --- */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border: 2px solid var(--accent-primary);
    border-radius: 5px;
    box-shadow: 0 0 30px rgba(255, 87, 34, 0.3);
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    transition: color 0.3s;
}

.lightbox-close:hover {
    color: var(--accent-primary);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 3rem;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 50%;
    transition: background 0.3s, color 0.3s;
}

.lightbox-nav:hover {
    background: var(--accent-primary);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

@media (max-width: 768px) {
    .lightbox-nav {
        font-size: 2rem;
        padding: 5px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }
}