/* CST Province — cst.css
   Componenti del design system CST Province (design-system/components/bundle.css) senza lo strato
   di reboot: nel sito il reboot, la griglia e la tipografia arrivano da Bootstrap Italia (main.css).
   Caricare DOPO main.css e tokens.css. Le correzioni per la convivenza con Bootstrap Italia sono in fondo. */

/* ---------- Base ---------- */
html { scroll-padding-top: 96px; }
code, .cst-code { font-family: var(--font-mono); font-size: 14px; }
.cst-section { padding: var(--space-5) 0; }
.cst-section--tinted { background: var(--primary-lighter); }
.cst-section--muted { background: var(--gray-100); }
/* Banda newsletter (home) */
.cst-newsletter { padding: var(--space-5) 0; background: var(--accento, var(--primary-lighter)); color: var(--color-text-base); }
.cst-newsletter .btn { margin-top: var(--space-4); }
.cst-newsletter h2 { margin: 0 0 var(--space-2); color: var(--color-text-base); }
.cst-newsletter p { margin: 0; font-size: 18px; line-height: 28px; }
.cst-grid { display: grid; gap: var(--space-4); grid-template-columns: 1fr; }
@media (min-width: 768px) { .cst-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .cst-grid--3 { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Focus (BI utilities/focus.scss) ---------- */
:focus-visible { outline: 3px solid transparent; outline-offset: 3px; box-shadow: var(--focus-ring); border-radius: 2px; }
[data-focus-mouse="true"] { box-shadow: none !important; }

/* ---------- Icone ---------- */
.icon { width: 32px; height: 32px; fill: currentColor; flex: none; vertical-align: middle; }
.icon-xs { width: 16px; height: 16px; }
.icon-sm { width: 24px; height: 24px; }
.icon-lg { width: 48px; height: 48px; }
.icon-primary { fill: var(--primary); }
.icon-white { fill: var(--white); }
.icon-success { fill: var(--success); }
.icon-danger { fill: var(--danger); }
.icon-warning { fill: var(--warning); }

/* ---------- Skiplinks ---------- */
.skiplinks { background: var(--primary-lighter); text-align: center; }
.skiplinks a { display: inline-block; padding: var(--space-2) var(--space-3); font-weight: 600; color: var(--primary); }
.skiplinks a:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skiplinks.cst-demo a { position: static; width: auto; height: auto; clip: auto; }

/* ---------- Pulsanti (BI buttons) ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: var(--target-min); padding: 12px 24px; font: 600 16px/24px var(--font-sans); border: 2px solid transparent; border-radius: var(--radius); text-decoration: none; cursor: pointer; background: transparent; color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--white); }
.btn-primary:active { background: var(--primary-active); border-color: var(--primary-active); }
.btn-secondary { background: var(--secondary); border-color: var(--secondary); color: var(--white); }
.btn-secondary:hover { background: var(--color-background-secondary-hover); border-color: var(--color-background-secondary-hover); color: var(--white); }
.btn-outline-primary { border-color: var(--primary); color: var(--primary); box-shadow: none; }
.btn-outline-primary:hover { border-color: var(--primary-hover); color: var(--primary-hover); background: var(--primary-lighter); }
.btn-link { padding-left: 0; padding-right: 0; text-decoration: underline; }
.btn-sm { min-height: 36px; padding: 6px 16px; font-size: 16px; border-radius: var(--radius-sm); }
.btn-lg { padding: 14px 28px; font-size: 18px; line-height: 28px; border-radius: var(--radius-lg); }
.btn-icon .icon { width: 24px; height: 24px; }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--color-background-disabled); border-color: var(--color-background-disabled); color: var(--color-text-disabled); cursor: not-allowed; }
.btn-light-on-dark { background: var(--white); color: var(--primary); }
.btn-outline-white { border-color: var(--white); color: var(--white); }
.btn-outline-white:hover { background: var(--white); color: var(--primary); }

/* ---------- Header (BI it-header-wrapper) ---------- */
.it-header-wrapper { position: relative; }
.it-header-slim-wrapper { background: var(--header-slim-bg); color: var(--white); }
.it-header-slim-wrapper .container { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-slim-height); gap: var(--space-3); }
.it-header-slim-wrapper a { color: var(--white); font-size: 14px; font-weight: 600; text-decoration: none; }
.it-header-slim-wrapper a:hover { text-decoration: underline; }
.it-header-slim-wrapper .cst-slim-actions { display: flex; gap: var(--space-3); align-items: center; }
.it-header-center-wrapper { background: var(--header-center-bg); color: var(--white); }
.it-header-center-wrapper .container { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: 96px; padding-top: var(--space-3); padding-bottom: var(--space-3); }
@media (min-width: 992px) { .it-header-center-wrapper .container { min-height: 120px; } }
.it-brand-wrapper a { display: flex; align-items: center; gap: var(--space-3); color: var(--white); text-decoration: none; }
.it-brand-wrapper .cst-stemma { width: 48px; height: 48px; flex: none; }
@media (min-width: 992px) { .it-brand-wrapper .cst-stemma { width: 82px; height: 82px; } }
.it-brand-title { display: block; font-size: 20px; line-height: 24px; font-weight: 700; color: var(--white); }
.it-brand-tagline { display: none; font-size: 14px; line-height: 20px; font-weight: 400; color: var(--white); }
@media (min-width: 768px) { .it-brand-title { font-size: 32px; line-height: 40px; } .it-brand-tagline { display: block; } }
.it-right-zone { display: flex; align-items: center; gap: var(--space-3); }
.it-socials { display: none; align-items: center; gap: var(--space-2); font-size: 14px; }
@media (min-width: 992px) { .it-socials { display: flex; } }
.it-socials a { color: var(--white); display: inline-flex; min-width: var(--target-min); min-height: var(--target-min); align-items: center; justify-content: center; }
.it-search-wrapper { display: flex; align-items: center; gap: var(--space-2); font-size: 14px; font-weight: 600; }
.it-search-wrapper .search-link { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; background: var(--white); color: var(--primary); }
.it-search-wrapper .search-link .icon { width: 24px; height: 24px; fill: var(--primary); }
.it-header-navbar-wrapper { background: var(--header-center-bg); color: var(--white); }
.cst-navbar { display: flex; align-items: center; }
.cst-navbar-toggler { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--target-min); padding: 0 var(--space-2); margin-left: calc(-1 * var(--space-2)); background: none; border: 0; color: var(--white); font: 600 16px/24px var(--font-sans); cursor: pointer; }
.cst-navbar-toggler .icon { width: 24px; height: 24px; fill: var(--white); }
.cst-navbar .navbar-nav { list-style: none; margin: 0; padding: 0; display: none; }
.cst-navbar.is-open .navbar-nav { display: block; position: absolute; left: 0; right: 0; top: 100%; z-index: 20; background: var(--white); box-shadow: var(--shadow); padding: var(--space-3) 0; }
.cst-navbar.is-open .nav-link { color: var(--primary); padding: var(--space-2) var(--space-4); border-left: 0; }
.cst-navbar.is-open .nav-link[aria-current="page"] { background: var(--primary-lighter); }
.nav-link { display: block; padding: 13px var(--space-4); font-size: 16px; line-height: 24px; font-weight: 600; color: var(--white); text-decoration: none; }
.nav-link:hover { color: var(--white); text-decoration: underline; }
.nav-link[aria-current="page"] { box-shadow: inset 0 -4px 0 var(--white); }
@media (min-width: 992px) {
  .cst-navbar-toggler { display: none; }
  .cst-navbar .navbar-nav { display: flex; margin-left: calc(-1 * var(--space-4)); }
  .cst-navbar.is-open .navbar-nav { position: static; display: flex; background: none; box-shadow: none; padding: 0; }
  .cst-navbar.is-open .nav-link { color: var(--white); padding: 13px var(--space-4); }
  .cst-navbar.is-open .nav-link[aria-current="page"] { background: none; }
}
/* Voce con sottovoci (menu a tendina) */
.cst-nav-dropdown { position: relative; }
.cst-nav-dropdown-toggle { display: flex; align-items: center; gap: var(--space-1); width: 100%; min-height: var(--target-min); background: none; border: 0; font-family: var(--font-sans); text-align: left; cursor: pointer; }
.cst-nav-dropdown-toggle .icon { width: 24px; height: 24px; fill: currentColor; transition: transform .2s; }
.cst-nav-dropdown-toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }
.cst-nav-dropdown-toggle.is-current { box-shadow: inset 0 -4px 0 var(--white); }
.cst-navbar.is-open .cst-nav-dropdown-toggle.is-current { box-shadow: none; background: var(--primary-lighter); }
.cst-subnav { list-style: none; margin: 0; padding: 0; }
.cst-subnav[hidden] { display: none; }
.cst-subnav a { display: flex; align-items: center; min-height: var(--target-min); padding: var(--space-2) var(--space-5); font-size: 16px; line-height: 24px; font-weight: 600; color: var(--white); text-decoration: none; }
.cst-navbar.is-open .cst-subnav a { color: var(--primary); }
.cst-subnav a:hover { text-decoration: underline; }
.cst-subnav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; }
@media (min-width: 992px) {
  .cst-nav-dropdown-toggle { width: auto; }
  .cst-subnav { position: absolute; top: 100%; left: 0; z-index: 30; min-width: 240px; padding: var(--space-2) 0; background: var(--white); box-shadow: var(--shadow); border-radius: var(--radius-sm); }
  .cst-subnav a, .cst-navbar.is-open .cst-subnav a { color: var(--primary); padding: var(--space-2) var(--space-4); }
  .cst-subnav a[aria-current="page"] { background: var(--primary-lighter); }
}
/* Header chiaro (site.config.json → header.stile = "chiaro"): fascia centrale bianca con stemma e logo a colori, menu nel colore primario, linea d'accento sotto */
.cst-header-chiaro .it-header-center-wrapper { background: var(--white); color: var(--primary); }
.cst-header-chiaro .it-brand-wrapper a, .cst-header-chiaro .it-socials, .cst-header-chiaro .it-socials a, .cst-header-chiaro .it-search-wrapper { color: var(--primary); }
.cst-header-chiaro .it-search-wrapper .search-link { background: var(--primary); }
.cst-header-chiaro .it-search-wrapper .search-link .icon { fill: var(--white); }
.cst-header-chiaro .it-header-navbar-wrapper { border-bottom: 4px solid var(--accento, var(--primary-light)); }
.it-brand-wrapper { min-width: 0; }
.it-brand-wrapper a { min-width: 0; }
.it-brand-wrapper .cst-logo { height: 32px; width: auto; min-width: 0; max-width: 100%; flex: 0 1 auto; object-fit: contain; object-position: left center; }
.it-brand-wrapper .cst-stemma + .cst-logo { padding-left: var(--space-3); border-left: 1px solid var(--color-border-subtle); }
@media (min-width: 992px) { .it-brand-wrapper .cst-logo { height: 56px; } }
.it-header-wrapper :focus-visible { box-shadow: 0 0 0 2px var(--focus-outline-out), 0 0 0 5px var(--focus-outline-in); }

