/* ═══════════════════════════════════════════════════════════════════════════
   comune-hub.css — Pagine hub multi-comune (es. /alghero, /ozieri).
   Prefisso: .ch-*
   Pattern: hero foto + stat live + 8 sezioni opt-in con band alternate +
            sidebar sticky 280px. Mobile-first, breakpoint 640/980.
   Riusa token da style.css/editorial.css. Zero inline.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Body wrapper ──────────────────────────────────────────────────────── */
.page-comune-hub {
  background: var(--color-bg);
  color: var(--color-text);
}

/* ─────────────────────────────────────────────────────────────────────────
   HERO foto + overlay + 4 stat live
   ───────────────────────────────────────────────────────────────────────── */
.ch-hero {
  position: relative;
  min-height: 480px;
  padding: 0;
  background-color: #1e1c17;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #fff;
  overflow: hidden;
  border-bottom: 1px solid var(--color-border);
}
.ch-hero-inner {
  position: relative;
  z-index: 2;
  padding: clamp(48px, 7vw, 96px) 0 clamp(32px, 5vw, 72px);
}
.ch-crumbs {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 22px;
}
.ch-crumbs a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
}
.ch-crumbs a:hover {
  color: #fff;
  text-decoration: underline;
}
.ch-crumbs span[aria-hidden] {
  margin: 0 8px;
  color: rgba(255, 255, 255, 0.5);
}
.ch-eyebrow,
.ch-hero .hd-eyebrow {
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 16px;
}
.ch-eyebrow .dot,
.ch-hero .hd-eyebrow .dot {
  background: var(--color-primary);
  box-shadow: 0 0 0 0 rgba(var(--color-primary-rgb), 0.6);
  animation: ch-pulse-dot 2.4s ease-out infinite;
}
@keyframes ch-pulse-dot {
  0% {
    box-shadow: 0 0 0 0 rgba(var(--color-primary-rgb), 0.6);
  }
  100% {
    box-shadow: 0 0 0 10px rgba(var(--color-primary-rgb), 0);
  }
}
.ch-hero-h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(40px, 6vw, 76px);
  line-height: 0.98;
  letter-spacing: 0;
  color: #fff;
  margin: 0 0 20px;
  text-wrap: balance;
}
.ch-hero-h1 em {
  font-family: var(--font-accent);
  font-style: italic;
  color: var(--color-primary-light, #e88670);
}
.ch-hero-lead {
  font-size: 17px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.88);
  max-width: 60ch;
  margin: 0 0 32px;
}
.ch-hero-lead strong {
  color: #fff;
  font-weight: 600;
}

/* Stat live grid 4-col, mobile 2-col */
.ch-hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  padding-top: 24px;
  max-width: 720px;
}
.ch-hero-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 14px 0 0;
  border-right: 1px solid rgba(255, 255, 255, 0.18);
}
.ch-hero-stat:last-child {
  border-right: 0;
}
.ch-hero-stat-n {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: #fff;
}
.ch-hero-stat-l {
  font-family: var(--hd-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.ch-hero-attrib {
  margin: 24px 0 0;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  font-style: italic;
}
.ch-hero-attrib small {
  font-size: inherit;
}

/* ─────────────────────────────────────────────────────────────────────────
   LAYOUT main + sidebar
   ───────────────────────────────────────────────────────────────────────── */
.ch-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin: clamp(32px, 5vw, 56px) auto clamp(48px, 6vw, 80px);
}
@media (min-width: 980px) {
  .ch-layout {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 44px;
  }
}
.ch-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ─────────────────────────────────────────────────────────────────────────
   SEZIONI numerate con band alternate (warm/paper/ink)
   ───────────────────────────────────────────────────────────────────────── */
.ch-sec {
  position: relative;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 18px;
  padding: clamp(24px, 4vw, 36px);
  scroll-margin-top: 96px;
}
.ch-sec--warm {
  background: var(--color-bg-warm);
  border-color: color-mix(in srgb, var(--color-border) 80%, transparent);
}
.ch-sec--paper {
  background: var(--color-bg-card);
}
.ch-sec--ink {
  background: var(--color-text);
  color: var(--color-bg);
  border-color: var(--color-text);
}
.ch-sec--ink h2,
.ch-sec--ink .hd-sec-num,
.ch-sec--ink .ch-sec-lead {
  color: rgba(255, 255, 255, 0.92);
}
.ch-sec--ink .hd-sec-num {
  color: var(--color-primary-light, #e88670);
}

.ch-sec .hd-sec-num {
  display: inline-block;
  font-family: var(--hd-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 10px;
}
.ch-sec h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 3.4vw, 36px);
  line-height: 1.1;
  letter-spacing: 0;
  color: var(--color-text);
  margin: 0 0 14px;
  text-wrap: balance;
}
.ch-sec h2 em {
  font-family: var(--font-accent);
  font-style: italic;
  color: var(--color-primary);
}
.ch-sec-lead {
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text-light, var(--color-text-muted));
  margin: 0 0 22px;
  max-width: 60ch;
}

