/* --- FONT --- */
      @font-face {
        font-family: 'STIX Two Text';
        src: url('font/STIX_Two_Text/static/STIXTwoText-Regular.ttf') format('truetype');
        font-weight: normal;
        font-style: normal;
      }
      @font-face {
        font-family: 'STIX Two Text';
        src: url('font/STIX_Two_Text/static/STIXTwoText-Bold.ttf') format('truetype');
        font-weight: bold;
        font-style: normal;
      }

      @font-face {
        font-family: 'STIX Two Text';
        src: url('font/STIX_Two_Text/static/STIXTwoText-SemiboldItalic.ttf') format('truetype');
        font-weight: normal;
        font-style: italic;
      }

      /* --- VARIABILI COLORI --- */
      :root {
        --bg-color: #f5f0dc;
        --blue-color: rgb(30, 82, 166);
        --yellow-color: #FFB700;
        --gray-color: #aaaaaa;
      }

      /* --- BASE --- */
      body {
        margin: 0;
        padding: 0;
        background-color: var(--bg-color);
        font-family: 'STIX Two Text', serif;
        color: var(--blue-color);
        overflow-x: hidden;
      }

/* -------------- */
/* --- NAVBAR --- */
/* -------------- */
#navbar {
    position: fixed; 
    top: 0; left: 0; right: 0; 
    background-color: var(--bg-color);
    z-index: 1000; 
    padding-left: 20px;
    padding-right: 20px; 
    padding-top: 10px;
    /*box-shadow: 0 4px 15px rgba(0,0,0,0.05);*/
  }
  
  /* Linea blu */
  .linea-parallela-top {
    height: 2px;
    background: var(--blue-color);
    width: 100%;
    margin: 2px 0px;
    z-index: -100px;
  }
  
  .linea-parallela-bottom {
    height: 2px;
    background: var(--blue-color);
    width: 100%;
    margin: 2px 0px;
  }

  /* Solo Home e Info: linea inferiore un po' più vicina al titolo (non su Dettaglio) */
  body.page-home .linea-parallela-bottom,
  body.page-info .linea-parallela-bottom {
    margin-top: -2px;
    position: relative;
    top: -3px;
  }

  
  
  .navbar-wrapper {
    display: flex;
    flex-direction: column; /* ← due righe */
    width: 100%;
  }

