/* PREMIUM HERO WITH SLIDER */
.our-work-gallery .gallery-hero {
    background: #0d0d0d;
    color: white;
    padding: 160px 2rem 80px;
    position: relative;
    z-index: 1;
}

.our-work-gallery .hero-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 60px;
    align-items: center;
}

.our-work-gallery .text-green { color: #2ecc71; }

.our-work-gallery .hero-proof-badge {
    background: #2ecc71;
    color: white;
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 20px;
    display: inline-block;
    letter-spacing: 1px;
}

.our-work-gallery .gallery-hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
    font-weight: 900;
}

.our-work-gallery .gallery-hero-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.our-work-gallery .hero-cta-btn {
    background: #2ecc71;
    color: white;
    padding: 1.2rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 800;
    display: inline-block;
    transition: all 0.3s ease;
}

.our-work-gallery .hero-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(46, 204, 113, 0.4);
}

/* INTERACTIVE BEFORE/AFTER SLIDER */
.our-work-gallery .comparison-slider {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 40px 80px rgba(0,0,0,0.6);
    cursor: ew-resize;
}

.our-work-gallery .image-after, 
.our-work-gallery .image-before {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.our-work-gallery .image-before {
    width: 50%;
}

.our-work-gallery .slider-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    background: white;
    transform: translateX(-50%);
    z-index: 10;
}

.our-work-gallery .handle-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 54px;
    height: 54px;
    background: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 30px rgba(0,0,0,0.4);
    font-size: 20px;
    color: #333;
}

.our-work-gallery .label-before, 
.our-work-gallery .label-after {
    position: absolute;
    top: 20px;
    padding: 6px 14px;
    background: rgba(0,0,0,0.6);
    color: white;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    backdrop-filter: blur(4px);
    border-radius: 4px;
    z-index: 5;
}

.our-work-gallery .label-before { left: 20px; }
.our-work-gallery .label-after { right: 20px; }

@media (max-width: 968px) {
    .our-work-gallery .hero-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

/* PREMIUM FILTER SYSTEM */
.our-work-gallery .gallery-filters {
    background: #ffffff;
    padding: 1.5rem 1rem;
    position: sticky;
    top: 70px;
    z-index: 50; /* Below nav z-index */
    border-bottom: 1px solid #eaeaea;
    text-align: center;
}

.our-work-gallery .filter-container {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 1400px;
    margin: 0 auto;
}

.our-work-gallery .filter-btn {
    appearance: none;
    background: #ffffff;
    border: 1px solid #dddddd;
    border-radius: 100px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    color: #333333;
    cursor: pointer;
    transition: all 0.3s ease;
}

.our-work-gallery .filter-btn:hover {
    border-color: #111;
    transform: translateY(-1px);
}

.our-work-gallery .filter-btn.active {
    background: #111;
    color: #fff;
    border-color: #111;
}

@media (max-width: 640px) {
    .our-work-gallery .filter-btn {
        padding: 8px 18px;
        font-size: 13px;
    }
}


.our-work-gallery .gallery-section {
    padding: 2rem 1rem 4rem;
    background: white;
}

.our-work-gallery .gallery-grid {
    max-width: 935px; /* Instagram's standard width */
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Always 3 columns like Instagram */
    gap: 28px; /* Instagram's gap */
    transition: none; /* No transition on grid itself */
}

/* Desktop: 3 columns */
@media (min-width: 768px) {
    .our-work-gallery .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 28px;
    }
}

/* Tablet: 3 columns, smaller gap */
@media (min-width: 640px) and (max-width: 767px) {
    .our-work-gallery .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

/* Mobile: 3 columns, tight gap */
@media (max-width: 639px) {
    .our-work-gallery .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 4px; /* Instagram mobile */
    }
    
    .our-work-gallery .gallery-section {
        padding: 1rem 0 3rem;
    }
}

/* ============================================
   GALLERY ITEM CARDS (SMOOTH COLLAPSE)
   ============================================ */