/* ─────────────────────────────────────────────────────────────────────────
   § 01 — Identità grid (testo + glossario aside)
   ───────────────────────────────────────────────────────────────────────── */
.ch-identita-block {
  margin: 0;
}
.ch-identita-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 720px) {
  .ch-identita-grid {
    grid-template-columns: 1.4fr 1fr;
    gap: 32px;
  }
}
.ch-identita-text h3 {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 22px;
  margin: 0 0 12px;
  color: var(--color-text);
}
.ch-identita-text p {
  font-size: 15px;
  line-height: 1.7;
  margin: 0 0 12px;
  color: var(--color-text);
}
.ch-identita-text p em {
  font-style: italic;
  color: var(--color-primary);
}
.ch-identita-glossario {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 22px;
}
.ch-identita-glossario h3 {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 18px;
  margin: 0 0 6px;
  color: var(--color-text);
}
.ch-glossario-lead {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0 0 14px;
}
.ch-gloss-list {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.ch-gloss-item {
  display: grid;
  gap: 4px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--color-border);
}
.ch-gloss-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.ch-gloss-list dt {
  font-family: var(--font-heading);
  font-weight: 500;
  font-style: italic;
  font-size: 15px;
  color: var(--color-primary);
}
.ch-gloss-list dd {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-light, var(--color-text-muted));
}

/* ─────────────────────────────────────────────────────────────────────────
   § 02 — Servizi cats grid (4 categorie reali con counter)
   ───────────────────────────────────────────────────────────────────────── */
