/* ========================================
   СТРАНИЦА "ПОРТФОЛИО"
   ======================================== */

.portfolio-page {
    padding: 120px 5% 80px;
    position: relative;
    z-index: 1;
}

.portfolio-title {
    text-align: center;
    font-size: 48px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 60px;
}

.portfolio-title span {
    color: #60a5fa;
}

/* Галерея */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.gallery-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: #1e293b;
    border: 1px solid #334155;
    cursor: pointer;
    transition: all 0.4s;
}

.gallery-item:hover {
    transform: translateY(-8px);
    border-color: #3b82f6;
    box-shadow: 0 20px 35px rgba(0, 0, 0, 0.3);
}

.gallery-item img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    transition: transform 0.4s;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item p {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 15px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s;
}

@media (max-width: 768px) {
    .portfolio-title {
        font-size: 36px;
        margin-bottom: 40px;
    }
    .gallery {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .gallery-item img {
        height: 220px;
    }
}

/* ========================================
   ЛАЙТБОКС
   ======================================== */

.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(12px);
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 85vh;
    border-radius: 16px;
    border: 2px solid #3b82f6;
    box-shadow: 0 0 50px rgba(59, 130, 246, 0.3);
}

.lightbox .close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #ffffff;
    font-size: 3rem;
    cursor: pointer;
    transition: color 0.3s;
}

.lightbox .close:hover {
    color: #ef4444;
}

.lightbox .prev,
.lightbox .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #ffffff;
    font-size: 3rem;
    cursor: pointer;
    transition: color 0.3s;
    background: rgba(0, 0, 0, 0.5);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.lightbox .prev {
    left: 20px;
}

.lightbox .next {
    right: 20px;
}

.lightbox .prev:hover,
.lightbox .next:hover {
    color: #3b82f6;
    background: rgba(0, 0, 0, 0.8);
}

.lightbox-caption {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 25px;
    border-radius: 30px;
    font-size: 1rem;
    backdrop-filter: blur(10px);
    border: 1px solid #334155;
    color: #cbd5e1;
}

@media (max-width: 600px) {
    .lightbox .prev,
    .lightbox .next {
        width: 40px;
        height: 40px;
        font-size: 2rem;
    }
    .lightbox-caption {
        font-size: 0.85rem;
        padding: 8px 20px;
    }
}