/* ===================================
   WORK PAGE STYLES
   =================================== */

/* Nav with background for work page */
nav {
    background: #1a1a1a;
    border-bottom: none;
}

/* Filters Wrapper */
.filters-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    padding: 100px var(--spacing-md) 8px;
    margin-bottom: 0;
}

/* Project Filters - Hierarchy */
.project-filters {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.filter-parent {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #e0e0e0;
}

.filter-projects {
    display: flex;
    gap: var(--spacing-md);
}

.filter-btn {
    font-family: var(--font-sans);
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: color var(--transition-fast), font-weight var(--transition-fast);
}

.filter-child {
    font-size: 0.78rem;
    color: #5a5a5a;
    padding: 0.3rem 0.5rem;
}

.filter-child:hover,
.filter-child.active {
    color: #e0e0e0;
    font-weight: 600;
}

/* Project Description */
.project-description {
    max-width: 900px;
    margin: 0 auto;
    padding: 4px var(--spacing-md) 32px;
    text-align: center;
}

.project-description p {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    line-height: 1.8;
    color: #b0b0b0;
}

/* Gallery Container */
.gallery-container {
    padding: 0 3rem var(--spacing-xl) 3rem;
}

.coming-soon {
    text-align: center;
    padding: var(--spacing-xl) 0;
}

.coming-soon p {
    font-family: var(--font-sans);
    font-size: 1.2rem;
    color: #6a6a6a;
    font-style: italic;
}

.project-gallery {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.75rem;
    margin-bottom: var(--spacing-xl);
}

.project-gallery.hidden {
    display: none;
}

/* Gallery Items - Golden Ratio */
.gallery-item {
    aspect-ratio: 1.618;
    overflow: hidden;
    background: var(--color-white);
    position: relative;
    opacity: 0;
    animation: fadeIn 0.6s ease-out forwards;
}

.gallery-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: 1;
}

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

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: pointer;
}

.gallery-item .image-caption {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 85%;
    color: #e0e0e0;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: 2;
}

.gallery-item:hover .image-caption {
    opacity: 1;
}

/* Staggered Animation */
.gallery-item:nth-child(1) { animation-delay: 0.05s; }
.gallery-item:nth-child(2) { animation-delay: 0.1s; }
.gallery-item:nth-child(3) { animation-delay: 0.15s; }
.gallery-item:nth-child(4) { animation-delay: 0.2s; }
.gallery-item:nth-child(5) { animation-delay: 0.25s; }
.gallery-item:nth-child(6) { animation-delay: 0.3s; }
.gallery-item:nth-child(7) { animation-delay: 0.35s; }
.gallery-item:nth-child(8) { animation-delay: 0.4s; }
.gallery-item:nth-child(9) { animation-delay: 0.45s; }
.gallery-item:nth-child(10) { animation-delay: 0.5s; }
.gallery-item:nth-child(11) { animation-delay: 0.55s; }
.gallery-item:nth-child(12) { animation-delay: 0.6s; }
.gallery-item:nth-child(13) { animation-delay: 0.65s; }
.gallery-item:nth-child(14) { animation-delay: 0.7s; }
.gallery-item:nth-child(15) { animation-delay: 0.75s; }
.gallery-item:nth-child(16) { animation-delay: 0.8s; }

/* Responsive */
@media (max-width: 1400px) {
    .project-gallery {
        grid-template-columns: repeat(6, 1fr);
    }

    .gallery-container {
        padding-left: 3rem;
    }
}

@media (max-width: 1024px) {
    .filters-wrapper {
        padding: 90px var(--spacing-md) 20px;
        margin-bottom: 0;
    }

    .project-description {
        padding: var(--spacing-md) var(--spacing-md) 20px;
    }

    .project-gallery {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.75rem;
    }

    .gallery-container {
        padding: 0 1.5rem var(--spacing-lg) 2rem;
    }

    .project-filters {
        flex-wrap: wrap;
        gap: var(--spacing-sm);
    }
}

@media (max-width: 768px) {
    .filters-wrapper {
        padding: 80px var(--spacing-sm) 16px;
        margin-bottom: 0;
    }

    .project-description {
        padding: var(--spacing-sm) var(--spacing-sm) 16px;
    }

    .project-description p {
        font-size: 0.9rem;
    }

    .project-gallery {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .gallery-container {
        padding: 0 1rem var(--spacing-md) 1.5rem;
    }

    .filter-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

@media (max-width: 480px) {
    .project-gallery {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-container {
        padding: 0 0.75rem var(--spacing-md) 1rem;
    }
}

/* Lightbox Modal */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    z-index: 3000;
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-image {
    height: 87vh;
    width: auto;
    object-fit: contain;
    transition: opacity 0.6s ease-in-out;
}

.lightbox-top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.75rem;
    z-index: 3001;
}

.lightbox-counter {
    font-family: var(--font-sans);
    font-size: 1rem;
    color: #e0e0e0;
}

.lightbox-close {
    background: none;
    border: none;
    color: #e0e0e0;
    font-size: 2.5rem;
    font-weight: 300;
    cursor: pointer;
    transition: opacity var(--transition-fast);
    line-height: 1;
    padding: 0;
}

.lightbox-close:hover {
    opacity: 0.7;
}

.lightbox-bottom-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.75rem;
    z-index: 3001;
}

.lightbox-caption {
    font-family: var(--font-sans);
    font-size: 1rem;
    color: #e0e0e0;
    text-align: center;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #808080;
    font-size: 2rem;
    cursor: pointer;
    transition: color var(--transition-fast);
    padding: 1rem;
    z-index: 3001;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    color: #b0b0b0;
}

.lightbox-prev {
    left: 0.25rem;
}

.lightbox-next {
    right: 0.25rem;
}

@media (max-width: 768px) {
    .lightbox-image {
        height: 75vh;
    }
    
    .lightbox-top-bar,
    .lightbox-bottom-bar {
        height: 50px;
        padding: 0 0.5rem;
    }
    
    .lightbox-close {
        font-size: 2rem;
    }
    
    .lightbox-counter,
    .lightbox-caption {
        font-size: 0.9rem;
    }
    
    .lightbox-prev,
    .lightbox-next {
        font-size: 1.8rem;
        padding: 0.75rem;
    }
    
    .lightbox-prev {
        left: 0;
    }
    
    .lightbox-next {
        right: 0;
    }
}