body {
    /* overflow-x: hidden; /* rimuove scrollbar orizzontale globale */
}
/* Neutralizza lo stile mobile generico SOLO sui breadcrumbs */
@media screen and (max-width: 992px) {
    nav.breadcrumb-container {
        border: 0 !important;
        margin: 0 !important;
        top: auto !important;
        background: none !important;
    }
}

.breadcrumb-container {
    margin-top: 3.5rem !important;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* Override layout ER – WCAG 1.4.10 */
.u-layout-wide,
.u-layoutCenter {
    max-width: 144rem; /* mantieni il limite originale */
    margin-left: auto; /* centratura */
    margin-right: auto;
    padding-left: 1rem; /* oppure il valore originale di build.css */
    padding-right: 1rem;
    box-sizing: border-box; /* include padding nella larghezza */
    overflow-x: clip; /* impedisce overflow dei figli */
}

h1, h2, h3, h4, h5, h6 {
    color: #16395E;
}

.no-underline {
    text-decoration: none !important;
    display: inline-block;
    cursor: pointer;
    transition: box-shadow 0.2s, border-color 0.2s;
}

    .no-underline:hover {
        box-shadow: 0 0 0 3px #005fcc;
    }

    .no-underline:focus-visible {
        outline: 3px solid #005fcc;
        outline-offset: 3px;
    }

.boxombra {
    -moz-box-shadow: 10px 10px 5px #dedede inset;
    -webkit-box-shadow: 10px 10px 5px #dedede inset;
    box-shadow: 10px 10px 5px #dedede inset;
    padding: 10px;
    background-color: aquamarine;
}

.GVPrev {
    max-width: 100%;
    min-width: 0;
    border-collapse: collapse;
}

    .GVPrev td,
    .GVPrev th {
        padding: 8px;
        border: 1px solid #ccc;
        text-align: left;
        vertical-align: top;
    }
    /* Alternating rows per contrasto */
    .GVPrev tr:nth-child(even) {
        background-color: #f9f9f9;
    }

@media (max-width: 800px), (min-width: 0px) and (max-zoom: 200%) {
    .GVPrev thead {
        position: absolute;
        left: -9999px;
        top: -9999px;
    }

    .GVPrev tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #ccc;
        padding: 0.5rem;
        background: #fff;
    }

    .GVPrev td {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: flex-start;
        gap: 1rem;
        padding: 0.4rem 0;
        border: none;
        border-bottom: 1px solid #eee;
        word-break: break-word;
    }

        .GVPrev td::before {
            content: attr(data-label);
            font-weight: 600;
            text-align: left;
            flex: 0 0 45%;
            min-width: 45%
        }

        .GVPrev td:last-child {
            border-bottom: none;
        }
}

.gv-container {
    display: inline-block; /* si adatta al contenuto, non al contenitore padre */
    width: fit-content; /* prende la larghezza della tabella */
    max-width: 100%;
}

.rigasottoiltitolo {
    margin-top: -13px;
    font-size: 0.2em;
    color: #FFCC00;
}

.rigatraibottoni {
    color: #FFCC00;
}

.titolo {
    font-size: 1.8em;
    font-weight: bold;
    color: #015A9C;
    font-family: "Titillium Web","Helvetica Neue",Helvetica,Arial,sans-serif;
    /*font-family: Verdana, Geneva, Arial, Helvetica, Sans-Serif;*/
}

.titolo2 {
    font-size: 1.5em;
    font-weight: bold;
    color: #015A9C;
    font-family: "Titillium Web","Helvetica Neue",Helvetica,Arial,sans-serif;
    /*font-family: Verdana, Geneva, Arial, Helvetica, Sans-Serif;*/
}

.titolo3 {
    font-size: 1.3em;
    font-weight: bold;
    color: #015A9C;
    font-family: "Titillium Web","Helvetica Neue",Helvetica,Arial,sans-serif;
    /*font-family: Verdana, Geneva, Arial, Helvetica, Sans-Serif;*/
}

.titolo4 {
    font-size: 1.2em;
    color: #015A9C;
    font-family: "Titillium Web","Helvetica Neue",Helvetica,Arial,sans-serif;
    /*font-family: Verdana, Geneva, Arial, Helvetica, Sans-Serif;*/
    text-decoration: none;
    font-weight: bold;
}

.titolo5 {
    font-size: 1em;
    font-weight: bold;
    color: #015A9C;
    font-family: "Titillium Web","Helvetica Neue",Helvetica,Arial,sans-serif;
    text-decoration: none;
    margin-top: 0.5em;
    margin-bottom: 0.2em;
}