.ch-cats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 880px) {
  .ch-cats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.ch-cat {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
  text-align: left;
  color: inherit;
  font-family: inherit;
  min-height: 130px;
}
.ch-sec--warm .ch-cat {
  background: var(--color-bg);
}
.ch-cat:hover {
  transform: translateY(-2px);
  border-color: var(--color-text);
  box-shadow: 0 10px 24px -14px rgba(20, 19, 15, 0.18);
}
.ch-cat-ico {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--color-bg-warm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
}
.ch-sec--warm .ch-cat .ch-cat-ico {
  background: var(--color-bg-card);
}
.ch-cat-ico svg {
  width: 18px;
  height: 18px;
}
.ch-cat-name {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.2;
  color: var(--color-text);
}
.ch-cat-count {
  margin-top: auto;
  font-family: var(--hd-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

/* ─────────────────────────────────────────────────────────────────────────
   § 03 — Search + risultati + pager
   ───────────────────────────────────────────────────────────────────────── */
.ch-search {
  margin: 0 0 20px;
  background: var(--color-bg-warm);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 12px;
}
.ch-search-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr auto;
  gap: 8px;
}
@media (max-width: 880px) {
  .ch-search-row {
    grid-template-columns: 1fr 1fr;
  }
  .ch-search-field--wide {
    grid-column: 1 / -1;
  }
  .ch-search-submit {
    grid-column: 1 / -1;
  }
}
@media (max-width: 520px) {
  .ch-search-row {
    grid-template-columns: 1fr;
  }
  .ch-search-field--wide {
    grid-column: auto;
  }
}
.ch-search-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  min-height: 48px;
}
.ch-search-label {
  font-family: var(--hd-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.ch-search-field input,
.ch-search-field select {
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--color-text);
  padding: 0;
  min-height: 22px;
  appearance: none;
}
.ch-search-field input::placeholder {
  color: var(--color-text-muted);
}
.ch-search-submit {
  min-width: 110px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--color-text);
  color: var(--color-bg);
  border: 0;
  border-radius: 10px;
  padding: 0 18px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  min-height: 48px;
  transition: background 0.15s;
}
.ch-search-submit:hover {
  background: var(--color-primary);
}

.ch-results {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (max-width: 720px) {
  .ch-results {
    grid-template-columns: 1fr;
  }
}
.ch-result {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  color: inherit;
  transition:
    border-color 0.15s,
    transform 0.15s;
}
.ch-result:hover {
  border-color: var(--color-text);
  transform: translateY(-2px);
}
.ch-result-cat {
  font-family: var(--hd-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.ch-result h3 {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.2;
  margin: 0;
  color: var(--color-text);
}
.ch-result-meta {
  font-size: 13px;
  color: var(--color-text-light, var(--color-text-muted));
}
.ch-result-meta a {
  color: var(--color-primary);
  text-decoration: none;
}
.ch-result-meta a:hover {
  text-decoration: underline;
}

.ch-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.ch-pager button {
  min-width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-bg-card);
  font-family: var(--hd-mono);
  font-size: 13px;
  color: var(--color-text);
  cursor: pointer;
}
.ch-pager button.is-active {
  background: var(--color-text);
  color: var(--color-bg);
  border-color: var(--color-text);
}
.ch-pager button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ─────────────────────────────────────────────────────────────────────────
   § 04 — Mappa (Leaflet) + pills filtro
   ───────────────────────────────────────────────────────────────────────── */
.ch-map-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px;
}
.ch-map-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  font-family: var(--hd-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 32px;
}
.ch-map-pill:hover {
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}
.ch-map-pill.is-active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.ch-map-wrap {
  width: 100%;
  height: 460px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  position: relative;
  z-index: 1;
}
iframe.ch-map-wrap {
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.1); /* override default browser frameborder */
}
@media (max-width: 640px) {
  .ch-map-wrap {
    height: 380px;
  }
}
/* Leaflet pin (CSP-safe divIcon) */
.ch-map-pin {
  position: relative;
  cursor: pointer;
}
.ch-map-pin-dot {
  position: absolute;
  top: 0;
  left: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(0, 0, 0, 0.08);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}
.ch-map-pin:hover .ch-map-pin-dot {
  transform: scale(1.25);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(0, 0, 0, 0.1);
  z-index: 999;
}
/* Popup */
.ch-popup-wrap .leaflet-popup-content-wrapper {
  border-radius: 10px;
  background: var(--color-bg-card);
  color: var(--color-text);
  padding: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.ch-popup-wrap .leaflet-popup-content {
  margin: 14px 16px;
  font-family: var(--font-body);
  line-height: 1.45;
}
.ch-popup-wrap .leaflet-popup-tip {
  background: var(--color-bg-card);
}
.ch-popup-title {
  margin: 0 0 6px;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 500;
  color: var(--color-primary);
}
.ch-popup-addr,
.ch-popup-phone,
.ch-popup-link {
  margin: 4px 0;
  font-size: 13px;
}
.ch-popup-phone a,
.ch-popup-link a {
  color: var(--color-primary);
  text-decoration: none;
}
.ch-popup-phone a:hover,
.ch-popup-link a:hover {
  text-decoration: underline;
}
.ch-popup-desc {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.45;
  font-style: italic;
}
.ch-map-wrap .leaflet-control-attribution {
  font-size: 10px;
  background: rgba(255, 255, 255, 0.85);
  padding: 2px 6px;
  border-radius: 4px 0 0 0;
}

/* ─────────────────────────────────────────────────────────────────────────
   § 05 — Eventi grid
   ───────────────────────────────────────────────────────────────────────── */
.ch-eventi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.ch-evento {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  color: inherit;
  transition:
    border-color 0.15s,
    transform 0.15s;
}
.ch-sec--paper .ch-evento {
  background: var(--color-bg-warm);
}
.ch-evento:hover {
  border-color: var(--color-text);
  transform: translateY(-2px);
}
.ch-evento-data {
  font-family: var(--hd-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-primary);
}
.ch-evento h3 {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.2;
  margin: 0;
  color: var(--color-text);
}
.ch-evento-meta {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* ─────────────────────────────────────────────────────────────────────────
   § 06 — Voci / testimonianze
   ───────────────────────────────────────────────────────────────────────── */
.ch-voices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.ch-voice {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ch-sec--warm .ch-voice {
  background: var(--color-bg);
}
.ch-voice-quote {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text);
  margin: 0;
}
.ch-voice-quote::before {
  content: '«';
  color: var(--color-primary);
  font-size: 22px;
  margin-right: 4px;
}
.ch-voice-quote::after {
  content: '»';
  color: var(--color-primary);
  font-size: 22px;
  margin-left: 4px;
}
.ch-voice-author {
  font-size: 13px;
  color: var(--color-text-muted);
}
.ch-voice-author strong {
  color: var(--color-text);
  font-weight: 600;
}
.ch-voice-badge {
  display: inline-block;
  font-family: var(--hd-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--color-bg-warm);
  color: var(--color-text-muted);
  margin-left: 6px;
}

/* ─────────────────────────────────────────────────────────────────────────
   § 07 — Numeri di emergenza
   ───────────────────────────────────────────────────────────────────────── */
.ch-emergenza-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.ch-emergenza-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ch-emergenza-card.is-urgente {
  border-left-color: var(--color-status-alert, #d9534f);
  background: color-mix(in srgb, var(--color-status-alert, #d9534f) 5%, var(--color-bg-card));
}
.ch-emergenza-card.is-locale {
  border-left-color: var(--color-primary);
}
.ch-emergenza-card.is-nazionale {
  border-left-color: #4a7a3e;
}
.ch-emergenza-numero {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 500;
  color: var(--color-primary);
  line-height: 1;
}
.ch-emergenza-numero a {
  color: inherit;
  text-decoration: none;
}
.ch-emergenza-numero a:hover {
  text-decoration: underline;
}
.ch-emergenza-label {
  font-weight: 600;
  font-size: 14px;
  color: var(--color-text);
}
.ch-emergenza-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11px;
  color: var(--color-text-muted);
}
.ch-badge {
  display: inline-block;
  font-family: var(--hd-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--color-bg-warm);
  color: var(--color-text-muted);
}
.ch-badge--ambito-nazionale {
  background: #e8f1e8;
  color: #2a6b2a;
}
.ch-badge--ambito-locale {
  background: #f5e8d4;
  color: #8a5a1a;
}
.ch-badge--urgente {
  background: #f3e4e4;
  color: #8a3e3e;
}

/* ─────────────────────────────────────────────────────────────────────────
   § 08 — CTA grid (3 ticket)
   ───────────────────────────────────────────────────────────────────────── */
.ch-cta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 880px) {
  .ch-cta-grid {
    grid-template-columns: 1fr;
  }
}
.ch-cta-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 22px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  transition:
    border-color 0.18s,
    transform 0.18s,
    box-shadow 0.18s;
}
.ch-cta-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px -18px rgba(20, 19, 15, 0.2);
}
.ch-cta-ico {
  font-size: 28px;
  line-height: 1;
}
.ch-cta-title {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 18px;
  color: var(--color-text);
}
.ch-cta-sub {
  font-size: 13px;
  line-height: 1.55;
  color: var(--color-text-muted);
}

.ch-cta-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}

/* ─────────────────────────────────────────────────────────────────────────
   SIDEBAR sticky 280px
   ───────────────────────────────────────────────────────────────────────── */
.ch-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
@media (min-width: 980px) {
  .ch-sidebar {
    position: sticky;
    top: 92px;
    align-self: start;
  }
}
.ch-side-block {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 18px 20px;
}
.ch-side-block h3 {
  font-family: var(--hd-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text);
  margin: 0 0 12px;
  font-weight: 600;
}
.ch-side-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.ch-side-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ch-side-list a {
  color: var(--color-primary);
  text-decoration: none;
  font-size: 14px;
}
.ch-side-list a:hover {
  text-decoration: underline;
}
.ch-side-n {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 22px;
  line-height: 1;
  color: var(--color-text);
}
.ch-side-l {
  font-size: 12px;
  color: var(--color-text-muted);
}
.ch-side-iststxt {
  margin: 0;
  font-size: 14px;
}
.ch-side-iststxt a {
  color: var(--color-primary);
  text-decoration: none;
}
.ch-side-iststxt a:hover {
  text-decoration: underline;
}

.ch-side-faq {
  border-top: 1px dashed var(--color-border);
  padding: 10px 0;
}
.ch-side-faq:first-of-type {
  border-top: 0;
  padding-top: 0;
}
.ch-side-faq summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}
.ch-side-faq summary::after {
  content: '+';
  font-family: var(--hd-mono);
  font-size: 14px;
  color: var(--color-primary);
  transition: transform 0.18s;
}
.ch-side-faq[open] summary::after {
  content: '−';
}
.ch-side-faq p {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-muted);
}

