/* === SLIDER CONTAINER === */
.slider {
  position: relative;
  width: 100%;
  height: 100vh; /* slider a tutta altezza */
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000; /* fallback nel caso le immagini non si carichino */
}

/* === SLIDE BASE === */
.slide {
  position: absolute;
  inset: 0; /* sostituisce top/left/right/bottom: 0 */
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1s ease, transform 1s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #fff;
}

.slide.active {
  opacity: 1;
  z-index: 1;
  transform: scale(1);
}

/* === SLIDE SPECIFICHE === */
.ft01 {
  background-image: url('../foto/sicurezza.jpg');
}

.ft02 {
  background-image: url('../foto/formazione1.jpg');
}

.ft03 {
  background-image: url('../foto/sicurezza.jpg');
}

/* === Versione WebP automatica === */
@supports (background-image: url("../foto/sicurezza.webp")) {
  .ft01 {
    background-image: url('../foto/sicurezza.webp');
  }
  .ft02 {
    background-image: url('../foto/formazione1.webp');
  }
  .ft03 {
    background-image: url('../foto/sicurezza.webp');
  }
}

/* === CONTENUTO === */
.boxH {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: #fff;
  text-shadow: 2px 2px 8px rgba(0,0,0,0.5);
  margin-top: 20vh;
  margin-bottom: 0.5em;
  text-align: center;
  letter-spacing: 1px;
}

.sotto {
  font-size: clamp(1rem, 2vw, 1.4rem);
  color: #f2f2f2;
  text-shadow: 1px 1px 5px rgba(0,0,0,0.5);
  text-align: center;
  max-width: 800px;
  padding: 0 1rem;
}

/* === PULSANTI NAVIGAZIONE === */
/* === FRECCE DI NAVIGAZIONE === */
.prev,
.next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;       /* nessun cerchio di sfondo */
  color: rgba(255, 255, 255, 0.5); /* meno evidente */
  border: none;
  font-size: 2.5rem;
  padding: 0 0.3em;
  cursor: pointer;
  transition: color 0.3s ease, transform 0.2s ease;
  z-index: 2;
  opacity: 0;                    /* inizialmente nascoste */
  pointer-events: none;          /* non cliccabili finché invisibili */
}

/* Mostra le frecce al passaggio del mouse sullo slider */
.slider:hover .prev,
.slider:hover .next {
  opacity: 1;
  pointer-events: auto;
}

/* Hover sulle frecce */
.prev:hover,
.next:hover {
  color: rgba(255, 255, 255, 0.9);
  transform: translateY(-50%) scale(1.1);
}

/* Posizioni laterali */
.prev { left: 20px; }
.next { right: 20px; }


.boxH {
  margin-top: 250px;              /* sposta verso il basso sotto al menu */
  padding: 20px 40px;
  background: rgb(12, 117, 173);
  color: #ffffff;
  font-weight: 600;
  font-size: xx-large;
  border-radius: 16px;
  border: 1px solid #FFF;
  backdrop-filter: blur(8px);
  text-align: center;
  z-index: 10;
  transition: transform 0.3s ease;
}

.boxH:hover {
  transform: translateY(-4px);
}
/* Testo sotto */
/* === TESTO SOTTO === */
.sotto {
  margin-top: 20px;
  max-width: 700px;
  text-align: center;
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.95);
  font-weight: 400;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  opacity: 0; /* parte invisibile, così si anima solo quando serve */
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Quando la slide è attiva, anima il testo */
.slide.active .sotto {
  opacity: 1;
  transform: translateY(0);
  animation: fadeInUp 1s ease both;
}

/* === Effetto ingresso dolce === */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* bordo o sfumatura leggera dietro al testo */
.sotto::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 12px;
  filter: blur(6px);
  z-index: -1;
}

/* Effetto ingresso dolce */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/************************************/
/* Ottimizzazione mobile */
@media (max-width: 980px) {
  .ft01 {
    min-height: 70vh;
  }
 .boxH {
    top: 100px; /* meno distanza su mobile */
    padding: 15px 25px;
    font-size: 0.95rem;
  }
  .sotto {
    margin-top: 15px;
    font-size: 1rem;
    width: 85%;
  }
}

@media (max-width: 480px) {
  .ft01 {
    min-height: 60vh;
  }
  .boxH {
    top: 80px; /* meno distanza su mobile */
    padding: 15px 25px;
    font-size: 0.95rem;
  }
  .sotto {
    font-size: 0.95rem;
  }
}