/* ---------- Breadcrumb ---------- */
.breadcrumb-container { padding: var(--space-3) 0; }
.breadcrumb { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; font-size: 16px; line-height: 24px; }
.breadcrumb-item { display: flex; align-items: center; color: var(--gray-600); }
.breadcrumb-item a { color: var(--color-text-secondary); font-weight: 600; text-decoration: none; }
.breadcrumb-item a:hover { text-decoration: underline; }
.breadcrumb-item .separator { padding: 0 var(--space-2); color: var(--gray-600); }
.breadcrumb-item.active { color: var(--gray-600); }

/* ---------- Hero ---------- */
.it-hero-wrapper { background: var(--primary); color: var(--white); }
.it-hero-wrapper .it-hero-text-wrapper { padding: var(--space-5) 0; max-width: 720px; }
.it-hero-wrapper .category { display: block; margin-bottom: var(--space-2); font-size: 14px; line-height: 20px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--white); }
.it-hero-wrapper h1, .it-hero-wrapper .h1, .it-hero-wrapper p { color: var(--white); }
.it-hero-wrapper .display-1 { font-size: 40px; line-height: 48px; font-weight: 700; margin-bottom: var(--space-3); }
@media (min-width: 576px) { .it-hero-wrapper .display-1 { font-size: 56px; line-height: 70px; } }
.it-hero-wrapper .it-btn-container { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-4); }