.ch-side-block--cta {
  background: var(--color-bg-warm);
}

/* ─────────────────────────────────────────────────────────────────────────
   Skeleton + empty states
   ───────────────────────────────────────────────────────────────────────── */
.ch-skel {
  padding: 28px 20px;
  text-align: center;
  font-style: italic;
  color: var(--color-text-muted);
  background: var(--color-bg-warm);
  border-radius: 10px;
  font-size: 14px;
  grid-column: 1 / -1;
}
.ch-empty {
  padding: 28px 20px;
  text-align: center;
  font-size: 14px;
  color: var(--color-text-muted);
  border: 1px dashed var(--color-border);
  border-radius: 10px;
  grid-column: 1 / -1;
}

/* ─────────────────────────────────────────────────────────────────────────
   Reveal animations (IntersectionObserver toggle)
   ───────────────────────────────────────────────────────────────────────── */
.reveal-section {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.5s ease,
    transform 0.5s ease;
}
.reveal-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal-section {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .ch-cat,
  .ch-cta-card,
  .ch-result,
  .ch-evento {
    transition: none;
  }
  .ch-eyebrow .dot,
  .ch-hero .hd-eyebrow .dot {
    animation: none;
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   Mobile (≤640px)
   ───────────────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .ch-hero {
    min-height: 380px;
  }
  .ch-hero-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    border-top: 0;
    padding-top: 0;
  }
  .ch-hero-stat {
    border-right: 0;
    padding: 12px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
  }
  .ch-sec {
    padding: 22px 18px;
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   Dark mode
   ───────────────────────────────────────────────────────────────────────── */
[data-theme='dark'] .ch-sec--ink {
  background: #14130f;
  border-color: #14130f;
}
[data-theme='dark'] .ch-cat,
[data-theme='dark'] .ch-result,
[data-theme='dark'] .ch-evento,
[data-theme='dark'] .ch-voice,
[data-theme='dark'] .ch-emergenza-card,
[data-theme='dark'] .ch-cta-card,
[data-theme='dark'] .ch-side-block,
[data-theme='dark'] .ch-identita-glossario {
  background: var(--color-bg-card);
}
[data-theme='dark'] .ch-search {
  background: rgba(255, 255, 255, 0.04);
}
[data-theme='dark'] .ch-search-field {
  background: var(--color-bg);
}
