/* ============================================
   Tema CET - Custom CSS
   Basato su Bootstrap Italia / UI Kit Italia
   ============================================ */

:root {
    --cet-primary: #003580;
    --cet-primary-dark: #002856;
    --cet-primary-light: #0059b3;
    --cet-accent-green: #4CAF50;
    --cet-accent-yellow: #FFC107;
    --cet-accent-orange: #FF9800;
    --cet-accent-red: #E53935;
    --cet-bg-light: #f5f7fa;
    --cet-text: #333333;
    --cet-text-muted: #666666;
    --cet-border: #e0e0e0;
}

/* ---- Typography ---- */
:root {
    --bs-body-font-family: 'Titillium Web', sans-serif;
}

body {
    font-family: 'Titillium Web', sans-serif;
    color: var(--cet-text);
}

/* Footer sempre in fondo */
#main-content {
    min-height: calc(100vh - 200px);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Titillium Web', sans-serif;
    font-weight: 700;
}

/* Forza Titillium Web su tutto il contenuto generato da wp_editor */
.about-card-text,
.about-card-text *,
.trasp-descrizione,
.trasp-descrizione *,
.page-content,
.page-content *,
.page-description,
.page-description * {
    font-family: 'Titillium Web', sans-serif !important;
}

/* ---- Header ---- */

/* Center Header (white background) - override Bootstrap Italia height/bg */
.it-header-center-wrapper {
    background-color: #fff !important;
    height: auto !important;
    padding: 16px 0 !important;
    transition: padding 0.3s ease;
}

.it-brand-wrapper {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 16px;
}

.it-brand-wrapper a {
    display: inline-block;
    text-decoration: none;
}

.it-brand-wrapper .brand-logo,
.it-brand-wrapper img.brand-logo {
    width: auto;
    height: 80px;
    transition: height 0.3s ease;
}

.it-brand-wrapper .brand-logo-placeholder {
    display: inline-block;
}

.it-brand-wrapper .brand-logo-text {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--cet-primary);
}

.it-brand-tagline {
    font-size: 0.85rem;
    color: var(--cet-text-muted);
}

.it-brand-tagline strong {
    color: var(--cet-primary);
    text-decoration: underline;
}

/* Right Zone: Social + Search */
.it-right-zone {
    display: flex;
    align-items: center;
    gap: 24px;
}

.it-socials {
    display: flex;
    align-items: center;
    gap: 12px;
}

.socials-label {
    font-size: 0.9rem;
    color: var(--cet-text-muted);
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--cet-primary);
    transition: opacity 0.2s;
}

.social-icon:hover {
    opacity: 0.7;
}

.social-icon .icon {
    width: 22px;
    height: 22px;
    fill: var(--cet-primary-dark);
}

.it-search-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-label {
    font-size: 1rem;
    color: var(--cet-text);
    font-weight: 600;
}

.it-search-wrapper .search-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--cet-primary);
    transition: background 0.2s;
}

.it-search-wrapper .search-link:hover {
    background: var(--cet-primary-dark);
}

.it-search-wrapper .search-link .icon {
    width: 20px;
    height: 20px;
    fill: #fff;
    transition: width 0.3s ease, height 0.3s ease;
}

/* Navigation */
.it-header-navbar-wrapper {
    background-color: var(--cet-primary);
}

.it-header-navbar-wrapper .navbar {
    padding: 0;
}

.it-header-navbar-wrapper .navbar-nav .nav-link {
    color: #fff;
    padding: 14px 18px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: background 0.2s;
}

.it-header-navbar-wrapper .navbar-nav .nav-link:hover,
.it-header-navbar-wrapper .navbar-nav .nav-item.active .nav-link {
    background: rgba(255, 255, 255, 0.1);
}

/* Dropdown arrows on nav items */
.it-header-navbar-wrapper .navbar-nav .nav-link.dropdown-toggle::after {
    display: inline-block;
    margin-left: 6px;
    vertical-align: middle;
    content: "";
    border-top: 5px solid #fff;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
}

.custom-navbar-toggler {
    background: none;
    border: none;
    color: #fff;
    padding: 8px;
    cursor: pointer;
}

.custom-navbar-toggler .icon {
    fill: #fff;
    width: 24px;
    height: 24px;
}

