/* ─── CSS PARTE A: carosello chrome + slide 1 ─── */
/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   SEZIONE 5 — Classificazione sismica e sismicità italiana
   Prefisso: .s5- / #s5-
   Variabili colore ereditate dal :root del padre
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

/* ── 1. Carosello chrome ── */

#s5-carousel {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

#s5-track {
    display: flex;
    height: 100%;
    transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.s5-slide {
    width: 100vw;
    min-width: 100vw;
    height: 100%;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    background: var(--black);
}

/* Frecce navigazione */
.s5-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    width: 52px;
    height: 52px;
    background: rgba(8, 8, 8, 0.85);
    border: 1px solid rgba(245, 237, 224, 0.12);
    color: rgba(245, 237, 224, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.3s, background 0.3s, color 0.3s, opacity 0.3s;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 1.1rem;
}
.s5-arrow:hover {
    border-color: var(--terracotta);
    background: rgba(196, 97, 42, 0.14);
    color: var(--terracotta);
}
.s5-arrow[disabled] {
    opacity: 0.1;
    pointer-events: none;
}
.s5-prev { left: 1.2rem; }
.s5-next { right: 1.2rem; }

/* Nav bottom: dots + counter */
.s5-nav {
    position: absolute;
    bottom: 1.6rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 1.4rem;
}
.s5-dots-row {
    display: flex;
    gap: 0.55rem;
    align-items: center;
}
.s5-dot {
    width: 5px;
    height: 5px;
    background: rgba(196, 97, 42, 0.2);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.35s ease;
}
.s5-dot.active {
    background: var(--terracotta);
    transform: scale(1.9);
}
.s5-counter {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.56rem;
    letter-spacing: 0.28em;
    color: rgba(245, 237, 224, 0.2);
    text-transform: uppercase;
    white-space: nowrap;
}

/* Eyebrow tipografia comune */
.s5-eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    letter-spacing: 0.35em;
    color: var(--terracotta);
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.8rem;
}

/* ── 2. Slide 1 — mappa full-screen + box DPC overlay a destra ── */