/* ---------- Card ---------- */
.card { position: relative; display: flex; flex-direction: column; background: var(--white); border-radius: var(--radius-0); }
.card.card-bg { box-shadow: var(--shadow-card); }
.card.cst-card-border { border: 1px solid var(--color-border-subtle); }
.card .card-body { padding: var(--space-4) var(--space-card-x) var(--space-4); display: flex; flex-direction: column; flex: 1; }
.card .category-top { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); font-size: 14px; line-height: 20px; }
.card .category { font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--color-text-base); text-decoration: none; }
.card .data { color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 1px; }
.card .card-title { font-size: 20px; line-height: 24px; font-weight: 600; margin: 0 0 var(--space-2); }
@media (min-width: 576px) { .card .card-title { font-size: 24px; line-height: 32px; } }
.card .card-title a { color: var(--primary); text-decoration: none; }
.card .card-title a::after { content: ""; position: absolute; inset: 0; }
.card .card-title a:hover { text-decoration: underline; }
.card:focus-within { box-shadow: var(--focus-ring); }
.card .card-title a:focus-visible { box-shadow: none; }
.card .card-text { color: var(--color-text-base); margin-bottom: var(--space-3); }
.card .cst-card-foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.card .card-img { aspect-ratio: 16 / 9; background: var(--primary-light); overflow: hidden; }
.card .card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .cst-card-icon { display: inline-flex; width: 56px; height: 56px; align-items: center; justify-content: center; background: var(--primary-lighter); margin-bottom: var(--space-3); }
.card .cst-card-icon .icon { fill: var(--primary); }
.card .cst-readmore { display: inline-flex; align-items: center; gap: var(--space-1); font-size: 14px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--primary); }
.card .cst-readmore .icon { width: 16px; height: 16px; fill: var(--primary); }

