/* =========================================================
   ANALISI URBANA — style.css
   Convenzione: kebab-case per tutti i selettori
   ========================================================= */
/* ── FONT SELF-HOSTED (no Google Fonts) ─────────────────── */
@font-face {
    font-family: 'Bai Jamjuree';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/BaiJamjuree-Regular.ttf') format('truetype');
}

@font-face {
    font-family: 'Bai Jamjuree';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('fonts/BaiJamjuree-SemiBold.ttf') format('truetype');
}

@font-face {
    font-family: 'Titillium Web';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/TitilliumWeb-Regular.ttf') format('truetype');
}

@font-face {
    font-family: 'Titillium Web';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('fonts/TitilliumWeb-SemiBold.ttf') format('truetype');
}

/* ── BASE ─────────────────────────────────────────────── */
body {
    background-color: #000000;
    font-family: 'Bai Jamjuree', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    padding-top: var(--nav-h);
}

:root {
    --nav-h: clamp(44px, 3.2vw, 68px);
}

/* Le ancore non finiscono sotto il menu fisso */
section[id],
.sp-figure[id],
.sp-header[id] {
    scroll-margin-top: calc(var(--nav-h) + 16px);
}

/* ── NAVBAR ───────────────────────────────────────────── */
.barramenu {
    position: fixed;
    width: 100%;
    z-index: 10;
    top: 0;
}

.navbar-desktop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    box-sizing: border-box;
    height: var(--nav-h);
    padding: 0 2.5%;
    display: flex;
    align-items: center;
    gap: clamp(16px, 2.2vw, 56px);
    background-color: #000000;
}

.nav-logo {
    flex: 0 0 clamp(64px, 5vw, 110px);
    display: flex;
    align-items: center;
    height: 100%;
}

.nav-logo img {
    height: 70%;
    width: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: clamp(70px, 6vw, 140px);
    padding: 6px 0.6vw;
    border-bottom: 1px solid #ffffff;
    color: #ffffff;
    font-size: clamp(11px, 0.95vw, 16px);
    line-height: 1.2;
    white-space: nowrap;
    text-decoration: none;
}

.nav-link:hover {
    text-decoration: underline;
}

.nav-link img {
    height: 1.05em;
    width: auto;
}

.nav-spacer {
    flex: 1;
}

.navbar-mobile {
    z-index: 10;
    background-color: #000000;
    margin: 1% auto 5%;
    display: grid;
    grid-template-columns: 25% 50% 25%;
    align-items: center;
}

.navm-links {
    grid-column: 2;
    display: flex;
    flex-direction: column;
}

