/* Grille Masonry responsive */
.masonry-grid
{
    column-count: 4;
    column-gap: 1.5rem;
    margin-top: 2rem;
}

.masonry-item
{
    display: inline-block;
    width: 100%;
    margin-bottom: 1.5rem;
    cursor: pointer;
    transition: transform 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
    background-color: var(--card-background-color);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.masonry-item:hover { transform: translateY(-5px); }
.masonry-item img { display: block; width: 100%; height: auto; transition: opacity 0.3s; }
.masonry-item:hover img { opacity: 0.9; }

@media (max-width: 1200px) { .masonry-grid { column-count: 3; } }
@media (max-width:  900px) { .masonry-grid { column-count: 2; } }
@media (max-width:  600px) { .masonry-grid { column-count: 1; } }

/* Lightbox immersive */
dialog#lightbox
{
    background: transparent;
    border: none;
    max-width: 100vw;
    max-height: 100vh;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

dialog#lightbox::backdrop
{
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
}

.lightbox-container
{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    width: 100vw;
    position: relative;
}

.lightbox-img
{
    max-height: 80vh;
    max-width: 90vw;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 40px rgba(0,0,0,0.5);
}

.lightbox-caption
{
    color: #fff;
    margin-top: 2rem;
    font-size: 1.2rem;
    font-weight: 300;
    letter-spacing: 0.5px;
    text-align: center;
}

/* Navigation */
.nav-btn
{
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: white;
    font-size: 3.5rem;
    cursor: pointer;
    padding: 2rem;
    z-index: 100;
    opacity: 0.4;
    transition: opacity 0.2s, transform 0.2s;
}
.nav-btn:hover { opacity: 1; background: none; transform: translateY(-50%) scale(1.1); }
.prev-btn { left: 5px; }
.next-btn { right: 5px; }

.close-btn
{ 
    position: absolute; 
    top: 2rem; 
    right: 2rem; 
    z-index: 101; 
    font-size: 3rem; 
    color: white; 
    background: none; 
    border: none;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
}
.close-btn:hover { opacity: 1; background: none; }