/* ---------- Badge e chip ---------- */
.badge { display: inline-flex; align-items: center; gap: var(--space-1); padding: 2px var(--space-2); font-size: 14px; line-height: 20px; font-weight: 600; border-radius: var(--radius-sm); color: var(--white); background: var(--secondary); }
.badge .icon { width: 16px; height: 16px; fill: currentColor; }
.bg-primary { background: var(--primary) !important; color: var(--white) !important; }
.bg-success { background: var(--success) !important; color: var(--white) !important; }
.bg-danger { background: var(--danger) !important; color: var(--white) !important; }
.bg-warning { background: var(--warning) !important; color: var(--white) !important; }
.bg-secondary { background: var(--secondary) !important; color: var(--white) !important; }
.cst-badge-outline { background: var(--white); color: var(--primary-active); box-shadow: inset 0 0 0 1px var(--primary); }
.chip { display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--target-min); padding: 0 var(--space-3); border: 1px solid var(--color-border-secondary); border-radius: var(--radius-pill); background: var(--white); color: var(--color-text-secondary); font: 600 14px/20px var(--font-sans); cursor: pointer; text-decoration: none; }
.chip:hover { background: var(--color-background-secondary-hover); border-color: var(--color-background-secondary-hover); color: var(--white); }
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--white); }
.chip[aria-pressed="true"]::before { content: ""; width: 16px; height: 16px; background: currentColor; -webkit-mask: var(--cst-check) center / contain no-repeat; mask: var(--cst-check) center / contain no-repeat; }
:root { --cst-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9.6 16.9 4.3 11.6l.7-.7 4.6 4.6 9.4-9.4.7.7z'/%3E%3C/svg%3E"); }
.cst-chip-group { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; padding: 0; margin: 0; }

/* ---------- Form (BI form-group) ---------- */
.form-group { position: relative; margin-bottom: var(--space-4); }
.form-group label, .form-label { display: block; margin-bottom: var(--space-1); font-size: 16px; line-height: 24px; font-weight: 600; color: var(--color-text-base); }
.form-control, .form-select { display: block; width: 100%; height: var(--input-height); padding: 6px 12px; font: 400 16px/24px var(--font-sans); color: var(--color-text-base); background: var(--white); border: 0; border-bottom: 1px solid var(--color-border-secondary); border-radius: 0; }
textarea.form-control { height: auto; min-height: 96px; border: 1px solid var(--color-border-secondary); }
.form-control:focus-visible, .form-select:focus-visible { border-color: var(--focus-outline-out); }
.form-text { display: block; margin-top: var(--space-1); font-size: 14px; line-height: 20px; color: var(--color-text-muted); }
.form-control.is-invalid { border-bottom: 2px solid var(--danger); }
.invalid-feedback { display: flex; gap: var(--space-1); align-items: center; margin-top: var(--space-1); font-size: 14px; line-height: 20px; font-weight: 600; color: var(--danger); }
.invalid-feedback .icon { width: 16px; height: 16px; fill: var(--danger); }
.form-check { display: flex; align-items: flex-start; gap: var(--space-2); margin-bottom: var(--space-2); }
.form-check input { width: 24px; height: 24px; margin: 0; accent-color: var(--primary); flex: none; }
.form-check label { font-weight: 400; margin: 0; }
.cst-required { color: var(--danger); }
.input-group { display: flex; align-items: stretch; }
.input-group .form-control { flex: 1; }
.input-group .btn { border-radius: 0 var(--radius) var(--radius) 0; }

/* ---------- Alert e callout ---------- */
.alert { display: flex; gap: var(--space-3); padding: var(--space-3) var(--space-4); border: 1px solid var(--color-border-subtle); border-left-width: 1px; background: var(--white); border-radius: var(--radius); margin-bottom: var(--space-3); }
.alert .icon { width: 24px; height: 24px; margin-top: 0; }
.alert p:last-child { margin-bottom: 0; }
.alert-info { border-color: var(--info); } .alert-info .icon { fill: var(--info); }
.alert-success { border-color: var(--success); } .alert-success .icon { fill: var(--success); }
.alert-warning { border-color: var(--warning); } .alert-warning .icon { fill: var(--warning); }
.alert-danger { border-color: var(--danger); } .alert-danger .icon { fill: var(--danger); }
.alert strong { display: block; }
.callout { position: relative; padding: var(--space-4); margin: var(--space-4) 0; background: var(--primary-lighter); border: 1px solid var(--primary); border-radius: var(--radius-lg); }
.callout .callout-title { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); font-size: 16px; line-height: 24px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--primary-active); }
.callout .callout-title .icon { width: 24px; height: 24px; fill: var(--primary-active); }
.callout p:last-child { margin-bottom: 0; }
.callout.cst-callout-pnrr { background: var(--white); border-color: var(--color-background-emphasis); }

