/* ============================================
   СТИЛИ ГАЛЕРЕИ
   ============================================ */

/* Page header для галереи */
.gallery-header {
    min-height: 300px;
}

.gallery-page {
    padding-bottom: 40px;
}

/* ============================================
   ФИЛЬТРЫ КАТЕГОРИЙ
   ============================================ */
.gallery-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 40px;
    justify-content: center;
}

.gallery-filter {
    padding: 10px 20px;
    background: var(--cosmic-card);
    border: 2px solid var(--cosmic-border);
    border-radius: var(--radius-xl);
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
}

.gallery-filter:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.gallery-filter.active {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--cosmic-card);
}

.filter-count {
    font-size: 12px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.08);
}

.gallery-filter.active .filter-count {
    background: rgba(255, 255, 255, 0.25);
}

/* ============================================
   СЕТКА ГАЛЕРЕИ
   ============================================ */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 60px;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4 / 3;
    background: var(--cosmic-border);
    transition: all var(--transition-normal);
}

.gallery-item { pointer-events: auto; }

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* Анимация скрытия при фильтрации */
.gallery-item.hidden {
    display: none;
}

.gallery-item.fade-in {
    animation: galleryFadeIn 0.4s ease forwards;
}

@keyframes galleryFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Placeholder изображения */
.gallery-image {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

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

.image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--steel-blue-light), hsl(222, 47%, 18%));
    gap: 10px;
}

.placeholder-icon {
    font-size: 2.5rem;
    opacity: 0.5;
}

.placeholder-text {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    padding: 0 15px;
}

/* ============================================
   ОВЕРЛЕЙ НА КАРТОЧКЕ
   ============================================ */
.gallery-overlay { pointer-events: none; }
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.85) 0%,
        rgba(0, 0, 0, 0.3) 40%,
        transparent 100%
    );
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.gallery-item:hover .gallery-overlay { pointer-events: none; }
    opacity: 1;
}

.overlay-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--cosmic-card);
    margin-bottom: 5px;
}

.overlay-content p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 10px;
}

.overlay-actions {
    display: flex;
    justify-content: flex-end;
}

.btn-expand {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: var(--cosmic-card);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-expand:hover {
    background: var(--gold);
    border-color: var(--gold);
    transform: scale(1.1);
}

.btn-expand svg {
    width: 18px;
    height: 18px;
}

/* Категория тег */
.category-tag {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(52, 152, 219, 0.3);
    color: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   CTA БЛОК ГАЛЕРЕИ
   ============================================ */
.gallery-cta {
    text-align: center;
    padding: 50px 40px;
    background: linear-gradient(135deg, hsl(222, 47%, 18%), #1a2a3a);
    border-radius: var(--radius-md);
    color: var(--cosmic-card);
    margin-bottom: 40px;
}

.gallery-cta h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.gallery-cta p {
    font-size: 1rem;
    opacity: 0.8;
    margin-bottom: 30px;
}

/* ============================================
   ЛАЙТБОКС
   ============================================ */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
}

.lightbox.active {
    display: flex;
    animation: lightboxFadeIn 0.3s ease forwards;
}

@keyframes lightboxFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
}

.lightbox-content {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    width: 95%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Кнопки лайтбокса */
.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: var(--cosmic-card);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.lightbox-close svg {
    width: 20px;
    height: 20px;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: var(--cosmic-card);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.lightbox-nav:hover {
    background: var(--gold);
    border-color: var(--gold);
}

.lightbox-nav svg {
    width: 24px;
    height: 24px;
}

.lightbox-prev {
    left: -70px;
}

.lightbox-next {
    right: -70px;
}

/* Изображение в лайтбоксе */
.lightbox-image {
    width: 100%;
    aspect-ratio: 16 / 10;
    background: hsl(222, 40%, 14%);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.lightbox-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.lightbox-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.lightbox-placeholder .placeholder-icon {
    font-size: 4rem;
    opacity: 0.4;
}

.lightbox-placeholder .placeholder-text {
    font-size: 1.3rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
}

/* Инфо в лайтбоксе */
.lightbox-info {
    text-align: center;
    color: var(--cosmic-card);
}

.lightbox-info h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.lightbox-info p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 10px;
}

.lightbox-counter {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 10px;
    font-weight: 500;
}

/* ============================================
   АДАПТИВНОСТЬ
   ============================================ */
@media (max-width: 992px) {
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-close {
        top: -55px;
        right: 10px;
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
    
    .gallery-filters {
        gap: 8px;
        margin-bottom: 30px;
    }
    
    .gallery-filter {
        padding: 8px 15px;
        font-size: 13px;
    }
    
    .gallery-overlay { pointer-events: none; }
        opacity: 1;
        background: linear-gradient(
            to top,
            rgba(0, 0, 0, 0.7) 0%,
            transparent 50%
        );
    }
    
    .overlay-actions {
        display: none;
    }
    
    .lightbox-content {
        width: 100%;
    }
    
    .lightbox-image {
        aspect-ratio: 4 / 3;
    }
    
    .lightbox-placeholder .placeholder-icon {
        font-size: 3rem;
    }
    
    .gallery-cta {
        padding: 40px 25px;
    }
    
    .gallery-cta h3 {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .gallery-item {
        aspect-ratio: 3 / 2;
    }
    
    .gallery-filters {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
    }
    
    .gallery-filter {
        var(--cosmic-card)-space: nowrap;
        flex-shrink: 0;
    }
    
    .cta-actions {
        flex-direction: column;
    }
    
    .btn-cta {
        justify-content: center;
    }
}

/* Gallery CTA - dark theme fix */
.gallery-cta {
    background: linear-gradient(135deg, hsl(222, 47%, 18%), hsl(222, 47%, 10%)) !important;
    color: hsl(210, 40%, 96%) !important;
}
.gallery-cta h3,
.gallery-cta p {
    color: hsl(210, 40%, 96%) !important;
}