#s5-s1 {
    position: relative;
    width: 100%;
    height: 100%;
    background: #080808;
}
#s5-map {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    background: #080808;
}
.leaflet-container { background: #080808 !important; }

/* Box DPC: overlay assoluto sul lato destro */
.s5-dpc-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 290px;
    z-index: 500;
    background: rgba(8,8,8,0.88);
    border-left: 1px solid rgba(196,97,42,0.25);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 2rem 1.4rem 1.4rem 1.4rem;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(196,97,42,0.2) transparent;
}
.s5-dpc-panel-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(1.8rem, 2.8vw, 3rem);
    font-weight: 300;
    line-height: 1.05;
    color: var(--cream);
    margin: 0;
}
.s5-dpc-section { display: flex; flex-direction: column; gap: 0.35rem; }
.s5-dpc-box-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.46rem;
    letter-spacing: 0.28em;
    color: rgba(196,97,42,0.7);
    text-transform: uppercase;
}
.s5-dpc-box-text {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 0.9rem;
    line-height: 1.72;
    color: rgba(245,237,224,0.62);
    margin: 0;
}
.s5-dpc-zones-grid {
    display: flex;
    flex-direction: column;
    gap: 0.32rem;
    padding: 0.65rem 0;
    border-top: 1px solid rgba(245,237,224,0.07);
    border-bottom: 1px solid rgba(245,237,224,0.07);
}
.s5-dpc-zone-row {
    display: grid;
    grid-template-columns: 9px 42px 76px 1fr;
    align-items: center;
    gap: 0.45rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.49rem;
    letter-spacing: 0.05em;
}
.s5-dpc-zone-dot  { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.s5-dpc-zone-num  { color: rgba(245,237,224,0.82); }
.s5-dpc-zone-pga  { color: rgba(245,237,224,0.4); }
.s5-dpc-zone-desc { color: rgba(245,237,224,0.28); text-transform:uppercase; letter-spacing:0.1em; }
.s5-dpc-controls {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
}
.s5-dpc-controls label {
    display: flex; align-items: center; gap: 0.4rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.52rem; letter-spacing: 0.06em;
    color: rgba(245,237,224,0.55); cursor: pointer;
}
.s5-dpc-controls input { accent-color: var(--terracotta); cursor: pointer; }

/* Sovrascrittura stili Leaflet per tema scuro */
#s5-map .leaflet-tile-pane { filter: brightness(0.92); }
#s5-map .leaflet-control-zoom {
    border: 1px solid rgba(196, 97, 42, 0.35) !important;
    background: rgba(8, 8, 8, 0.88) !important;
}
#s5-map .leaflet-control-zoom a {
    background: rgba(8, 8, 8, 0.88) !important;
    color: rgba(245, 237, 224, 0.7) !important;
    border-bottom: 1px solid rgba(245, 237, 224, 0.1) !important;
    font-size: 1rem !important;
    line-height: 26px !important;
}
#s5-map .leaflet-control-zoom a:hover {
    background: rgba(196, 97, 42, 0.2) !important;
    color: var(--terracotta) !important;
}
#s5-map .leaflet-popup-content-wrapper {
    background: rgba(8, 8, 8, 0.94);
    border: 1px solid rgba(196, 97, 42, 0.4);
    border-radius: 2px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
    color: var(--cream);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    line-height: 1.7;
    letter-spacing: 0.04em;
}
#s5-map .leaflet-popup-tip {
    background: rgba(8, 8, 8, 0.94);
}
#s5-map .leaflet-tooltip {
    background: rgba(8, 8, 8, 0.92);
    border: 1px solid rgba(196, 97, 42, 0.35);
    border-radius: 2px;
    color: var(--cream);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    letter-spacing: 0.04em;
    line-height: 1.65;
    padding: 0.55rem 0.75rem;
    white-space: pre-line;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}
#s5-map .leaflet-tooltip::before {
    border-top-color: rgba(196, 97, 42, 0.35);
}

/* Titolo sovrapposto alla mappa, in alto al centro */
.s5-map-title {
    position: absolute;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    text-align: center;
    pointer-events: none;
    white-space: nowrap;
}
.s5-map-title .s5-eyebrow {
    margin-bottom: 0.35rem;
    font-size: 0.6rem;
}
.s5-map-title h2 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(2rem, 4vw, 4rem);
    font-weight: 300;
    color: var(--cream);
    line-height: 1.1;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.8), 0 0 60px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.01em;
}

/* Pannello controlli: in alto a sinistra */
.s5-control-panel {
    position: absolute;
    top: 5rem;
    left: 1.2rem;
    z-index: 1000;
    min-width: 220px;
    background: rgba(8, 8, 8, 0.88);
    border: 1px solid #C4612A;
    border-radius: 4px;
    padding: 1rem;
}

/* Eyebrow interno al pannello */
.s5-control-panel .s5-panel-eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.52rem;
    letter-spacing: 0.35em;
    color: rgba(196, 97, 42, 0.65);
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.75rem;
}

/* Toggle checkbox/radio */
.s5-control-panel label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    letter-spacing: 0.06em;
    color: rgba(245, 237, 224, 0.7);
    cursor: pointer;
    margin-bottom: 0.45rem;
    user-select: none;
}
.s5-control-panel label:hover {
    color: var(--cream);
}
.s5-control-panel input[type="checkbox"],
.s5-control-panel input[type="radio"] {
    accent-color: var(--terracotta);
    width: 13px;
    height: 13px;
    cursor: pointer;
    flex-shrink: 0;
}

/* Divisore sottile nel pannello */
.s5-panel-divider {
    height: 1px;
    background: rgba(245, 237, 224, 0.08);
    margin: 0.7rem 0;
}

