/* Correzione spaziatura per evitare la sovrapposizione dell'header fisso */
body {
    padding-top: 120px;
}

@media (max-width: 768px) {
    body {
        padding-top: 80px;
    }
}
.masonry-gallery {
    column-count: 4;
    column-gap: 4px;
    width: 100%;
}

@media (max-width: 1200px) {
    .masonry-gallery {
        column-count: 3;
    }
}

@media (max-width: 768px) {
    .masonry-gallery {
        column-count: 2;
    }
}

@media (max-width: 480px) {
    .masonry-gallery {
        column-count: 1;
    }
}

.masonry-gallery .photo-item {
    break-inside: avoid;   
    margin-bottom: 4px;    
    position: relative;
    overflow: hidden;
    background: #000;
}

.masonry-gallery .photo-item a {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 2;
    cursor: pointer !important;
}

.masonry-gallery .photo-item img {
    width: 100%;
    height: auto;          
    display: block;
    transition: transform 0.3s ease;
    cursor: pointer !important;
}

.masonry-gallery .photo-item:hover img {
    transform: scale(1.03);
}

/* Sfondo scuro a tutto schermo con cornice interna bianca */
.masonry-gallery .photo-item .caption-overlay {
    position: absolute;
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0;
    background: rgba(0, 0, 0, 0.6); 
    color: #fff;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    /* Spostato dal centro/alto al bordo inferiore all'interno della cornice */
    justify-content: flex-end; 
    align-items: center;
    text-align: center;
    padding: 30px; /* Spazio per mantenere la cornice attorno */
    z-index: 3; 
    pointer-events: none;
}

/* Cornice bianca interna */
.masonry-gallery .photo-item .caption-overlay::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    border: 2px solid #ffffff;
    pointer-events: none;
}

.masonry-gallery .photo-item:hover .caption-overlay {
    opacity: 1;
}

/* Didascalia della Lightbox in basso, ampia e ben leggibile */
.blueimp-gallery > .title {
    position: absolute;
    top: auto !important;
    bottom: 25px !important;
    left: 50% !important;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    padding: 15px 25px;
    border-radius: 4px;
    width: 85%;
    max-width: 900px;
    text-align: center;
    white-space: normal !important;
    font-size: 16px;
    line-height: 1.5;
    color: #fff;
    display: block !important;
}

/* Forza la manina su tutto il contenuto della galleria */
.masonry-gallery a, 
.masonry-gallery img {
    cursor: pointer !important;
}

/* Griglia delle card nella pagina pubblica dell'elenco Reportage */
.rep-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: flex-start;
    padding: 0 3% 60px;
}

.rep-card {
    width: 320px;
    max-width: 100%;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.rep-card:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    transform: translateY(-3px);
}

.rep-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.rep-card-body {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.rep-card-body h3 {
    margin-top: 0;
    font-size: 18px;
    text-transform: uppercase;
    color: #333;
}

.rep-card-body p {
    color: #888;
    font-size: 14px;
    line-height: 1.5;
}

.btn-rep {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 20px;
    background: #21abca;
    color: #fff !important;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
    border-radius: 2px;
    transition: background 0.3s ease;
}

.btn-rep:hover {
    background: #1BC0DC;
}