/* ------------------------- */
/*    RIGA ALTA: data + link */
/* ------------------------- */
  .navbar-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  /* Data (sinistra) */
  .navbar-date {
    font-size: 18px;
    margin: 0;
    color: var(--blue-color);
  }
  
  /* Link (destra) */
  .navbar-right {
    display: flex;
    gap: 15px;
    align-items: right;
  }
  
  .nav-link {
    color: var(--blue-color);
    font-size: 16px;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.2s;
  }
  
  
  /* ------------------------- */
  /*    RIGA CENTRALE: titolo  */
  /* ------------------------- */
  .navbar-bottom {
    text-align: center;
    padding: 2px 0;
  }
  
  .navbar-title {
    color: var(--blue-color);
    font-size: 40px;
    font-weight: bold;
    letter-spacing: 1px;
    font-style: italic;
  }
  /* Hover (PASSAGGIO DEL MOUSE) */
  .nav-link:hover {
    opacity: 1;                       /* diventa più visibile */
    color: var(--blue-color);
    border-bottom: 2px solid var(--blue-color);
  }
  
  /* Pagina ATTIVA (SELEZIONATA) */
  .nav-link.active {
    opacity: 1;
    border-bottom: 2px solid var(--blue-color);
  }
  
  .nav-spacer { 
    height: 10px; 
  }
  
  
  /* canvas p5 - solo se presente */
  canvas {
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1;
    pointer-events: none;
  }
  /*-----------------*/
  /* HELP TOGGLE (dentro navbar) */
  /*-----------------*/
  .help-controls {
    height: 10px;
    width: auto;
    gap: 8px;
    margin-left: 40px; /* distacco dal menu */
  }
  
  .help-toggle-btn {
    display: flex;             /* permette all'icona di essere centrata */
    justify-content: center;   /* centro orizzontale */
    align-items: center;    
    background: var(--color-primary, #1E52A6);
    color: white;
    border: none;
    height: 20px;
    width: auto;
    padding: 8px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
  
  }
  
  .help-toggle-btn:hover {
    background: var(--color-primary-hover, #1E52A6);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(30, 82, 166, 0.3);
  }
  
  .help-toggle-btn.active {
    background: var(--color-yellow, #FFB700);
    color: #1C2836;
  }
  
  .help-icon {
    font-size: 16px;
    font-weight: bold;
    align-self: center;
  }
  
  .help-status {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    min-width: 40px;
    text-align: center;
  }
  
  .help-status.active {
    color: var(--color-yellow, #FFB700);
  }
  #help-toggle.active {
    background-color: #FFB700 !important; /* Giallo del tema */
    color: #163264 !important;
    border: 2px solid #163264 !important;
  }
  
  /* Hover effect */
  #help-toggle:hover {
    transform: scale(1.1);
  }

 /* --- LAYOUT SEZIONI --- */
 main {
  width: 100%;
  max-width: 100%; /* Usa tutta la larghezza */
  margin: 0;
  padding: 0; /* Rimuovi il padding di 200px */
}
.section-row {
  height: 100vh;
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  
  /* Allineamento dall'alto */
  justify-content: flex-start; 
  
  /* AUMENTATO DA 160px A 220px per sicurezza */
  padding-top: 220px;          
  
  align-items: center;
  box-sizing: border-box;
  overflow: hidden;

  /* Le tue animazioni */
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 1s ease-out, transform 1s ease-out;
}
/* IMPORTANTE: Assicura che la prima sezione non finisca sotto la navbar */

.section-row:nth-child(2) {
  margin-top: 0 !important;
  padding-top: 220px !important; /* Forza lo stesso padding della prima */
}
      .section-row.visible {
        opacity: 1;
        transform: translateY(0);
      }

  
      /* Colonne */
      .text-col {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        width: 100%;
        max-width: 1000px;
      }

     .visual-col {
  display: flex;
  flex-wrap: nowrap;
  gap: 15px;
  height: auto;
  margin-top: 0;       
  margin-bottom: 80px; /* Distanza fissa tra omini e testo */
  justify-content: center;
  align-items: flex-end; 
}

      /* --- TIPOGRAFIA INGRANDITA --- */
      h1, h2, p { margin: 0; }
      
      /* 1. Intro */
      .txt-intro {
        font-size: 40px;
        font-weight: bold;
        text-align: center;
      }


      /* 3. Statistica */
      .txt-stat {
        font-size: 65px;
        font-weight: bold;
        text-align: center;
        line-height: 0.8;
        color: var(--yellow-color);
      }

      /* 4. Hero finale */
      .txt-hero {
        font-size: 60px; /* Titolo finale più impattante */
        line-height: 0.83;
        font-weight: bold;
        margin-top: 90px;
        margin-bottom: 50px;
        text-align: center;
      }

      .highlight-yellow { color: var(--yellow-color); font-weight: bold; }
      .highlight-blue { color: var(--blue-color); font-weight: bold; }


      

      .omino {
        width: 90px; /* INGRANDITO: da 45px a 70px */
        height: auto;
        opacity: 0;
        transform: scale(0);
        transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
      }
      .omino:hover { transform: scale(1.15) translateY(-5px); }

      .omino-big {
        width: 380px; /* Anche l'omino finale leggermente più grande */
        height: auto;
        opacity: 0;
        transform: scale(0.8);
        transition: opacity 1s ease, transform 1s ease;
      }

      /* Animazioni */
      .section-row.visible .omino {
        animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
      }

      .section-row.visible .omino-big {
        opacity: 1;
        transform: scale(1);
      }

      /* Ritardi a cascata */
      .section-row.visible .omino:nth-child(1) { animation-delay: 0.2s; }
      .section-row.visible .omino:nth-child(2) { animation-delay: 0.3s; }
      .section-row.visible .omino:nth-child(3) { animation-delay: 0.4s; }
      .section-row.visible .omino:nth-child(4) { animation-delay: 0.5s; }
      .section-row.visible .omino:nth-child(5) { animation-delay: 0.6s; }
      .section-row.visible .omino:nth-child(6) { animation-delay: 0.7s; }
      .section-row.visible .omino:nth-child(7) { animation-delay: 0.8s; }
      .section-row.visible .omino:nth-child(8) { animation-delay: 0.9s; }
      .section-row.visible .omino:nth-child(9) { animation-delay: 1.0s; }
      .section-row.visible .omino:nth-child(10) { animation-delay: 1.1s; }

      /* Sezioni con freccia */
      .section-with-arrow {
        position: relative;
      }

      .scroll-arrow {
        display: flex;
        justify-content: center;
        align-items: center;
        color: var(--blue-color);
        animation: bounceArrow 2s infinite;
        cursor: pointer;
        opacity: 0.8;
        transition: opacity 0.3s ease, transform 0.3s ease;
        padding: 15px;
        border-radius: 50%;
      }
      
      .scroll-arrow:active {
        transform: scale(0.95);
      }

      .scroll-arrow svg {
        width: 70px;
        height: 70px;
        filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.3));
      }

      /* Animazione per le frecce del carosello - movimento sequenziale */
      .scroll-arrow svg path:first-child {
        animation: fadeArrow 2s infinite;
      }

      .scroll-arrow svg path:last-child {
        animation: fadeArrow 2s infinite 0.3s;
      }

      @keyframes fadeArrow {
        0%, 100% {
          opacity: 0.3;
        }
        50% {
          opacity: 1;
        }
      }

      @keyframes bounceArrow {
        0%, 100% {
          transform: translateY(0);
        }
        50% {
          transform: translateY(15px);
        }
      }

      @keyframes fadeInScroll {
        0% {
          opacity: 0;
        }
        100% {
          opacity: 0.8;
        }
      }

      /* Nascondi la freccia quando l'utente scrolla */
     .scroll-indicator {
  position: absolute;
  bottom: 10px;            /* Molto vicino al bordo inferiore */
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  width: auto;
  display: flex;
  justify-content: center;
  cursor: pointer;
  opacity: 1;
}

      @keyframes popIn {
        to { opacity: 1; transform: scale(1); }
      }
