/* =========================================
   VARIABILI & RESET
   ========================================= */
:root {
    --bg: #F9F7F2;
    --text: #1A1A1A;
    --text-light: #555;
    --primary: #D4AF37;      /* Oro/Giallo locandine */
    --primary-dark: #B8962E;
    --accent-green: #2E8B57; /* Verde Gen Verde */
    --white: #FFFFFF;
    --black: #111111;
    --radius: 12px;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
    --font-heading: 'Oswald', sans-serif;
    --font-body: 'Montserrat', sans-serif;
    --max-width: 1200px;
    --spacing: clamp(1.5rem, 5vw, 3rem);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; transition: 0.2s ease; }
ul { list-style: none; }
.container { width: 90%; max-width: var(--max-width); margin: 0 auto; }

/* =========================================
   HEADER & NAV
   ========================================= */
.site-header {
    position: fixed;
    top: 0; left: 0; width: 100%;
    background: rgba(249, 247, 242, 0.9);
    backdrop-filter: blur(10px);
    z-index: 100;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.header-inner { display: flex; justify-content: space-between; align-items: center; padding: 1rem 0; }
.logo { font-family: var(--font-heading); font-size: 1.8rem; font-weight: 700; color: var(--white); text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.main-nav ul { display: flex; gap: 2rem; }
.main-nav a { font-weight: 600; font-size: 0.95rem; color: var(--black); text-shadow: 0 1px 3px rgba(0,0,0,0.5); position: relative; }
.main-nav a::after { content: ''; position: absolute; bottom: -4px; left: 0; width: 0; height: 2px; background: var(--primary); transition: width 0.3s ease; }
.main-nav a:hover::after { width: 100%; }
.menu-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--white); text-shadow: 0 1px 3px rgba(0,0,0,0.5); }

/* =========================================
   HERO SECTION (PARALLAX)
   ========================================= */
.hero {
    min-height: 100vh; /* Full screen height */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    /* Sostituisci l'URL qui sotto con la tua immagine di sfondo (montagna, piazza, pubblico) */
    background-image: url('hero2.png'); 
    background-size: cover;
    background-position: center;
    /* EFFETTO PARALLAX CSS PURO */
    background-attachment: fixed; 
}

/* Overlay scuro per far risaltare il testo bianco */
.hero-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.7) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    color: var(--white);
    padding-top: 60px; /* Offset per header fisso */
}

.badge {
    display: inline-block;
    background: var(--primary);
    color: var(--black);
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(212,175,55,0.4);
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(3.5rem, 10vw, 8rem);
    line-height: 0.9;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: -2px;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.tagline {
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    font-weight: 400;
    margin-bottom: 2.5rem;
    font-style: italic;
    opacity: 0.9;
}

.dates {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 3rem;
    letter-spacing: 2px;
}

.separator { margin: 0 0.8rem; color: var(--primary); }

/* Indicatore Scroll */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    animation: bounce 2s infinite;
    color: var(--white);
    font-size: 2rem;
    opacity: 0.7;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0) translateX(-50%);}
    40% {transform: translateY(-10px) translateX(-50%);}
    60% {transform: translateY(-5px) translateX(-50%);}
}

/* =========================================
   BOTTONI
   ========================================= */
.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.btn-primary { background: var(--primary); color: var(--black); }
.btn-primary:hover { background: var(--white); transform: translateY(-3px); box-shadow: 0 10px 20px rgba(0,0,0,0.2); }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary-dark); }
.btn-outline:hover { background: var(--primary); color: var(--black); border-color: var(--primary); }

/* =========================================
   SEZIONI
   ========================================= */
.section { padding: var(--spacing) 0; }
.section-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 3.5rem);
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    text-transform: uppercase;
}
.section-title::after {
    content: ''; display: block; width: 80px; height: 5px;
    background: var(--primary); margin: 1rem auto 0;
}
.intro { text-align: center; max-width: 900px; margin: 0 auto; }
.intro h2 { font-family: var(--font-heading); font-size: 2.5rem; margin-bottom: 1.5rem; }
.lead { font-size: 1.15rem; color: var(--text-light); line-height: 1.8; margin-bottom: 1rem; }

/* =========================================
   EVENT CARDS
   ========================================= */
.events-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.event-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}
.event-card:hover { transform: translateY(-5px); }
.event-image img { width: 100%; object-fit: cover; }
.event-content { padding: 2rem; flex: 1; display: flex; flex-direction: column; }
.event-date { display: block; font-weight: 700; color: var(--primary-dark); margin-bottom: 0.5rem; font-size: 0.9rem; text-transform: uppercase; }
.event-content h3 { font-family: var(--font-heading); font-size: 2rem; margin-bottom: 1rem; line-height: 1.1; }
.event-content p { color: var(--text-light); margin-bottom: 1.5rem; flex-grow: 1; }
.event-card .btn { align-self: flex-start; }

/* =========================================
   INFO SECTION
   ========================================= */