/* Gruppo radio filtro magnitudine */
.s5-magfilter-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.45rem;
}
.s5-magfilter-group .s5-group-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.5rem;
    letter-spacing: 0.25em;
    color: rgba(245, 237, 224, 0.3);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

/* Counter eventi */
.s5-event-counter {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.58rem;
    letter-spacing: 0.08em;
    color: rgba(245, 237, 224, 0.45);
    margin-top: 0.5rem;
}
.s5-event-counter span {
    color: var(--ochre);
}

/* Stato API (errore fallback) */
#s5-api-status {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.54rem;
    letter-spacing: 0.06em;
    color: rgba(139, 26, 26, 0.9);
    margin-top: 0.5rem;
    line-height: 1.5;
}

/* Legenda compatta zone */
.s5-legend {
    margin-top: 0.6rem;
}
.s5-legend-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.5rem;
    letter-spacing: 0.25em;
    color: rgba(245, 237, 224, 0.3);
    text-transform: uppercase;
    margin-bottom: 0.4rem;
}
.s5-legend-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.56rem;
    letter-spacing: 0.06em;
    color: rgba(245, 237, 224, 0.55);
    margin-bottom: 0.3rem;
}
.s5-legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
}
.s5-legend-dot.z1 { background: rgba(139, 26, 26, 0.85); border-color: #8B1A1A; }
.s5-legend-dot.z2 { background: rgba(196, 97, 42, 0.75); border-color: #C4612A; }
.s5-legend-dot.z3 { background: rgba(212, 137, 58, 0.65); border-color: #D4893A; }
.s5-legend-dot.z4 { background: rgba(58, 126, 196, 0.55); border-color: #3A7EC4; }

/* ── 3. Marker L'Aquila ── */

.s5-aquila-marker {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Cerchio pulsante principale */
.s5-aquila-core {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #8B1A1A;
    border: 2px solid rgba(245, 237, 224, 0.9);
    box-shadow: 0 0 8px rgba(139, 26, 26, 0.8);
    position: relative;
    z-index: 2;
}

/* Anello pulsante esterno */
.s5-aquila-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(139, 26, 26, 0.4);
    transform: translate(-50%, -50%);
    animation: s5-pulse 2s ease-out infinite;
    z-index: 1;
}

/* Label permanente */
.s5-aquila-label {
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    color: rgba(245, 237, 224, 0.95);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9), 0 0 12px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
    font-weight: 500;
    z-index: 3;
}

/* Classe applicata al wrapper dell'anello per la pulse */
.s5-aquila-pulse {
    animation: s5-pulse 2s ease-out infinite;
}

/* ── Keyframe pulse L'Aquila ── */
@keyframes s5-pulse {
    0%   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    50%  { opacity: 0.4; transform: translate(-50%, -50%) scale(2.5); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ─── CSS PARTE B: slide 2-3 ─── */
/* ── Slide 2: La formula del rischio ── */

#s5-s2 {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: stretch;
}

.s5-s2-left {
  flex: 0 0 50%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 3rem 4rem;
  margin-left: 10%;
  overflow-y: auto;
  gap: 1rem;
  text-align: center;
}

.s5-s2-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.s5-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: var(--terracotta, #C4612A);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
}

.s5-s2-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.2rem, 4vw, 4rem);
  font-weight: 300;
  color: var(--cream, #F5EDE0);
  line-height: 1.15;
  margin: 0 0 0.6rem 0;
}

.s5-s2-body {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  line-height: 1.65;
  color: rgba(245, 237, 224, 0.6);
  margin: 0;
  text-align: left;
}

.s5-formula-box {
  background: #0d0d0d;
  border: 1px solid #C4612A;
  padding: 0.7rem;
  margin: 0.8rem 0;
  text-align: center;
}

.s5-formula-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(0.6rem, 0.9vw, 0.75rem);
  color: #C4612A;
  letter-spacing: 0.1em;
  line-height: 1.5;
}

.s5-btn-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0;
  justify-content: center;
}

.s5-gear-btn {
  background: transparent;
  border: 1px solid rgba(245, 237, 224, 0.2);
  color: rgba(245, 237, 224, 0.6);
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  transition: border-color 0.2s ease, color 0.2s ease;
  text-transform: uppercase;
}

.s5-gear-btn:hover {
  border-color: var(--terracotta, #C4612A);
  color: var(--terracotta, #C4612A);
}

#s5-gear-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--ochre, #D4893A);
  min-height: 2rem;
  margin-top: 0.8rem;
  line-height: 1.6;
}

#s5-gear-canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ── Slide 3: Il rischio città per città ── */

#s5-s3 {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.s5-s3-header {
  flex: 0 0 auto;
  padding: 1.8rem 3rem 1rem 3rem;
  text-align: center;
}

.s5-s3-header .s5-eyebrow {
  margin-bottom: 0.4rem;
}

.s5-s3-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.6rem, 2.8vw, 2.8rem);
  font-weight: 300;
  color: var(--cream, #F5EDE0);
  line-height: 1.2;
  margin: 0;
}