/* Aggiungi questa nuova regola CSS */
.btn-container {
  text-align: center; /* Centra orizzontalmente gli elementi inline/inline-block al suo interno */
  width: 100%;
  margin-top: 40px; /* Aggiunge spazio tra il testo e il bottone */
}

/* ... (resto del CSS) ... */
      /* --- BOTTONE --- */
      .action-btn {
        display: inline-block;
        opacity: 0;
        transform: translateY(20px);
        background-color: var(--blue-color);
        color: var(--bg-color);
        border: none;
        padding: 20px 45px;
        font-family: 'STIX Two Text', serif;
        font-size: 24px;
        font-weight: bold;
        border-radius: 60px;
        text-decoration: none;
        box-shadow: 0 5px 15px rgba(7, 55, 137, 0.3);
        transition: all 0.3s ease;
      }
      
      .section-row.visible .action-btn {
        animation: fadeInUpBtn 0.8s ease forwards 1.0s; 
      }
      
      @keyframes fadeInUpBtn {
        to { opacity: 1; transform: translateY(0); }
      }

      .action-btn:hover {
        background-color:  #FFB700;;
        transform: translateY(-4px) !important;
        box-shadow: 0 8px 25px rgba(202, 148, 31, 0.4);

      }

      #help-toggle {
        width: 32px; height: 32px; border-radius: 50%;
        background-color: var(--blue-color); color: var(--bg-color);
        border: none; cursor: pointer; font-weight: bold; font-size: 18px;
        display: flex; align-items: center; justify-content: center;
        margin-left: 10px; transition: transform 0.3s ease;
      }
      #help-toggle:hover { transform: rotate(20deg) scale(1.1); }

      /* MEDIA QUERY MOBILE */
      @media (max-width: 900px) {
        .section-row, .section-row:nth-child(even) {
          flex-direction: column; text-align: center; gap: 40px; min-height: auto; margin-bottom: 100px;
        }
        .text-col, .section-row:nth-child(odd) .text-col, .section-row:nth-child(even) .text-col {
          align-items: center; text-align: center;
        }
        .visual-col, .section-row:nth-child(odd) .visual-col, .section-row:nth-child(even) .visual-col {
          justify-content: center;
        }
        /* Per la prima visual su mobile permetti il wrap per evitare overflow orizzontale */
        .section-row:first-of-type .visual-col {
          flex-wrap: wrap;
          overflow-x: visible;
        }
        /* Riduco un po' su mobile per farli stare */
        .txt-year { font-size: 100px; }
        .txt-stat { font-size: 32px; }
        .omino { width: 50px; } 
        .omino-big { width: 250px; }
      }