.butt_standard {
    width: 80px;
    Height: 30px;
    font-size: 100%;
}

.butt_small {
    width: 70px;
    Height: 25px;
    font-size: 90%;
    white-space: normal;
}

.overflow {
    overflow: auto;
}


.posizioneprimodiv {
    margin-right: 5px;
    font-size: 85%;
}

/* --- angoli arrotondati --- */

.rndbord {
    -moz-border-radius: 10px;
    -webkit-border-radius: 10px;
    border-radius: 10px;
    border: 2px solid black;
}

.imgRid {
    height: 50%;
    width: 50%;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.no-table-layout {
    table-layout: fixed;
    display: block !important;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.checkbox-normale,
.checkbox-normale label,
.checkbox-normale * {
    font-weight: normal !important;
    vertical-align: top;
    display: inline-block;
}

    .checkbox-normale input[type="checkbox"] {
        vertical-align: text-top;
        margin-right: 5px;
    }

.pager-container {
    text-align: center;
    padding: 10px 0;
    background-color: #ffffff; /* più chiaro per contrasto migliore */
    display: flex;
    justify-content: center; /* Centra tutto */
    align-items: center; /* Allinea verticalmente */
    gap: 8px;
    /*
    border-top: 1px solid #ccc;
    margin-top: 5px;
        */
}

/* LINK NORMALE */
.pager-link {
    padding: 4px 8px;
    margin: 2px;
    border-radius: 4px;
    background-color: #e6e6e6; /* chiaro ma con contrasto */
    color: #212121; /* grigio molto scuro (quasi nero) */
    font-weight: normal;
    text-decoration: none;
    border: 1px solid #bbb;
}

    /* LINK HOVER */
    .pager-link:hover {
        background-color: #cccccc;
        color: #000000;
        border-color: #999;
        cursor: pointer;
    }

    /* LINK FOCUS */
    .pager-link:focus {
        outline: 2px solid #0056b3;
        outline-offset: 2px;
    }

    /* LINK DISABILITATO */
    .pager-link[disabled],
    .pager-link:disabled {
        color: #888888;
        background-color: #f2f2f2;
        pointer-events: none;
        cursor: default;
        border: 1px solid #ddd;
    }

/* TESTO NUMERI PAGINA */
.pager-numbers {
    font-weight: bold;
    margin: 0 10px;
    color: #212121; /* contrasto elevato */
}

/* NUMERI PAGINA LINK */
.page-number {
    padding: 4px 8px;
    margin: 2px;
    border-radius: 4px;
    background-color: #e6e6e6;
    color: #212121;
    font-weight: normal;
    border: 1px solid #bbb;
    text-decoration: none;
}

    /* NUMERO PAGINA ATTIVO */
    .page-number.active {
        background-color: #003366; /* blu scuro */
        color: #ffffff; /* bianco puro */
        font-weight: bold;
        border-color: #003366;
    }

    /* NUMERO PAGINA HOVER (non attivo) */
    .page-number:hover:not(.active) {
        background-color: #cccccc;
        color: #000000;
    }

.rbl-group {
    border: none;
    padding: 0;
    margin-bottom: 15px;
}

.rbl-wrapper {
    display: flex;
    align-items: flex-start;
}

.rbl-input {
    margin-right: 10px;
}

.rbl-no-border {
    border: none !important;
    padding: 0;
    margin: 0;
}

.rbl-description {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.rbl-label {
    font-weight: bold;
    white-space: nowrap;
}

.rbl-data {
    font-style: italic;
    color: #555;
    margin-top: 2px;
    padding-left: 0px;
}
/* Spaziatura tra cerchietto e etichetta */
.rbl-spaced input[type="radio"] {
    margin-right: 4px;
    margin-left: 4px;
}

.keyword-item {
    background-color: #CCFFFF;
    font-weight: bold;
    padding: 6px 12px;
    margin-bottom: 5px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.parola {
    flex: 1;
    font-size: 1em;
}

.btn-delete {
    color: darkred;
    text-decoration: none;
    font-weight: bold;
}

    .btn-delete:hover, btn-delete A {
        color: red;
        text-decoration: none;
    }

.no-border {
    border: none !important;
    box-shadow: none !important;
}

.form-control {
    width: 100%;
    padding: 4px;
}

.elencocompatto {
    line-height: 1;
    padding: 2px;
}

input[type="checkbox"] + label {
    font-weight: normal !important;
}

form, .aspNetHidden {
    margin: 0 !important;
}

.custom-tooltip {
    background: #fff8dc;
    border: 1px solid #999;
    color: #333;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 0 3px rgba(0,0,0,0.3);
}

/* Popup */
.leaflet-popup-content-wrapper {
    padding: 10px;
    border-radius: 8px;
}

.leaflet-popup-content {
    font-size: 16px !important;
    overflow-wrap: break-word;
    white-space: normal;
    word-break: break-word;
    max-height: 220px;
    overflow-y: auto;
    line-height: 1.4;
}

.leaflet-control-attribution {
    font-size: 14px !important; /* o la dimensione che preferisci */
}

    .leaflet-control-attribution a {
        font-size: 14px !important;
    }


.popup-content a {
    display: inline-block;
    margin-top: 8px;
    color: #0645ad;
    text-decoration: underline;
    font-weight: 500;
}

/* Stili dei textbox, ddl, ecc*/

/* Classe base: tutto ciò che vale per tutti i tipi */
.input-common {
    display: block;
    width: 100%;
    max-width: 90vw;
    box-sizing: border-box;
    padding: 0.5em 0.8em;
    font-size: clamp(1.2rem, 1.8vw, 1.8rem);
    line-height: 1.4;
    color: #000;
    background-color: #fff;
    border: 1px solid #003399;
    border-radius: 6px;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

    /* Stati di focus */
    .input-common:focus,
    .input-common:focus-visible {
        outline: 3px solid #ffcc00;
        outline-offset: 2px;
        border-color: #001f80;
        box-shadow: 0 0 0 2px rgba(0, 51, 153, 0.25);
    }

/* Textarea */
textarea.input-common {
    resize: vertical;
    min-height: 3em;
}

/* Dropdown */
select.input-common {
    background-image: url("data:image/svg+xml;utf8,<svg fill='%23003399' height='16' viewBox='0 0 20 20' width='16' xmlns='http://www.w3.org/2000/svg'><path d='M5.516 7.548l4.484 4.9 4.484-4.9z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 0.6em center;
    background-size: 1em;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 2em;
}

    select.input-common::-ms-expand {
        display: none; /* IE11 compat */
    }

/* --- VARIANTI RESPONSIVE --- */
.input-verysmall {
    max-width: 50px !important;
}

.input-mildsmall {
    max-width: 100px !important;
}

.input-small {
    max-width: 180px !important;
}

.input-medio {
    max-width: 220px !important;
}

.input-mediowide {
    max-width: 350px !important;
}

.input-wide {
    max-width: 800px !important;
}

.input-large {
    font-size: 1rem;
}

.butt_prevenzione {
    background-color: #16395e;
    color: #fff;
    text-align: center;
    display: inline-flex;
    margin-top: 5px;
    padding: 0.4em 1.2em;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    line-height: 1.3;
    min-height: 44px; /* target touch */
    height: auto;
    max-width: 100%;
    white-space: normal;
}

    .butt_prevenzione:hover,
    .butt_prevenzione:focus {
        background-color: #002266;
        box-shadow: 0 0 0 3px rgba(0, 51, 153, 0.3);
        outline: none;
    }

.captcha-container {
    display: inline-block;
    border: 2px solid brown;
    border-radius: 8px;
    padding: 15px;
    box-sizing: border-box;
    margin: 0 auto;
    background-color: #fff;
    font-size: inherit; /* eredita dal contesto */
}
/* Riga con i tre elementi allineati */
.captcha-row {
    display: flex;
    align-items: center;
    gap: 0.5rem; /* spaziatura tra gli elementi */
    flex-wrap: wrap; /* su schermi piccoli va a capo */
}

    .captcha-row > * {
        min-width: 0; /* importantissimo per consentire al testo di ridursi */
    }
    /* Label */
    .captcha-row label {
        font-weight: bold;
        white-space: nowrap;
        display: inline-block !important;
    }

    .captcha-row input.input-common,
    .captcha-row select.input-common {
        display: inline-block !important;
        width: auto !important;
        max-width: 100%;
        flex: 1 1 auto;
        box-sizing: border-box;
    }
/* NEW card styles */
/* Wrapper generale delle card */
.cards-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start; /* parte da sinistra */
    row-gap: 15px; /* solo tra righe multiple */
    column-gap: 15px; /* solo tra colonne */
    align-items: flex-start; /* evita stretch verticale */
}

.card-container {
    width: 100%; /* occupa tutta la larghezza del link */
    height: 100%; /* occupa tutta l’altezza del link */
    box-sizing: border-box;
}

/* Card link (elemento realmente focussabile) */
.card {
    display: block;
    width: 100%;
    max-width: 260px;
    text-decoration: none;
    position: relative;
    vertical-align: top;
}

/* Card interna (contenuto) */
.card-inner {
    width: 100%;
    aspect-ratio: 260 / 350; /* MODIFICATO: mantiene proporzioni della card */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    border: 5px solid #ccc;
    overflow: hidden;
    box-sizing: border-box;
    background-color: #fff;
}

/* Header: icona misura + nome filiera */
.card-header {
    display: flex;
    align-items: flex-start; /* MODIFICATO: allinea in alto */
    padding: 0;
}

    .card-header img {
        width: 26px;
        height: 20px;
        margin-right: 0;
        display: block;
    }

.nome-filiera {
    flex: 1;
    text-align: left;
    font-size: 12px;
    border: 1px solid #ccc;
    padding: 0 4px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    line-height: 18px;
}
/* Wrapper immagine */
.img-wrapper {
    width: 100%;
    /* AGGIUNTO: niente altezza fissa, height viene da object-fit */
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* Immagine di sfondo */
.img-base {
    width: 100%;
    height: auto; /* MODIFICATO: mantiene proporzioni */
    object-fit: contain; /* AGGIUNTO: non taglia l’immagine */
    object-position: center; /* AGGIUNTO: centrata */
    display: block;
}

/* Corpo: titolo e descrizione */
.card-body {
    padding: 2px 4px; /* MODIFICATO: minimo padding */
    margin: 0;
    line-height: 1.2;
    flex-shrink: 0; /* AGGIUNTO: non si comprime */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.text-truncate {
    display: -webkit-box;
    -webkit-line-clamp: 2; /* taglia a 2 linee */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Footer: logo e fase */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 4px; /* MODIFICATO: minimo padding */
    margin: 0;
    flex-shrink: 0; /* non si comprime */
}

.logo-sx, .fase-dx {
    width: 50%;
    text-align: center;
}

/* Localizzazione appoggiata al fondo */
.localizzazione {
    font-size: small;
    line-height: 1.2;
    padding: 2px 4px; /* MODIFICATO: ridotto padding */
    margin-top: auto; /* AGGIUNTO: spinge la localizzazione al fondo */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Focus e hover */
.card:focus-visible {
    outline: 3px solid #005fcc;
    outline-offset: 0;
}

.card:hover .card-inner {
    box-shadow: 0 0 0 3px #005fcc33;
}

/* Responsive: 2 card per riga su schermi medi */
@media (max-width: 768px) {
    .card {
        width: 45%;
        /* aspect-ratio mantiene le proporzioni */
    }
}

/* Responsive: 1 card per riga su schermi piccoli */
@media (max-width: 480px) {
    .card {
        width: 90%;
        /* aspect-ratio mantiene le proporzioni */
    }
}

/* FINE NEW CARD STYLE */

/* Contenitore flessibile per box a due colonne */
.scheda-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1.5rem;
    margin-top: 0.5rem;
    max-width: 100%;
}

/* Box singolo */
.scheda-box {
    flex: 1 1 45%;
    border: 1px dotted brown;
    padding: 1rem;
    box-sizing: border-box;
    background-color: #fff;
}

/* Box grande a tutta larghezza */
.scheda-box-full {
    flex: 1 1 100%;
    border: 1px dotted brown;
    padding: 1rem;
    box-sizing: border-box;
    background-color: #fff;
}

/* Titoli sezioni */
.scheda-box h4 {
    display: block;
    font-weight: bold;
    color: #015A9C;
    margin-bottom: 0.5rem;
}

.scheda-box-full h4, .scheda-box-full h3 {
    display: block;
    font-weight: bold;
    color: #015A9C;
    margin-bottom: 0.5rem;
}

/* GridView compatte */
.elencocompatto td {
    padding: 2px 4px;
    font-size: 0.9em;
}

/* Adatta il layout su schermi piccoli */
@media (max-width: 480px) {
    .captcha-container {
        max-width: 95%;
        padding: 1rem;
    }

    .scheda-box {
        flex: 1 1 100%;
        max-width: 100%;
    }

    .overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 9998;
        display: block;
    }

    .CookiesAlert {
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        width: 30%;
        max-width: min(400px, 90vw); /* garantisce che non superi la viewport */
        min-width: 200px; /* evita che diventi troppo stretto */
        min-height: 150px;
        max-height: 80vh;
        border-radius: 15px;
        text-align: center;
        background-color: #16395e;
        color: #fff;
        padding: 10px;
        z-index: 10000;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
        overflow-y: auto; /* scroll verticale se serve */
        overflow-x: hidden; /* blocca scroll orizzontale */
        word-wrap: break-word; /* forza il testo lungo a andare a capo */
    }

        .CookiesAlert a {
            color: #ffffff;
            text-decoration: underline;
            word-break: break-word;
            overflow-wrap: break-word;
        }

            .CookiesAlert a:focus,
            .CookiesAlert button:focus {
                outline: 2px solid gold;
                outline-offset: 2px;
            }

    .cookie-btn {
        border-radius: 5px;
        background-color: gold;
        color: #16395e;
        font-weight: bold;
        padding: 5px 12px;
        border: none;
        cursor: pointer;
    }

        .cookie-btn:hover {
            background-color: #ffde55;
        }

    /* SCHEDONE */
    /* Contenitore principale schedone */
    .schedone-container {
        width: 100%;
        max-width: 800px;
        margin: 10px auto;
        padding: 10px;
        box-sizing: border-box;
        background-color: transparent;
        color: #ffffff;
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        position: relative;
    }

    /* Header: logo + info principali */
    .schedone-header {
        display: flex;
        flex-wrap: nowrap; /* consente al footer di spostarsi sotto se necessario */
        gap: 10px;
        padding: 15px;
        width: 100%;
        position: relative; /* necessario per absolute fallback */
        align-items: flex-start;
        background-color: #001b3e;
        box-shadow: 3px 3px 10px #dedede, -3px -3px 10px #dedede;
        border: 1px solid #dedede;
        box-sizing: border-box;
    }

        .schedone-header .logo {
            flex-shrink: 0;
            width: 120px;
            height: 120px;
        }

            .schedone-header .logo img {
                width: 100%;
                height: 100%;
                object-fit: fill; /* forza l’immagine a riempire il box */
            }

        .schedone-header .blocco-centrale {
            flex: 1 1 auto;
            min-width: 200px;
        }

    /* Titolo e descrizione con troncamento multilinea */
    .text-truncate-multi {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Link e focus */
    .schedone-container a:focus,
    .schedone-container a:hover {
        outline: 2px solid #005fcc;
        outline-offset: 2px;
    }

    /* Blocchi ListView e dettagli */
    .schedone-block {
        width: 100%;
        max-width: 800px;
        margin: 10px auto 0 auto;
        padding: 10px;
        background-color: white;
        color: #000;
        box-shadow: 3px 3px 10px #dedede, -3px -3px 10px #dedede;
        border: 1px solid #dedede;
        box-sizing: border-box;
    }

    .listview-flex {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Parole chiave inline */
    .keyword-item {
        display: inline-block;
        margin-right: 10px;
    }

    /* Footer icons (Filiera, Fase, Misura) */
    .schedone-footer-icons {
        position: relative;
        justify-content: flex-end;
        margin-top: 10px;
        right: 5px;
        display: flex;
        gap: 10px;
    }

        .schedone-footer-icons .icon-block {
            text-align: center;
            width: 60px;
        }
    /* FORTE ZOOM o schermi stretti: footer scivola sotto */
    @media (max-width: 600px) {
        .schedone-header {
            flex-wrap: wrap; /* permette di andare a capo */
        }
    }

    .vociregistra {
        color: #015A9C;
        font-family: "Titillium Web","Helvetica Neue",Helvetica,Arial,sans-serif;
        font-weight: bold;
    }

    .btn-icon {
        background: none;
        border: none;
        cursor: pointer;
        text-decoration: none;
        font-size: 1.1em; /* dimensione emoji o icona */
        padding: 4px;
        color: #000; /* colore testo o icona */
    }

        /* Outline visibile al focus (tastiera) */
        .btn-icon:focus, .btn-icon:hover {
            outline: 2px solid #005fcc; /* colore blu accessibile */
            outline-offset: 2px;
            box-shadow: 0 0 2px 2px rgba(0, 95, 204, 0.5); /* opzione più evidente */
        }

        .btn-icon:hover {
            background-color: #e6f0ff;
        }

    .labBoldBlu {
        color: #16395E;
        font-weight: bold;
        max-width: 100%;
    }

        .labBoldBlu span.label-main {
            display: block; /* testo principale va a capo se serve */
            font-weight: bold;
            word-break: break-word;
        }

        .labBoldBlu span.label-sub {
            display: block; /* testo secondario sempre sotto */
            font-weight: normal !important;
            margin-top: 0.2rem;
            word-break: break-word;
        }
}
