:root {
    --blue: #0369a1;
    --blue2: #0ea5e9;
    --red: #dc2626;
    --soft: #f0f9ff;
    --text: #18181b;
    --muted: #52525b;
    --line: #e4e4e7;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, Arial, sans-serif;
    color: var(--text);
    background: #fff;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}


/* Header */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(8px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    height: 68px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
}

.brand-dot {
    color: var(--blue2);
}

.desktop-nav {
    display: flex;
    gap: 24px;
    font-size: 14px;
}

.desktop-nav a:hover {
    color: var(--blue);
}


/* Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border: 0;
    border-radius: 14px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.btn-danger {
    color: #fff;
    background: var(--red);
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-secondary {
    color: var(--text);
    background: #fff;
    border: 1px solid #d4d4d8;
}

.btn-secondary:hover {
    border-color: #a1a1aa;
}


/* Hero senza mappa */

.hero {
    display: flex;
    align-items: center;
    min-height: calc(100vh - 68px);
    padding: 90px 0;
    background: linear-gradient(
        180deg,
        #f0f9ff 0%,
        #f8fcff 55%,
        #ffffff 100%
    );
}

.hero-single {
    display: block;
}

.hero-content {
    width: 100%;
    max-width: 1100px;
}

.hero-content h1 {
    max-width: 1050px;
    margin: 0;
    font-size: clamp(58px, 7.5vw, 108px);
    line-height: 0.95;
    letter-spacing: -0.05em;
}

.hero-content h1 span {
    color: var(--blue);
}

.hero-content p {
    max-width: 800px;
    margin: 32px 0 0;
    color: var(--muted);
    font-size: clamp(20px, 2vw, 30px);
    line-height: 1.35;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 34px 0;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    color: var(--muted);
    font-size: 14px;
}

.hero-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}


/* Sections */

.section {
    padding: 64px 0;
}

.section-soft {
    background: var(--soft);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.section-title h2 {
    margin: 0;
    font-size: 34px;
}


/* Map */

.map-card {
    position: relative;
    min-height: 390px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
}

.map-card.big {
    min-height: 520px;
}

.map {
    position: absolute;
    inset: 0;
}

.map-card-head {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 400;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(
        rgba(255, 255, 255, 0.96),
        rgba(255, 255, 255, 0.7)
    );
}

.map-card-head strong,
.legend,
.legend span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend {
    gap: 12px;
    font-size: 12px;
}

.dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 999px;
}

.dot.red {
    background: #ef4444;
}

.dot.amber {
    background: #f59e0b;
}

.dot.blue {
    background: #0ea5e9;
}


/* Situation */

.situation-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.updates-card,
.form-card,
.info-card,
.news-card {
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
}

.updates-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    border-bottom: 1px solid var(--line);
}

.update-row {
    padding: 16px;
    border-bottom: 1px solid #f4f4f5;
}

.update-row:last-child {
    border-bottom: 0;
}

.update-main {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
}

.badge {
    flex-shrink: 0;
    padding: 5px 10px;
    border-radius: 999px;
    background: #f4f4f5;
    font-size: 12px;
}


/* Reports */

.reports-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.form-card {
    padding: 24px;
}

.side-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.info-card {
    padding: 20px;
}

.info-card h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 0;
}


/* Three columns */

.three-col,
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}


/* Icons */

.icon {
    width: 24px;
    height: 24px;
}

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

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

.icon-blue {
    color: var(--blue);
}

.icon-red {
    color: var(--red);
}


/* Notices */

.notice {
    padding: 14px;
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
}


/* ACF form */

.acf-form {
    margin-top: 18px;
}

.acf-form .acf-fields {
    display: grid;
    gap: 16px;
}

.acf-form .acf-field {
    padding: 0 !important;
    border: 0 !important;
}

.acf-form .acf-label {
    margin: 0 0 7px !important;
}

.acf-form .acf-label label {
    color: var(--muted);
    font-size: 14px !important;
    font-weight: 600 !important;
}

.acf-form input[type="text"],
.acf-form input[type="email"],
.acf-form input[type="tel"],
.acf-form input[type="number"],
.acf-form select,
.acf-form textarea {
    width: 100% !important;
    padding: 12px 14px !important;
    color: var(--text) !important;
    background: #fff !important;
    border: 1px solid #d4d4d8 !important;
    border-radius: 12px !important;
    box-shadow: none !important;
    font-size: 16px !important;
}

.acf-form textarea {
    min-height: 140px !important;
    resize: vertical;
}

.acf-form input:focus,
.acf-form select:focus,
.acf-form textarea:focus {
    outline: none !important;
    border-color: #38bdf8 !important;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15) !important;
}

.acf-form .acf-submit {
    margin-top: 18px;
}