.navm-link {
    display: block;
    padding: 6px 0;
    border-bottom: 1px solid #ffffff;
    color: #ffffff;
    font-size: 13px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.navm-links > .navm-link:first-child {
    border-top: 1px solid #ffffff;
}

.navm-dropdown summary {
    list-style: none;
}

.navm-dropdown summary::-webkit-details-marker {
    display: none;
}

.navm-sub {
    display: flex;
    flex-direction: column;
    background-color: #181818;
    border-bottom: 1px solid #ffffff;
}

.navm-sub a {
    padding: 8px 4px;
    color: #c3c1c1;
    font-size: 12px;
    text-align: center;
    text-decoration: none;
}

.navm-logo {
    grid-column: 3;
    display: flex;
    justify-content: center;
}

.navm-logo img {
    width: 60%;
}

.nav-item {
    border-bottom: 1px solid;
    color: #ffffff;
    grid-area: 1 / 2 / 2 / 3;
}

.container {
    color: #ffffff;
    font-size: 1em;
}

.navbar a:hover,
.dropdown:hover .dropbtn {
    text-decoration: underline;
}

.dropdown {
    width: 100%;
    height: 100%;
    overflow: hidden;
    margin: auto;
}

.dropdown .dropbtn {
    color: #ffffff;
    text-decoration: none;
    font-size: 1vw;
    border: none;
    outline: none;
    background-color: inherit;
    z-index: 2;
    margin: auto;
    text-align: center !important;
}

/* ── TIPOGRAFIA ───────────────────────────────────────── */
/* Testo generico: descrizioni, label, footer, ecc. */
.text-body {
    font-size: clamp(12px, 1.05vw, 16px);
    font-weight: 400;
    width: 95%;
    line-height: 1.5;
    text-decoration: none;
    color: #c3c1c1;
    z-index: 0;
    margin: 6px;
    text-align: right;
}

/* Testo intro sezione (descrizione sotto il titolo) */
.text-intro {
    margin: auto;
    width: 90%;
    grid-area: 2 / 2 / 3 / 3;
    font-size: clamp(13px, 1.2vw, 16px);
    text-align: left;
}

/* Nota / sottotitolo secondario sezione */
.text-note {
    width: 85%;
    font-style: italic;
    text-transform: uppercase;
    grid-area: 3 / 2 / 4 / 3;
    margin: auto !important;
}

/* Hero intro (testo vicino alla GIF) */
.hero-intro {
    font-size: clamp(14px, 1.2vw, 20px);
    line-height: 1.6;
    text-align: center;
}

/* Titolo card (link + hover) */
.titolo-sezione {
    color: white;
    font-size: clamp(12px, 1.1vw, 18px);
    width: auto;
    z-index: 0;
    text-decoration: none;
    margin-left: 0%;
}

.titolo-sezione:hover {
    text-decoration: underline;
}

/* Titolo sezione nelle sotto-pagine */
.titolo-sezione-base {
    color: white;
    font-size: 1.5vw;
    width: 96%;
    margin-left: 2%;
    z-index: 0;
    margin-top: 6%;
}

/* Titolo principale di sezione (bullet + MAIUSCOLO) */
.heading-section {
    font-size: clamp(12px, 1.2vw, 18px);
    color: #ffffff;
    text-decoration: none;
    margin: auto auto 2% 5%;
    letter-spacing: 1px;
    grid-area: 1 / 1 / 2 / 3;
}

/* Titolo grande centrato (usato in sottopagine) */
.heading-large {
    font-size: clamp(18px, 1.5vw, 30px);
    text-align: center;
    height: auto;
    font-variant: small-caps;
    grid-area: 1 / 1 / 2 / 4;
    margin-top: 2%;
}

/* ── LAYOUT SEZIONI ───────────────────────────────────── */
/* Intestazione di ogni sezione (titolo + testo intro) */
.section-intro {
    height: 3%;
    z-index: 5;
    width: 100%;
    margin-top: 3%;
    margin-bottom: 22px;
    display: grid;
    grid-template-columns: 45% 55%;
    grid-template-rows: auto auto;
}

/* Grid card: 3 colonne su desktop */
.flex-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

/* Singola card */
.riquadro {
    display: grid;
    grid-template-columns: 100%;
    grid-template-rows: 510px 1fr;
    width: 380px;
    height: 720px;
    overflow: hidden;
    margin: auto 2%;
}

/* Testo dentro la card */
.card-body {
    width: 98%;
    margin-top: 2%;
    grid-area: 2 / 1 / 3 / 2;
}

/* Colonne fisse (usate nelle sottopagine) */
.col {
    width: 25%;
    box-sizing: border-box;
    padding: 10px;
}

/* Layout a 3 colonne per pagine interne */
.main-content-box {
    display: grid;
    grid-template-columns: 33% 34% 34%;
    grid-template-rows: 3vw 29vw;
    margin-top: 3%;
    width: 94%;
    margin-left: 3%;
}

/* ── IMMAGINI ─────────────────────────────────────────── */
/* Immagine card con hover sepia */
.img-flash {
    grid-area: 1 / 1 / 2 / 2;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease;
}

.card-img-link {
    position: relative;
    display: block;
    overflow: hidden;
}

/* Bordo rosso (colore del logo) sopra l'immagine al passaggio del mouse */
.card-img-link::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 3px solid transparent;
    transition: border-color 0.3s ease;
    pointer-events: none;
}

.riquadro:hover .card-img-link::after {
    border-color: #CB0100;
}

.riquadro:hover .img-flash {
    transform: scale(1.08);
}

/* Logo GIF rotante */
.rotate {
    animation: rotation 45s infinite linear;
    z-index: 0;
}