/* ---- Sticky Header (single header that shrinks) ---- */
header.it-header-wrapper {
    position: relative;
    z-index: 1040;
    transition: box-shadow 0.3s ease;
    width: 100%;
}

header.it-header-wrapper.is-sticky {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

/* ---- Sticky: white bar shrinks ---- */
header.is-sticky .it-header-center-wrapper {
    padding: 8px 0 !important;
    height: auto !important;
}

header.is-sticky .it-brand-wrapper {
    margin: 0 !important;
    padding: 0 !important;
}

header.is-sticky .it-brand-wrapper a {
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
}

header.is-sticky .it-brand-wrapper .brand-logo,
header.is-sticky .it-brand-wrapper img.brand-logo {
    height: 60px !important;
}

header.is-sticky .it-brand-wrapper .brand-logo-text {
    font-size: 0.85rem !important;
}

header.is-sticky .it-brand-tagline {
    display: none !important;
}

header.is-sticky .it-socials {
    display: none !important;
}

header.is-sticky .search-label {
    display: none !important;
}

header.is-sticky .it-right-zone {
    gap: 8px !important;
}

header.is-sticky .it-search-wrapper .search-link {
    width: 28px !important;
    height: 28px !important;
}

header.is-sticky .it-search-wrapper .search-link .icon {
    width: 14px !important;
    height: 14px !important;
}

/* ---- Sticky: navbar shrinks ---- */
header.is-sticky .it-header-navbar-wrapper .navbar-nav .nav-link {
    padding: 6px 14px !important;
    font-size: 0.85rem !important;
}

/* Admin bar offset for sticky header */
.admin-bar header.it-header-wrapper.is-sticky {
    top: 32px !important;
}

@media (max-width: 782px) {
    .admin-bar header.it-header-wrapper.is-sticky {
        top: 46px !important;
    }
}

/* Spacer to prevent content jump when header becomes fixed */
.header-spacer {
    display: none;
}

.header-spacer.active {
    display: block;
}

/* ---- Breadcrumb ---- */
.breadcrumb {
    background: none;
    padding: 0;
    margin-bottom: 0;
    font-size: 0.9rem;
}

.breadcrumb-item a {
    color: var(--cet-primary);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--cet-text-muted);
}

/* ---- Cards (override Bootstrap Italia) ---- */
.card-wrapper {
    display: block !important;
    padding-bottom: 0 !important;
}

.card-wrapper .card-body,
.card.card-big .card-body {
    padding: 20px !important;
}

/* Bootstrap Italia: .card a.read-more { position:absolute; bottom:24px } - fix */
.card a.read-more,
a.read-more {
    position: static !important;
    display: inline-flex !important;
    margin-top: 12px;
}

.card-bg {
    background: #fff;
    border: 1px solid var(--cet-border);
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s;
    overflow: hidden;
}

.card-bg:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.border-bottom-card {
    border-bottom: 3px solid var(--cet-primary);
}

.card .category-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.card .category-top .category {
    color: var(--cet-primary);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.card .category-top .data {
    color: var(--cet-text-muted);
}

.card-title a {
    color: var(--cet-text);
    text-decoration: none;
}

.card-title a:hover {
    color: var(--cet-primary);
}

.card-text {
    color: var(--cet-text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--cet-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.read-more:hover {
    text-decoration: underline;
}

.read-more .icon {
    width: 18px;
    height: 18px;
    fill: var(--cet-primary);
}

/* ---- Hero Section (Homepage) ---- */
.hero-section {
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 420px;
    display: flex;
    align-items: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.15) 50%, transparent 75%);
    z-index: 0;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.hero-content {
    max-width: 650px;
    padding: 80px 0;
}

.hero-kicker {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.hero-title {
    color: #fff;
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.1;
}

.hero-description {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.3rem;
    margin-bottom: 32px;
    line-height: 1.7;
}

.hero-cta {
    background: #d4956a;
    color: #fff;
    border: none;
    padding: 14px 36px;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.hero-cta:hover {
    background: #c07e55;
    color: #fff;
}

/* ---- Page Header Image (Internal Pages) ---- */
.page-header-image {
    position: relative;
    height: 200px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.page-header-overlay {
    display: none;
}

/* ---- About / Presentazione Consorzio ---- */
.section-about {
    background: var(--cet-bg-light);
}

.about-card {
    padding: 0;
    height: 100%;
}

.about-card-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
}

.about-card-icon {
    width: 180px;
    height: 180px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-card-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.about-card-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--cet-primary);
    margin: 0;
}

.about-card-text {
    font-size: 0.95rem;
    color: var(--cet-text-muted);
    line-height: 1.7;
    margin: 0;
}

.about-card-text p {
    font-size: inherit;
    color: inherit;
    line-height: inherit;
    margin: 0 0 0.5em;
}

.about-card-text p:last-child {
    margin-bottom: 0;
}

.about-card-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--cet-primary);
    text-decoration: none;
}

.about-card-link:hover {
    text-decoration: underline;
}

.about-card-link .icon {
    fill: var(--cet-primary);
}

@media (max-width: 575px) {
    .about-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .about-card-icon {
        width: 120px;
        height: 120px;
    }

    .about-card-title {
        font-size: 1.6rem;
    }
}

/* ---- Homepage Sections ---- */
.section-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--cet-text);
}