.acf-form .acf-button,
.acf-form input[type="submit"] {
    padding: 12px 18px !important;
    color: #fff !important;
    background: var(--red) !important;
    border: 0 !important;
    border-radius: 12px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
}

.acf-form .acf-button:hover,
.acf-form input[type="submit"]:hover {
    background: #b91c1c !important;
}

.acf-notice.-success {
    padding: 12px 14px !important;
    color: #075985 !important;
    background: #ecfeff !important;
    border: 1px solid #bae6fd !important;
    border-radius: 12px !important;
}


/* Via e civico affiancati */

@media (min-width: 700px) {
    .acf-form .acf-fields {
        grid-template-columns: minmax(0, 1fr) 180px;
    }

    .acf-form .acf-field[data-name="zona"],
    .acf-form .acf-field[data-name="causa"],
    .acf-form .acf-field[data-name="email"] {
        grid-column: 1 / -1;
    }

    .acf-form .acf-field[data-name="via"] {
        grid-column: 1;
    }

    .acf-form .acf-field[data-name="civico"] {
        grid-column: 2;
    }
}


/* Thank-you area */

.is-hidden {
    display: none !important;
}

.thank-you-area {
    display: flex;
    min-height: 360px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 42px 24px;
    text-align: center;
}

.thank-you-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
    color: #15803d;
    background: #dcfce7;
    border-radius: 999px;
}

.thank-you-icon .icon {
    width: 30px;
    height: 30px;
}

.thank-you-area h3 {
    margin: 0 0 12px;
    font-size: 28px;
    line-height: 1.2;
}

.thank-you-area p {
    max-width: 560px;
    margin: 0 0 24px;
    color: var(--muted);
    line-height: 1.6;
}

.thank-you-area .btn-secondary {
    cursor: pointer;
    font: inherit;
}


/* News cards */

.news-card {
    overflow: hidden;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}

.news-card:hover {
    transform: translateY(-3px);
    border-color: #bae6fd;
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.08);
}

.news-img-link {
    display: block;
}

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

.news-body {
    padding: 20px;
}

.news-body h3 {
    margin-top: 0;
    margin-bottom: 14px;
}

.news-body h3 a {
    color: inherit;
    text-decoration: none;
}

.news-body h3 a:hover {
    color: var(--blue);
}

.news-source {
    margin-bottom: 10px;
    color: #71717a;
    font-size: 13px;
}

.news-body p {
    margin-top: 0;
    margin-bottom: 20px;
    color: #3f3f46;
    line-height: 1.55;
}

.news-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.news-read-more {
    color: var(--blue);
    font-weight: 600;
    text-decoration: none;
}

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

.news-source-link {
    color: #71717a;
    font-size: 14px;
    text-decoration: underline;
}

.news-source-link:hover {
    color: var(--blue);
}


/* Single news */

.single-news-main {
    padding: 56px 0 80px;
}

.single-news-article {
    max-width: 860px;
    margin: 0 auto;
}

.single-news-back {
    display: inline-flex;
    margin-bottom: 24px;
    color: var(--blue);
    font-weight: 700;
}

.single-news-title {
    margin: 0;
    font-size: clamp(36px, 6vw, 64px);
    line-height: 1.05;
}

.single-news-meta {
    margin: 18px 0 30px;
    color: var(--muted);
}

.single-news-image {
    margin-bottom: 32px;
    overflow: hidden;
    border-radius: 20px;
}

.single-news-image img {
    display: block;
    width: 100%;
    height: auto;
}

.single-news-content {
    font-size: 18px;
    line-height: 1.75;
}


/* Footer */

.site-footer {
    padding: 48px 0;
    border-top: 1px solid var(--line);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 30px;
}


/* Tablet */

@media (max-width: 900px) {
    .desktop-nav {
        display: none;
    }

    .situation-grid,
    .reports-grid,
    .three-col,
    .news-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: auto;
        padding: 72px 0;
    }

    .hero-content h1 {
        max-width: 760px;
        font-size: clamp(52px, 10vw, 82px);
    }

    .hero-content p {
        max-width: 680px;
        font-size: 22px;
    }
}


/* Mobile */

