/* ==========================================
   GALLERY COMPONENT STYLES
   Дата: 22 ноября 2025
   ========================================== */

.gallery-preview {
    padding: 60px 20px;
    text-align: center;
}

.gallery-preview h2 {
    font-weight: 300;
    margin-bottom: 40px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 28px;
    color: #333;
}

/* === CATEGORY FILTER === */
.category-filter {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.category-filter button {
    background: transparent;
    border: 2px solid #ddd;
    padding: 10px 20px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
    font-family: 'Montserrat', sans-serif;
}

.category-filter button:hover {
    border-color: #333;
    color: #333;
}

.category-filter button.active {
    background: #333;
    color: #fff;
    border-color: #333;
}

/* === GRID LAYOUT === */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin: 0 auto;
    max-width: 1200px;
}

.grid-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border-radius: 4px;
    background: #f9f9f9;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.grid-item:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    transform: translateY(-5px);
}

.grid-item img {
    width: 100%;
    height: 450px;
    object-fit: cover;
    filter: grayscale(15%);
    transition: all 0.4s ease;
    display: block;
}

.grid-item:hover img {
    filter: grayscale(0%);
    transform: scale(1.05);
}

/* === GRID ITEM INFO === */
.grid-item-info {
    padding: 20px;
    text-align: center;
    background: #fff;
}

.grid-item h3 {
    font-weight: 400;
    font-size: 16px;
    letter-spacing: 1px;
    color: #333;
    margin-bottom: 8px;
}

.grid-item .meta {
    font-size: 12px;
    color: #888;
    letter-spacing: 0.5px;
}

/* === MASONRY LAYOUT OPTION === */
.grid.masonry {
    grid-auto-rows: 20px;
}

.grid.masonry .grid-item {
    grid-row-end: span 20;
}

/* === LIGHTBOX OVERLAY === */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    padding: 10px;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    padding: 20px;
    transition: background 0.3s ease;
}

.lightbox-nav:hover {
    background: rgba(255,255,255,0.2);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* === LOADING STATE === */
.gallery-loading {
    text-align: center;
    padding: 60px 20px;
}

.gallery-loading .spinner {
    margin: 0 auto;
}

/* === EMPTY STATE === */
.gallery-empty {
    text-align: center;
    padding: 80px 20px;
    color: #888;
}

.gallery-empty h3 {
    font-size: 22px;
    margin-bottom: 15px;
    font-weight: 300;
}

.gallery-empty p {
    font-size: 14px;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .gallery-preview {
        padding: 40px 15px;
    }
    
    .gallery-preview h2 {
        font-size: 24px;
        margin-bottom: 30px;
    }
    
    .grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .grid-item img {
        height: 350px;
    }
    
    .category-filter {
        gap: 10px;
    }
    
    .category-filter button {
        padding: 8px 15px;
        font-size: 11px;
    }
    
    .lightbox-nav {
        font-size: 30px;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .grid-item img {
        height: 280px;
    }
    
    .lightbox-content {
        max-width: 95%;
    }
}
