/* Stile generale del corpo della pagina */
body {
  margin: 0;
  background: #f6fbff; /* Colore di sfondo di fallback */
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: #2b4a66; /* Colore del testo principale */
  line-height: 1.6;
  overflow-x: hidden; /* Previene lo scorrimento orizzontale */
}

/* Stile per i link */
a {
  color: #00A67D;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Contenitore principale per centrare il contenuto */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Intestazione del sito */
header {
  background: #ffffff;
  padding: 16px 24px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* Logo nell'intestazione */
header .logo img {
  height: 40px;
  display: block;
}

/* Navigazione principale */
header nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  gap: 16px;
}

header nav a {
  font-weight: 600;
  color: #17324d;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background-color 0.3s;
}

header nav a:hover,
header nav a.active {
  background-color: #e8f7ff;
  color: #007acc;
}

/* Stile generico per le sezioni */
section {
  padding: 80px 0;
  border-bottom: 1px solid #e8e8e8;
}

section:last-of-type {
  border-bottom: none;
}

/* Titoli delle sezioni */
section h2 {
  font-size: 32px;
  font-weight: 800;
  color: #17324d;
  text-align: center;
  margin-bottom: 16px;
}

/* Paragrafo descrittivo sotto il titolo */
section .section-intro {
  font-size: 18px;
  text-align: center;
  max-width: 720px;
  margin: 0 auto 48px auto;
}

/* Sezione Home (Hero) */
#home {
  background-image: linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.15) 0%,
      rgba(255, 255, 255, 0.2) 35%,
      rgba(255, 255, 255, 0.85) 75%,
      rgba(255, 255, 255, 0.92) 100%
    ),
    url('sfondi/sfondo3.png');
  background-size: cover;
  background-position: left center;
  background-repeat: no-repeat;
  padding: 100px 0;
  text-align: center;
}

#filosofia {
  position: relative;
  overflow: hidden;
  background: #0c243d;
  color: #fdfefe;
}

#filosofia::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(125deg, rgba(12, 36, 61, 0.35), rgba(255, 255, 255, 0.3));
  z-index: 1;
}

.section-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
}

#filosofia .container {
  position: relative;
  z-index: 2;
}

#filosofia .section-intro {
  color: rgba(245, 249, 255, 0.9);
}

#filosofia .gallery-item {
  background: rgba(255, 255, 255, 0.9);
  color: #17324d;
}

#filosofia .gallery-item figcaption {
  color: #17324d;
}

#eventi {
  position: relative;
  overflow: hidden;
  background: #fef7f0;
}

#eventi::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 247, 240, 0.75), rgba(255, 255, 255, 0.35));
  z-index: 1;
}

#eventi .container {
  position: relative;
  z-index: 2;
}

#eventi .section-intro {
  color: #4a3218;
}

#eventi .gallery-item {
  background: rgba(255, 255, 255, 0.92);
}

#home .container {
  margin-left: auto;
  margin-right: 5%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.home-logo {
  max-width: 1000px; /* Imposta la larghezza massima del logo */
  margin: 14px auto; /* Centra il logo nella colonna */
}

#home h1 {
  font-size: 40px;
  font-weight: 800;
  color: #17324d;
  margin-bottom: 16px;
}

#home .tagline {
  font-size: 22px;
  font-weight: 600;
  color: #00A67D;
}

/* Pulsanti Call to Action */
.cta-button {
  display: inline-block;
  background-color: #00A67D;
  color: #ffffff;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 12px;
  text-align: center;
  margin-top: 32px;
  box-shadow: 0 4px 12px rgba(0, 166, 125, 0.3);
  transition: all 0.3s;
  border: none; /* Aggiunto per coerenza con altri bottoni */
  cursor: pointer; /* Aggiunto per coerenza */
}

.cta-button:hover {
  background-color: #008e6b;
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 166, 125, 0.4);
}

/* Gallerie di immagini */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
  margin-top: 48px;
}

.gallery-item {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  background: #ffffff;
  text-align: center;
}

.gallery-item img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.gallery-item figcaption {
  padding: 12px;
  font-size: 14px;
  font-weight: 500;
  color: #2b4a66;
}

/* Sezione Gusti e Contatti (liste) */
#gusti {
  background-image: linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.2) 0%,
      rgba(255, 255, 255, 0.45) 45%,
      rgba(255, 255, 255, 0.85) 100%
    ),
    url('sfondi/sfondo1.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

#gusti .container {
  margin: 0 auto;
  max-width: 720px;
  text-align: center;
}

#gusti h2,
#gusti .section-intro {
  text-align: center;
}

.feature-list {
  list-style: none;
  padding: 0;
  max-width: 720px;
  margin: 48px auto 0 auto;
}