.our-work-gallery .gallery-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    background: var(--gray-light);
    transition: opacity 0.15s ease, transform 0.15s ease;
    opacity: 1;
}

.our-work-gallery .gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* Hidden items removed from display - grid will collapse naturally */
.our-work-gallery .gallery-item.hidden {
    display: none;
}

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

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

/* Prevent CTA section from moving during filter transition */
.our-work-gallery .gallery-cta {
    background: linear-gradient(135deg, var(--green) 0%, #006400 100%);
    color: white;
    text-align: center;
    padding: 4rem 2rem;
    /* Force GPU acceleration for smoother rendering */
    transform: translateZ(0);
    will-change: auto;
}

/* Enhanced overlay */
.our-work-gallery .gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 100%);
    padding: 1.25rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

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

.our-work-gallery .gallery-caption {
    color: white;
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.our-work-gallery .gallery-location {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8125rem;
    margin-bottom: 0.5rem;
}

.our-work-gallery .gallery-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================
   ENHANCED LIGHTBOX (IMPROVED VERSION)
   ============================================ */
.our-work-gallery .lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.96);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

.our-work-gallery .lightbox.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.our-work-gallery .lightbox-content {
    max-width: 85vw;
    max-height: 85vh;
    position: relative;
    animation: slideUp 0.4s ease;
    padding: 0 1rem;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.our-work-gallery .lightbox-image {
    max-width: 100%;
    max-height: 70vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 25px 75px rgba(0, 0, 0, 0.6);
    display: block;
    margin: 0 auto;
}

.our-work-gallery .lightbox-info {
    text-align: center;
    margin-top: 1rem;
    color: white;
    padding: 0 1rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.our-work-gallery .lightbox-caption {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
}

.our-work-gallery .lightbox-location {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.625rem;
}

.our-work-gallery .lightbox-badge {
    display: inline-block;
    background: var(--green);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.375rem 1rem;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Lightbox Controls */
.our-work-gallery .lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.our-work-gallery .lightbox-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg);
}

.our-work-gallery .lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.our-work-gallery .lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%) scale(1.1);
}

.our-work-gallery .lightbox-prev {
    left: -70px;
}

.our-work-gallery .lightbox-next {
    right: -70px;
}

@media (max-width: 768px) {
    .our-work-gallery .lightbox-content {
        max-width: 95vw;
        max-height: 90vh;
        padding: 0 0.5rem;
    }
    
    .our-work-gallery .lightbox-image {
        max-height: 60vh;
        border-radius: 6px;
    }
    
    .our-work-gallery .lightbox-info {
        margin-top: 0.75rem;
    }
    
    .our-work-gallery .lightbox-caption {
        font-size: 1rem;
    }
    
    .our-work-gallery .lightbox-location {
        font-size: 0.875rem;
    }
    
    .our-work-gallery .lightbox-badge {
        font-size: 0.6875rem;
        padding: 0.3rem 0.75rem;
    }
    
    .our-work-gallery .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    
    .our-work-gallery .lightbox-prev {
        left: 10px;
    }
    
    .our-work-gallery .lightbox-next {
        right: 10px;
    }
    
    .our-work-gallery .lightbox-close {
        top: 10px;
        right: 10px;
    }
}

/* ============================================
   CTA SECTION
   ============================================ */
.our-work-gallery .gallery-cta h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin-bottom: 1rem;
}

.our-work-gallery .gallery-cta p {
    font-size: 1.125rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.our-work-gallery .cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.our-work-gallery .btn {
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

.our-work-gallery .btn-primary {
    background: white;
    color: var(--green);
}

.our-work-gallery .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.our-work-gallery .btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.our-work-gallery .btn-secondary:hover {
    background: white;
    color: var(--green);
}

/* ============================================
   LOADING STATE
   ============================================ */
.our-work-gallery .gallery-loading {
    text-align: center;
    padding: 3rem;
    color: var(--gray-dark);
}

.our-work-gallery .spinner {
    border: 3px solid rgba(0, 128, 0, 0.1);
    border-top: 3px solid var(--green);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