/* ---------- Accordion ---------- */
.accordion { border-top: 1px solid var(--color-border-subtle); }
.accordion-item { border-bottom: 1px solid var(--color-border-subtle); }
.accordion-header { margin: 0; font-size: 18px; line-height: 24px; }
.accordion-button { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: var(--target-min); padding: var(--space-3) var(--space-3); background: none; border: 0; text-align: left; font: 600 18px/24px var(--font-sans); color: var(--primary); cursor: pointer; }
.accordion-button .icon { width: 24px; height: 24px; fill: var(--primary); transition: transform .2s; }
.accordion-button[aria-expanded="true"] .icon { transform: rotate(180deg); }
.accordion-button:hover { background: var(--primary-lighter); }
.accordion-body { padding: 0 var(--space-3) var(--space-3); }
.accordion-collapse[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .accordion-button .icon { transition: none; } }

/* ---------- Lista di download (BI it-list / link-list) ---------- */
.cst-download-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--color-border-subtle); }
.cst-download-list li { border-bottom: 1px solid var(--color-border-subtle); }
.cst-download-list a { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-2); text-decoration: none; color: var(--color-text-base); }
.cst-download-list a:hover { background: var(--primary-lighter); }
.cst-download-list .icon { width: 32px; height: 32px; fill: var(--primary); }
.cst-download-list .cst-dl-title { display: block; font-weight: 600; color: var(--primary); text-decoration: underline; }
.cst-download-list .cst-dl-meta { display: block; font-size: 14px; line-height: 20px; color: var(--color-text-muted); }
.cst-download-list .cst-dl-action { margin-left: auto; }
.cst-download-list .cst-dl-action .icon { width: 24px; height: 24px; }

/* ---------- Paginazione ---------- */
.pagination-wrapper { display: flex; justify-content: center; }
.pagination { display: flex; list-style: none; gap: var(--space-1); margin: 0; padding: 0; }
.page-link { display: inline-flex; align-items: center; justify-content: center; min-width: var(--target-min); height: var(--target-min); padding: 0 var(--space-2); font-weight: 600; color: var(--primary); text-decoration: none; border-radius: var(--radius); border: 1px solid transparent; }
.page-link:hover { background: var(--primary-lighter); }
.page-link[aria-current="page"] { border-color: var(--primary); color: var(--primary-active); }
.page-link .icon { width: 24px; height: 24px; fill: var(--primary); }
.page-item.disabled .page-link { color: var(--color-text-disabled); pointer-events: none; }
.page-item.disabled .icon { fill: var(--color-text-disabled); }

/* ---------- Filtri servizi ---------- */
.cst-filters { display: grid; gap: var(--space-3); }
.cst-filters fieldset { border: 0; margin: 0; padding: 0; }
.cst-filters legend { font-size: 16px; line-height: 24px; font-weight: 600; margin-bottom: var(--space-2); }
.cst-results-count { font-size: 16px; font-weight: 600; color: var(--color-text-secondary); margin: var(--space-3) 0; }