@keyframes rotation {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(359deg);
    }
}

/* Logo con dissolvenza sull'hover */
.img-opacita {
    opacity: 0.5;
}

.img-opacita:hover {
    opacity: 1.0;
}

/* ── SLIDESHOW (sotto-pagine) ─────────────────────────── */
.slideshow-container {
    margin: auto;
}

.prev,
.next {
    cursor: pointer;
    color: white;
    font-weight: bold;
    font-size: 6vw;
    transition: 0.6s ease;
    user-select: none;
    width: 6%;
    height: 6%;
    margin-top: auto;
    margin-left: 90%;
    margin-bottom: auto;
    align-items: center;
}

.prev:hover,
.next:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.fade {
    animation-name: fade;
    animation-duration: 1s;
}

@keyframes fade {
    from {
        opacity: .4;
    }

    to {
        opacity: 1;
    }
}

/* ── COMPONENTI VARI ──────────────────────────────────── */
/* Iframe webmap */
.iframe {
    width: 100%;
    height: 50vw;
    margin: 0.1vw;
}

/* Pulsante isolamento */
.button-iso {
    cursor: pointer;
    border: 1px solid #ffffff;
    background-color: black;
    color: #ffffff;
    padding: 6px 16px;
    border-radius: 0;
    font-family: inherit;
    font-size: clamp(12px, 1vw, 16px);
}

.button-iso[aria-pressed="true"] {
    background-color: #ffffff;
    color: #000000;
}

/* ── FOOTER ───────────────────────────────────────────── */
.footer {
    margin: auto;
    display: grid;
    grid-template-columns: 3% 14% 1fr 1fr 1fr;
    grid-template-rows: auto;
}

.footer-info {
    width: 100%;
    margin: auto;
    font-size: clamp(10px, 0.9vw, 14px) !important;
    grid-area: 1 / 3 / 2 / 4;
    text-align: center;
}

.footer-address {
    width: 100%;
    margin: auto;
    font-size: clamp(10px, 0.9vw, 14px) !important;
    grid-area: 1 / 4 / 2 / 5;
    text-align: center;
}

/* ================================
   RESPONSIVE MEDIA QUERIES
   ================================ */
@media (min-width: 850px) {
    .navbar-mobile {
        display: none;
    }
}

@media (max-width: 1200px) {
    .logohome {
        grid-template-columns: 100vw !important;
        grid-template-rows: 55vw 30% !important;
    }

    .divlogo1 {
        width: 100%;
    }

    .divlogo2 {
        grid-area: 2/1/2/3 !important;
    }
}

@media (max-width: 850px) {
    .navbar-desktop {
        display: none !important;
    }

    .barramenu {
        position: static !important;
    }

    body {
        padding-top: 0 !important;
    }

    .text-body {
        font-size: 13px !important;
        line-height: 16px !important;
    }

    .heading-large {
        font-size: 18px !important;
    }

    .heading-section {
        font-size: 15px;
    }

    .titolo-sezione {
        font-size: 12px !important;
    }

    .dropbtn {
        font-size: 13px !important;
    }

    .section-intro {
        display: grid;
        grid-template-rows: auto auto;
        grid-template-columns: 45% 55%;
    }

    .text-intro {
        width: 70%;
        text-align: left;
        grid-area: 2 / 1 / 3 / 3;
        margin-left: auto;
    }

    .text-note {
        grid-area: 3 / 1 / 4 / 3 !important;
    }

    .iframe_media_850 {
        height: 80vh !important;
        width: 95% !important;
    }
}

@media (max-width: 768px) {
    .col {
        width: 100%;
    }
}

@media (max-width: 550px) {
    .text-body {
        font-size: 10px !important;
        line-height: 14px !important;
    }

    .heading-large {
        font-size: 15px !important;
    }

    .dropbtn {
        font-size: 10px !important;
    }

    .footer-info {
        font-size: 11px !important;
    }
}

