/* Ritocchi di sportello: tocco, token ente, focus, movimento ridotto. */

:root {
    --si-primary: var(--bs-primary, #0066cc);
}

.t-primary,
.text-primary,
a.text-primary,
.btn-link,
.link-list-wrapper ul li a,
.chip.chip-primary .chip-label,
.it-card-title a,
.it-card-link {
    color: var(--si-primary) !important;
}

/* Titoli delle it-card: stessi stili delle card storiche (span.card-title.h4
   dentro a.text-decoration-none): h4, colore primary, nessuna sottolineatura. */
.it-card .it-card-title {
    font-size: 1.5rem;
    line-height: 2rem;
    font-weight: 600;
}

.it-card .it-card-title a,
.it-card .it-card-title a:hover,
.it-card .it-card-title a:focus {
    font-weight: inherit;
    text-decoration: none !important;
}

/* Titolo esplicitamente bianco (tile su sfondo primary): la regola sopra lo rendeva verde su verde. */
.it-card .it-card-title a.text-white {
    color: #fff !important;
}

/* Tile con icona della home (servizi, come fare per): icona e titolo centrati nella card. */
#servizi-prestazioni .it-card.text-center,
#come-fare-per .it-card.text-center {
    justify-content: center;
    padding: 1rem 0.5rem;
}

.bg-primary,
.btn-primary:not(.bg-white),
.chip.chip-primary.chip-simple.bg-primary,
.page-item .page-link.current,
.pagination .page-item.active .page-link {
    background-color: var(--si-primary) !important;
    border-color: var(--si-primary) !important;
}

.btn-primary:not(.bg-white),
.page-item .page-link.current,
.pagination .page-item.active .page-link {
    color: #fff !important;
}

.btn-outline-primary {
    color: var(--si-primary) !important;
    border-color: var(--si-primary) !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-primary:not(.bg-white):hover,
.btn-primary:not(.bg-white):focus {
    background-color: var(--bs-primary-text-emphasis, #17324d) !important;
    border-color: var(--bs-primary-text-emphasis, #17324d) !important;
    color: #fff !important;
}

.form-check [type=checkbox]:checked + label::after,
.form-check [type=radio]:checked + label::before {
    border-color: var(--si-primary);
}

svg.icon-primary,
.icon-primary {
    fill: var(--si-primary) !important;
    color: var(--si-primary) !important;
}

.btn.btn-xs,
.btn-group-sm > .btn {
    min-height: 2.75rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

a.btn.p-0,
button.btn.p-0.analogue-1-color,
button.btn.text-primary.p-0,
.si-hit {
    min-height: 2.75rem;
    display: inline-flex;
    align-items: center;
}

.si-hit {
    padding: 0.5rem 0.75rem;
}

.page-link {
    min-width: 2.75rem;
    min-height: 2.75rem;
}

.cmp-rating .rating input:focus + label {
    border-color: #17324d !important;
    box-shadow: 0 0 0 2px #17324d !important;
    outline: 2px solid #fff !important;
}

.it-card .si-doc-action {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--si-primary);
    font: inherit;
    text-align: left;
    text-decoration: underline;
    min-height: 2.75rem;
}

/* comuni.css forza .figure.img-full img a min 300px / 600px (hero/gallery).
   Nelle it-card l'immagine deve solo riempire il ratio BI, altrimenti
   esce dal box e la card sembra "full image". */
.it-card .figure.img-full img {
    min-height: 0 !important;
    height: 100% !important;
    width: 100%;
    max-height: none;
    object-fit: cover;
}

/*
 * Primo piano (carousel landscape): da desktop BI posiziona
 * .img-responsive in absolute sull'<a>, ma .img-responsive-wrapper
 * resta height:0 + overflow:hidden → immagine clipata/invisibile.
 */
@media (min-width: 992px) {
    .it-carousel-wrapper.it-carousel-landscape-abstract .it-single-slide-wrapper > a {
        flex-basis: 50%;
        position: relative;
        align-self: stretch;
        min-height: 16rem;
    }

    .it-carousel-wrapper.it-carousel-landscape-abstract .it-single-slide-wrapper > a .img-responsive-wrapper {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        overflow: hidden;
    }

    .it-carousel-wrapper.it-carousel-landscape-abstract .it-single-slide-wrapper > a .img-responsive-wrapper .img-responsive,
    .it-carousel-wrapper.it-carousel-landscape-abstract .it-single-slide-wrapper > a .img-responsive-wrapper .img-wrapper {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        padding-bottom: 0;
    }

    .it-carousel-wrapper.it-carousel-landscape-abstract .it-single-slide-wrapper > a .img-responsive-wrapper img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

#slideshow .carousel-image {
    position: relative;
    background-size: cover;
    background-repeat: no-repeat;
    z-index: 0;
}

/* Immagine a proporzioni naturali, titolo della slide sotto l'immagine */
#slideshow .carousel-item,
#slideshow .carousel-item.active {
    height: auto;
}

#slideshow .carousel-item.active {
    display: block !important;
}

#slideshow .carousel-item img {
    height: auto;
    margin-left: auto;
    margin-right: auto;
}

#slideshow .carousel-caption {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    padding: 1rem;
    background: #fff;
    text-align: left;
    max-width: none;
}

/* Frecce centrate in verticale, sopra l'immagine (il titolo è sotto) */
#slideshow .carousel-control-prev,
#slideshow .carousel-control-next {
    width: 2.75rem;
    height: 2.75rem;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    opacity: 1;
}

#slideshow .carousel-control-prev {
    left: 0.5rem;
}

#slideshow .carousel-control-next {
    right: 0.5rem;
}


@media (prefers-reduced-motion: reduce) {
    .cmp-disclaimer {
        animation: none !important;
    }

    .carousel-item {
        transition: none;
    }
}