@media (max-width: 640px) {
    .container {
        padding: 0 18px;
    }

    .header-inner {
        height: 62px;
    }

    .header-inner > .btn-danger {
        padding: 10px 12px;
        font-size: 13px;
    }

    .hero {
        min-height: calc(100vh - 62px);
        padding: 56px 0;
    }

    .hero-content h1 {
        font-size: clamp(44px, 14vw, 68px);
        line-height: 0.98;
    }

    .hero-content p {
        margin-top: 24px;
        font-size: 19px;
    }

    .hero-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .hero-meta {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .section {
        padding: 48px 0;
    }

    .section-title h2 {
        font-size: 30px;
    }

    .map-card.big {
        min-height: 420px;
    }

    .update-main {
        align-items: flex-start;
        flex-direction: column;
    }

    .badge {
        align-self: flex-start;
    }

    .form-card {
        padding: 18px;
    }

    .news-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .thank-you-area {
        min-height: 320px;
        padding: 36px 18px;
    }
}

/* Cause e metriche dinamiche */

.cause-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.cause-card {
    min-width: 0;
    padding: 24px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
}

.cause-card-primary {
    border-color: #bae6fd;
    box-shadow: 0 12px 30px rgba(3, 105, 161, 0.07);
}

.cause-card-label {
    margin-bottom: 10px;
    color: var(--blue);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.cause-card h3 {
    margin: 0 0 18px;
    font-size: 21px;
    line-height: 1.25;
}

.cause-highlight {
    margin: 0 0 20px;
    color: #3f3f46;
    line-height: 1.6;
}

.cause-breakdown,
.network-updates,
.metrics-list {
    display: grid;
    gap: 10px;
}

.cause-breakdown-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 12px;
    background: #f8fafc;
    border-radius: 11px;
    font-size: 14px;
}

.cause-breakdown-row strong {
    flex-shrink: 0;
    color: var(--blue);
}

.network-update {
    display: grid;
    gap: 5px;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid transparent;
    border-radius: 11px;
    line-height: 1.35;
}

.network-update:hover {
    color: var(--blue);
    background: #fff;
    border-color: #bae6fd;
}

.network-update small {
    color: #71717a;
    font-size: 12px;
}

.network-disclaimer {
    margin: 16px 0 0;
    color: #71717a;
    font-size: 12px;
    line-height: 1.5;
}

.cause-empty {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.metric-row {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 11px;
}

.metric-row strong {
    color: var(--blue);
    font-size: 26px;
    line-height: 1;
}

.metric-row span {
    color: #3f3f46;
    font-size: 14px;
    line-height: 1.35;
}

.metric-row-zone {
    grid-template-columns: 1fr;
    gap: 5px;
}

.metric-row-zone strong {
    font-size: 20px;
    line-height: 1.2;
}

@media (max-width: 1000px) {
    .cause-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .cause-card {
        padding: 20px;
    }
}


/* Aggiornamenti dalla rete */

.network-section {
    background: #ffffff;
}

.network-panel {
    overflow: hidden;
    padding: 34px;
    background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 100%);
    border: 1px solid var(--line);
    border-radius: 24px;
}

.network-panel-heading {
    max-width: 850px;
    margin-bottom: 24px;
}

.network-panel-heading h3 {
    margin: 8px 0 12px;
    font-size: clamp(28px, 4vw, 46px);
    line-height: 1.08;
}

.network-panel-heading p {
    max-width: 760px;
    margin: 0;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.6;
}

.network-updates-scroll {
    display: grid;
    gap: 12px;
    max-height: none;
    padding-right: 0;
    overflow: visible;
}

.network-update {
    display: block;
    padding: 20px 22px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(228, 228, 231, 0.9);
    border-radius: 16px;
    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

.network-update:hover {
    transform: translateY(-2px);
    border-color: #bae6fd;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.07);
}

.network-update span {
    display: block;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
}

.network-update small {
    display: block;
    margin-top: 7px;
    color: #71717a;
    font-size: 13px;
}

.network-disclaimer {
    margin: 20px 0 0;
    color: #71717a;
    font-size: 14px;
    line-height: 1.5;
}

.cause-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.desktop-nav {
    align-items: center;
}

@media (max-width: 1100px) {
    .desktop-nav {
        gap: 15px;
        font-size: 13px;
    }
}

@media (max-width: 900px) {
    .cause-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .network-panel {
        padding: 24px 18px;
    }
.network-update {
        padding: 17px;
    }

    .network-update span {
        font-size: 16px;
    }
}

section[id] {
    scroll-margin-top: 70px;
}

.site-footer {
    text-align: center;
}

.footer-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.site-footer .brand {
    justify-content: center;
}

.site-footer p {
    margin: 0;
}

/* Navbar fixed-top */
.site-header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

/* Compensa l'altezza della navbar fissa */
body {
    padding-top: 68px;
}

/* Lascia spazio sopra alle sezioni raggiunte dal menu */
section[id],
footer[id] {
    scroll-margin-top: 105px;
}

@media (max-width: 640px) {
    body {
        padding-top: 62px;
    }

    section[id],
    footer[id] {
        scroll-margin-top: 92px;
    }
}

.leaflet-control-attribution.leaflet-control {
    display: none;
}
.acf-form .acf-field[data-name="privacy_accettata"] {
    grid-column: 1 / -1;
    width: 100%;
}