@media (max-width: 850px) {
    .iframe-duo {
        display: block !important;
        width: 96% !important;
        margin-left: 2% !important;
    }

    .iframe-duo iframe {
        display: block !important;
        width: 100% !important;
        height: 80vw !important;
        margin: 8px 0 !important;
    }

    .iframe-duo p {
        display: block !important;
        width: 100% !important;
        line-height: normal !important;
    }

    .iframe-duo img {
        display: block !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

@media (max-width: 850px) {
    .footer {
        grid-template-columns: 5% 15% 25% 25% 25% 5% 0% 0% !important;
        grid-template-rows: auto !important;
    }

    #GRAFICI-COMPARATIVI {
        grid-template-columns: 100% !important;
        grid-template-rows: repeat(6, 60vw) !important;
    }

    #GRAFICI-COMPARATIVI iframe {
        grid-column: 1 / 2 !important;
    }

    #GRAFICI-COMPARATIVI iframe:nth-child(1) {
        grid-row: 1 / 2 !important;
    }

    #GRAFICI-COMPARATIVI iframe:nth-child(2) {
        grid-row: 2 / 3 !important;
    }

    #GRAFICI-COMPARATIVI iframe:nth-child(3) {
        grid-row: 3 / 4 !important;
    }

    #GRAFICI-COMPARATIVI iframe:nth-child(4) {
        grid-row: 4 / 5 !important;
    }

    #GRAFICI-COMPARATIVI iframe:nth-child(5) {
        grid-row: 5 / 6 !important;
    }

    #GRAFICI-COMPARATIVI iframe:nth-child(6) {
        grid-row: 6 / 7 !important;
    }
}

.grafici_sistemi {
    height: 50vw;
    width: 75vw;
    margin: auto;
}

.grafici_tematici_sistemi {
    width: 100%;
    height: 100%;
    margin: auto;
}

.legenda_grafici_sist_ins {
    width: 15%;
    margin-left: 85%;
    margin-top: 5%;
}

/* ── UTILITY CLASSES (extracted from inline styles) ──── */
/* Card image link wrapper (common in home page cards) */
.card-img-link {
    text-align: left;
    font-size: 1.1vw;
    grid-area: 1 / 1 / 2 / 2;
}

/* Card body text alignment */
.card-text-left {
    text-align: left;
    line-height: normal;
    grid-area: 2 / 1 / 3 / 2;
}

/* Section content wrapper */
.content-wrapper {
    width: 100%;
}

/* Sub-page content block */
.subpage-content {
    width: 88%;
    margin-left: 6%;
    margin-top: 3%;
    display: grid;
    grid-template-columns: 50% 50%;
}

/* Sub-page full-width image */
.subpage-img {
    width: 90%;
    margin: auto auto 3%;
}

/* Footer link area */
.partner-link {
    margin: auto;
}

/* Hero section container */
.hero-section {
    height: 90vh;
    overflow-x: clip;
}

/* Background dark section */
.bg-dark {
    background-color: #181818;
}

/* ── GRIGLIA CARD (home + english) ────────────────────── */
/* 3 colonne bilanciate (6 card → 3+3, 5 card → 3+2 centrate) */
.card-grid {
    gap: 48px 32px;
    max-width: 2000px;
    margin: 0 auto;
    padding: 0 4% 56px;
    box-sizing: border-box;
}

/* 5 card su una riga (schermi grandi); sotto i 2000px: 3+2, poi 2, poi 1 */
.card-grid .riquadro {
    width: calc((100% - 4 * 32px) / 5);
    height: auto;
    margin: 0;
    grid-template-rows: auto auto;
    align-content: start;
}

.card-grid .img-flash {
    display: block;
    height: auto !important;
    aspect-ratio: 380 / 510;
    object-fit: cover;
}

.card-grid .titolo-sezione {
    display: inline-block;
    font-size: clamp(12px, 0.95vw, 15px) !important;
    letter-spacing: 0.5px;
    line-height: 1.3;
}

@media (max-width: 2000px) {
    .card-grid .riquadro {
        width: calc((100% - 2 * 32px) / 3);
    }
}

@media (max-width: 1100px) {
    .card-grid .riquadro {
        width: calc((100% - 32px) / 2);
    }
}

@media (max-width: 600px) {
    .card-grid .riquadro {
        width: 100%;
        max-width: 420px;
    }
}

