/* ============================================
   ZVPOL LIGHTBOX GALLERY CSS — ПОЛНАЯ ВЕРСИЯ
   Включает: Lightbox + Модульная сетка + Асимметричная сетка
   Версия: 2.0 (с асимметричной сеткой)
   ============================================ */

/* ============================================
   1. LIGHTBOX — МОДАЛЬНОЕ ОКНО
   ============================================ */

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
    align-items: center;
    justify-content: center;
}

/* Контейнер изображения */
.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

/* Изображение в полноэкранном режиме */
.lightbox-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Название изображения снизу */
.lightbox-caption {
    color: white;
    font-size: 18px;
    font-weight: 500;
    text-align: center;
    padding: 12px 24px;
    background: rgba(86,92,224, 0.9);
    border-radius: 8px;
    max-width: 80%;
    line-height: 1.4;
}

/* Кнопка закрытия */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid white;
    border-radius: 50%;
    color: white;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10000;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Стрелки навигации */
.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(86,92,224, 0.8);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(86,92,224, 1);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev:active,
.lightbox-next:active {
    transform: translateY(-50%) scale(0.95);
}

/* Счетчик изображений */
.lightbox-counter {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    font-size: 16px;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    border-radius: 20px;
    z-index: 10000;
}

/* ============================================
   2. МОДУЛЬНАЯ СЕТКА (SWISS DESIGN)
   ============================================ */

.zvpol-modular-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(4, 140px);
    gap: 16px;
    margin-bottom: 80px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.zvpol-modular-grid .grid-item-1 { grid-column: 1 / 5; grid-row: 1 / 3; }
.zvpol-modular-grid .grid-item-2 { grid-column: 5 / 9; grid-row: 1 / 3; }
.zvpol-modular-grid .grid-item-3 { grid-column: 9 / 13; grid-row: 1 / 3; }
.zvpol-modular-grid .grid-item-4 { grid-column: 1 / 7; grid-row: 3 / 5; }
.zvpol-modular-grid .grid-item-5 { grid-column: 7 / 10; grid-row: 3 / 5; }
.zvpol-modular-grid .grid-item-6 { grid-column: 10 / 13; grid-row: 3 / 5; }

.zvpol-modular-grid .gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.zvpol-modular-grid .gallery-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(86,92,224, 0.95), transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.zvpol-modular-grid .gallery-item:hover {
    transform: scale(1.03);
    z-index: 10;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.zvpol-modular-grid .gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.zvpol-modular-grid .gallery-item-title {
    color: white;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
}

.zvpol-modular-grid .gallery-item-description {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    text-align: center;
}

/* ============================================
   3. АСИММЕТРИЧНАЯ СЕТКА (CREATIVE)
   ============================================ */

.asymmetric-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 200px 300px;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto 80px;
    padding: 0 24px;
}

/* Позиционирование блоков асимметричной сетки */
.asymmetric-grid .asym-item-1 {
    grid-column: 1;
    grid-row: 1 / 3;
}

.asymmetric-grid .asym-item-2 {
    grid-column: 2;
    grid-row: 1;
}

.asymmetric-grid .asym-item-3 {
    grid-column: 3;
    grid-row: 1;
}

.asymmetric-grid .asym-item-4 {
    grid-column: 2 / 4;
    grid-row: 2;
}

/* Стили элементов асимметричной сетки */
.asymmetric-grid .gallery-item {
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.asymmetric-grid .gallery-item:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.asymmetric-grid .gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

/* ============================================
   4. ОБЩИЕ СТИЛИ ДЛЯ OVERLAY (обе сетки)
   ============================================ */

.gallery-item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(86,92,224, 0.95), transparent);
    opacity: 0;
    transition: opacity 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px;
    color: white;
}

.gallery-item-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.gallery-item-description {
    font-size: 14px;
    margin: 0;
    opacity: 0.9;
}

/* ============================================
   5. АДАПТИВНОСТЬ — ПЛАНШЕТЫ (1024px и меньше)
   ============================================ */

