/**
 * Gallery & Portfolio Styles
 * Masonry Grid Layout for Portfolio Pages
 */

/* Portfolio Page Container */
.portfolio-page {
    padding: 140px var(--spacing-2xl) 100px;
    background: #fff;
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 80px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.page-title {
    font-family: var(--font-heading);
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 500;
    letter-spacing: -0.5px;
    margin-bottom: var(--spacing-lg);
    color: var(--primary-color);
}

.page-subtitle {
    font-size: 17px;
    color: var(--light-text);
    max-width: 650px;
    margin: 0 auto var(--spacing-xl);
    line-height: 1.8;
    font-weight: 400;
}

/* Masonry Grid Layout */
.masonry-grid {
    column-count: 3;
    column-gap: 20px;
    max-width: var(--breakpoint-wide);
    margin: 0 auto;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background: var(--bg-light);
    margin-bottom: 20px;
    break-inside: avoid;
    display: inline-block;
    width: 100%;
    border-radius: 0;
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    filter: brightness(0.98);
}

.gallery-item:hover img {
    transform: scale(1.04);
    filter: brightness(1);
}

/* Lightbox Styles */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: transparent;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    transition: opacity 0.3s ease;
    opacity: 0.7;
}

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

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: white;
    font-size: 40px;
    cursor: pointer;
    padding: 20px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.lightbox-nav:hover {
    opacity: 1;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* Responsive */
@media (max-width: 1200px) {
    .masonry-grid {
        column-count: 2;
        column-gap: 16px;
    }

    .gallery-item {
        margin-bottom: 16px;
    }
}

@media (max-width: 768px) {
    .portfolio-page {
        padding: 120px var(--spacing-md) 60px;
    }

    .page-header {
        margin-bottom: 50px;
    }

    .masonry-grid {
        column-count: 1;
        column-gap: 0;
    }

    .gallery-item {
        margin-bottom: 12px;
    }

    .lightbox-nav {
        font-size: 30px;
        padding: 10px;
    }

    .lightbox-prev {
        left: 10px;
    }

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