/**
 * Frontend styles for Custom Gallery plugin
 */
/* Filter buttons */
.gallery-filters {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 40px;
    padding-bottom: 4px;
    border-bottom: 1px solid #ccc;
}
.gallery-filters .btn-filter {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #666;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    padding: 0 0 5px 0;
    margin-bottom: -16px;
}
.gallery-filters .btn-filter:hover,
.gallery-filters .btn-filter.active {
    color: #c00;
    border-bottom-color: #c00;
}
/* Gallery grid */
.cg-gallery-grid {
    margin-top: 40px;
    position: relative;
}

.cg-gallery-grid .grid-sizer {
    width: 31.333%;
}

.cg-gallery-grid .gallery-item {
    width: 31.333%;
    float: left;
    margin-bottom: 30px;
    overflow: hidden;
}

/* Большой блок - 670px */
.cg-gallery-grid .gallery-item--large {
    height: 670px;
}

/* Маленький блок - 340px */
.cg-gallery-grid .gallery-item--small {
    height: 340px;
}

.cg-gallery-grid .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 992px) {
    .cg-gallery-grid .grid-sizer,
    .cg-gallery-grid .gallery-item {
        width: 48%;
    }
    
    .cg-gallery-grid .gallery-item--large {
        height: 500px;
    }
    
    .cg-gallery-grid .gallery-item--small {
        height: 280px;
    }
}

@media (max-width: 576px) {
    .cg-gallery-grid .grid-sizer,
    .cg-gallery-grid .gallery-item {
        width: 100%;
    }
    
    .cg-gallery-grid .gallery-item--large,
    .cg-gallery-grid .gallery-item--small {
        height: auto;
    }
}
.cg-gallery-grid .gallery-item a {
    display: block;
    height: 100%;
}
/* Filter animation */
.gallery-item.hidden {
    display: none;
}
.gallery-item.fade-out {
    opacity: 0;
}
.gallery-item.fade-in {
    animation: fadeIn 0.4s ease forwards;
}
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
/* Lightbox */
.gallery-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 999999;
    justify-content: center;
    align-items: center;
}
.gallery-lightbox.active {
    display: flex;
}
.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    text-align: center;
}
.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
}
.lightbox-caption {
    color: #fff;
    padding: 15px 0;
    font-size: 16px;
}
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
}
.lightbox-close:hover {
    opacity: 0.7;
}
.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 50px;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    padding: 20px;
    z-index: 10;
}
.lightbox-prev {
    left: 20px;
}
.lightbox-next {
    right: 20px;
}
.lightbox-prev:hover,
.lightbox-next:hover {
    opacity: 0.7;
}
/* Empty state */
.gallery-empty {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}
/* Responsive */
@media (max-width: 576px) {
    
    .gallery-filters {
        gap: 15px;
    }
    
    .gallery-filters .btn-filter {
        font-size: 14px;
    }
    
    .lightbox-prev,
    .lightbox-next {
        font-size: 35px;
        padding: 10px;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
}