.info { background: #fff; border-top: 1px solid #eee; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2rem; text-align: center; }
.info-item { padding: 2rem; border: 1px solid #eee; border-radius: var(--radius); transition: 0.3s; }
.info-item:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.info-item h3 { font-family: var(--font-heading); font-size: 1.4rem; margin-bottom: 0.8rem; color: var(--primary-dark); }
.link-accent { color: var(--primary-dark); font-weight: 700; text-decoration: underline; }

/* =========================================
   FOOTER
   ========================================= */
.site-footer { background: var(--black); color: var(--white); padding: 4rem 0 1.5rem; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 2rem; margin-bottom: 2rem; }
.footer-brand h4 { font-family: var(--font-heading); font-size: 2rem; color: var(--primary); margin-bottom: 0.5rem; }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { font-size: 0.9rem; opacity: 0.7; }
.footer-links a:hover { opacity: 1; color: var(--primary); }
.copyright { text-align: center; font-size: 0.8rem; opacity: 0.4; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 1.5rem; }

.footer-social {
    display: flex;
    gap: 1.5rem;
}

.footer-social a {
    font-size: 1.5rem; /* Dimensione icone */
    color: var(--white);
    opacity: 0.7;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.footer-social a:hover {
    opacity: 1;
    transform: translateY(-3px);
}

.social-instagram:hover {
    color: #E4405F;
}

.social-facebook:hover {
    color: #1877F2;
}

/* =========================================
   MODAL / POPUP
   ========================================= */
.modal {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 1rem;
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.modal-content {
  position: relative;
  background: var(--bg);
  width: 100%;
  max-width: 600px;
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  padding: 2.5rem;
  transform: translateY(20px) scale(0.98);
  transition: transform 0.3s ease;
  max-height: 90vh;
  overflow-y: auto;
}

.modal.active .modal-content {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 1rem; right: 1rem;
  background: transparent;
  border: none;
  font-size: 1.8rem;
  color: var(--text-light);
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem;
  transition: color 0.2s;
}

.modal-close:hover { color: var(--primary-dark); }

.modal-badge {
  display: inline-block;
  background: var(--primary);
  color: var(--black);
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.modal-content h2 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.modal-text {
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.modal-footer {
  margin-top: 1.5rem;
  text-align: center;
}

/* Blocca scroll body quando modal è aperto */
body.no-scroll { overflow: hidden; }

@media (max-width: 768px) {
  .modal-content { padding: 1.5rem; }
  .modal-content h2 { font-size: 1.5rem; }
}

/* Stili specifici per i modali legali */
.modal-legal {
    max-width: 800px; /* Più largo per leggere meglio */
    text-align: left; /* Testo allineato a sinistra */
}

.modal-body-scrollable {
    max-height: 70vh; /* Altezza massima per lo scroll */
    overflow-y: auto; /* Scroll verticale se il testo è lungo */
    padding-right: 10px; /* Spazio per la scrollbar */
}

/* Stile scrollbar personalizzata (opzionale ma carino) */
.modal-body-scrollable::-webkit-scrollbar {
    width: 8px;
}
.modal-body-scrollable::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}
.modal-body-scrollable::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

.modal-legal h2 {
    font-family: var(--font-heading);
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

.modal-legal h3 {
    font-family: var(--font-heading);
    color: var(--text);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.modal-legal ul {
    padding-left: 1.2rem;
    margin-bottom: 1rem;
    color: var(--text-light);
}

.modal-legal p {
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.modal-legal a {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* =========================================
   COOKIE BANNER
   ========================================= */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--white);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    z-index: 2000; /* Sopra a tutto */
    border-top: 3px solid var(--primary); /* Linea dorata sopra */
    padding: 1rem 0;
    transform: translateY(100%); /* Nascosto inizialmente sotto */
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-banner.visible {
    transform: translateY(0);
}

.cookie-banner.hidden {
    display: none;
}

.cookie-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.cookie-content {
    flex: 1;
    min-width: 250px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cookie-icon {
    font-size: 1.5rem;
}

.cookie-content p {
    font-size: 0.9rem;
    color: var(--text);
    margin: 0;
    line-height: 1.4;
}

.cookie-link {
    color: var(--primary-dark);
    font-weight: 700;
    text-decoration: underline;
}

.cookie-actions {
    display: flex;
    gap: 1rem;
}

/* Bottoni piccoli per il banner */
.btn-cookie {
    padding: 0.5rem 1.2rem;
    font-size: 0.85rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary-small {
    background: var(--primary);
    color: var(--black);
}

.btn-primary-small:hover {
    background: var(--primary-dark);
}

.btn-outline-small {
    background: transparent;
    border: 1px solid #ccc;
    color: var(--text-light);
}

.btn-outline-small:hover {
    border-color: var(--text);
    color: var(--text);
}

/* Mobile responsive per il banner */
@media (max-width: 768px) {
    .cookie-inner {
        flex-direction: column;
        text-align: center;
    }
    
    .cookie-content {
        justify-content: center;
    }

    .cookie-actions {
        width: 100%;
        justify-content: center;
    }
    
    .btn-cookie {
        flex: 1;
        text-align: center;
    }
}


/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
        z-index: 102; /* Assicura che sia sempre cliccabile sopra il menu */
    }

    .main-nav {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--bg);
        border-top: 1px solid rgba(0,0,0,0.05);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        /* ✅ PADDING RIMOSSO DA QUI */
    }

    .main-nav.active {
        max-height: 400px; /* ✅ AUMENTATO per contenere padding + link */
    }

    .main-nav ul {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        padding: 1.5rem 0; /* ✅ PADDING SPOSTATO QUI: non fuoriesce quando il menu è chiuso */
        margin: 0;
    }

    .main-nav a {
        color: var(--text); /* Testo scuro per leggibilità su sfondo chiaro */
        text-shadow: none;
        font-size: 1.1rem;
    }

    .events-grid { grid-template-columns: 1fr; }
    .footer-inner { flex-direction: column; text-align: center; }
    .footer-links, .footer-social { justify-content: center; }
}



section[id] {
    scroll-margin-top: 100px; /* Compensa l'altezza dell'header fisso + un po' di aria */
}