/* ==========================
   RESET E IMPOSTAZIONI BASE
========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito', Arial, sans-serif;
    background: #ffffff;
    color: #222;
    line-height: 1.6;
}

/* ==========================
   COLORI
========================== */
:root {
    --blu: #47458d;
    --blu-scuro: #33335f;
    --terra: #a94f2c;
    --terra-hover: #873b20;
    --grigio: #f5f5f5;
    --testo: #222;
    --terracotta-pdf: #A8442A;
    --blu-notte: #1B365D;
}

/* ==========================
   HEADER & NAVIGAZIONE
========================== */
header {
    background: #ffffff;
    padding: 20px 35px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #ddd;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo img {
    width: 90px;
    height: auto;
}

/* Desktop Menu */
.nav-desktop {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-desktop a {
    text-decoration: none;
    color: var(--blu);
    font-weight: 700;
    padding: 8px 13px;
    transition: color 0.2s ease;
}

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

/* Mobile Menu (Nascosto di default) */
.nav-mobile {
    display: none;
}

/* ==========================
   HERO SAGRA (BREVE: TITOLO + LOCANDINA + PDF)
========================== */
.hero {
    background: var(--grigio);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 70px 25px;
    width: 100%;
    scroll-margin-top: 95px; /* Evita sovrapposizione dell'header sticky */
}

.hero-text {
    max-width: 700px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 44px;
    line-height: 1.2;
    color: #111;
    font-weight: 800;
}

.hero-cover {
    width: 100%;
    max-width: 480px;
    border-radius: 10px;
    margin: 25px auto 0;
    display: block;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

.btn {
    display: inline-block;
    margin-top: 35px;
    padding: 15px 28px;
    border-radius: 8px;
    background: var(--terra);
    color: white;
    text-decoration: none;
    font-weight: 800;
    font-size: 17px;
    transition: background 0.2s ease;
}

.btn:hover {
    background: var(--terra-hover);
}

/* ==========================
   PULSANTE PDF PROGRAMMA (SAGRA)
========================== */
.btn-pdf {
    display: block;
    width: 100%;
    max-width: 480px;
    margin: 22px auto 0;
    padding: 14px;
    background: var(--terracotta-pdf);
    color: #ffffff;
    font-weight: 800;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    font-size: 17px;
    transition: background 0.2s ease;
}

.btn-pdf:hover {
    background: #8a3620;
}

/* ==========================
   SEZIONE PROGRAMMA + ACCORDION GIORNI
========================== */
.accordion-programma {
    margin-top: 10px;
    text-align: left;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.giorno {
    background: #ffffff;
    border: 1px solid #e2e2e2;
    border-radius: 10px;
    margin-bottom: 14px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.giorno summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    font-weight: 800;
    font-size: 17px;
    color: var(--blu);
    cursor: pointer;
    list-style: none;
    outline: none;
    background: var(--grigio);
    transition: background 0.2s ease;
}

.giorno summary:hover {
    background: #ececec;
}

.giorno[open] summary {
    border-bottom: 1px solid #e2e2e2;
}

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

.giorno summary::after {
    content: "+";
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--terracotta-pdf);
    color: #ffffff;
    font-size: 19px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.2s ease;
}

.giorno[open] summary::after {
    content: "–";
    background: var(--blu-notte);
}

.giorno-contenuto {
    padding: 18px 20px;
}

.giorno-contenuto ul {
    list-style: none;
    padding-left: 0;
}

.giorno-contenuto li {
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px dashed #e5e5e5;
}

.giorno-contenuto li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.riga-meta {
    margin-bottom: 4px;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
}

.orario {
    color: var(--terracotta-pdf);
    font-weight: 800;
    font-size: 15px;
}

.luogo {
    color: #888;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.attivita {
    display: block;
    font-size: 15px;
    color: #333;
    margin-top: 2px;
}

/* ==========================
   SEZIONI E RITMO VISIVO
========================== */
section {
    width: 100%;
    max-width: 100%; /* Permette allo sfondo di estendersi */
    padding: 80px 25px;
    scroll-margin-top: 95px; /* Evita sovrapposizione dell'header sticky per tutte le sezioni */
}

/* Wrapper interni per mantenere il contenuto centrato e max-width 900px */
.greenbit, .gallery, .assemblea, .lista-link, .archivio, .racconta {
    max-width: 900px;
    margin: 0 auto;
}

/* Alternanza Sfondi */
.section-white {
    background-color: #ffffff;
}

.section-light {
    background-color: var(--grigio);
}

.section-title {
    font-size: 32px;
    font-weight: 800;
    color: #111;
    text-align: center;
    margin-bottom: 45px;
}

/* ==========================
   BERNAREGGIO SI RACCONTA
========================== */
.racconta {
    text-align: center;
}

.sottotitolo {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #555;
    margin-top: 10px;
    letter-spacing: 0.2px;
}

.racconta-img {
    width: 85%;
    max-width: 600px;
    border-radius: 10px;
    margin-top: 10px;
}

.btn-progetto {
    display: block;
    width: 100%;
    max-width: 500px;
    margin: 25px auto 0;
    padding: 12px;
    background: var(--blu-notte);
    color: #ffffff;
    border: 2px solid var(--blu-notte);
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    font-weight: 800;
    font-size: 16px;
    transition: background 0.2s ease;
}

.btn-progetto:hover {
    background: #142a47;
}

/* ==========================
   GREENBIT
========================== */
.greenbit {
    text-align: center;
}

.greenbit img {
    width: 85%;
    max-width: 750px;
    border-radius: 10px;
}

.greenbit .btn {
    background: #278c70;
    margin-top: 35px;
}

.greenbit .btn:hover {
    background: #176650;
}

/* ==========================
   MOMENTI INSIEME
========================== */
.gallery {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    align-items: start;
}

.gallery img {
    width: 100%;
    border-radius: 10px;
}

/* ==========================
   ASSEMBLEA
========================== */
.assemblea {
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    padding: 40px;
    border-radius: 10px;
    color: #222;
    border: 1px solid #eee;
}

.assemblea p {
    font-size: 17px;
}

/* ==========================
   TRASPARENZA & ARCHIVIO
========================== */
.separatore {
    border-top: 1px solid #ddd;
}

.lista-link {
    list-style: none;
    padding-left: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Allineamento pulito */
    max-width: 600px;
    margin: 0 auto;
    gap: 18px;
}

.lista-link li {
    position: relative;
    padding-left: 30px;
}

.lista-link li::before {
    content: "-";
    position: absolute;
    left: 0;
    top: 0;
    font-size: 18px;
}

.lista-link a {
    font-size: 18px;
    color: var(--blu);
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s ease;
}

.lista-link a:hover {
    color: var(--terra);
}

.archivio {
    text-align: center;
}

.archivio img {
    width: 300px;
    max-width: 90%;
}

/* ==========================
   FOOTER
========================== */
footer {
    background: var(--blu);
    color: white;
    padding: 60px 25px;
    display: flex;
    justify-content: center;
    gap: 50px;
    flex-wrap: wrap;
    text-align: center;
    scroll-margin-top: 95px; /* Evita il taglio del footer sui link interni */
}

.footer-box {
    max-width: 300px;
}

.footer-box h3 {
    color: white;
    margin-bottom: 15px;
    font-size: 22px;
}

.footer-box p {
    font-size: 15px;
}

.footer-box a {
    color: white;
}

.cookie {
    background: #222;
    color: white;
    text-align: center;
    padding: 15px;
    font-size: 14px;
}
/* ==========================
   FACEBOOK
========================== */

/* ==========================
   FACEBOOK
========================== */

.facebook-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    padding: 10px 18px;
    background: #ffffff;
    color: var(--blu) !important;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 800;
    transition: transform 0.2s ease, background 0.2s ease;
}

.facebook-link img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.facebook-link:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
}
/* ==========================
   MOBILE RESPONSIVE
========================== */
@media(max-width: 768px) {
    header {
        padding: 15px 20px;
    }

    .nav-desktop {
        display: none;
    }

    .nav-mobile {
        display: block;
        width: 100%;
        margin-top: 10px;
    }

    .nav-mobile details {
        background: var(--grigio);
        border-radius: 6px;
        padding: 10px;
    }

    .nav-mobile summary {
        font-weight: 700;
        color: var(--blu);
        cursor: pointer;
        list-style: none;
        outline: none;
        text-align: center;
    }

    .mobile-menu-links {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding-top: 15px;
        text-align: center;
    }

    .mobile-menu-links a {
        text-decoration: none;
        color: var(--blu);
        font-weight: 700;
        font-size: 16px;
        padding: 6px 0;
        border-bottom: 1px solid #e5e5e5;
    }

    .mobile-menu-links a:last-child {
        border-bottom: none;
    }

    .hero {
        padding: 55px 20px;
    }

    .hero h1 {
        font-size: 30px;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    section {
        padding: 60px 18px;
    }

    .section-title {
        font-size: 25px;
    }

    .greenbit img {
        width: 100%;
    }

    .assemblea {
        padding: 25px 18px;
    }

    .lista-link {
        align-items: flex-start;
        padding-left: 10px;
    }

    .lista-link a {
        font-size: 16px;
    }

    .giorno summary {
        font-size: 16px;
        padding: 14px 16px;
    }

    footer {
        flex-direction: column;
        text-align: center;
        gap: 35px;
        padding: 45px 20px;
    }
}