/* Enhanced Gallery Styles */
.photos-header {
    background: transparent;
    color: #2c3e50;
    padding: 2rem 0 1rem 0;
    text-align: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.photos-header h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.photos-content {
    padding: 0 0 0 0;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.gallery-item {
    cursor: pointer;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    background: white;
    position: relative;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.gallery-thumb {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

.gallery-item:hover .gallery-thumb {
    transform: scale(1.05);
}

.gallery-caption {
    text-align: center;
    font-size: 0.95rem;
    color: #555;
    margin-top: 0.8rem;
    padding: 0 1rem 1rem;
    line-height: 1.4;
    font-weight: 500;
}

/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.lightbox-content {
    max-width: 90%;
    max-height: 80%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.3);
}

.lightbox-close {
    position: absolute;
    top: 25px;
    right: 40px;
    color: white;
    font-size: 40px;
    cursor: pointer;
    background: none;
    border: none;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.lightbox-close:hover {
    transform: scale(1.1);
}

.lightbox-prev, .lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    color: #333;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

.lightbox-caption {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 1.1rem;
    text-align: center;
    max-width: 80%;
    background: rgba(0,0,0,0.7);
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    backdrop-filter: blur(5px);
}

/* Section Dividers */
.section-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, #3498db, transparent);
    margin: 3rem 0;
    width: 100%;
}

/* Loading Animation */
.gallery-thumb {
    background: #f0f0f0;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.2rem;
    }
}

@media (max-width: 768px) {
    .photos-header h1 {
        font-size: 1.8rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .gallery-thumb {
        height: 200px;
    }
    
    .lightbox-content {
        max-width: 95%;
        max-height: 70%;
    }
    
    .lightbox-close {
        top: 15px;
        right: 20px;
        font-size: 35px;
    }
    
    .lightbox-prev, .lightbox-next {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .lightbox-prev {
        left: 15px;
    }
    
    .lightbox-next {
        right: 15px;
    }
    
    .lightbox-caption {
        font-size: 1rem;
        bottom: 20px;
        padding: 0.6rem 1.2rem;
    }
    
    .section-divider {
        margin: 2rem 0;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .gallery-thumb {
        height: 180px;
    }
    
    .gallery-caption {
        font-size: 0.85rem;
        padding: 0 0.8rem 0.8rem;
    }
    
    .lightbox-prev, .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .lightbox-caption {
        font-size: 0.9rem;
        bottom: 15px;
        padding: 0.5rem 1rem;
    }
}

/* Accessibility */
.gallery-item:focus {
    outline: 3px solid #3498db;
    outline-offset: 2px;
}

.lightbox-close:focus,
.lightbox-prev:focus,
.lightbox-next:focus {
    outline: 3px solid #3498db;
    outline-offset: 2px;
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .gallery-item,
    .gallery-thumb,
    .lightbox-close,
    .lightbox-prev,
    .lightbox-next {
        transition: none;
    }
    
    .gallery-thumb {
        animation: none;
        background: #f0f0f0;
    }
}

/* Добавьте эти стили в конец photos.css */

/* Плавные переходы для lightbox */
.lightbox {
    transition: opacity 0.3s ease;
}

.lightbox-content {
    transition: opacity 0.2s ease;
}

/* Стили для состояния загрузки */
.lightbox-img-loading {
    opacity: 0;
}

.lightbox-img-loaded {
    opacity: 1;
}

/* Улучшения для мобильных свайпов */
.lightbox {
    touch-action: pan-y;
}

/* Анимация для навигации */
.lightbox-content {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

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

/* Улучшения доступности */
.lightbox-close:focus,
.lightbox-prev:focus,
.lightbox-next:focus {
    outline: 3px solid #3498db;
    outline-offset: 2px;
}

.gallery-item:focus {
    outline: 3px solid #3498db;
    outline-offset: 2px;
}

/* Индикатор загрузки */
.lightbox-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #ffffff;
    border-top: 3px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Адаптивность для очень маленьких экранов */
@media (max-width: 360px) {
    .lightbox-content {
        max-width: 95%;
        max-height: 60%;
    }
    
    .lightbox-caption {
        font-size: 0.9rem;
        bottom: 10px;
        padding: 0.4rem 0.8rem;
    }
}