.s5-s3-cols {
  flex: 1;
  display: flex;
  flex-direction: row;
  gap: 1.2rem;
  padding: 0 2rem 2rem 2rem;
  overflow: hidden;
  min-height: 0;
}

/* Pannelli città */
.s5-city-panel {
  background: rgba(8, 8, 8, 0.6);
  border: 1px solid rgba(245, 237, 224, 0.08);
  border-radius: 4px;
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.s5-city-header {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  color: var(--terracotta, #C4612A);
  margin-bottom: 0.8rem;
  text-transform: uppercase;
}

.s5-select {
  background: #101010;
  border: 1px solid rgba(196, 97, 42, 0.3);
  color: #F5EDE0;
  padding: 0.4rem 0.6rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  cursor: pointer;
  margin-bottom: 0.5rem;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
}

.s5-select:focus {
  border-color: rgba(196, 97, 42, 0.6);
}

.s5-select option {
  background: #101010;
  color: #F5EDE0;
}

.s5-bars {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.8rem;
}

.s5-bar-row {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.s5-bar-row label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  letter-spacing: 0.15em;
  color: rgba(245, 237, 224, 0.45);
  text-transform: uppercase;
}

.s5-bar-bg {
  background: rgba(255, 255, 255, 0.05);
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  margin: 0.3rem 0;
}

.s5-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
  width: 0%;
}

/* Pericolosità: gradiente verde→rosso sangue */
.s5-bar-peri {
  background: linear-gradient(to right, #2d8f4e, #D4893A, #8B1A1A);
  background-size: 1000% 100%;
}

.s5-bar-vuln {
  background: #C4612A;
}

.s5-bar-expo {
  background: #3A7EC4;
}

.s5-bar-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: rgba(245, 237, 224, 0.7);
}

.s5-bar-note {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.55rem;
  color: rgba(245, 237, 224, 0.25);
  font-style: italic;
}

.s5-risk-circle-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: auto;
  padding-top: 0.8rem;
}

.s5-risk-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: rgba(245, 237, 224, 0.5);
  margin-top: 0.4rem;
  text-align: center;
  text-transform: uppercase;
}

/* Pannello centrale di confronto */
#s5-compare-panel {
  flex: 0 0 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.6rem;
}

#s5-compare-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: rgba(245, 237, 224, 0.6);
  text-align: center;
  line-height: 1.8;
  letter-spacing: 0.05em;
}

#s5-compare-arrow {
  font-size: 2rem;
  color: var(--ochre, #D4893A);
  text-align: center;
}

.s5-arrow-anim {
  animation: s5ArrowPulse 1.4s ease-in-out infinite;
}

