.galleria-card {
    width: 22rem;
    max-width: 100%;
}

/* Il riquadro con la foto iniziale: tutto cliccabile, apre il pop up. */
.gallery-cover {
    position: relative;
    display: block;
    width: 100%;
    padding: 10px;
    border: 0;
    background: none;
    cursor: pointer;
    overflow: hidden;
}

.gallery-cover img {
    display: block;
    width: 100%;
    height: 12rem;
    object-fit: cover;
    border-radius: 20px;
    transition: transform 0.3s ease;
}

.gallery-cover:hover img,
.gallery-cover:focus-visible img {
    transform: scale(1.05);
}

.gallery-cover-badge {
    position: absolute;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    padding: 0.35em 0.9em;
    border-radius: 999px;
    background-color: rgba(88, 21, 28, 0.85);
    color: white;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Galleria ancora senza foto: la copertina non è cliccabile. */
.galleria-card-vuota .gallery-cover {
    cursor: default;
}

.galleria-card-vuota .gallery-cover img {
    filter: grayscale(100%);
    opacity: 0.75;
}

.galleria-card-vuota .gallery-cover:hover img {
    transform: none;
}

/* Pop up ingrandito (uno per galleria, generati da scatti.js) */
.galleria-modal .modal-content {
    background-color: #111;
    border: 0;
}

.galleria-modal .modal-header,
.galleria-modal .modal-footer {
    border-color: rgba(255, 255, 255, 0.15);
}

.galleria-modal .modal-title {
    color: white;
}

.galleria-modal .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.gallery-photo {
    width: 100%;
    max-height: 78vh;
    object-fit: contain;
    margin: 0 auto;
}

.gallery-counter {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
}

.galleria-carousel .carousel-control-prev,
.galleria-carousel .carousel-control-next {
    width: 12%;
}

@media screen and (max-width: 768px) {
    .galleria-card {
        width: 100% !important;
        max-width: 22rem;
    }

    .gallery-photo {
        max-height: 65vh;
    }
}
