/* --- GLOBALS & HERO --- */
.work-hero {
    background-color: #f4f6f8;
    padding: 80px 20px;
    text-align: center;
    border-bottom: 1px solid #eaeaea;
}

.hero-content h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-content p {
    font-size: 1.1rem;
    color: #555;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* --- FILTER BUTTONS --- */
.portfolio-container {
    padding: 60px 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.portfolio-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 40px;
}

.filter-btn {
    background-color: transparent;
    border: 2px solid #2c3e50;
    color: #2c3e50;
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover, 
.filter-btn.active {
    background-color: #2c3e50;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(44, 62, 80, 0.2);
}

/* --- GALLERY GRID --- */
.portfolio-grid {
    display: grid;
    /* This creates a responsive masonry-like grid automatically */
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

.portfolio-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background: #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    /* For the filtering animation */
    transition: transform 0.4s ease, opacity 0.4s ease;
}

/* Class added by JS when filtering out items */
.portfolio-item.hide {
    display: none;
    opacity: 0;
    transform: scale(0.8);
}

.portfolio-item img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

/* Image Zoom on hover */
.portfolio-item:hover img {
    transform: scale(1.08);
}

/* --- HOVER OVERLAY --- */
.portfolio-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 50%, rgba(0,0,0,0) 100%);
    display: flex;
    align-items: flex-end;
    padding: 30px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

.overlay-text {
    color: white;
    transform: translateY(20px);
    transition: transform 0.4s ease;
}

.portfolio-item:hover .overlay-text {
    transform: translateY(0);
}

.overlay-text h3 {
    margin: 0 0 5px 0;
    font-size: 1.3rem;
    font-weight: 700;
}

.overlay-text p {
    margin: 0;
    font-size: 0.9rem;
    color: #4facfe; /* Accent color */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- LIGHTBOX MODAL --- */
.lightbox {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.show {
    opacity: 1;
}

.lightbox-content {
    max-width: 90%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.lightbox.show .lightbox-content {
    transform: scale(1);
}

#lightbox-caption {
    margin-top: 15px;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 1px;
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 40px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: #4facfe;
    text-decoration: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .portfolio-filters {
        gap: 10px;
    }
    .filter-btn {
        padding: 6px 15px;
        font-size: 0.85rem;
    }
    .portfolio-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    .portfolio-item img {
        height: 280px;
    }
    .lightbox-close {
        top: 15px;
        right: 20px;
    }
}