/* ── SOTTOPAGINE: contenuto più stretto su schermi grandi ── */
/* Le immagini hanno larghezze in %, quindi si riducono del 10% */
@media (min-width: 1800px) {
    main.content:not(:has(.card-grid)) {
        width: 90%;
        margin: 0 auto;
    }
}

/* ── SOTTOPAGINE: blocchi immagine (sp-*) ─────────────── */
/* Contenitore: largo al massimo 1600px, centrato */
.sp-content {
    width: 90%;
    max-width: 1600px;
    margin: 3% auto 0;
    display: flex;
    flex-direction: column;
    gap: clamp(40px, 5vw, 96px);
}

.sp-figure {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sp-caption {
    width: 100%;
    max-width: 1100px;
    margin: 0;
    text-align: left;
}

/* Mappa + legenda: la legenda resta agganciata all'immagine */
.sp-map {
    position: relative;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
}

/* La mappa entra sempre intera nello schermo */
.sp-map > img:first-child {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - var(--nav-h) - 80px);
    width: auto;
    height: auto;
}

.sp-legend {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 11%;
}

/* Due immagini affiancate su schermi larghi, una sotto l'altra altrimenti */
.sp-pair {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(40px, 5vw, 96px);
}

@media (min-width: 1200px) {
    .sp-pair {
        grid-template-columns: 1fr 1fr;
        gap: 4%;
        align-items: start;
    }
}

/* Grafici Flourish: altezza limitata */
.sp-chart {
    position: relative;
    width: 100%;
}

.sp-chart iframe {
    display: block;
    width: 100%;
    height: clamp(420px, 45vw, 72vh);
}

.sp-chart-legend {
    position: absolute;
    top: 0;
    right: 0;
    width: 13%;
}

@media (max-width: 850px) {
    .sp-chart iframe {
        height: 80vh;
    }

    .sp-chart-legend {
        position: static;
        display: block;
        width: 40%;
        margin: 8px 0 0 auto;
    }
}

/* Intestazioni interne (titolo + testo introduttivo) */
.sp-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    text-align: left;
}

.sp-title {
    width: auto;
    margin: 0;
    font-size: clamp(16px, 1.4vw, 26px);
}

.sp-title.heading-large {
    font-size: clamp(18px, 1.5vw, 30px);
}

.sp-lead {
    width: 100%;
    max-width: 1100px;
    margin: 0;
    text-align: left;
}

/* Pulsanti (es. isocrone) */
.sp-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

/* Slideshow: frecce ai lati della mappa */
.sp-slider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2%;
}

.sp-arrow {
    flex: 0 0 auto;
    cursor: pointer;
    border: none;
    background: none;
    color: #ffffff;
    font-size: clamp(28px, 3vw, 56px);
    padding: 8px;
}

.sp-arrow:hover {
    color: #c3c1c1;
}

/* Grafici: varianti di altezza */
.sp-chart--tall iframe {
    height: clamp(480px, 60vw, 85vh);
}

.sp-chart--grid iframe {
    height: clamp(360px, 33vw, 60vh);
}

/* Griglia di grafici a 2 colonne */
.sp-grid2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* Griglia di schede a 3 colonne (immagine + testo) */
.sp-cards3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(24px, 3vw, 56px);
    max-width: 1300px;
    width: 100%;
    margin: 0 auto;
}

.sp-card,
.sp-tile {
    margin: 0;
}

.sp-card img,
.sp-tile img {
    display: block;
    width: 100%;
    height: auto;
}

.sp-card figcaption {
    width: 100%;
    margin: 12px 0 0;
    text-align: center;
    line-height: 1.6;
}

/* Riquadri con etichetta sovrapposta in alto */
.sp-tile {
    position: relative;
}

.sp-tile figcaption {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    margin: 0;
    padding: 4px 10px;
    background-color: rgba(11, 11, 11, 0.7);
    color: #ffffff;
    text-align: center;
    white-space: nowrap;
}

@media (max-width: 1000px) {
    .sp-cards3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 850px) {
    .sp-grid2 {
        grid-template-columns: 1fr;
    }

    .sp-chart--tall iframe,
    .sp-chart--grid iframe {
        height: 80vh;
    }
}

