/* ==========================================================================
   CSS GALERIE MODERNA (Filtrare + Lightbox)
   ========================================================================== */

/* 1. Chips de filtrare */
.galerie-filtre {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 40px 0 50px 0;
}

.chip-filtru {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 2px solid transparent;
    padding: 10px 24px;
    border-radius: var(--radius-pill);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.chip-filtru:hover {
    background: var(--bg-secondary);
    color: var(--primary);
    transform: translateY(-2px);
}

.chip-filtru.active {
    background: var(--primary-gradient);
    color: var(--white);
    border-color: transparent;
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

/* 2. Grid Asimetric (Masonry style approx cu auto-fill) */
.galerie-grila-moderna {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    grid-auto-rows: 250px;
    gap: 20px;
    margin-bottom: 60px;
}

.galerie-item-modern {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.4s ease;
    opacity: 1;
    transform: scale(1);
    cursor: pointer;
}

.galerie-item-modern.ascuns {
    display: none;
    opacity: 0;
    transform: scale(0.9);
}

/* Facem grid-ul dinamic - a 3-a sau a 4-a poza poate fi mai lata (span 2) pt diversitate, dar e optional. Pt siguranta, lasam aspect uniform de baza */

.galerie-item-modern a {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

.galerie-item-modern img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.galerie-item-modern:hover img {
    transform: scale(1.1);
}

/* 3. Overlay Cinematic la Hover */
.galerie-hover-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to top, rgba(15,23,42,0.8) 0%, rgba(15,23,42,0.2) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 2.5rem;
}

.galerie-item-modern:hover .galerie-hover-overlay {
    opacity: 1;
}

.galerie-hover-overlay i {
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.galerie-item-modern:hover .galerie-hover-overlay i {
    transform: translateY(0);
}

/* 4. Lightbox Custom (Vanilla JS) */
.lightbox-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    object-fit: contain;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox-modal.active .lightbox-img {
    transform: scale(1);
}

.lightbox-caption {
    color: var(--white);
    margin-top: 15px;
    font-size: 1.1rem;
    text-align: center;
    font-family: 'Outfit', sans-serif;
}

/* Controale Lightbox */
.lightbox-close, .lightbox-prev, .lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    width: 50px; height: 50px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10000;
}

.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover {
    background: var(--primary);
    transform: scale(1.1);
}

.lightbox-close {
    top: 20px;
    right: 20px;
}

.lightbox-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

@media (max-width: 768px) {
    .galerie-grila-moderna {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        grid-auto-rows: 150px;
        gap: 10px;
    }
    .lightbox-prev, .lightbox-next {
        width: 40px; height: 40px;
    }
}
