body {
  font-family: "Georgia", "Times New Roman", Times, serif;
  font-size: 16px;
  line-height: 1.8;
  color: #333;
  margin: 0;
  padding: 0;
  overflow-x: hidden; /* Importante: previene lo scrolling orizzontale */
}

/* ===== BANNER COMPLETAMENTE RISCritTO ===== */
.banner-container {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.banner-image-container {
  width: 100%;
}

.banner-image {
  width: 100%;
  height: auto;
  display: block;
}

.banner-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: white;
  padding: 20px;
  box-sizing: border-box;
}

.banner-title {
  font-size: clamp(28px, 6vw, 48px);
  margin: 0;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
  line-height: 1.2;
  word-wrap: break-word;
  white-space: normal;
  max-width: 95%; /* Non arriva mai ai bordi */
  font-family: "Georgia", cursive;
  font-style: italic;
  font-weight: bold;
  padding: 0 10px;
}

.banner-subtitle {
  font-size: clamp(18px, 4vw, 36px);
  margin: 15px 0 0;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
  line-height: 1.2;
  word-wrap: break-word;
  white-space: normal;
  max-width: 95%; /* Non arriva mai ai bordi */
  font-style: italic;
  font-family: "Lucida Handwriting";
  padding: 0 10px;
}

/* ===== NAVIGATION ===== */
nav {
  background: #333;
  overflow: hidden;
  display: flex;
  justify-content: flex-start;
  padding: 0 10px;
  flex-wrap: wrap;
}

nav .dropbtn {
  font-size: 16px;
  color: white;
  padding: 10px 20px;
  border: none;
  background: #333;
  cursor: pointer;
  width: auto;
  margin-right: 10px;
}

nav .dropbtn:hover {
  background-color: #555;
}

/* ===== MAIN LAYOUT ===== */
.main-container {
  display: flex;
  margin-top: 20px;
  width: 100%;
  box-sizing: border-box;
}

main {
  flex: 3;
  padding: 20px;
  padding-right: 20px;
  box-sizing: border-box;
}

aside {
  flex: 1;
  border-left: 1px solid #ccc;
  padding-left: 20px;
  box-sizing: border-box;
}

/* ===== CONTENT STYLES ===== */
#content, 
#content * {
  font-size: 18px !important;
  line-height: 1.6;
}

#content div[id^="sdfootnote"] {
  margin-top: 60px;
  font-size: 12px !important;
  line-height: 1.6;
}

.footnote-separator {
  border: none;
  border-top: 2px solid #333;
  margin: 40px 0 20px 0;
}

.firma-button {
  background-color: #8B0000;
  color: white;
  border: none;
  padding: 15px 30px;
  font-size: 18px;
  font-weight: bold;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.firma-button:hover {
  background-color: #A52A2A; 
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.firma-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* ===== MOBILE STYLES ===== */
@media (max-width: 768px) {
  /* BANNER MOBILE - SOLUZIONE SICURA */
  .banner-container {
    display: flex;
    flex-direction: column;
  }
  
  .banner-content {
    position: relative !important;
    background: rgba(0, 0, 0, 0.7);
    padding: 30px 15px !important;
    height: auto !important;
    order: 2; /* Testo sotto l'immagine */
  }
  
  .banner-image-container {
    order: 1; /* Immagine sopra il testo */
  }
  
  .banner-title {
    font-size: clamp(22px, 7vw, 32px) !important;
    line-height: 1.3 !important;
    max-width: 100% !important;
    padding: 0 5px !important;
  }
  
  .banner-subtitle {
    font-size: clamp(16px, 5vw, 24px) !important;
    line-height: 1.3 !important;
    max-width: 100% !important;
    padding: 0 5px !important;
  }
  
  /* LAYOUT MOBILE */
  .main-container {
      flex-direction: column !important;
      margin-top: 10px !important;
  }

  main {
      flex: 1 !important;
      padding: 15px !important;
      width: 100% !important;
      padding-right: 15px !important;
      order: 1; /* main stays on top */
  }

  aside {
      display: block !important;   /* show sidebar as footer */
      width: 100% !important;      /* full width below main */
      padding: 20px !important;    /* padding for footer look */
      border-left: none !important;/* remove desktop left border */
      border-top: 1px solid #ccc !important; /* optional separator */
      margin-top: 20px !important; /* space from main */
      order: 2;                     /* ensure it comes after main */
  }
  
  /* NAVIGATION MOBILE */
  nav {
    flex-direction: column !important;
    padding: 10px !important;
  }
  
  nav .dropbtn {
    width: 100% !important;
    margin-right: 0 !important;
    margin-bottom: 5px !important;
    padding: 12px 15px !important;
    font-size: 14px !important;
    text-align: center !important;
  }
}

/* STYLES PER SCHERMI PICCOLISSIMI */
@media (max-width: 480px) {
  .banner-content {
    padding: 20px 10px !important;
  }
  
  .banner-title {
    font-size: clamp(18px, 6vw, 24px) !important;
  }
  
  .banner-subtitle {
    font-size: clamp(14px, 4vw, 18px) !important;
  }
  
  main {
    padding: 10px !important;
  }
  
  nav .dropbtn {
    padding: 10px 12px !important;
    font-size: 13px !important;
  }
}

/* GARANZIA EXTRA - nessun testo sarà mai tagliato */
@media (max-width: 320px) {
  .banner-content {
    padding: 15px 5px !important;
  }
  
  .banner-title {
    font-size: 16px !important;
    line-height: 1.4 !important;
  }
  
  .banner-subtitle {
    font-size: 14px !important;
    line-height: 1.4 !important;
  }
}