.section-news {
    background: #fff;
}

.section-bandi {
    background: var(--cet-bg-light);
}

.section-bandi .card .categoryicon-top {
    margin-bottom: 12px;
}

.section-bandi .card .categoryicon-top .icon {
    width: 40px;
    height: 40px;
}

.icon-lg {
    width: 40px;
    height: 40px;
}

/* Bandi tipo contratto */
.cet-bandi-tipo {
    font-size: 0.75rem;
    color: var(--cet-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin: 0 0 8px;
    font-weight: 600;
}

/* Bandi categorie buttons */
.cet-bandi-cat-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 24px;
    background: #fff;
    border: 2px solid var(--cet-border);
    border-radius: 6px;
    color: var(--cet-text);
    text-decoration: none;
    transition: all 0.2s;
    height: 100%;
}

.cet-bandi-cat-btn:hover {
    border-color: var(--cet-primary);
    color: var(--cet-primary);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.cet-bandi-cat-btn-icon {
    width: 32px;
    height: 32px;
    fill: var(--cet-primary);
    flex-shrink: 0;
}

.cet-bandi-cat-btn-title {
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.2;
    display: block;
}

.cet-bandi-cat-btn-sub {
    display: block;
    font-size: 0.82rem;
    font-weight: 400;
    color: var(--cet-text-muted);
    margin-top: 2px;
}

@media (max-width: 575px) {
    .cet-bandi-cat-btn {
        padding: 14px 16px;
        gap: 10px;
    }

    .cet-bandi-cat-btn-icon {
        width: 24px;
        height: 24px;
    }

    .cet-bandi-cat-btn-title {
        font-size: 0.9rem;
    }

    .cet-bandi-cat-btn-sub {
        font-size: 0.75rem;
    }
}

/* Siti Tematici */
.section-siti-tematici {
    background: #fff;
}

.sito-tematico-link {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    border-radius: 24px;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: opacity 0.2s;
}

.sito-tematico-link:hover {
    opacity: 0.85;
    color: #fff;
    text-decoration: none;
}

.sito-tematico--primary {
    background-color: var(--cet-primary);
}

.sito-tematico--danger {
    background-color: var(--cet-accent-red);
}

.sito-tematico--success {
    background-color: var(--cet-accent-green);
}

.sito-tematico--info {
    background-color: var(--cet-primary-light);
}

/* ---- Accordion (Società Trasparente) ---- */
.accordion-item {
    border: none;
    border-bottom: 1px solid var(--cet-border);
}

.accordion-button {
    font-weight: 600;
    color: var(--cet-text);
    padding: 16px 0;
    background: none;
    box-shadow: none;
}

.accordion-button:not(.collapsed) {
    color: var(--cet-primary);
    background: none;
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: none;
    border-color: var(--cet-border);
}

.accordion-button::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23003580'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

.accordion-body {
    padding: 16px 0 24px;
}

/* ---- Trasparenza: layout a due colonne ---- */

/* Sidebar menu */
.trasp-sidebar {
    background: #fff;
    border: 1px solid var(--cet-border);
    border-radius: 6px;
    overflow: hidden;
    position: sticky;
    top: 120px;
}

.trasp-cat-group {
    border-bottom: 1px solid var(--cet-border);
}

.trasp-cat-group:last-child {
    border-bottom: none;
}

.trasp-cat-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--cet-text);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, color 0.15s;
}

