/*
Theme Name: Design Comuni Italia Child
Description: Tema child generico compatibile con Design Comuni Italia 1.12.8.
Template: design-comuni-wordpress-theme-main
Version: 1.5.0
Text Domain: design-comuni-italia-child
*/

.card-title {
    font-size: 1.77rem;
}

/* Collegamenti istituzionali nella barra superiore. */
.dcic-institutional-links {
    align-items: center;
    display: inline-flex;
    flex: 0 0 auto;
    justify-content: flex-end;
    min-width: 0;
    margin-right: .5rem;
}

.it-header-slim-right-zone {
    align-items: center;
    display: flex;
    gap: .25rem;
    margin-left: auto;
    justify-content: flex-end;
    width: auto;
}

.dcic-institutional-links a {
    border-left: 1px solid rgba(255, 255, 255, .28);
    display: inline-flex;
    align-items: center;
    min-height: 2.5rem;
    padding: .35rem 1.25rem;
    text-decoration: none;
    white-space: nowrap;
}

.dcic-institutional-links a:last-child {
    border-right: 1px solid rgba(255, 255, 255, .28);
}

.dcic-institutional-links a:hover,
.dcic-institutional-links a:focus-visible {
    text-decoration: underline;
}

/* Immagine panoramica e schede in sovrapposizione, come nell'esempio di riferimento. */
.dcic-home-news {
    padding-bottom: 1px;
}

.dcic-home-hero {
    height: clamp(320px, 38vw, 610px);
    overflow: hidden;
    width: 100%;
}

.dcic-home-hero-image {
    display: block;
    height: 100%;
    object-fit: cover;
    object-position: center 48%;
    width: 100%;
}

.dcic-home-news-container {
    position: relative;
    z-index: 1;
}

.dcic-home-news-cards {
    margin-top: -3.75rem;
}

.dcic-featured-fallback {
    padding-top: 2rem;
}

@media (min-width: 992px) {
    .it-header-wrapper .it-nav-wrapper .it-header-center-wrapper {
        height: 128px !important;
        min-height: 128px;
    }

    .it-header-wrapper .it-nav-wrapper .it-header-center-wrapper .it-header-center-content-wrapper {
        min-height: 128px;
    }

    .it-header-slim-wrapper .it-header-slim-wrapper-content .it-header-slim-right-zone {
        flex: 0 0 auto;
        justify-content: flex-end !important;
        margin-left: auto !important;
        width: auto !important;
    }
}

@media (max-width: 991.98px) {
    .dcic-institutional-links {
        justify-content: flex-end;
        margin-right: 0;
    }

    .dcic-institutional-links a {
        min-height: 2.25rem;
        padding-left: .75rem;
        padding-right: .75rem;
    }

    .it-header-slim-right-zone {
        flex-wrap: wrap;
        justify-content: flex-end;
        width: 100%;
    }

    .dcic-home-news-cards {
        margin-top: -2rem;
    }
}

@media (max-width: 575.98px) {
    .dcic-home-hero {
        height: 56vw;
        min-height: 240px;
        max-height: 380px;
    }

    .dcic-institutional-links {
        justify-content: space-between;
        width: 100%;
    }

    .dcic-institutional-links a {
        font-size: .8rem;
        padding-left: .45rem;
        padding-right: .45rem;
        white-space: normal;
    }
}

