/* 1. Assicura che la pagina occupi almeno tutto lo schermo */
html, body {
    height: 100%;
    margin: 0;
}

/* 2. Flexbox sul body */
body {
    display: flex;
    flex-direction: column;
}

/* 3. Questa è la chiave: 
   Diciamo che tutto ciò che sta tra header e footer deve espandersi 
   solo se c'è spazio, ma senza forzare spazi bianchi dove non servono.
   Poiché il footer ha 'margin-top: auto', farà tutto da solo.
*/
.welcome, .main-content {
    flex: 1 0 auto;
}

/* 4. Il footer resta fermo in fondo se c'è spazio */
footer {
    flex-shrink: 0;
}


/* ==========================================
   IL SUPER-FOOTER DEFINITIVO (STRUTTURA BASE PC)
   ========================================== */
footer, #footer, .footer {
    display: block !important;
    background-color: #3a7b6d !important; /* Il tuo verde originale */
    color: #fff !important;                /* Testo bianco */
    text-align: center !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 2rem 1rem !important;         /* Spazio interno che dà altezza al blocco verde */
    margin-top: 50px !important;           /* Stacca il footer dai fumetti sopra */
    clear: both !important;                /* Evita che i float del PC gli salgano sopra */
}

footer a, .footer a {
    color: #fff !important;
    text-decoration: none !important;
}

footer a:hover, .footer a:hover {
    text-decoration: underline !important;
}
/* FONT DEFINITIONS */
@font-face {
  font-family: 'Quicksand';
  src: url('assets/font/Quicksand-VariableFont_wght.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
}

@font-face {
  font-family: 'CarneysGallery';
  src: url('assets/font/Carneys Gallery.otf') format('opentype');
}

@font-face {
  font-family: 'CarneysGalleryScript';
  src: url('assets/font/Carneys Gallery Script.otf') format('opentype');
}

/* GENERAL STYLES */
body {
  margin: 0;
  font-family: 'Quicksand', sans-serif;
  background: #ffffff;
  color: #333;
}

/* PROVVISORIO */
html, body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
}


/* HEADER STRUCTURE */
.main-header {
  background-color: #3a7b6d;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  flex-wrap: wrap;
}

.header-left a,
.header-right a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: #fff;
  font-family: 'Quicksand', sans-serif;
  font-size: 1.1rem;
}

.header-center {
  flex-grow: 1;
  display: flex;
  justify-content: center;
}

.main-nav {
  display: flex;
  gap: 1rem;
}

.main-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: #fff;
  font-family: 'Quicksand', sans-serif;
  font-size: 1rem;
}

.main-nav a.active {
  color: orange;
  text-decoration: none;
}

/* TITLES */
.titolo {
  font-family: 'CarneysGallery', sans-serif;
  text-decoration: none;
  color: #fff;
  font-size: 1.5rem;
}

.titolo1 {
  font-family: 'CarneysGalleryScript', cursive;
  text-decoration: none;
  color: #fff;
  font-size: 1.5rem;
}

/* CAROSELLO IN HOMEPAGE */
.hero-carousel {
  position: relative;
  width: 100%;
  max-width: 1200px;
  aspect-ratio: 16 / 9;  /* sostituisci con il rapporto reale delle tue immagini */
  margin: 0 auto;
  overflow: hidden;
  min-height: 500px; /* oppure height: auto; se preferisci */
}

.carousel {
  position: relative;
  width: 100%;
  height: 100%;             /* prende tutta l’altezza del contenitore */
}

.carousel-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* riempie tutto il contenitore */
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.carousel-image.active {
  opacity: 1;
}

/* LOGIN ICON */
.login-icon {
  width: 20px;
  height: 20px;
}

/* HERO SECTION */
.hero {
  text-align: center;
  padding: 2rem;
}

.hero img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
}

.hero-section {
  position: relative;
  text-align: center;
}

.hero-section .hero-wave {
  width: 100%;
  display: block;
}

.hero-section .buttons {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 80px;
}

/* INSTAGRAM LINK */
.hero-section .instagram-link {
  position: absolute;
  top: 60%;       
  left: 50%;
  transform: translateX(-50%);
  font-family: 'CarneysGallery', sans-serif;
}

.hero-section .instagram-link a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: #548c75;
  background: none;
  padding: 0;
  border: none;
  font-size: 1.7rem;
}

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