.trasp-cat-toggle:hover {
    background: var(--cet-bg-light);
}

.trasp-cat-toggle.active {
    background: var(--cet-primary);
    color: #fff;
}

.trasp-cat-toggle .trasp-chevron {
    fill: currentColor;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.trasp-cat-toggle.active .trasp-chevron {
    transform: rotate(90deg);
}

.trasp-cat-items {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.trasp-cat-items.open {
    max-height: 600px;
}

.trasp-cat-items li {
    border-top: 1px solid var(--cet-border);
}

.trasp-cat-items .trasp-empty {
    padding: 10px 16px 10px 28px;
    color: var(--cet-text-muted);
    font-size: 0.85rem;
    font-style: italic;
}

/* Sottocategorie */
.trasp-subcat {
    list-style: none;
}

.trasp-subcat-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 16px 10px 28px;
    background: rgba(0, 53, 128, 0.03);
    border: none;
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--cet-primary);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}

.trasp-subcat-toggle:hover {
    background: rgba(0, 53, 128, 0.07);
}

.trasp-subcat-toggle .trasp-chevron {
    fill: var(--cet-primary);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.trasp-subcat-toggle.active .trasp-chevron {
    transform: rotate(90deg);
}

.trasp-subcat-items {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.trasp-subcat-items.open {
    max-height: 600px;
}

.trasp-subcat-items .trasp-item-link {
    padding-left: 42px;
}

.trasp-item-link {
    display: block;
    padding: 10px 16px 10px 28px;
    color: var(--cet-text);
    text-decoration: none;
    font-size: 0.88rem;
    transition: background 0.15s, color 0.15s;
}

.trasp-item-link:hover {
    background: var(--cet-bg-light);
    color: var(--cet-primary);
}

.trasp-item-link.active {
    background: rgba(0, 53, 128, 0.08);
    color: var(--cet-primary);
    font-weight: 600;
}

/* Pannello dettaglio */
.trasp-detail {
    background: #fff;
    border: 1px solid var(--cet-border);
    border-radius: 6px;
    padding: 30px;
    min-height: 300px;
    /* Il menu e' lungo (23 categorie, 64 voci): se il dettaglio restasse in cima alla
       riga, aprendo una voce in fondo all'elenco bisognerebbe risalire per leggerla.
       Agganciandolo, il contenuto sta sempre di fianco alla voce che si e' cliccata.
       Le voci molto lunghe (es. il registro delle determine) scorrono dentro il pannello. */
    position: sticky;
    top: 120px;
    align-self: flex-start;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* La barra del pannello, discreta */
.trasp-detail::-webkit-scrollbar {
    width: 10px;
}

.trasp-detail::-webkit-scrollbar-thumb {
    background: #d4d8dd;
    border-radius: 5px;
}

.trasp-detail:focus-visible {
    outline: 2px solid var(--cet-primary);
    outline-offset: 2px;
}

/* Tipografia unica del pannello. I testi arrivano da posti diversi (descrizione della
   voce, descrizione dei blocchi, note, tabelle importate dal vecchio sito) e ognuno
   portava la sua misura: qui si impone una sola famiglia e una sola dimensione. */
.trasp-detail,
.trasp-detail * {
    font-family: 'Titillium Web', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.95rem;
    line-height: 1.65;
}

/* Le uniche due misure diverse, e sono gerarchia: il titolo della voce e i titoli dei blocchi. */
.trasp-detail #trasp-titolo {
    font-size: 1.35rem;
    line-height: 1.3;
}

.trasp-detail .trasp-blocco-frontend h4 {
    font-size: 1rem;
    line-height: 1.4;
}

.trasp-detail-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    text-align: center;
    color: var(--cet-text-muted);
}

.trasp-detail-placeholder p {
    margin-top: 16px;
    font-size: 0.95rem;
}

#trasp-titolo {
    font-size: 1.4rem;
    color: var(--cet-primary);
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--cet-primary);
}

.trasp-descrizione,
#trasp-descrizione {
    color: var(--cet-text-muted);
    margin-bottom: 24px;
    line-height: 1.7 !important;
    font-size: 0.95rem !important;
}