/*-----------------------*/
/*--    INFORMAZIONI   --*/
/*-----------------------*/
/* =========================
   STRUTTURA BASE
========================= */

.page {
  width: 100vw;
  min-height: 100vh;
  margin: 0;
  box-sizing: border-box;
}


/* =========================
   HERO
========================= */

.hero {
  margin: 140px auto 60px auto; /* top, sides, bottom */
  flex-wrap: wrap; /* così si adatta su mobile */
  justify-content: center;
  text-align: center;
}

.text-block {
    flex: 1;
    align-content: center;

}

.text-block h2 {
  font-size: 48px;
  color: var(--blue-color);
  text-align: center;

}

.text-block h3 {
 text-align: center;
  font-size: 36px;
  color: var(--blue-color);
  margin-top: 20px;
  margin-bottom: 0px;
}

.hero p {
  justify-content: center;
 text-align: center;
  font-size: 18px;
  margin-top: 10px;
  line-height: 1.5;
  max-width: 530px;
  margin-left: 32%;
}
.affluenza-container {
  display: flex;
  justify-content: center;
  gap: 160px;          /* distanza reale visibile */
  flex-wrap: wrap;
  margin-top: 60px;
  margin-bottom: 150px;
}
/* Wrapper tipo dati-type */
.affluenza-type {
  display: flex;
  flex-direction: column;
  align-items: center;
 cursor: pointer;
  position: relative;

}

/* Cerchio giallo */
.yellow-circle.small {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background-color: var(--yellow-color);

  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;

  transition: transform 0.3s;

}


.affluenza-type:hover .yellow-circle.small {
  transform: scale(2.5);
}

.circle-title,
.circle-description {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  text-align: center;
  color: var(--blue-color);
  pointer-events: none;
}
/* Titolo sopra il cerchio */
.circle-title {
margin-left: 8px;
  font-size: 24px;
  font-weight: bold;
  line-height: 1.2;
  z-index: 2;
}

.circle-description {
font-size: 80px;
  font-weight: bold;
  opacity: 0;
  z-index: 3;
  transition: opacity 0.3s;
left: 15px;
top: 12px;
}

/* Hover: scritta scompare, percentuale appare grande */
.affluenza-type:hover .circle-title {
  opacity: 0;
  transition: opacity 0.3s;
}

.affluenza-type:hover .circle-description {
  opacity: 1;
  font-size: 72px;
    margin-right: -15px;
}




/* =========================
   INFO – STRUTTURA
========================= */

.info {
  width: 100%;
  padding-top: 20px;
}

/* =========================
   SEZIONE DATI
========================= */

.dati {
  margin-top: 140px;
}

.dati-intro {
  max-width: 520px;
  margin: 0 auto 50px auto; /* centro orizzontale */
  text-align: center;
}

.dati-intro h3 {
  font-size: 36px;
  color: var(--blue-color);
  margin-bottom: 10px;
}

.dati-intro p {
  font-size: 18px;
  line-height: 1.5;
}

/* CONTENITORE TIPI */
.dati-types {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-left: 32%;
  margin-right: 20%;
  flex-wrap: wrap; /* permette l’adattamento su mobile */
}

/* SINGOLO TIPO */
.dati-type {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  max-width: 450px;
}