/* ---------- Contatti / sede ---------- */
.cst-contact-list { list-style: none; padding: 0; margin: 0; }
.cst-contact-list li { display: flex; gap: var(--space-2); align-items: flex-start; margin-bottom: var(--space-2); }
.cst-contact-list .icon { width: 24px; height: 24px; fill: var(--primary); margin-top: 0; }
.cst-contact-list dt, .cst-contact-list .cst-k { font-weight: 600; }

/* ---------- Valutazione pagina ---------- */
.cst-rating { background: var(--primary-lighter); padding: var(--space-4); }
.cst-rating fieldset { border: 0; padding: 0; margin: 0; }
.cst-rating legend { font-size: 20px; line-height: 24px; font-weight: 600; margin-bottom: var(--space-3); }
.cst-rating .cst-stars { display: flex; gap: var(--space-1); }
.cst-rating .cst-stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cst-rating .cst-stars label { display: inline-flex; width: var(--target-min); height: var(--target-min); align-items: center; justify-content: center; cursor: pointer; }
.cst-rating .cst-stars .icon { width: 32px; height: 32px; fill: var(--primary); }
.cst-rating .cst-stars input:focus-visible + label { box-shadow: var(--focus-ring); }
.cst-rating .cst-star-full { display: none; }
.cst-rating .cst-stars label.is-on .cst-star-full { display: inline; }
.cst-rating .cst-stars label.is-on .cst-star-outline { display: none; }

/* ---------- Indice della pagina (BI navscroll) ---------- */
.cst-toc { border-left: 0; }
.cst-toc h2 { font-size: 14px; line-height: 20px; letter-spacing: 1px; text-transform: uppercase; margin-bottom: var(--space-2); color: var(--color-text-secondary); }
.cst-toc ol { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--color-border-subtle); }
.cst-toc li { border-bottom: 1px solid var(--color-border-subtle); }
.cst-toc a { display: block; padding: var(--space-2) 0; font-weight: 600; text-decoration: none; }
.cst-toc a:hover { text-decoration: underline; }
.cst-toc a[aria-current="true"] { color: var(--primary-active); box-shadow: inset 4px 0 0 var(--primary); padding-left: var(--space-3); }

/* ---------- Footer ---------- */
.it-footer-main { background: var(--footer-top-bg); color: var(--white); padding: var(--space-5) 0 var(--space-4); }
.it-footer-main a { color: var(--white); }
.it-footer-main .cst-footer-brand { display: flex; align-items: center; gap: var(--space-3); padding-bottom: var(--space-4); margin-bottom: var(--space-4); border-bottom: 1px solid var(--white); color: var(--white); text-decoration: none; }
.it-footer-main .cst-footer-brand .cst-stemma { width: 56px; height: 56px; }
.it-footer-main .cst-footer-brand span { font-size: 24px; line-height: 32px; font-weight: 700; }
.it-footer-main .cst-footer-brand .cst-footer-brand-text { display: flex; flex-direction: column; }
.it-footer-main .cst-footer-brand .cst-footer-brand-sub { font-size: 16px; line-height: 24px; font-weight: 400; }
.it-footer-main h3, .it-footer-main .cst-footer-title { font-size: 16px; line-height: 24px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--white); margin-bottom: var(--space-2); }
.it-footer-main .cst-footer-cols { display: grid; gap: var(--space-4); grid-template-columns: 1fr; }
@media (min-width: 768px) { .it-footer-main .cst-footer-cols { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .it-footer-main .cst-footer-cols { grid-template-columns: repeat(4, 1fr); } }
.it-footer-main ul { list-style: none; padding: 0; margin: 0; }
.it-footer-main li { margin-bottom: var(--space-1); }
.it-footer-main li a { display: inline-block; padding: 6px 0; text-decoration: none; }
.it-footer-main li a:hover { text-decoration: underline; }
.it-footer-main p { color: var(--white); }
.it-footer-small-prints { background: var(--footer-bottom-bg); color: var(--white); }
.it-footer-small-prints ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0 var(--space-4); margin: 0; padding: var(--space-3) 0; }
.it-footer-small-prints a { display: inline-block; padding: 6px 0; color: var(--white); font-size: 14px; line-height: 20px; font-weight: 600; text-decoration: none; }
.it-footer-small-prints a:hover { text-decoration: underline; }
.it-footer-main :focus-visible, .it-footer-small-prints :focus-visible { box-shadow: 0 0 0 2px var(--focus-outline-out), 0 0 0 5px var(--focus-outline-in); }

