/* === GALLERY SECTION (Галерея) === */
.gallery-section {
    min-height: calc(100vh - var(--header-height));
    display: flex;
    align-items: center;
    padding: 6rem 0;
    position: relative;
    background: linear-gradient(135deg, #1a1c22 0%, #0f1115 100%); /* Темный градиентный фон */
}

/* Эффект мерцания фона */
.gallery-section .section-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 15% 85%, rgba(139, 144, 154, 0.4) 0%, transparent 32%),
        radial-gradient(circle at 85% 15%, rgba(90, 95, 107, 0.3) 0%, transparent 42%);
    opacity: 0.12;
    animation: atmosphericPulse 7s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes atmosphericPulse {
    0%, 100% { opacity: 0.08; }
    50% { opacity: 0.18; }
}

.gallery-section .container-fluid-custom {
    position: relative;
    z-index: 1;
}

.gallery-section .section-title {
    color: #d6940d;
}

.gallery-section .section-description {
    color: #c1c9d2;
}

/* Белая подпись (используем точечно на отдельных страницах) */
.gallery-section .section-description.section-description--light {
    color: #c1c9d2;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    grid-auto-rows: 1fr;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    aspect-ratio: 16 / 9;
    background: transparent;
    border: 1px solid rgba(152, 158, 161, 0.18);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.gallery-image {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.4s ease;
}

/* При наведении: увеличение + осветление */
.gallery-item:hover .gallery-image img {
    transform: scale(1.1);
    filter: brightness(1.2);
}

/* Градиент для текста */
.gallery-image::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 60%;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.8) 100%);
}

/* Подпись поверх изображения */
.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    color: white;
    font-size: 1.125rem;
    font-weight: 600;
    z-index: 1;
    transition: color 0.3s ease;
}

/* При наведении текст желтеет */
.gallery-item:hover .gallery-caption {
    color: #faa608;
}

/* Модальное окно */
.gallery-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.gallery-modal.active {
    display: flex;
    animation: modalFadeIn 0.3s ease;
}

.gallery-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    animation: modalZoomIn 0.3s ease;
}

.gallery-modal-content img {
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.gallery-modal-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: transparent;
    border: none;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
    padding: 0;
}

.gallery-modal-close:hover {
    transform: rotate(90deg);
    color: #d6940d;
}

/* Navigation arrows */
.gallery-modal-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #d6940d;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10000;
    padding: 1rem;
}

.gallery-modal-nav:hover {
    color: #faa608;
    transform: translateY(-50%) scale(1.2);
}

.gallery-modal-nav-prev {
    left: 2rem;
}

.gallery-modal-nav-next {
    right: 2rem;
}

.gallery-modal-nav svg {
    width: 48px;
    height: 48px;
    stroke: currentColor;
    filter: drop-shadow(0 0 10px rgba(214, 148, 13, 0.5));
}

/* Image animation */
.gallery-modal-content img {
    animation: imageSlideIn 0.4s ease;
}

@keyframes imageSlideIn {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalZoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive */
@media (max-width: 1365px) {
    .gallery-section {
        min-height: auto;
        height: auto;
        padding: 4rem 0;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .gallery-section {
        padding: 3rem 0;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .gallery-caption {
        font-size: 1rem;
        padding: 1rem;
    }
    
    .gallery-modal-content {
        max-width: 95vw;
    }
    
    .gallery-modal-close {
        top: -40px;
        font-size: 2rem;
    }
    
    .gallery-modal-nav {
        padding: 0.5rem;
    }
    
    .gallery-modal-nav-prev {
        left: 0.5rem;
    }
    
    .gallery-modal-nav-next {
        right: 0.5rem;
    }
    
    .gallery-modal-nav svg {
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 480px) {
    .gallery-section {
        padding: 2rem 0;
    }
    
    .gallery-caption {
        font-size: 0.9rem;
        padding: 0.75rem;
    }
}