@keyframes s5ArrowPulse {
  0%, 100% { opacity: 0.4; transform: translateY(0); }
  50%       { opacity: 1;   transform: translateY(4px); }
}

#s5-compare-desc {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.75rem;
  color: rgba(245, 237, 224, 0.4);
  text-align: center;
  line-height: 1.7;
  font-style: italic;
}

/* ─── CSS PARTE C: slide 4-6 ─── */
/* ──────────────────────────────────────────
   SLIDE 4 — E se avessimo costruito meglio?
   ────────────────────────────────────────── */

#s5-s4 {
    background: #080808;
    display: grid;
    grid-template-rows: auto 1fr;
    height: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

/* Intestazione slide 4 */
.s5-s4-header {
    padding: 1.8rem 4rem 0.8rem;
    flex-shrink: 0;
}

.s5-s4-eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    letter-spacing: 0.32em;
    color: var(--terracotta);
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.4rem;
}

.s5-s4-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(1.6rem, 3vw, 2.8rem);
    font-weight: 300;
    color: var(--cream);
    line-height: 1.15;
    margin: 0;
}

/* Layout corpo slide 4: intro+SVG a sinistra, metrica+slider a destra */
.s5-s4-body {
    display: grid;
    grid-template-columns: 1fr 55%;
    gap: 1.5rem;
    padding: 0.5rem 4rem 1.2rem;
    min-height: 0;
    overflow: hidden;
}

/* Colonna sinistra: intro testo + visualizzazione edifici */
.s5-s4-left {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    min-height: 0;
}

.s5-s4-intro {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 0.95rem;
    line-height: 1.7;
    color: rgba(245, 237, 224, 0.65);
}

/* Contenitore SVG edifici */
#s5-buildings-viz {
    position: relative;
    flex: 1;
    min-height: 0;
    border: 1px solid rgba(245, 237, 224, 0.04);
    border-radius: 3px;
    overflow: hidden;
    background: rgba(8, 8, 8, 0.6);
}

/* Stati edifici: solo uno attivo per volta */
.s5-building-state {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 0.5rem;
}

.s5-building-state.active {
    opacity: 1;
}

.s5-building-state svg {
    width: 100%;
    height: 100%;
    max-height: 220px;
}

/* Label stato edificio */
.s5-building-state-label {
    position: absolute;
    bottom: 0.4rem;
    left: 0;
    right: 0;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.52rem;
    letter-spacing: 0.18em;
    color: rgba(245, 237, 224, 0.35);
    text-transform: uppercase;
    pointer-events: none;
}

/* Colonna destra: slider + metriche */
.s5-s4-right {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    min-height: 0;
}

/* Slider track */
.s5-slider-track {
    background: rgba(8, 8, 8, 0.9);
    border: 1px solid rgba(245, 237, 224, 0.06);
    border-radius: 3px;
    padding: 1rem 1.2rem 0.8rem;
    flex-shrink: 0;
}

#s5-building-slider {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: linear-gradient(to right, var(--blood), var(--terracotta), var(--ochre), #4CAF50);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    margin-bottom: 0.5rem;
    accent-color: var(--terracotta);
}

#s5-building-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--cream);
    border-radius: 50%;
    border: 2px solid var(--terracotta);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#s5-building-slider::-webkit-slider-thumb:hover {
    border-color: var(--ochre);
    box-shadow: 0 0 8px rgba(196, 97, 42, 0.5);
}

#s5-building-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--cream);
    border-radius: 50%;
    border: 2px solid var(--terracotta);
    cursor: pointer;
}

/* Label posizioni slider (5 etichette) */
.s5-slider-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.6rem;
    gap: 0.2rem;
}

.s5-slider-labels span {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.46rem;
    letter-spacing: 0.06em;
    color: rgba(245, 237, 224, 0.25);
    text-align: center;
    flex: 1;
    line-height: 1.3;
    transition: color 0.3s;
}