/* WELCOME TEXT */
.welcome {
  text-decoration: none;
  text-align: center;
  font-family: 'CarneysGallery', sans-serif;
  padding: 0;
  color: #548c75;
  background: none;
  border: none;
  font-size: 1.7rem;
}


.year-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.year {
  font-size: 2.5rem;
  font-weight: bold;
  color: #3a7f6f;
  font-family: 'CarneysGallery', sans-serif;
}

.line-css {
  height: 2px;
  width: 800px;
  background-color: #3a7f6f;
}

/* DESCRIZIONE */
.descrizione {
  text-align: center;
  padding: 2rem;
  font-family: 'Quicksand', sans-serif;
}

/* BUTTONS */
.buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: nowrap;
}

.button {
  font-family: 'CarneysGallery', sans-serif;
  font-size: 1.5rem;
  color: #fff;
  text-decoration: none;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  padding: 1rem 2rem;
  background-color: #333;
  flex: 1 1 0;
  text-align: center;
  min-width: 200px;
}

.foto { background-color: #f7a98c; }
.brani { background-color: #548c75; }
.pillole { background-color: #d9925b; }

.button1 {
  font-family: 'CarneysGallery', sans-serif;
  font-size: 1.5rem;
  color: #fff;
  text-decoration: none;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  padding: 1rem 2rem;
  background-color: #333;
  flex: 1 1 0;
  text-align: center;
  min-width: 200px;
  margin: 0 30px;
}

.suono { background-color: #548c75; }
.intervallo { background-color: #548c75; }
.scala { background-color: #548c75; }
.tonalita { background-color: #548c75; }
.accordo { background-color: #548c75; }
.file { background-color: #548c75; }
.quiz { background-color: #d9925b; }
.testo_pillole {
  margin-left: 20px; /* spazio bianco a sinistra */
}

.no-underline {
  text-decoration: none;
  color: inherit; /* opzionale: mantiene il colore del testo */
}

.paragrafo p {
  font-family: sans-serif !important; /* Stesso font delle canzoni */
  font-size: 17px !important;         /* Dimensione identica a brani.php */
  color: #2f4f4f !important;          /* Colore identico a brani.php */
  font-weight: normal !important;     /* Rimosso il grassetto */
  margin-left: 30px !important;       /* Mantenuto il tuo rientro */
  line-height: 1.4 !important;        /* Migliora la leggibilità */
  margin-bottom: 10px !important;     /* Spazio tra i paragrafi */
}
/* opzionale: per uniformità, dai margine sinistro anche ai <p> normali */
.testo_pillole p {
  margin-left: 30px;
  margin-right: 30px;
}

.testo_quiz p {
  margin-left: 30px;
  margin-right: 30px;
}

#immagine-container1 {
  display: flex;
  justify-content: center;   /* centra il contenuto */
  margin: 20px auto;         /* centra il contenitore nella pagina */
  width: fit-content;        /* il div si adatta alla dimensione dell'immagine */
}

#note-container {
  display: flex;
  justify-content: center;   /* CENTRA il blocco nella pagina */
  gap: 40px;                 /* spazio tra le colonne */
  margin: 20px auto;         /* assicura centratura orizzontale */
}

.colonna {
  display: flex;
  flex-direction: column;    /* radio in colonna */
  align-items: flex-start;   /* mantiene le label allineate a sinistra */
}

.colonna label {
  margin-bottom: 6px;        /* spazio tra i radio */
}

#verifica {
  display: block;        /* permette il centraggio */
  margin: 20px auto;     /* centra orizzontalmente */
  padding: 10px 20px;    /* opzionale: migliora l'aspetto */
}

#genera {
  display: block;        /* permette il centraggio */
  margin: 20px auto;     /* centra orizzontalmente */
  padding: 10px 20px;    /* opzionale: migliora l'aspetto */
}
/* IMAGE BOXES */
.image-title {
  font-family: 'CarneysGallery', serif;
  font-size: 18px;
  margin-bottom: 10px;
  text-align: center;
  color: #548c75;
}

.image-box {
  text-align: center;
  margin: 10px;
}

.image-box img {
  display: block;
  width: 200px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  border-radius: 10px;
}

.image-box img::after {
  content: "";
  display: block;
  background: inherit;
  transform: scaleY(-1);
  opacity: 0.5;
  position: absolute;
  bottom: -100%;
  left: 0;
  height: 100%;
  width: 100%;
  pointer-events: none;
}

.images-container {
  display: flex;
  justify-content: center;
  gap: 40px;         /* spazio tra le immagini */
  flex-wrap: nowrap; /* impedisce che vadano a capo */
  padding: 2rem;
}


.gallery-container {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  padding: 2rem;
  justify-items: center;
}

.gallery-item img {
  width: 100%;
  max-width: 200px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  transition: transform 0.2s ease;
}

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

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 999;
  padding-top: 60px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.9);
}

.modal-content {
  margin: auto;
  display: block;
  max-width: 80%;
  max-height: 80%;
  border-radius: 10px;
  transition: opacity 0.3s ease;
}

.close {
  position: absolute;
  top: 30px;
  right: 50px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
}

.pagina_foto {
  padding: 2rem;
  font-family: 'CarneysGallery', sans-serif;
  color: #548c75;
}







/* Layout a due colonne - PC DESKTOP */
.riquadri {
  display: flex !important;
  flex-direction: row !important;
  width: 100% !important;
  padding: 40px 0 !important;
  box-sizing: border-box !important;
}

/* Wrapper per colonne (Applica il 50% esatto sia alla colonna sinistra che a quella destra) */
.riquadri .riquadro-wrapper {
  width: 50% !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
  padding-left: 20px !important;
  padding-right: 20px !important;
}

/* Testo sopra i riquadri (Valido sia per destra che per sinistra automaticamente) */
.testo-sopra {
  font-family: sans-serif;
  color: #2f4f4f;
  margin-bottom: 10px;
}

.testo-sopra h3 {
  font-family: 'CarneysGallery', sans-serif;
  font-size: 1.5em;
  margin: 0;
}

.testo-sopra p {
  font-family: 'Quicksand', sans-serif;
  font-size: 1.1em;
  margin: 5px 0 0;
}

/* I Fumetti interni (Ora entrambi prendono il 100% della loro metà colonna e tornano larghi uguali) */
.riquadro.sinistra,
.riquadro.destra {
  width: 100% !important;
  max-width: 100% !important;
  background-color: #c3d6d2 !important;
  border-radius: 25px !important;
  padding: 30px !important;
  box-sizing: border-box !important;
  min-height: 200px !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1) !important;
}






/* COOKIE BANNER - parte nascosto */
#cookie-banner {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 20px;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 20px;
  max-width: 90%;
  width: 480px; /* o 500px, o 520px */
  padding: 20px;
  background: #ffffff;
  border: 2px solid #111;
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  z-index: 999999;
  box-sizing: border-box;
  display: none; /* IMPORTANTISSIMO */
}

/* BLOCCO SINISTRO */
.cookie-left {
  flex: 0 0 140px;
  overflow: visible; 
}

.cookie-left img {
  width: 180px;
  max-height: none;
  height: auto;
  display: block;
}

/* BLOCCO DESTRO */
.cookie-right {
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding-right: 10px;
}

/* TITOLO */
.cookie-title {
  width: 100%;
  height: auto;
}

/* TESTO */
.cookie-text {
  font-size: 14px;
  line-height: 1.4;
  color: #111;
  margin: 0;
}

.cookie-text a {
  color: #4aa3c7;
  text-decoration: underline;
}

/* BOTTONI */
.cookie-buttons {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.cookie-buttons button {
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
}

/* ACCETTA */
.btn-accept {
  background: #007a6f;
  color: #fff;
}

/* RIFIUTA */
.btn-decline {
  background: #d9c6b3;
  color: #111;
}

/* --- CONTENITORE GENERALE --- */
#div_chisiamo {
    max-width: 1400px;
    margin: 60px auto 40px auto;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* --- FUMETTO (Angoli arrotondati selettivi) --- */
.chisiamo-box {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    background-color: #c3d6d2;
    /* Arrotondiamo solo gli angoli esterni del testo: Top-Left e Bottom-Left */
    border-radius: 40px 0 0 40px; 
    overflow: visible; /* Rimosso hidden per non tagliare l'immagine squadrata */
}

/* Versione inversa (Immagine a sinistra, arrotondamento a destra) */
.chisiamo-box.reverse {
    flex-direction: row-reverse;
    border-radius: 0 40px 40px 0; /* Arrotondiamo solo gli angoli esterni del testo */
}

/* --- TESTO E IMMAGINI (PC) --- */
.chisiamo-testo { 
    flex: 0 0 65%; 
    padding: 40px; 
    line-height: 1.6; 
    box-sizing: border-box; 
    text-align: left; 
}

.chisiamo-img { 
    flex: 0 0 35%; 
    display: flex; 
}

.chisiamo-img img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    border-radius: 0 !important; /* Angoli immagine rigorosamente squadrati */
    display: block; 
}

.riquadro.sinistra,
.riquadro-wrapper {
    max-width: 100%;
    flex: 1 1 100%;
}

  .testo-sopra h3 {
    font-size: 1.2em;
  }

  .testo-sopra p {
    font-size: 1em;
  }

.testo-sopra h3 {
  font-family: 'CarneysGallery', sans-serif;
  margin: 0;
  font-size: 1.2em;
}

.testo-sopra p {
  font-family: 'Quicksand', sans-serif;
  margin: 5px 0 0;
  font-size: 1em;
}



.download-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: #333;
  font-weight: 500;
}

.download-icon {
  width: 26px; /* ← Dimensione icona */
  height: 26px; /* ← Dimensione icona */
  margin-left: 8px; /* Spazio tra testo e icona */
  vertical-align: middle;
}



.box-icona {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    min-width: 200px; /* Per Desktop le tiene su una riga se c'è spazio */
}

.box-icona img {
    width: 80px;
}

/* Stile del testo */
.box-icona > div {
    font-size: 17px;
    line-height: 1.2;
}
.non-cliccabile {
    cursor: default; /* Il cursore resta una freccia normale */
    pointer-events: none; /* Disabilita completamente il click sull'elemento */
}
.center-img {
    display: block;
    margin-left: auto;
    margin-right: auto;
    max-width: 80%;
    height: auto;
}

/* Questa riga forza il contenitore a centrare tutto il suo contenuto interno */
.welcome {
    text-align: center;
}
/* --- ADATTAMENTO MOBILE --- */
@media (max-width: 768px) {
    #div_chisiamo { 
        margin-top: 30px !important; 
    }

    .chisiamo-box, .chisiamo-box.reverse { 
        display: flex !important; /* Forza il display flex */
        flex-direction: column !important; 
        border-radius: 20px 20px 0 0 !important; 
        margin: 0 15px 20px 15px !important; 
        overflow: hidden !important; 
        height: auto !important; /* Importante: lascia che il box cresca col contenuto */
    }

    .chisiamo-img { 
        flex: 1 1 auto !important; 
        order: 2; 
        width: 100% !important;
        display: block !important;
    }

    .chisiamo-img img { 
        border-radius: 0 !important; 
        width: 100% !important;
        height: auto !important; /* L'altezza si calcola in base alla larghezza */
        display: block !important;
        min-height: 200px; /* Imposta un minimo per vedere qualcosa */
    }

    .chisiamo-testo { 
        flex: 1 1 auto !important; 
        padding: 20px !important; 
        order: 1; 
        text-align: center; 
    }
}