@media (max-width: 1024px) {
    /* Модульная сетка на планшетах */
    .zvpol-modular-grid {
        grid-template-columns: repeat(6, 1fr);
        grid-template-rows: repeat(6, 120px);
        gap: 12px;
    }
    
    .zvpol-modular-grid .grid-item-1 { grid-column: 1 / 4; grid-row: 1 / 3; }
    .zvpol-modular-grid .grid-item-2 { grid-column: 4 / 7; grid-row: 1 / 3; }
    .zvpol-modular-grid .grid-item-3 { grid-column: 1 / 4; grid-row: 3 / 5; }
    .zvpol-modular-grid .grid-item-4 { grid-column: 4 / 7; grid-row: 3 / 5; }
    .zvpol-modular-grid .grid-item-5 { grid-column: 1 / 4; grid-row: 5 / 7; }
    .zvpol-modular-grid .grid-item-6 { grid-column: 4 / 7; grid-row: 5 / 7; }

    /* Асимметричная сетка на планшетах */
    .asymmetric-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, 180px);
        gap: 16px;
    }
    
    .asymmetric-grid .asym-item-1,
    .asymmetric-grid .asym-item-2,
    .asymmetric-grid .asym-item-3,
    .asymmetric-grid .asym-item-4 {
        grid-column: auto;
        grid-row: auto;
    }

    /* Lightbox на планшетах */
    .lightbox-image {
        max-height: 75vh;
    }

    .lightbox-caption {
        font-size: 16px;
        padding: 10px 16px;
    }

    .lightbox-close {
        width: 44px;
        height: 44px;
        font-size: 24px;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .lightbox-counter {
        font-size: 14px;
        padding: 6px 12px;
    }
}

/* ============================================
   6. АДАПТИВНОСТЬ — МОБИЛЬНЫЕ (640px и меньше)
   ============================================ */

@media (max-width: 640px) {
    /* Модульная сетка на мобильных */
    .zvpol-modular-grid {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(6, 200px);
        gap: 12px;
        padding: 0 8px;
    }
    
    .zvpol-modular-grid .grid-item-1,
    .zvpol-modular-grid .grid-item-2,
    .zvpol-modular-grid .grid-item-3,
    .zvpol-modular-grid .grid-item-4,
    .zvpol-modular-grid .grid-item-5,
    .zvpol-modular-grid .grid-item-6 {
        grid-column: 1;
        grid-row: auto;
    }

    /* Асимметричная сетка на мобильных */
    .asymmetric-grid {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, 200px);
        gap: 12px;
        padding: 0 1px;
    }

    .asymmetric-grid .asym-item-1,
    .asymmetric-grid .asym-item-2,
    .asymmetric-grid .asym-item-3,
    .asymmetric-grid .asym-item-4 {
        grid-column: 1;
        grid-row: auto;
    }

    /* Lightbox на мобильных */
    .lightbox-image {
        max-height: 70vh;
        border-radius: 4px;
    }

    .lightbox-caption {
        font-size: 14px;
        padding: 8px 12px;
        max-width: 95%;
    }

    .lightbox-close {
        width: 40px;
        height: 40px;
        top: 10px;
        right: 10px;
        font-size: 20px;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .lightbox-prev {
        left: 5px;
    }

    .lightbox-next {
        right: 5px;
    }

    .lightbox-counter {
        font-size: 12px;
        padding: 5px 10px;
        top: 10px;
        left: 10px;
    }

    /* Текст в overlay на мобильных */
    .gallery-item-title {
        font-size: 16px;
    }

    .gallery-item-description {
        font-size: 12px;
    }
}

/* ============================================
   7. ДОПОЛНИТЕЛЬНЫЕ УТИЛИТЫ
   ============================================ */

/* Предотвращение прокрутки body при открытой галерее */
body.lightbox-open {
    overflow: hidden;
}

/* Анимация смены изображений */
.lightbox-image.changing {
    animation: fadeSwitch 0.2s ease;
}

@keyframes fadeSwitch {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Поддержка клавиатурной навигации */
.lightbox:focus {
    outline: none;
}

/* ============================================
   КОНЕЦ ФАЙЛА
   Версия: 2.0 (с асимметричной сеткой)
   Размер: ~10 KB
   Зависимости: Нет
   ============================================ */