.s5-slider-labels span.s5-label-active {
    color: var(--terracotta);
}

/* Label grande stato corrente */
#s5-slider-label {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(0.9rem, 1.5vw, 1.15rem);
    font-weight: 600;
    color: var(--cream);
    text-align: center;
    margin-top: 0.3rem;
    letter-spacing: 0.01em;
    min-height: 1.4em;
    transition: color 0.3s;
}

/* Griglia 2x2 metriche */
.s5-metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    flex: 1;
    min-height: 0;
}

/* Singola card metrica */
.s5-metric-card {
    background: rgba(16, 16, 16, 0.8);
    border: 1px solid rgba(245, 237, 224, 0.06);
    border-radius: 4px;
    padding: 1rem 1rem 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    overflow: hidden;
    position: relative;
}

/* Barra verticale di sfondo (indicatore visivo) */
.s5-metric-bar-bg {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: rgba(245, 237, 224, 0.04);
    border-radius: 0 0 0 4px;
}

.s5-metric-bar-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 3px;
    background: var(--blood);
    border-radius: 0 0 0 4px;
    transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1), background 0.4s;
}

.s5-metric-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.52rem;
    letter-spacing: 0.25em;
    color: rgba(245, 237, 224, 0.4);
    text-transform: uppercase;
}

.s5-metric-value {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(1.8rem, 3.5vw, 3rem);
    font-weight: 300;
    color: var(--cream);
    line-height: 1;
    transition: color 0.4s;
}

/* Card MCS: usa font diverso per numeri romani grandi */
#s5-metric-mcs .s5-metric-value {
    font-size: clamp(1.4rem, 2.8vw, 2.4rem);
    letter-spacing: 0.02em;
}

.s5-metric-note {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.48rem;
    color: var(--blood);
    margin-top: 0.2rem;
    line-height: 1.4;
    letter-spacing: 0.04em;
}

/* Disclaimer in fondo alla slide */
.s5-s4-disclaimer {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.52rem;
    line-height: 1.6;
    color: rgba(245, 237, 224, 0.22);
    text-align: center;
    padding: 0.4rem 4rem;
    border-top: 1px solid rgba(245, 237, 224, 0.04);
    flex-shrink: 0;
    letter-spacing: 0.04em;
}

/* ──────────────────────────────────────────
   SLIDE 5 — Mappa pericolosità INGV annotata
   ────────────────────────────────────────── */

#s5-s5 {
    background: #050508;
    display: flex;
    height: 100%;
    overflow: hidden;
}

/* Area mappa: 70% */
#s5-map-area {
    flex: 0 0 70%;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Header area mappa con titolo e eyebrow */
.s5-s5-map-header {
    position: absolute;
    top: 1.5rem;
    left: 2rem;
    z-index: 10;
    pointer-events: none;
}

.s5-s5-eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.58rem;
    letter-spacing: 0.32em;
    color: var(--terracotta);
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.4rem;
}

.s5-s5-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(1.4rem, 2.5vw, 2.2rem);
    font-weight: 300;
    color: var(--cream);
    line-height: 1.2;
    margin: 0;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.8);
}

/* Immagine mappa */
#s5-hazard-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Fallback se immagine non si carica */
.s5-img-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #0a0a12;
    text-align: center;
    padding: 3rem;
    box-sizing: border-box;
}

.s5-img-fallback p {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    line-height: 1.8;
    color: rgba(245, 237, 224, 0.35);
    letter-spacing: 0.06em;
}

.s5-img-fallback strong {
    color: var(--terracotta);
}

/* SVG overlay annotazioni */
.s5-hazard-svg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Stili annotazioni alta pericolosità */
.s5-anno-high {
    fill: none;
    stroke: #8B1A1A;
    stroke-width: 1;
}

.s5-anno-high-dot {
    fill: #8B1A1A;
}