/* RESPONSIVE MOBILE */
@media (max-width: 500px) {
  #cookie-banner {
    flex-direction: column;
    width: 80%;
    bottom: 10px;
    left: 5%;
    padding: 15px;
    gap: 2px;
  }
  #cookie-banner .cookie-left {
    margin-bottom: 0 !important;
  }
#cookie-banner .cookie-right {
    margin-top: 0 !important;
  }
  .cookie-left, .cookie-right {
    flex: none;
    width: 100%;
    min-width: 0;
  }

  .cookie-right {
    align-items: flex-start;
  }
}



@media screen and (max-width: 768px) {
    /* 1. Mette il titolo in alto al centro e sotto i blocchi dei link */
    .main-header {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 1rem;
        gap: 1.2rem;
    }

    /* Centra il logo/titolo */
    .header-left {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    /* Rimuove i vincoli del PC per gestire le righe */
    .header-center {
        flex-grow: 0;
        width: 100%;
    }

    /* 2. Trasforma il menu in un contenitore flessibile che va a capo da solo */
    .main-nav {
        display: flex;
        flex-wrap: wrap; 
        justify-content: center;
        gap: 0.8rem 1.2rem; /* Spazio verticale e orizzontale tra i link */
        width: 100%;
    }

    /* Gestione dei singoli link del menu */
    .main-nav a {
        font-size: 0.9rem; /* Leggermente più piccolo per farlo stare in una riga su smartphone */
        white-space: nowrap; /* Impedisce al testo del singolo link di spezzarsi in due righe */
    }

    /* 3. Sposta il blocco Login in linea con gli ultimi link */
    .header-right {
        width: 100%;
        display: flex;
        justify-content: center;
        margin-top: -0.4rem; /* Avvicina il Login alla seconda riga del menu */
    }

    .header-right a {
        font-size: 0.9rem;
        white-space: nowrap;
    }
/* ==========================================
       HERO & BOTTONI (index.php) - FIX COMPLETO
       ========================================== */

    /* Resetta il contenitore dell'onda per farlo comportare normalmente */
    .hero-section {
        position: static !important;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* Gestione dell'immagine dell'onda */
    .hero-section .hero-wave {
        width: 100%;
        height: auto;
        display: block;
        margin-bottom: 1.5rem;
    }
.hero-section .buttons {
    position: static !important;
    transform: none !important;
    left: auto !important;
    top: auto !important;

    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 2.5rem !important;
    
    /* MODIFICHE PER SPALMARE IL COLORE DA BORDO A BORDO */
    width: 100% !important;
    max-width: 100% !important; /* Ora lo sfondo prende tutta la larghezza dello schermo */
    background-color: #c3d6d2 !important; /* L'azzurrino dell'onda */
    
    /* Spazio interno: 0 sopra (per attaccarsi all'onda), 1.5rem ai lati, 3rem sotto */
    padding: 0 1.5rem 3rem 1.5rem !important; 
    margin: 0 !important; /* Rimuove i margini che isolavano la scatola */
    box-sizing: border-box !important;
    margin-top: -100px !important; /* <--- AUMENTA QUESTO VALORE (es. -50px) PER FARLI SALIRE ANCORA DI PIÙ */
}

/* Applichiamo i tuoi 230px direttamente sul singolo bottone, così lo sfondo resta largo ma i tasti rimangono compatti */
.button {
    display: block !important;
    width: 100% !important;
    max-width: 230px !important; /* I tuoi tasti rimangono della larghezza che volevi! */
    flex: none !important;
    min-width: 0 !important;
    padding: 1.9rem 0.2rem !important;
    box-sizing: border-box !important;
    text-align: center !important;
}
/* ==========================================
       FIX INSTAGRAM AL CENTRO (index.php)
       ========================================== */
    .instagram-link {
	background-color: #c3d6d2 !important;
        position: static !important;
        transform: none !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        
        display: flex !important;
        justify-content: center !important; /* Centra il contenuto in orizzontale */
        align-items: center !important;     /* Centra gli elementi in verticale */
        width: 100% !important;             /* Prende tutto lo schermo dello smartphone */
        max-width: 100% !important;
        margin: 2rem 0 !important;          /* Spazio sopra e sotto per non toccare i bottoni e il footer */
        padding: 2rem !important;
        box-sizing: border-box !important;
	margin-top: -30px !important; /* <--- AUMENTA QUESTO VALORE (es. -50px) PER FARLI SALIRE ANCORA DI PIÙ */
    }

    .instagram-link a {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.5rem !important;
        width: auto !important;
        text-align: center !important;
        margin: 0 auto !important;          /* Forza la centratura matematica */
        font-size: 1.1rem !important;
    }

    .instagram-icon {
        display: inline-block !important;
        max-width: 30px !important;         /* Dimensione controllata dell'icona */
        height: auto !important;
    }
    /* ==========================================
       SPAZIATURE TESTI INIZIALI (index.php)
       ========================================== */

    /* Gestisce lo spazio SOTTO il carosello */
    .hero-carousel {
        margin-bottom: 2.5rem !important; /* <--- Aumenta o diminuisci questo per allontanare/avvicinare la scritta "Benvenuti" */
    }

    /* Ottimizza la scritta di Benvenuti */
    .welcome {
        margin-top: 0 !important;
        margin-bottom: 0.8rem !important; /* Spazio tra "Benvenuti" e la descrizione sotto */
        padding: 0 1rem !important;
        text-align: center !important;
        font-size: 1.5rem !important; /* Regola la dimensione del font su mobile */
    }

    /* Ottimizza la descrizione */
    .descrizione {
        margin-top: 0 !important;
        margin-bottom: 2rem !important; /* Spazio tra la descrizione e l'onda/bottoni sotto */
        padding: 0 1.5rem !important;
        text-align: center !important;
        font-size: 1rem !important;
        line-height: 1.4 !important; /* Rende il testo più leggibile su smartphone */
    }

/* ==========================================
       PAGINA FOTO - GRIGLIA A 2 COLONNE MOBILE
       ========================================== */

    /* 1. SISTEMIAMO LE LINEE DEGLI ANNI */
    .year-line {
        justify-content: flex-start !important; /* Allinea l'anno a sinistra */
        width: 100% !important;
        padding: 0 1.5rem !important;
        box-sizing: border-box !important;
    }

    .year {
        font-size: 2rem !important; /* Riduce leggermente la dimensione del testo dell'anno */
    }

    .line-css {
        width: 100% !important; /* Rende la linea fluida */
        max-width: 120px !important; /* Decide la lunghezza massima della linea di fianco all'anno */
        height: 2px !important;
    }

    /* 2. TRASFORMIAMO IL CONTENITORE IN UNA GRIGLIA A 2 COLONNE */
    .images-container {
        display: grid !important; /* Cambia da Flex a Grid */
        grid-template-columns: repeat(2, 1fr) !important; /* Forza esattamente 2 colonne uguali */
        gap: 20px 15px !important; /* 20px di spazio verticale tra le righe, 15px orizzontale */
        padding: 1rem 1.5rem 3rem 1.5rem !important; /* Padding ottimizzato per i lati dello schermo */
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* 3. ADATTIAMO LE SCATOLE DELLE FOTO */
    .image-box {
        margin: 0 !important; /* Resetta i margini del PC */
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    /* Sistema i titoli delle copertine (evita che si sovrappongano) */
    .image-title {
        font-size: 0.95rem !important;
        margin-bottom: 8px !important;
        font-weight: bold;
        text-align: center;
        line-height: 1.2;
    }

    /* 4. FACCIAMO DIVENTARE LE IMMAGINI FLUIDE */
    .image-box img, .reflected-image {
        width: 100% !important; /* L'immagine non è più fissa a 200px, ma occupa tutto lo spazio della sua colonna */
        max-width: 100% !important;
        height: auto !important; /* Mantiene le proporzioni corrette senza schiacciarsi */
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2) !important; /* Ammorbidisce l'ombra su mobile */
    }

    /* DISTANZIA IL PRIMO ANNO DALL'HEADER SU MOBILE */
    section.welcome:first-of-type {
        margin-top: 30px !important; /* <--- Aumenta questo valore (es. 40px o 50px) se vuoi ancora più spazio */
    }

/* ==========================================
       STRUTTURA MOBILE - INCOLONNATI E CENTRATI
       ========================================== */

    .riquadri {
        display: flex !important;
        flex-direction: column !important; /* Una colonna sotto l'altra */
        gap: 35px !important;
        padding: 20px 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Su mobile i wrapper si allargano e si centrano */
    .riquadri .riquadro-wrapper {
        width: 90% !important;
        max-width: 90% !important;
        margin: 0 auto !important; /* Centra perfettamente */
        padding: 0 !important;
        float: none !important;
        clear: both !important;
        display: block !important;
    }
    .riquadro-wrapper:nth-child(2) {
        order: 1 !important;
    }

    /* Il blocco "Scalette" (il primo nel codice) lo forziamo a stare sotto */
    .riquadro-wrapper:nth-child(1) {
        order: 2 !important;
    }

    /* I titoli si allineano a sinistra del fumetto */
    .testo-sopra {
        padding-left: 10px !important;
        margin-bottom: 12px !important;
        text-align: left !important;
    }

    /* I fumetti occupano tutto il wrapper mobile */
    .riquadro.sinistra, 
    .riquadro.destra {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        padding: 30px 25px !important; /* Margine interno per il testo */
        box-sizing: border-box !important;
    }

    /* Distanza del testo dal bordo sinistro */
    .scaletta p {
        padding-left: 15px !important;
        padding-right: 15px !important;
        margin: 8px 0 !important;
    }
    @media screen and (max-width: 768px) {
    .buttons {
        display: flex !important;
        flex-direction: row !important; /* Forza la riga */
        flex-wrap: wrap !important;     /* Permette di andare a capo */
        justify-content: center !important;
        gap: 5px !important;            /* Spazio tra i bottoni */
    }

    .buttons .button1 {
        width: 40% !important;          /* Ridotto a 40% per sicurezza */
        flex: 0 0 40% !important;       /* Forza la dimensione */
        margin: 5px !important;         /* Margin piccoli per evitare overflow */
    }

    /* Il quiz da solo */
    .buttons:last-of-type .button1 {
        width: 85% !important;
        flex: 0 0 85% !important;
    }
}