/* ---------- Cookie bar ---------- */
.cookiebar { position: relative; background: var(--color-background-emphasis); color: var(--white); padding: var(--space-4); }
.cookiebar.cst-fixed { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; }
.cookiebar p { color: var(--white); margin-bottom: var(--space-3); }
.cookiebar a { color: var(--white); }
.cookiebar .cookiebar-buttons { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.cookiebar :focus-visible { box-shadow: 0 0 0 2px var(--focus-outline-out), 0 0 0 5px var(--focus-outline-in); }
.cookiebar[hidden] { display: none; }

/* ---------- Torna su ---------- */
.back-to-top { position: fixed; right: var(--space-4); bottom: var(--space-4); width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--primary); box-shadow: var(--shadow); opacity: 0; visibility: hidden; transition: opacity .2s; z-index: 40; }
.back-to-top.back-to-top-show { opacity: 1; visibility: visible; }
.back-to-top .icon { width: 24px; height: 24px; fill: var(--white); }
.back-to-top:hover { background: var(--primary-hover); }
.back-to-top.cst-demo { position: static; opacity: 1; visibility: visible; }
@media (prefers-reduced-motion: reduce) { .back-to-top { transition: none; } html { scroll-behavior: auto; } }

.cst-search-label { display: none; }
@media (min-width: 768px) { .cst-search-label { display: inline; } }
.cst-section > .container > h2 { margin-bottom: var(--space-4); }
.cst-article > section { margin-bottom: var(--space-5); }
.cst-article > section > h2 { margin-bottom: var(--space-3); }
[data-cst-item][hidden] { display: none !important; }
.input-group .form-control { height: auto; }
.input-group .btn { padding-top: 8px; padding-bottom: 8px; }
.input-group .btn .icon { width: 24px; height: 24px; }
.cst-row { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }

/* ---------- Pagine del sito ---------- */
.cst-testata { padding: var(--space-2) 0 var(--space-5); max-width: 800px; }
.cst-testata .lead { margin-bottom: var(--space-3); }
.cst-category { display: block; margin-bottom: var(--space-2); font-size: 14px; line-height: 20px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--color-text-secondary); }
.cst-page-body { padding-bottom: var(--space-5); }
.cst-block { margin-top: var(--space-5); }
.cst-block > h2 { margin-bottom: var(--space-3); }
.cst-prose h2 { margin-top: var(--space-5); margin-bottom: var(--space-3); }
.cst-prose h2:first-child { margin-top: 0; }
.cst-prose h3 { margin-top: var(--space-4); }
.cst-prose ul, .cst-prose ol { padding-left: var(--space-4); }
.cst-prose li { margin-bottom: var(--space-1); }
@media (min-width: 992px) { .cst-sticky { position: sticky; top: var(--space-4); } }
.cst-figure { margin: 0 0 var(--space-5); }
.cst-figure img { width: 100%; height: auto; display: block; }
.cst-figure figcaption { font-size: 14px; line-height: 20px; color: var(--color-text-muted); margin-top: var(--space-2); }
.cst-dl { display: grid; grid-template-columns: auto 1fr; gap: var(--space-1) var(--space-3); margin: 0; }
.cst-dl dt { font-weight: 600; }
.cst-dl dd { margin: 0; }
.cst-results { list-style: none; padding: 0; border-top: 1px solid var(--color-border-subtle); }
.cst-results li { padding: var(--space-3) 0; border-bottom: 1px solid var(--color-border-subtle); }
.cst-results a { font-weight: 600; font-size: 18px; }
.cst-sitemap ul { margin-top: var(--space-1); }
.cst-contact-list a, .cst-contact-list span, .it-footer-main p, .cst-download-list .cst-dl-title { overflow-wrap: break-word; min-width: 0; }
.cst-grid > * { min-width: 0; }
.btn { white-space: normal; } .cst-email { overflow-wrap: anywhere; }

/* ---------- Convivenza con Bootstrap Italia ----------
   Bootstrap Italia 2.x imposta alcuni default diversi dal design system: qui si riallineano. */