/* Tabelle dentro la descrizione: arrivano dal vecchio sito (registri di determine,
   prospetti per anno) e senza bordi sono illeggibili, le colonne si incollano. */
.trasp-detail table {
    width: 100%;
    border-collapse: collapse;
    margin: 14px 0 20px;
}

.trasp-detail th,
.trasp-detail td {
    border: 1px solid var(--cet-border);
    padding: 7px 10px;
    text-align: left;
    vertical-align: top;
    line-height: 1.5;
}

.trasp-detail thead th,
.trasp-detail tr:first-child td {
    background: var(--cet-bg-light);
    font-weight: 600;
}

.trasp-detail tbody tr:nth-child(even) td {
    background: #fbfcfd;
}

.trasp-descrizione p,
.trasp-descrizione ul,
.trasp-descrizione ol,
.trasp-descrizione dl,
.trasp-descrizione li,
#trasp-descrizione p,
#trasp-descrizione ul,
#trasp-descrizione ol,
#trasp-descrizione dl,
#trasp-descrizione li {
    font-size: 0.95rem !important;
    line-height: 1.7 !important;
    color: inherit;
    margin: 0 0 0.5em;
}

.trasp-descrizione p:last-child,
.trasp-descrizione ul:last-child,
.trasp-descrizione ol:last-child,
#trasp-descrizione p:last-child,
#trasp-descrizione ul:last-child,
#trasp-descrizione ol:last-child {
    margin-bottom: 0;
}

@media (max-width: 767.98px) {
    .trasp-detail {
        position: static;
        max-height: none;
        overflow-y: visible;
    }
    /* L'elenco aperto ha un tetto di 600px per l'animazione: col pannello dentro una voce
       i contenuti lunghi restavano tagliati. Da qui in giu' l'altezza la fa il contenuto
       (l'elenco chiuso resta a 0, quindi la fisarmonica continua a funzionare). */
    .trasp-cat-items.open,
    .trasp-subcat-items.open {
        max-height: none;
        overflow: visible;
    }
}

/* Nota per le voci senza documenti: sul vecchio sito sono meta', fra "non sussiste la
   fattispecie" e sezioni proprio vuote. Riquadrarle fa sembrare la scheda finita. */
.trasp-nota {
    display: none;
    margin: 4px 0 8px;
    padding: 14px 16px;
    background: var(--cet-bg-light);
    border-left: 3px solid var(--cet-primary);
    border-radius: 0 4px 4px 0;
    color: var(--cet-text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.trasp-nota p {
    margin: 0 0 6px;
}

.trasp-nota p:last-child {
    margin-bottom: 0;
}

/* Blocchi documenti */
.trasp-blocco-frontend {
    margin-bottom: 24px;
}

.trasp-blocco-frontend h4 {
    font-size: 1rem;
    color: var(--cet-text);
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--cet-border);
}

.trasp-blocco-desc-frontend {
    color: var(--cet-text-muted);
    margin: 0 0 10px;
}

.trasp-blocco-desc-frontend p {
    margin: 0 0 6px;
}

.trasp-documenti-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.trasp-documenti-list li {
    padding: 3px 0;
}

.trasp-documenti-list a {
    color: var(--cet-primary);
    text-decoration: none;
    font-weight: 500;
}

.trasp-documenti-list a:hover {
    text-decoration: underline;
}

@media (max-width: 767px) {
    .trasp-sidebar {
        position: static;
        margin-bottom: 20px;
    }

    .trasp-detail {
        padding: 20px;
    }
}

/* ---- News Archive Sidebar ---- */
.news-archive-sidebar {
    background: #fff;
    border: 1px solid var(--cet-border);
    border-radius: 6px;
    padding: 24px;
    position: sticky;
    top: 120px;
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--cet-text);
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--cet-primary);
}

.archive-year-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid var(--cet-border);
    text-decoration: none;
    color: var(--cet-text);
    transition: background 0.15s;
}

.archive-year-link:last-child {
    border-bottom: none;
}

.archive-year-link:hover {
    background: var(--cet-bg-light);
    color: var(--cet-primary);
}

.archive-year {
    font-weight: 600;
    font-size: 1rem;
}