@media (max-width: 600px) {
    .sp-cards3 {
        grid-template-columns: 1fr;
        max-width: 420px;
    }
}

/* Due grafici sovrapposti (stessa area, per leggere la correlazione) */
.sp-chart--overlay {
    display: grid;
}

.sp-chart--overlay iframe {
    grid-area: 1 / 1;
}

/* ── LINK "VAI ALLA PAGINA" / "APPROFONDISCI" ─────────── */
.section-link {
    margin-left: 16px;
    font-size: 0.85em;
    letter-spacing: 0;
    color: #c3c1c1;
    white-space: nowrap;
}

a:hover > .heading-section .section-link {
    color: #ffffff;
    text-decoration: underline;
}

.card-more {
    display: inline-block;
    margin: 4px 6px 0;
    color: #ffffff;
    font-size: clamp(12px, 0.95vw, 15px);
    text-decoration: none;
    border-bottom: 1px solid #ffffff;
}

.card-more:hover {
    color: #c3c1c1;
    border-color: #c3c1c1;
}

/* ── MENU: tendina Data Lab ───────────────────────────── */
.nav-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}

.nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    flex-direction: column;
    min-width: max-content;
    padding: 6px 0;
    background-color: #000000;
    border: 1px solid #444444;
}

.nav-dropdown:hover .nav-menu,
.nav-dropdown:focus-within .nav-menu {
    display: flex;
}

.nav-menu a {
    padding: 10px 18px;
    color: #ffffff;
    font-size: clamp(11px, 0.95vw, 16px);
    text-decoration: none;
    white-space: nowrap;
}

.nav-menu a:hover {
    background-color: #181818;
    text-decoration: underline;
}

/* ── INTRO DI SEZIONE: testo a sinistra, sotto il titolo ── */
/* Allineata al bordo sinistro della griglia delle card */
.section-intro {
    display: flex;
    flex-direction: column;
    max-width: 2000px;
    height: auto;
    margin: 0 auto 32px;
    padding: 0 4%;
    box-sizing: border-box;
}

.section-intro .heading-section {
    margin: 3% 0 14px;
}

.section-intro .text-intro {
    order: 1;
    width: 100%;
    max-width: 900px;
    margin: 0;
    text-align: left;
}

/* ── TITOLI DELLE SOTTOPAGINE: stesso stile della home ── */
.heading-large {
    font-variant: normal;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.titolo-sezione-base.heading-large::before {
    content: "\2022  ";
}

/* Intro delle sottopagine: titolo e testo a sinistra */
.sp-intro {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sp-intro .heading-large {
    width: auto;
    margin: 0;
    text-align: left;
}

.sp-intro .text-body {
    width: 100%;
    max-width: 1100px;
    margin: 0;
    text-align: left;
}

/* Link in fondo alle sottopagine */
.back-home {
    align-self: flex-start;
    margin-bottom: 48px;
    color: #ffffff;
    font-size: clamp(13px, 1vw, 16px);
    text-decoration: none;
    border-bottom: 1px solid #ffffff;
}

.back-home:hover {
    color: #c3c1c1;
    border-color: #c3c1c1;
}

/* Indice delle sezioni in cima alle pagine tematiche */
.sp-toc {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    margin-top: calc(-1 * clamp(40px, 5vw, 96px) + 24px);
}

.sp-toc a {
    padding: 6px 14px;
    border: 1px solid #555555;
    border-radius: 0;
    color: #ffffff;
    font-size: clamp(12px, 0.95vw, 15px);
    text-decoration: none;
    white-space: nowrap;
}

.sp-toc a:hover {
    border-color: #ffffff;
    background-color: #181818;
}

/* Titolo delle sottosezioni (es. ↓ PIANIFICAZIONE AMBIENTALE) */
.sp-subtitle {
    font-weight: 600;
    color: #ffffff;
}

/* Coppie di immagini con proporzioni diverse: stessa cornice per entrambe */
.sp-pair--uniform .sp-map {
    width: 100%;
}

.sp-pair--uniform .sp-map > img:first-child {
    width: 100%;
    height: auto;
    aspect-ratio: var(--ratio);
    object-fit: cover;
}
