/* PAGE GALLERY - Стили для галереи */
.page-gallery {
    padding: 2rem 0 4rem;
}

.gallery-header {
    text-align: center;
    margin-bottom: 3rem;
}

.gallery-header h1 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: var(--font-size-4xl);
}

.gallery-subtitle {
    color: var(--text-secondary);
    font-size: var(--font-size-lg);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

.gallery-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

.gallery-item {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    aspect-ratio: 4/3;
}

.gallery-item:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-lg);
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover .gallery-image {
    transform: scale(1.1);
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-caption {
    transform: translateY(0);
}

.gallery-caption-text {
    font-size: var(--font-size-sm);
    line-height: 1.4;
}

/* Пустое состояние */
.gallery-empty {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-light);
    border-radius: var(--border-radius);
    color: var(--text-light);
    font-size: var(--font-size-lg);
    border: 2px dashed var(--border-color);
}

/* Модальное окно для увеличенного просмотра */
.gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.gallery-modal.active {
    display: flex;
}

.gallery-modal-content {
    position: relative;
    max-width: 1200px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gallery-modal-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--border-radius);
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
}

.gallery-modal-caption {
    margin-top: 1rem;
    color: white;
    font-size: var(--font-size-base);
    text-align: center;
    max-width: 600px;
}

.gallery-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.gallery-modal-close:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.gallery-modal-prev,
.gallery-modal-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.gallery-modal-prev {
    left: 1rem;
}

.gallery-modal-next {
    right: 1rem;
}

.gallery-modal-prev:hover,
.gallery-modal-next:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-50%) scale(1.1);
}

.gallery-modal-counter {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: var(--font-size-sm);
    background: rgba(0,0,0,0.5);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

/* Адаптивность */
@media (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .gallery-header h1 {
        font-size: var(--font-size-3xl);
    }
    
    .gallery-subtitle {
        font-size: var(--font-size-base);
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .gallery-caption {
        transform: translateY(0);
        background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    }
}

@media (max-width: 576px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-modal-prev,
    .gallery-modal-next {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}