/* TITOLO */
.dati-type h4 {
  position: relative;
  font-size: 20px;
  font-weight: 800;
  color: var(--blue-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 2;
  line-height: 1.1;
  margin-bottom: 5px;
}

/* CERCHIO GIALLO (versione piccola) */
.dati-type .yellow-circle.small {
  position: absolute;
  width: 60px;
  height: 60px;
  background-color: var(--yellow-color);
  border-radius: 50%;
  top: -10px;
  left: -22px;
  z-index: 1;
  transition: transform 0.3s ease;
}

/* DESCRIZIONE */
.dati-type .description {
  margin-top: 3px;
  max-width: 330px;
  font-size: 18px;
  line-height: 1.4;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* HOVER */
.dati-type:hover .yellow-circle.small {
  transform: scale(1.4);
}

.dati-type:hover .description {
  opacity: 1;
}

/* =========================
   MOBILE
========================= */
@media (max-width: 900px) {
  .dati-types {
    flex-direction: column;
    gap: 40px;
    margin: 0 auto;
  }

  .dati-type {
    max-width: 90%;
    align-items: center;
  }
}



/* =========================
   REFERENDUM – NUOVA SEZIONE
========================= */

.referendum {
  margin-top: 40px;
}

.referendum-intro {
  max-width: 520px;
  margin: 0 auto 80px auto; /* centro orizzontale */
  text-align: center;
}

.referendum-intro h3 {
  font-size: 36px;
  color: var(--blue-color);
  margin-bottom: 10px;
}

.referendum-intro p {
  font-size: 18px;
  line-height: 1.5;
}

/* CONTENITORE TIPI */
.referendum-types {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  margin: 0 10%;
}

/* SINGOLO TIPO */
.referendum-type {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}





/* =========================
   TIPI DI REFERENDUM
========================= */

.referendum-types {
  display: flex;
  justify-content: space-between;
  gap: 60px;
  margin: 0 10%;
}

.referendum-type {
  position: relative;
  cursor: pointer;
}

/* TITOLO */
.referendum-type h4 {
  position: relative;
  font-size: 20px;
  font-weight: 800;
  color: var(--blue-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 2;
  line-height: 1.1;
  margin-bottom: 5px;
}

/* CERCHIO GIALLO (versione piccola) */
.yellow-circle.small {
  position: absolute;
  width: 60px;
  height: 60px;
  background-color: var(--yellow-color);
  border-radius: 50%;
  top: -10px;
  left: -22px;
  z-index: 1;
  transition: transform 0.3s ease;
}

/* DESCRIZIONE */
.referendum-type .description {
  margin-top: 3px;
  margin-bottom: 100px;
  max-width: 220px;
  font-size: 18px;
  line-height: 1.4;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* HOVER */
.referendum-type:hover .yellow-circle.small {
  transform: scale(1.4);
}

.referendum-type:hover .description {
  opacity: 1;
}


/* =========================
   ELEMENTI GRAFICI
========================= */

.highlight {
  font-size: 28px;
  font-weight: bold;
  color: var(--blue-color);
}

.external-link {
  color: inherit;
  text-decoration: underline;
}


/* =========================
   ALBUM
========================= */

.album {
  padding: 50px 20px;
  text-align: center;
}

.album h1 {
  font-size: 40px;
  color: var(--blue-color);
  margin: 15px 0 20px;
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(3, 300px);
    grid-auto-rows: 300px; 
  gap: 20px;
  max-width: 900px;
margin-top: 40px;
margin-left: auto;
margin-right: auto;
margin-bottom: 0;
}


.album-item {
  display: flex;
  flex-direction: column;     /* ⬅️ immagine sopra, testo sotto */
  align-items: center;
  justify-content: flex-start;

  height: 360px;              /* spazio sufficiente */
  text-align: center;
margin-bottom: 10px;
}

.album-item img {
  width: 220px;
  height: 220px;              /* width = height */
  object-fit: cover;
  border-radius: 50%;
}

.album-item p {
  margin-top: 20px;
  font-size: 18px;
  color: var(--blue-color);
  font-weight: bold;
}


/*----------------------*/
/* CORNICI E ALTRO */
.frame-top,
.frame-bottom,
.frame-left,
.frame-right {
    position: fixed;
    background-color: var(--blue-color);
    z-index: 900;
}

.frame-top {
    top: 0;
    left: 30px;
    right: 30px;
    height: 4px;
}

.frame-bottom {
    bottom: 0;
    left: 20px;
    right: 20px;
    height: 4px;
}


.linea-parallela {
    height: 4px;
    background: var(--blue-color);
    margin: 0px auto 10px;
    width: 100%;
}

/*----------------------*/
/* ALBUM E FOOTER */

.site-footer {
    display: flex;
    justify-content: space-between;
    align-items: center; 
    color: var(--blue-color);          
    padding: 15px 30px;         
    font-size: 20px;
    font-style: italic;
}

.footer-left {
    text-align: left;
}

.footer-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.footer-right {
    text-align: right;
}