.feature-list li {
  font-size: 18px;
  font-weight: 600;
  padding: 10px 0;
  border-bottom: 1px solid #e8f7ff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.feature-list li:before {
  content: '🍦'; /* Icona cono gelato */
  margin-right: 0;
  margin-bottom: 4px;
  font-size: 20px;
}

#gusti .feature-list {
  max-width: 520px;
  margin: 48px auto 0 auto;
}

#gusti .feature-list li {
  border-bottom: none;
  justify-content: center;
  text-align: center;
}

.taste-name {
  font-size: 20px;
  letter-spacing: 0.5px;
}

.taste-desc {
  font-size: 16px;
  font-weight: 500;
  color: #2b4a66;
}

/* Sezione Contatti - sfondo personalizzato */
#contatti {
  background-image: linear-gradient(
      rgba(255, 255, 255, 0.65),
      rgba(255, 255, 255, 0.65)
    ),
    url('sfondi/sfondo2.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Sezione Contatti */
#contatti .social-links {
  text-align: center;
  margin-top: 40px;
}

#contatti .social-links a {
  display: inline-block;
  margin: 0 12px;
  transition: transform 0.3s;
}

#contatti .social-links img {
  height: 40px;
}

#contatti .social-links a:hover {
  transform: scale(1.1);
}

/* Footer */
footer {
  background: #17324d;
  color: #ffffff;
  text-align: center;
  padding: 32px 24px;
  font-size: 14px;
}

/* Stili per il Modal del Form */
.modal {
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background-color: #fefefe;
  margin: auto;
  padding: 24px 32px;
  border: 1px solid #888;
  width: 90%;
  max-width: 500px;
  border-radius: 12px;
  position: relative;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.close-button {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  position: absolute;
  top: 10px;
  right: 20px;
}

.close-button:hover,
.close-button:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

#quote-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#quote-form label {
    font-weight: 600;
    color: #17324d;
}

#quote-form input,
#quote-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-family: inherit;
    font-size: 16px;
    box-sizing: border-box; /* Aggiunto per un corretto calcolo della larghezza */
}

.form-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 16px;
}

.cancel-button {
    background-color: #ccc;
    color: #333;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s;
}

.cancel-button:hover {
    background-color: #b3b3b3;
}


/* Media Query per schermi piccoli (smartphone) */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 16px;
  }

  header nav ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  header nav a {
    padding: 6px 10px;
    font-size: 14px;
  }

  section {
    padding: 60px 0;
  }

  section h2 {
    font-size: 28px;
  }

  #home {
    padding: 80px 0;
    background-position: center;
  }

  #home h1 {
    font-size: 32px;
  }

  #home .container {
    margin: 0 auto;
    text-align: center;
    max-width: 90%;
  }

  .home-logo {
    margin: 14px auto;
  }

  #gusti .container {
    margin: 0 auto;
    text-align: center;
  }

  #gusti h2,
  #gusti .section-intro {
    text-align: center;
  }

  #gusti .feature-list {
    max-width: 100%;
    margin: 48px auto 0 auto;
  }

  #gusti .feature-list li {
    justify-content: center;
    text-align: center;
  }

  .gallery {
    grid-template-columns: 1fr; /* Una colonna su schermi piccoli */
  }
  
  .modal-content {
    width: 95%;
    padding: 20px;
  }
}

/* Stili per il Lightbox delle Immagini */
#lightbox-modal .lightbox-content {
    background-color: transparent; /* Lo sfondo è già gestito dal .modal */
    padding: 20px;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: none; /* Rimuove l'ombra dal contenuto per l'immagine */
}

#lightbox-modal #lightbox-img {
    max-width: 100%;
    max-height: 75vh; /* Limita l'altezza massima dell'immagine al 75% dell'altezza del viewport */
    display: block;
    object-fit: contain; /* Assicura che l'immagine si adatti senza tagliare */
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

#lightbox-modal #lightbox-caption {
    color: #ffffff;
    text-align: center;
    margin-top: 15px;
    font-size: 18px;
    background-color: rgba(0, 0, 0, 0.6);
    padding: 8px 15px;
    border-radius: 5px;
}

.lightbox-close {
    color: #ffffff;
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2001; /* Assicura che sia sopra l'immagine */
    text-shadow: 2px 2px 5px rgba(0,0,0,0.7);
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: #ccc;
}

/* Aggiunge il puntatore alle immagini della galleria */
.gallery-item img {
    cursor: pointer;
}

@media (max-width: 768px) {
    #lightbox-modal .lightbox-content {
        padding: 10px;
    }
    #lightbox-modal #lightbox-img {
        max-height: 60vh; /* Ancora più piccola su mobile */
    }
    #lightbox-modal #lightbox-caption {
        font-size: 14px;
    }
    .lightbox-close {
        font-size: 28px;
        top: 5px;
        right: 10px;
    }
}