/* Valori iniziali della palette, modificabili dal pannello Colori del sito. */
:root {
    --dcic-primary-color: #145a43;
    --dcic-primary-hover: #0e4432;
    --dcic-menu-color: #007a52;
    --bs-primary: var(--dcic-primary-color);
    --bs-primary-rgb: 20, 90, 67;
    --bs-success: var(--dcic-primary-color);
    --bs-success-rgb: 20, 90, 67;
    --bs-link-color: var(--dcic-primary-color);
    --bs-link-hover-color: var(--dcic-primary-hover);
}
/* Il tema padre imposta direttamente lo sfondo delle tre fasce dell'intestazione. */
.it-header-slim-wrapper {
    background-color: var(--dcic-primary-hover, #0e4432) !important;
}

.it-header-center-wrapper {
    background-color: var(--dcic-primary-color, #145a43) !important;
}

/* La barra dei menu mantiene il verde più chiaro e si estende per tutta la viewport. */
.it-header-wrapper .it-nav-wrapper .it-header-navbar-wrapper,
.it-header-wrapper .it-nav-wrapper .it-header-navbar-wrapper .navbar,
.it-header-wrapper .it-nav-wrapper .it-header-navbar-wrapper .navbar .navbar-collapsable,
.it-header-wrapper .it-nav-wrapper .it-header-navbar-wrapper .navbar .navbar-collapsable .menu-wrapper {
    background: var(--dcic-menu-color, #007a52) !important;
}

@media (min-width: 992px) {
    .it-header-wrapper .it-nav-wrapper .it-header-navbar-wrapper {
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
    }
}

.it-calendar-wrapper .it-header-block-title {
    background-color: var(--dcic-menu-color, #007a52) !important;
    color: #fff !important;
}

.row-calendar .it-calendar-wrapper .card .card-text a {
    color: var(--dcic-primary-color, #145a43) !important;
}

.row-calendar .it-calendar-wrapper .card .card-text a:hover {
    color: var(--dcic-primary-hover, #0e4432) !important;
}

.btn-primary,
.btn-success,
.it-header-slim-wrapper .it-header-slim-wrapper-content .it-access-top-wrapper > a,
.it-header-slim-wrapper .it-header-slim-wrapper-content .it-header-slim-right-zone button {
    background-color: var(--dcic-primary-color, #145a43) !important;
    border-color: var(--dcic-primary-color, #145a43) !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-success:hover,
.btn-success:focus,
.btn-success:active {
    background-color: var(--dcic-primary-hover, #0e4432) !important;
    border-color: var(--dcic-primary-hover, #0e4432) !important;
}

.btn-primary:focus,
.btn-success:focus,
.btn-outline-primary:focus,
.btn-outline-success:focus {
    box-shadow: 0 0 0 .25rem color-mix(in srgb, var(--dcic-primary-color, #145a43) 35%, transparent) !important;
}

.btn-outline-primary,
.btn-outline-success {
    color: var(--dcic-primary-color, #145a43) !important;
    border-color: var(--dcic-primary-color, #145a43) !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-success:hover,
.btn-outline-success:focus {
    color: #fff !important;
    background-color: var(--dcic-primary-color, #145a43) !important;
    border-color: var(--dcic-primary-color, #145a43) !important;
}

.link-primary,
.link-success,
.t-primary,
.icon-primary,
.icon-success,
.accordion-header .accordion-button,
.nav-tabs .nav-link.active,
.nav-tabs .nav-item.show .nav-link,
.pagination .page-item .page-link[aria-current],
.pagination .page-item .page-link:hover,
.primary-color-a1,
.primary-color-a2,
.primary-color-a3,
.primary-color-a4,
.primary-color-a5,
.primary-color-a6,
.primary-color-a7,
.primary-color-a8,
.primary-color-a9,
.primary-color-a10,
.primary-color-a11,
.primary-color-a12 {
    color: var(--dcic-primary-color, #145a43) !important;
}

.icon-primary,
.icon-success {
    fill: var(--dcic-primary-color, #145a43) !important;
}

.bg-primary,
.bg-success,
.progress-bar,
.accordion.accordion-background-active .accordion-header .accordion-button[aria-expanded="true"],
.accordion.accordion-background-hover .accordion-header .accordion-button:hover {
    background-color: var(--dcic-primary-color, #145a43) !important;
}

.primary-bg-a1 { background-color: color-mix(in srgb, var(--dcic-primary-color) 8%, white) !important; }
.primary-bg-a2 { background-color: color-mix(in srgb, var(--dcic-primary-color) 18%, white) !important; }
.primary-bg-a3 { background-color: color-mix(in srgb, var(--dcic-primary-color) 28%, white) !important; }
.primary-bg-a4 { background-color: color-mix(in srgb, var(--dcic-primary-color) 38%, white) !important; }
.primary-bg-a5 { background-color: color-mix(in srgb, var(--dcic-primary-color) 48%, white) !important; }
.primary-bg-a6 { background-color: color-mix(in srgb, var(--dcic-primary-color) 58%, white) !important; }
.primary-bg-a7 { background-color: color-mix(in srgb, var(--dcic-primary-color) 68%, white) !important; }
.primary-bg-a8 { background-color: color-mix(in srgb, var(--dcic-primary-color) 78%, white) !important; }
.primary-bg-a9,
.primary-bg-a10,
.primary-bg-a11,
.primary-bg-a12 { background-color: var(--dcic-primary-color) !important; }

.primary-border-color-a1 { border-color: color-mix(in srgb, var(--dcic-primary-color) 8%, white) !important; }
.primary-border-color-a2 { border-color: color-mix(in srgb, var(--dcic-primary-color) 18%, white) !important; }
.primary-border-color-a3 { border-color: color-mix(in srgb, var(--dcic-primary-color) 28%, white) !important; }
.primary-border-color-a4 { border-color: color-mix(in srgb, var(--dcic-primary-color) 38%, white) !important; }
.primary-border-color-a5 { border-color: color-mix(in srgb, var(--dcic-primary-color) 48%, white) !important; }
.primary-border-color-a6 { border-color: color-mix(in srgb, var(--dcic-primary-color) 58%, white) !important; }
.primary-border-color-a7 { border-color: color-mix(in srgb, var(--dcic-primary-color) 68%, white) !important; }
.primary-border-color-a8 { border-color: color-mix(in srgb, var(--dcic-primary-color) 78%, white) !important; }
.primary-border-color-a9,
.primary-border-color-a10,
.primary-border-color-a11,
.primary-border-color-a12 { border-color: var(--dcic-primary-color) !important; }

.it-carousel-wrapper .splide__pagination button.is-active,
.it-carousel-wrapper.it-carousel-landscape-abstract-three-cols-arrow-visible .splide__arrows .splide__arrow {
    background-color: var(--dcic-primary-color, #145a43) !important;
}

/* Sovrascrive anche il verde del messaggio evidenziato definito nel CSS del tema padre. */
.home-message.green,
.home-message .msg svg {
    background-color: var(--dcic-primary-color, #145a43) !important;
    color: #fff !important;
    fill: #fff !important;
}


/* Credito del tema, allineato in basso a destra nel footer. */
.dcic-footer-credit {
    margin-top: .5rem;
    text-align: right;
}

.dcic-footer-credit small {
    font-size: .8125rem;
}

.dcic-footer-credit a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: .15em;
}

.dcic-footer-credit a:hover,
.dcic-footer-credit a:focus-visible {
    color: #fff;
    text-decoration-thickness: 2px;
}


/* Mobile: evitare schede notizia troppo compresse e controlli verdi residui. */
@media (max-width: 575.98px) {
    .dcic-home-news-cards .card-teaser-image > .card-image-wrapper {
        align-items: stretch;
        flex-direction: column !important;
    }

    .dcic-home-news-cards .card-teaser-image > .card-image-wrapper > .card-body,
    .dcic-home-news-cards .card-teaser-image > .card-image-wrapper > .card-image {
        flex: 0 0 auto;
        width: 100% !important;
    }

    .dcic-home-news-cards .card-teaser-image > .card-image-wrapper > .card-body {
        padding: 1rem !important;
    }

    .dcic-home-news-cards .card-teaser-image .card-body .card-text {
        margin-bottom: .75rem !important;
    }

    .dcic-home-news-cards .card-teaser-image > .card-image-wrapper > .card-image {
        height: 180px;
        max-height: 180px;
        padding-bottom: 0 !important;
    }

    .dcic-home-news-cards .card-teaser-image .card-image img {
        height: 100%;
        object-fit: cover;
        width: 100%;
    }

    .it-header-slim-wrapper .it-header-slim-wrapper-content {
        align-items: stretch;
        flex-wrap: wrap;
        gap: .25rem 0;
    }

    .it-header-slim-wrapper .it-header-slim-wrapper-content > .navbar-brand {
        flex: 0 0 100%;
        padding-bottom: .25rem;
    }

    .it-header-slim-wrapper .it-header-slim-wrapper-content .it-header-slim-right-zone {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto auto;
        align-items: center;
        gap: 0 .35rem;
        margin: 0 !important;
        width: 100% !important;
    }

    .it-header-slim-right-zone .dcic-institutional-links {
        display: grid;
        grid-column: 1 / -1;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        justify-content: stretch;
        margin: 0 0 .25rem;
        width: 100%;
    }

    .it-header-slim-right-zone .dcic-institutional-links a {
        justify-content: center;
        min-width: 0;
        min-height: 2.35rem;
        padding: .35rem .4rem;
        font-size: .72rem;
        line-height: 1.2;
        text-align: center;
        white-space: normal;
    }

    .custom-navbar-toggler {
        background-color: var(--dcic-primary-color, #145a43) !important;
        border-radius: 4px;
    }

    .it-header-slim-right-zone [data-element="personal-area-login"] {
        background-color: var(--dcic-primary-color, #145a43) !important;
        border-color: var(--dcic-primary-color, #145a43) !important;
    }

    .it-header-slim-right-zone [data-element="personal-area-login"] .rounded-icon.rounded-primary,
    .it-header-slim-right-zone [data-element="personal-area-login"] .rounded-icon.rounded-success {
        background-color: var(--dcic-primary-color, #145a43) !important;
    }

    .it-header-slim-right-zone [data-element="personal-area-login"] .rounded-icon .icon {
        fill: #fff !important;
    }
}