.archive-count {
    background: var(--cet-primary);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
    min-width: 28px;
    text-align: center;
}

.archive-year-link.active {
    background: rgba(0, 53, 128, 0.08);
    color: var(--cet-primary);
}

.archive-year-link.active .archive-year {
    color: var(--cet-primary);
}

/* ---- News Featured (evidenza homepage) ---- */
.cet-news-featured {
    background: #fff;
    border: 1px solid var(--cet-border);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.cet-news-featured .row {
    margin: 0;
}

.cet-news-featured .row > div {
    padding: 0;
}

.cet-news-featured-text {
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}

.cet-news-featured-title {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 12px 0 16px;
}

.cet-news-featured-title a {
    color: var(--cet-text);
    text-decoration: none;
}

.cet-news-featured-title a:hover {
    color: var(--cet-primary);
}

.cet-news-featured-excerpt {
    color: var(--cet-text-muted);
    font-size: 1.05rem;    /* la news in evidenza si legge, non si intravede (Ale 09/09) */
    line-height: 1.6;
    margin: 0 0 20px;
    flex: 1;
}

.cet-news-featured-img {
    height: 100%;
    min-height: 280px;
    overflow: hidden;
}

.cet-news-featured-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (max-width: 767px) {
    .cet-news-featured-text {
        padding: 20px;
    }

    .cet-news-featured-title {
        font-size: 1.4rem;
    }

    .cet-news-featured-img {
        min-height: 200px;
    }
}

/* ---- News Cards (no Bootstrap Italia classes) ---- */
.cet-news-card {
    background: #fff;
    border: 1px solid var(--cet-border);
    border-bottom: 3px solid var(--cet-primary);
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s;
}

/* Flex + stessa altezza solo nelle griglie homepage */
.section-news .cet-news-card,
.section-bandi .cet-news-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.cet-news-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.cet-news-card-img {
    overflow: hidden;
    border-radius: 4px 4px 0 0;
}

.cet-news-card-img img {
    width: 100%;
    height: auto;
    display: block;
}

.cet-news-card-inner {
    padding: 20px;
}

/* flex layout solo quando le card sono affiancate */
.section-news .cet-news-card-inner,
.section-bandi .cet-news-card-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cet-news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.cet-news-cat {
    color: var(--cet-primary);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.cet-news-date {
    color: var(--cet-text-muted);
}

.cet-news-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 8px;
}

.cet-news-title a {
    color: var(--cet-text);
    text-decoration: none;
}

.cet-news-title a:hover {
    color: var(--cet-primary);
}

.cet-news-excerpt {
    color: var(--cet-text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0 0 12px;
}

.section-news .cet-news-excerpt,
.section-bandi .cet-news-excerpt {
    flex: 1;
}

.cet-news-more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--cet-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.cet-news-more:hover {
    text-decoration: underline;
}

.cet-news-more .icon {
    width: 18px;
    height: 18px;
    fill: var(--cet-primary);
}

/* ---- Article (Single Post) ---- */
.article-title {
    font-size: 2rem;
    line-height: 1.2;
}

.article-excerpt {
    font-size: 1.1rem;
}

.article-meta {
    font-size: 0.9rem;
}

.article-content {
    font-size: 1rem;
    line-height: 1.8;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.article-content p {
    margin-bottom: 1.2rem;
}

/* ---- Footer ---- */
.it-footer {
    margin-top: auto;
}

.it-footer-main {
    background-color: var(--cet-primary);
    color: #fff;
    padding: 20px 0;
}

.it-footer-main h4 {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 16px;
}

.it-footer-main a {
    color: #fff;
    text-decoration: none;
}

.it-footer-main a:hover {
    text-decoration: underline;
}

.it-footer-main .icon {
    fill: #fff;
}

.it-footer-small-prints {
    background-color: var(--cet-primary-dark);
    color: rgba(255, 255, 255, 0.7);
    padding: 12px 0;
    font-size: 0.8rem;
}

.it-footer-small-prints a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
}

.it-footer-small-prints a:hover {
    color: #fff;
    text-decoration: underline;
}

.it-footer-small-prints-list .list-inline-item:not(:last-child) {
    margin-right: 16px;
}

/* ---- Search Page ---- */
.search-opere-pubbliche .input-group-text {
    border-color: var(--cet-border);
}

.search-opere-pubbliche .form-control {
    border-color: var(--cet-border);
}

.search-opere-pubbliche .form-control:focus {
    border-color: var(--cet-primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 53, 128, 0.15);
}

/* ---- Pagination ---- */
.pagination {
    justify-content: center;
}

.page-link {
    color: var(--cet-primary);
}

.page-item.active .page-link {
    background-color: var(--cet-primary);
    border-color: var(--cet-primary);
}

/* ---- Utility ---- */
.page-title {
    font-size: 2rem;
    color: var(--cet-text);
}

.bg-light {
    background-color: var(--cet-bg-light) !important;
}

/* ---- Responsive ---- */
/* ============================================
   RESPONSIVE
   ============================================ */

/* ---- Desktop: hide mobile elements ---- */
@media (min-width: 992px) {
    .close-div {
        display: none;
    }

    .navbar-collapsable .overlay {
        display: none !important;
    }
}

/* ---- Tablet & below (< 992px): hamburger menu ---- */
@media (max-width: 991px) {
    .navbar .navbar-collapsable {
        display: block !important;
        position: fixed;
        top: 0;
        left: -300px;
        width: 300px;
        height: 100vh;
        background: var(--cet-primary);
        z-index: 1050;
        transition: left 0.3s ease;
        overflow-y: auto;
    }

    .navbar .navbar-collapsable.expanded {
        left: 0;
    }

    .navbar .navbar-collapsable .overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }

    .navbar .navbar-collapsable.expanded .overlay {
        display: block !important;
    }

    .close-div {
        padding: 16px;
        text-align: right;
    }

    .close-menu {
        color: #fff;
        background: none;
        border: none;
        padding: 8px;
    }

    .close-menu .icon {
        fill: #fff;
        width: 24px;
        height: 24px;
    }

    .it-header-navbar-wrapper .navbar-nav .nav-link {
        padding: 14px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    /* Hamburger button: min 44px touch target */
    .custom-navbar-toggler {
        padding: 10px;
        min-width: 44px;
        min-height: 44px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-content {
        padding: 50px 0;
    }

    .hero-section {
        min-height: 350px;
    }
}

/* ---- Tablet (577px - 767px) ---- */
@media (max-width: 767px) {
    .it-brand-wrapper img.brand-logo {
        height: 50px;
    }

    .it-brand-tagline {
        font-size: 0.75rem;
    }

    .page-header-image {
        height: 140px;
    }

    .hero-section {
        min-height: 300px;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .hero-description {
        font-size: 0.95rem;
    }

    .hero-cta {
        padding: 12px 28px;
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 1.3rem;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .article-title {
        font-size: 1.5rem;
    }

    /* Trasparenza: stack vertically */
    .trasp-sidebar {
        position: static;
        margin-bottom: 20px;
    }

    .trasp-detail {
        padding: 20px;
    }

    /* News archive sidebar */
    .news-archive-sidebar {
        position: static;
    }

    /* Footer stacking */
    .it-footer-small-prints .row > div {
        text-align: left !important;
    }
}

/* ---- Phone (< 576px) ---- */
@media (max-width: 575px) {
    /* Header */
    .it-header-center-wrapper {
        padding: 8px 0 !important;
    }

    .it-brand-wrapper img.brand-logo {
        height: 40px;
    }

    .it-brand-tagline {
        display: none;
    }

    .it-right-zone {
        gap: 8px;
    }

    .it-search-wrapper .search-link {
        width: 38px;
        height: 38px;
    }

    /* Hero */
    .hero-section {
        min-height: 250px;
    }

    .hero-content {
        padding: 30px 0;
    }

    .hero-kicker {
        font-size: 0.8rem;
    }

    .hero-title {
        font-size: 1.5rem;
        margin-bottom: 12px;
    }

    .hero-description {
        font-size: 0.88rem;
        margin-bottom: 20px;
    }

    .hero-cta {
        padding: 10px 24px;
        font-size: 0.85rem;
    }

    /* Page header */
    .page-header-image {
        height: 100px;
    }

    /* Typography */
    .page-title {
        font-size: 1.3rem;
    }

    .section-title {
        font-size: 1.15rem;
    }

    .article-title {
        font-size: 1.3rem;
    }

    .article-content {
        font-size: 0.95rem;
    }

    /* Cards */
    .cet-news-card-inner {
        padding: 14px;
    }

    .cet-news-title {
        font-size: 1rem;
    }

    /* Trasparenza */
    .trasp-cat-toggle {
        padding: 14px 16px;
        font-size: 0.85rem;
    }

    .trasp-item-link {
        padding: 12px 16px 12px 24px;
    }

    .trasp-detail {
        padding: 16px;
        min-height: 200px;
    }

    #trasp-titolo {
        font-size: 1.15rem;
    }

    /* Single post meta */
    .article-meta {
        flex-direction: column;
        gap: 4px;
    }

    .article-share {
        margin-top: 8px;
    }

    /* Footer */
    .it-footer-main {
        padding: 16px 0;
    }

    .it-footer-small-prints-list {
        flex-direction: column !important;
        gap: 4px;
    }
}

/* ---- SVG Icons ---- */
.icon {
    width: 24px;
    height: 24px;
    display: inline-block;
    vertical-align: middle;
}

.icon-xs {
    width: 16px;
    height: 16px;
}

.icon-sm {
    width: 20px;
    height: 20px;
}

.icon-primary {
    fill: var(--cet-primary);
}

.icon-white {
    fill: #fff;
}

/* Tabella con contenuto allineato in alto */
.wp-block-table.table-valign-top td,
.wp-block-table.table-valign-top th {
    vertical-align: top !important;
}

/* Tabella senza bordi (override WP block + Bootstrap Italia) */
.wp-block-table.table-no-border table,
.wp-block-table.table-no-border thead,
.wp-block-table.table-no-border tfoot,
.wp-block-table.table-no-border tbody,
.wp-block-table.table-no-border tr,
.wp-block-table.table-no-border td,
.wp-block-table.table-no-border th {
    border: none !important;
    border-width: 0 !important;
    box-shadow: none !important;
}

/* --- Pagina della singola voce di trasparenza (dal 24/09/2026 ogni voce ha il suo indirizzo).
   Lì il pannello non è più una finestra dentro la pagina: scorre la pagina, come un testo normale. --- */
.single-trasparenza .trasp-detail {
    position: static;
    max-height: none;
    overflow: visible;
}

/* Titolo della voce di trasparenza: sta sopra il contenuto, allineato in alto col menu. */
.single-trasparenza .trasp-voce-titolo {
    margin: 0 0 16px;
    line-height: 1.2;
}
.single-trasparenza .trasp-detail #trasp-titolo { display: none; }   /* il titolo è già l'H1 */
.trasp-cat-toggle { text-decoration: none; }
.trasp-cat-vuota { cursor: default; opacity: .6; }

/* --- WPDEV trasparenza colori (24/09/2026): gerarchia visiva del menu.
   Gruppo selezionato (pieno) > gruppo di primo livello (fondo medio) > voce selezionata (fondo chiaro). --- */
/* Colori invertiti il 25/09/2026 (Ale): il gruppo non selezionato è chiaro, la voce
   selezionata prende il blu medio con testo bianco. Il gruppo selezionato resta il pieno. */
.trasp-sidebar .trasp-cat-toggle {
    background: rgba(0, 53, 128, 0.08);
    color: var(--cet-primary);
    font-weight: 600;
    text-decoration: none;
}
.trasp-sidebar .trasp-cat-toggle:hover { background: rgba(0, 53, 128, 0.16); }
.trasp-sidebar .trasp-item-link.active,
.trasp-sidebar .trasp-item-link.active:hover {
    background: #4a77ac;
    color: #fff;
    font-weight: 600;
}
/* Due pixel di bianco fra un gruppo e l'altro: si leggono come blocchi separati. */
.trasp-sidebar .trasp-cat-group + .trasp-cat-group { margin-top: 2px; }
.trasp-sidebar .trasp-cat-group { border-bottom: 0; }
.trasp-sidebar .trasp-cat-toggle.active,
.trasp-sidebar .trasp-cat-toggle.active:hover { background: var(--cet-primary); color: #fff; }
.trasp-sidebar .trasp-cat-vuota,
.trasp-sidebar .trasp-cat-vuota:hover { background: rgba(0, 53, 128, 0.04); color: #7a869a; }   /* categoria senza voci */
