 :root {
            --primary: #1a3a5f;
            /* Blu Parrocchia */
            --accent: #b8860b;
            /* Oro/Bronzo Campane */
            --bg-light: #f8f9fa;
            --text-dark: #2d3436;
            --white: #ffffff;
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        html {
            scroll-behavior: smooth;
        }

        body {
            font-family: 'Open Sans', sans-serif;
            line-height: 1.6;
            color: var(--text-dark);
            background-color: var(--bg-light);
            padding-bottom: 60px;
        }

        /* --- HERO SECTION --- */
        .hero {
            position: relative;
            height: 50vh;
            min-height: 600px;
            display: flex;
            text-align: left;
            color: var(--white);
        }
        .hero-img{
            position: absolute;
            height: 100%;
            width: 100%;
            top: 0;
            left: 0;  
            object-fit: cover;
            z-index: 1; 
        }
        .hero-overlay{
            position: absolute;
            height: 100%;
            width: 100%;
            top: 0; 
            left: 0; 
            background: linear-gradient(rgba(26, 58, 95, 0), rgba(26, 58, 95, 1));
            z-index: 2; 
        }
        .hero-content{
            width: 1200px;
            margin: 0 auto;
            display: flex;
            flex-flow: column;
            justify-content: flex-end;
            padding: 0 20px 5% 20px;
            z-index: 999;
        }
        

        .hero-content h1 {
            font-family: 'Montserrat', sans-serif;
            font-size: 2.8rem;
            margin-bottom: 10px;
            text-transform: uppercase;
            letter-spacing: -1px;
        }

        .hero-content p {
            font-size: 1.2rem;
        }

       @media (max-width: 768px) {
          .hero{background-position: center center;}
          .hero-content h1{line-height: 1;}
        }

        /* --- LAYOUT --- */
        .container {
            max-width: 1200px;
            margin: -40px auto 40px;
            padding: 0 20px;
            display: grid;
            grid-template-columns: 250px 1fr;
            gap: 40px;
            position: relative;
            z-index: 10;
        }

        @media (max-width: 992px) {
            .container {
                grid-template-columns: 1fr;
                margin-top: 20px;
            }

            .hero {
                height: 35vh;
            }

            .sidebar-menu {
                position: relative !important;
                top: 0 !important;
            }
        }

        /* --- BARRA LATERALE: SOMMARIO --- */
        .sidebar-menu {
            position: sticky;
            top: 40px;
            align-self: start;
            background: var(--white);
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
            border-left: 4px solid var(--primary);
        }

        .sidebar-menu h3 {
            font-family: 'Montserrat', sans-serif;
            color: var(--primary);
            font-size: 1.1rem;
            margin-bottom: 15px;
            text-transform: uppercase;
        }

        .sidebar-menu ul {
            list-style: none;
        }

        .sidebar-menu ul li {
            margin-bottom: 12px;
        }

        .sidebar-menu ul li a {
            color: var(--text-dark);
            text-decoration: none;
            font-size: 0.95rem;
            font-weight: 600;
            transition: color 0.2s;
        }

        .sidebar-menu ul li a:hover {
            color: var(--accent);
        }

        /* --- BLOCCO PRINCIPALE --- */
        .main-content {
            display: flex;
            flex-direction: column;
            gap: 30px;
        }

        .card-section {
            background: var(--white);
            padding: 40px;
            border-radius: 8px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
        }

        .section-title {
            color: var(--primary);
            border-bottom: 2px solid var(--accent);
            padding-bottom: 10px;
            margin-bottom: 25px;
            font-family: 'Montserrat', sans-serif;
        }

        p {
            margin-bottom: 20px;
            text-align: justify;
        }

        /* --- GALLERY --- */
        .gallery-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
            gap: 15px;
            margin-bottom: 20px;
        }

        .gallery-item {
            position: relative;
            border-radius: 6px;
            overflow: hidden;
            height: 160px;
            cursor: pointer;
            transition: transform 0.3s ease;
        }

        .gallery-item:hover {
            transform: scale(1.03);
        }

        .gallery-item img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        /* --- DASHBOARD CIFRE --- */
        .dashboard-cifre {
            background: #fdfdfd;
            border-top: 5px solid var(--primary);
        }

        .dashboard-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 20px;
            margin-top: 20px;
            align-items: start;
        }

        .stat-box {
            background: var(--bg-light);
            padding: 15px;
            border-radius: 6px;
            text-align: center;
            min-height: 120px;
        }

        .stat-box span {
            font-size: 0.85rem;
            color: #666;
            display: block;
            margin-bottom: 5px;
            font-weight: 600;
        }

        .stat-box strong {
            font-size: 1.15rem;
            color: var(--primary);
            display: block;
        }

        .progress-container {
            background: #eee;
            height: 25px;
            border-radius: 15px;
            margin: 25px 0 10px;
            overflow: hidden;
        }

        .progress-bar {
            background: linear-gradient(90deg, var(--accent), #ffd700);
            height: 100%;
            width: 0%;
            transition: width 1.5s cubic-bezier(0.1, 0, 0.3, 1);
        }

        /* Stile per il tasto toggle dei dettagli mensili */
        .toggle-details-btn {
            display: inline-block;
            margin-top: 8px;
            font-size: 0.8rem;
            color: var(--accent);
            cursor: pointer;
            font-weight: 600;
            text-decoration: underline;
        }

        .toggle-details-btn:hover {
            color: var(--primary);
        }

        /* Nasconde i dettagli di default */
        .details-content {
            display: none;
            font-size: 0.75rem;
            color: #555;
            font-weight: normal;
            margin-top: 10px;
            text-align: left;
            border-top: 1px dashed #ccc;
            padding-top: 8px;
            line-height: 1.6;

            /* Attiva lo scroll orizzontale */
            overflow-x: auto;
            white-space: nowrap;

            /* Barra di scorrimento più morbida per browser moderni */
            scrollbar-width: thin;
            scrollbar-color: #cbd5e1 transparent;
        }

        .details-content-item {
            flex: 0 0 auto;
            /* Impedisce ai mesi di rimpicciolirsi, mantiene la larghezza fissa */
            background: #ffffff;
            border: 1px solid #e2e8f0;
            padding: 10px 14px;
            border-radius: 6px;
            text-align: left;
            min-width: 130px;
        }

        .details-content-item strong {
            color: var(--primary);
            display: block;
            font-size: 0.8rem;
            margin-bottom: 3px;
        }

        /* Classe attivata da JS per mostrare i dettagli */
        .details-content.show {
            display: flex;
        }

        /* --- ALBO DEI DONATORI --- */
        .donatori-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 12px;
            margin-top: 20px;
        }

        .donatore-tag {
            background: #f1f5f9;
            padding: 10px 15px;
            border-radius: 6px;
            font-size: 0.95rem;
            border-left: 3px solid var(--accent);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .donatore-tag span.amount {
            font-size: 0.8rem;
            font-weight: bold;
            color: #666;
            background: #e2e8f0;
            padding: 2px 6px;
            border-radius: 4px;
        }

        /* --- NUOVO DESIGN FIXED BOX --- */
        .fixed-donation-box {
            position: fixed;
            bottom: 20px;
            right: 20px;
            width: 340px;
            background: var(--white);
            border-radius: 12px;
            box-shadow: 0 10px 35px rgba(26, 58, 95, 0.15);
            border: 1px solid #e2e8f0;
            z-index: 1000;
            overflow: hidden;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .box-header {
            background: var(--primary);
            color: var(--white);
            padding: 14px 20px;
            font-family: 'Montserrat', sans-serif;
            font-weight: bold;
            font-size: 0.95rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            cursor: pointer;
        }

        .box-body {
            padding: 20px;
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .box-info-text {
            font-size: 0.85rem;
            color: #64748b;
            margin-bottom: 2px;
            text-align: left;
        }

        .bank-name {
            font-size: 0.8rem;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: var(--accent);
            font-weight: 700;
        }

        /* Container IBAN "All-in-one" */
        .iban-container {
            display: flex;
            align-items: center;
            background: #f8fafc;
            border: 1px solid #e2e8f0;
            border-radius: 6px;
            padding: 4px 4px 4px 12px;
        }

        .iban-code {
            font-family: 'Courier New', monospace;
            font-size: 0.85rem;
            font-weight: bold;
            color: var(--text-dark);
            letter-spacing: -0.3px;
            flex-grow: 1;
            word-break: break-all;
        }

        .btn-copy {
            background: var(--primary);
            color: white;
            border: none;
            padding: 8px 14px;
            border-radius: 4px;
            font-size: 0.8rem;
            font-weight: 600;
            cursor: pointer;
            transition: background 0.2s;
            white-space: nowrap;
        }

        .btn-copy:hover {
            background: #112741;
        }

        /* Box Causale Evidenziato */
        .causale-box {
            background: #fffbeb;
            border: 1px solid #fef3c7;
            padding: 10px 12px;
            border-radius: 6px;
            font-size: 0.85rem;
            color: #92400e;
            text-align: left;
        }

        .causale-box span {
            display: block;
            font-size: 0.75rem;
            color: #b45309;
        }

        /* Sezione Simulazione Compatta */
        .simulation-section {
            display: flex;
            gap: 8px;
            margin-top: 5px;
            border-top: 1px dashed #e2e8f0;
            padding-top: 12px;
        }

        .simulation-section input {
            flex-grow: 1;
            padding: 8px 12px;
            border: 1px solid #cbd5e1;
            border-radius: 6px;
            font-size: 0.85rem;
        }

        .simulation-section .btn-update {
            background: #e2e8f0;
            color: var(--text-dark);
            border: none;
            padding: 8px 14px;
            border-radius: 6px;
            font-weight: 600;
            font-size: 0.85rem;
            cursor: pointer;
            margin-top: 0;
        }

        .simulation-section .btn-update:hover {
            background: #cbd5e1;
        }

        /* 📱 OTTIMIZZAZIONE RESPONSIVE (MOBILE) */
        @media (max-width: 768px) {
            .fixed-donation-box {
                right: 10px;
                bottom: 10px;
                width: calc(100% - 20px);
                max-width: 360px;
            }
        }

        /* Stato contratto di default su mobile (mostra solo l'intestazione) */
        .fixed-donation-box.collapsed .box-body {
            display: none;
        }

        .fixed-donation-box.collapsed .toggle-icon {
            transform: rotate(180deg);
        }

        footer {
            background: var(--primary);
            color: white;
            text-align: center;
            padding: 40px 20px;
            margin-top: 60px;
        }

        /* --- STILE LIGHTBOX CON NAVIGAZIONE --- */
#lightbox {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

#lightbox img {
    max-width: 85%;
    max-height: 80%;
    border: 4px solid white;
    border-radius: 4px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

/* Stile comune per le frecce */
.lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    font-size: 2.5rem;
    padding: 15px 20px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
    user-select: none;
    z-index: 2010;
}
.lightbox-arrow:hover {
    background: rgba(255, 255, 255, 0.3);
    color: var(--accent);
}
.prev { left: 20px; }
.next { right: 20px; }

/* Tasto di chiusura in alto a destra */
.close-lightbox {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 3rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 2010;
    transition: color 0.2s;
}
.close-lightbox:hover { color: var(--accent); }

/* Nascondi le frecce su schermi molto piccoli per non sovrapporsi all'immagine */
@media (max-width: 576px) {
    .lightbox-arrow { padding: 10px 12px; font-size: 1.8rem; }
    .prev { left: 5px; }
    .next { right: 5px; }
}