body, p, .card .card-text, .lead, li, dd { font-family: var(--font-sans); }
.it-hero-wrapper .lead, .it-hero-wrapper p.lead { font-size: 20px; line-height: 32px; font-weight: 300; }
@media (min-width: 576px) { .it-hero-wrapper .lead, .it-hero-wrapper p.lead { font-size: 24px; } }
.card .category-top .data::before { content: none; display: none; }
.card::after { display: none; }
.it-header-center-wrapper, .it-header-slim-wrapper, .it-header-navbar-wrapper { height: auto; }
.cst-nav-container { position: relative; }
@media (min-width: 992px) { .cst-navbar .navbar-nav, .cst-navbar.is-open .navbar-nav { flex-direction: row; } }
.chip { height: auto; }
.breadcrumb-item + .breadcrumb-item::before { content: none; display: none; }
.breadcrumb-item + .breadcrumb-item { padding-left: 0; }
.it-hero-wrapper .it-hero-text-wrapper p, .it-hero-wrapper .it-hero-text-wrapper .lead { font-family: var(--font-sans); font-size: 20px; line-height: 32px; font-weight: 300; }
.it-hero-wrapper .it-hero-text-wrapper h1.display-1 { font-size: 40px; line-height: 48px; }
@media (min-width: 576px) { .it-hero-wrapper .it-hero-text-wrapper p, .it-hero-wrapper .it-hero-text-wrapper .lead { font-size: 24px; } .it-hero-wrapper .it-hero-text-wrapper h1.display-1 { font-size: 56px; line-height: 70px; } }
.card .card-body .card-text, .cst-prose p, .cst-prose li { font-family: var(--font-sans) !important; font-size: 16px; line-height: 24px; }
.cst-grid > .card, .cst-grid > article { margin: 0; }
.card.card-bg { margin-left: 0; margin-right: 0; }
.accordion .accordion-button, .accordion .accordion-button:not(.collapsed) { font: 600 18px/24px var(--font-sans); color: var(--primary); background: none; box-shadow: none; padding: var(--space-3); }
.accordion .accordion-button:hover { background: var(--primary-lighter); }
.accordion .accordion-button::after { display: none; }
.accordion-item { background: none; border-left: 0; border-right: 0; border-top: 0; }
.form-group label { position: static; line-height: 24px; padding: 0; color: var(--color-text-base); font-weight: 600; transform: none; background: none; }
.callout p, .alert p, .accordion-body p { font-family: var(--font-sans); color: var(--color-text-base); font-size: 16px; line-height: 24px; }

/* Link a sito esterno nella fascia sottile dell'header: icona in un cerchio bianco */
.it-header-slim-wrapper .cst-link-esterno { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--target-min); }
.cst-icona-esterno { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--white); flex: none; }
.cst-icona-esterno .icon { width: 16px; height: 16px; fill: var(--header-slim-bg); }

/* Logo del CST nel footer, accanto allo stemma (versione bianca: logo.cst_bianco, altrimenti logo.cst reso bianco) */
.it-footer-main .cst-footer-brand { min-width: 0; }
.it-footer-main .cst-footer-brand .cst-footer-brand-text { min-width: 0; }
.it-footer-main .cst-footer-brand .cst-logo { display: block; height: 40px; width: auto; min-width: 0; max-width: 100%; object-fit: contain; object-position: left center; margin-bottom: var(--space-1); }
.it-footer-main .cst-footer-brand .cst-logo--bianco { filter: brightness(0) invert(1); }
.it-footer-main .cst-footer-brand .cst-stemma + .cst-footer-brand-text { padding-left: var(--space-3); border-left: 1px solid var(--white); }

/* Hero con grafica decorativa (home.md → hero.grafica: profilo): profilo di montagne e lago lungo tutta la base, rete di punti a destra (solo da bp-lg) */
.it-hero-wrapper.cst-hero-con-grafica { position: relative; overflow: hidden; }
.it-hero-wrapper.cst-hero-con-grafica .container { position: relative; z-index: 1; padding-bottom: 64px; }
.cst-hero-grafica { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 120px; pointer-events: none; }
.cst-hero-grafica .rete, .cst-hero-grafica .rete-punti { display: none; }
@media (min-width: 992px) {
  .it-hero-wrapper.cst-hero-con-grafica .container { padding-bottom: 96px; }
  .cst-hero-grafica { height: 260px; }
  .cst-hero-grafica .rete, .cst-hero-grafica .rete-punti { display: inline; }
}
.cst-hero-grafica .profilo { fill: none; stroke: var(--accento, var(--white)); stroke-width: 2; }
.cst-hero-grafica .lago { stroke: var(--white); stroke-opacity: .6; stroke-width: 2; }
.cst-hero-grafica .rete line { stroke: var(--white); stroke-opacity: .35; stroke-width: 1; }
.cst-hero-grafica .rete-punti circle { fill: var(--white); }
.cst-hero-grafica .nodo-centrale { fill: var(--accento, var(--white)); }
.cst-hero-grafica .alone { fill: none; stroke: var(--accento, var(--white)); stroke-opacity: .5; }