.s5-anno-high-text {
    fill: rgba(245, 237, 224, 0.85);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.58rem;
    letter-spacing: 0.06em;
}

/* Stili annotazioni bassa pericolosità */
.s5-anno-low {
    fill: none;
    stroke: #3A7EC4;
    stroke-width: 1;
}

.s5-anno-low-dot {
    fill: #3A7EC4;
}

.s5-anno-low-text {
    fill: rgba(245, 237, 224, 0.6);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.55rem;
    letter-spacing: 0.04em;
}

/* Marker L'Aquila nell'overlay */
.s5-aquila-svg-core {
    fill: #8B1A1A;
}

.s5-aquila-svg-ring {
    fill: rgba(139, 26, 26, 0.3);
    animation: s5-pulse2 2s ease-out infinite;
    transform-origin: center;
    transform-box: fill-box;
}

@keyframes s5-pulse2 {
    0%   { opacity: 1; transform: scale(1); }
    50%  { opacity: 0.3; transform: scale(2.2); }
    100% { opacity: 1; transform: scale(1); }
}

.s5-aquila-svg-label {
    fill: var(--cream);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.58rem;
    letter-spacing: 0.06em;
    font-weight: 500;
    text-shadow: 0 1px 4px rgba(0,0,0,0.9);
}

/* Pannello legenda (30%) */
#s5-legend-panel {
    flex: 0 0 30%;
    padding: 2.5rem 2rem;
    overflow-y: auto;
    border-left: 1px solid rgba(245, 237, 224, 0.06);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.s5-legend-panel-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.1rem;
    font-weight: 300;
    color: var(--cream);
    line-height: 1.3;
    margin: 0;
}

.s5-legend-panel-subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.58rem;
    letter-spacing: 0.1em;
    color: rgba(245, 237, 224, 0.38);
    line-height: 1.5;
    margin-top: -0.5rem;
}

/* Scala colori legenda */
.s5-legend-scale {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.s5-legend-band {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.s5-legend-color {
    width: 1rem;
    height: 2.5rem;
    border-radius: 2px;
    flex-shrink: 0;
}

.s5-legend-band-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.s5-legend-band-pga {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.58rem;
    color: var(--cream);
    letter-spacing: 0.04em;
}

.s5-legend-band-zona {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.52rem;
    color: rgba(245, 237, 224, 0.45);
    letter-spacing: 0.08em;
}

/* Separatore */
/* Spiegazione PGA */
.s5-pga-explainer {
    padding: 0.9rem 1rem;
    background: rgba(245,237,224,0.03);
    border-left: 2px solid var(--terracotta, #C4612A);
    margin: 0.8rem 0;
}
.s5-pga-exp-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.52rem;
    letter-spacing: 0.22em;
    color: var(--terracotta, #C4612A);
    text-transform: uppercase;
    margin-bottom: 0.45rem;
}
.s5-pga-exp-body {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.8rem;
    line-height: 1.6;
    color: rgba(245,237,224,0.65);
}

.s5-legend-divider {
    height: 1px;
    background: rgba(245, 237, 224, 0.06);
}

/* Bullets statistici */
.s5-stat-bullets {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin-top: 0.3rem;
}

.s5-stat-bullet {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.58rem;
    line-height: 1.6;
    color: rgba(245, 237, 224, 0.5);
    padding-left: 0.9rem;
    border-left: 2px solid rgba(196, 97, 42, 0.3);
    letter-spacing: 0.03em;
}

/* Fonte citazione */
.s5-legend-source {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.48rem;
    color: rgba(245, 237, 224, 0.2);
    line-height: 1.6;
    letter-spacing: 0.06em;
    margin-top: auto;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(245, 237, 224, 0.04);
}

/* ──────────────────────────────────────────
   SLIDE 6 — Transizione
   ────────────────────────────────────────── */

#s5-s6 {
    background: #080808;
}

/* Freccia bounce in basso */
.s5-bounce-arrow {
    font-size: 1.8rem;
    color: var(--terracotta);
    margin-top: 1rem;
    animation: s5-bounce 1.6s ease-in-out infinite;
    display: block;
}

@keyframes s5-bounce {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(14px); }
}
/* ── Mappa zone sismiche (slide 5) ── */
#s5-zone-map { background: #080808; }
#s5-zone-map .leaflet-tooltip {
    background: rgba(8,8,8,0.92);
    border: 1px solid rgba(196,97,42,0.3);
    color: rgba(245,237,224,0.85);
    border-radius: 2px;
    padding: 0.4rem 0.7rem;
    box-shadow: none;
}
#s5-zone-map .leaflet-tooltip::before { display: none; }

