/* RESET DI BASE */
body {
  font-family: Arial, sans-serif;
  background-color: #ffffff;
  color: #000000;
  margin: 0;
  padding: 0;
  text-align: center;
  overflow-x: hidden;
}

/* CONTENITORE PRINCIPALE */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 10px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* CONTENITORE SUPERIORE: IMMAGINE + LINGUE */
.hero-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 0;
}

/* IMMAGINE */
.hero-image img {
  max-width: 100%;
  width: 400px;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* SELETTORE LINGUA */
.language-selector {
  margin: 10px 0;
  padding: 0 10px;
  width: 100%;
}

.language-note {
  font-size: 1.2em;
  font-weight: bold;
  margin-bottom: 10px;
  display: block;
  word-break: break-word;
  padding: 0 5px;
}

/* BANDIERE */
.language-selector .flags {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.language-selector .flags a {
  flex: 1 1 40%;
  max-width: 40%;
  display: flex;
  justify-content: center;
}

.language-selector .flags a img {
  width: 32px;
  height: auto;
  transition: transform 0.2s ease-in-out;
}

.language-selector .flags a img:hover {
  transform: scale(1.1);
}

/* DEDICA */
.hero-dedica {
  margin: 0;
  padding: 5px 10px;
  font-size: 1.1em;
  line-height: 1.6;
  min-height: 6em;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dedica-label {
  font-weight: bold;
  margin-bottom: 8px;
  font-style: normal;
  display: block;
  min-height: 1.5em;
}

.dedica {
  opacity: 1;
  transition: opacity 0.8s ease-in-out;
  font-style: italic;
  font-size: 1.1em;
  line-height: 1.6;
  min-height: 4em;
  padding: 10px;
  display: block;
  visibility: visible;
}

.visible {
  opacity: 1 !important;
}

/* RESPONSIVE PER MOBILE */
@media screen and (max-width: 800px) {
  .hero {
    margin-top: 0 !important;
    padding-top: 0;
  }

  .hero-top {
    flex-direction: column;
    align-items: center;
    gap: 0;
  }

.hero-dedica {
  order: -1;
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  padding-top: 15px; /* aumentato lo spazio sopra la dedica */
  margin-top: 10px;  /* reintrodotto leggero margine */
}

  .dedica {
    font-size: 1em;
  }

  .dedica-label {
    font-size: 1.1em;
    margin-bottom: 8px;
  }

  .hero-image img {
    width: 85%;
    margin-top: 10px;
  }

  .language-note {
    font-size: 1em;
    margin: 5px 0;
  }

  .language-selector {
    padding: 0 5px;
    width: 100%;
  }

  .language-selector .flags {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  .language-selector .flags a img {
    width: 30px;
  }
}

/* DESKTOP */
@media screen and (min-width: 801px) {
  .hero-top {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .hero-image {
    flex: 1;
    text-align: center;
  }

  .language-selector {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
  }

  .language-note {
    margin-bottom: 15px;
  }

  .hero-dedica {
    width: 100%;
    margin-top: 30px;
  }
}
