/* === GALLERIA BASE === */
.wp-block-db-street-photography-galleries {
    width: 100%;
}

.dbspg-gallery {
    display: block;
    width: 100%;
    gap: 15px;
    margin: 20px auto;
    box-sizing: border-box;
}

.dbspg-gallery.cols-1 { grid-template-columns: 1fr; }
.dbspg-gallery.cols-2 { grid-template-columns: repeat(2, 1fr); }
.dbspg-gallery.cols-3 { grid-template-columns: repeat(3, 1fr); }
.dbspg-gallery.cols-4 { grid-template-columns: repeat(4, 1fr); }

.dbspg-gallery img {
    max-width: 100%;
}

.dbspg-gallery-item {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 5px;
    transition: transform 0.3s ease;
}

.dbspg-gallery-item:hover {
    transform: scale(1.02);
}

.dbspg-gallery-item img {
    width: 100%;
    height: auto;
    display: block;
}

.dbspg-category-articles {
    width: 100%;
}

.dbspg-category-articles h2 {
    margin: 0 0 0.75rem;
}

.dbspg-category-articles__list {
    display: grid;
    grid-template-columns: repeat(var(--dbspg-category-columns, 3), minmax(0, 1fr));
    gap: 1rem 2rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (max-width: 780px) {
    .dbspg-category-articles__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
    .dbspg-category-articles__list { grid-template-columns: minmax(0, 1fr); }
}

.dbspg-category-articles__list li {
    margin: 0;
}

/* === BLOCCO SCROLL QUANDO LIGHTBOX APERTO === */
body.dbspg-modal-open {
    position: fixed !important;
    top: 0 !important;
    width: 100% !important;
    overflow: hidden !important;
}

/* === LIGHTBOX - VIEWPORT FISSO === */
.dbspg-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.9) !important;
    z-index: 999999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 20px !important;
    box-sizing: border-box !important;
}

.dbspg-overlay img {
    max-width: calc(100vw - 40px) !important;
    max-height: calc(100vh - 40px) !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    border-radius: 5px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .dbspg-gallery.cols-3,
    .dbspg-gallery.cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .dbspg-gallery.cols-2,
    .dbspg-gallery.cols-3,
    .dbspg-gallery.cols-4 {
        grid-template-columns: 1fr;
    }
}