/* ── Popup PGA / DPC ── */
.s5-pga-trigger, .s5-dpc-trigger {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--terracotta);
    color: var(--terracotta);
    font-family: inherit;
    font-size: inherit;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    letter-spacing: 0.05em;
    transition: color 0.2s, border-color 0.2s;
}
.s5-pga-trigger:hover, .s5-dpc-trigger:hover { color: var(--ochre); border-color: var(--ochre); }
.s5-s5-subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    color: rgba(245,237,224,0.45);
    margin-top: 0.6rem;
    text-shadow: 0 1px 8px rgba(0,0,0,0.8);
}
.s5-popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9000;
    backdrop-filter: blur(4px);
}
.s5-popup-overlay.open { display: block; }
.s5-info-popup {
    display: none;
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9001;
    background: rgba(12,12,12,0.97);
    border: 1px solid rgba(196,97,42,0.5);
    border-radius: 4px;
    padding: 2.5rem 2.8rem;
    max-width: 560px;
    width: 90vw;
    box-shadow: 0 8px 40px rgba(0,0,0,0.8);
}
.s5-info-popup.open { display: block; }
.s5-popup-close {
    position: absolute; top: 1rem; right: 1rem;
    background: transparent; border: none;
    color: rgba(245,237,224,0.35); font-size: 1rem;
    cursor: pointer; transition: color 0.2s;
}
.s5-popup-close:hover { color: var(--cream); }
.s5-popup-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.6rem; font-weight: 300;
    color: var(--cream); margin-bottom: 0.2rem;
}
.s5-popup-dates {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.56rem; letter-spacing: 0.2em;
    color: rgba(196,97,42,0.7); text-transform: uppercase;
    margin-bottom: 1.2rem;
}
.s5-popup-body {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.05rem; line-height: 1.85;
    color: rgba(245,237,224,0.75); margin-bottom: 1.2rem;
}
.s5-popup-geo {
    display: flex; flex-direction: column; gap: 0.3rem;
    border-top: 1px solid rgba(245,237,224,0.08);
    padding-top: 0.9rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.5rem; letter-spacing: 0.1em;
    color: rgba(245,237,224,0.3);
}
/* Gradient bar PGA */
.s5-pga-gradient-bar {
    width: 100%; height: 14px;
    border-radius: 2px;
    background: linear-gradient(to top,
        rgb(26,32,53) 0%, rgb(58,126,196) 14%,
        rgb(212,137,58) 42%, rgb(196,97,42) 69%,
        rgb(139,26,26) 100%);
    margin-bottom: 0.25rem;
}
.s5-pga-gradient-labels {
    display: flex; flex-direction: column;
    align-items: flex-end; gap: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.48rem; letter-spacing: 0.08em;
    color: rgba(245,237,224,0.35);
    margin-bottom: 0.6rem;
    line-height: 1;
}
.s5-pga-gradient-labels span { margin-bottom: 0; }
.s5-panel-dpc-note {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.54rem; letter-spacing: 0.06em;
    color: rgba(245,237,224,0.4);
    line-height: 1.6; margin-bottom: 0.8rem;
}
