/* ==========================================
   STILI SLIDESHOW ROTATOR CONTROLLABILE
   ========================================== */

/* Contenitore principale */
.rotator-container {
  position: relative;
  width: 100%;
  max-width: 900px; /* Larghezza coerente con il layout precedente */
  height: 675px;    /* Altezza personalizzabile delle slide */
  margin: 50px auto;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  background-color: #333; /* Colore di riempimento per le bande laterali/superiori */
}

/* Singole slide */
.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 2rem;
  font-weight: bold;
background-size: contain; /* Usa 'contain' per non tagliare, 'cover' per riempire */
  background-repeat: no-repeat;
  background-position: center;
}

.slide.active {
  opacity: 1;
  z-index: 1;
}

/* Pulsanti Avanti e Indietro */
.prev, .next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  padding: 15px;
  cursor: pointer;
  font-size: 18px;
  border-radius: 5px;
  transition: background 0.3s;
}

.prev:hover, .next:hover { background-color: rgba(0, 0, 0, 0.8); }
.prev { left: 15px; }
.next { right: 15px; }

/* Indicatori (pallini in basso) */
.dots-container {
  position: absolute;
  bottom: 15px;
  width: 100%;
  text-align: center;
  z-index: 2;
}

.dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin: 0 5px;
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.3s;
}

.dot.active { background-color: #ffffff; transform: scale(1.2); }

/* Pulsante Play/Pausa */
.play-pause {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 2;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
}

/* Responsive per tablet e smartphone */
@media (max-width: 992px) {
  .rotator-container {
    width: calc(100% - 30px);
    height: auto;
    aspect-ratio: 4 / 3; /* stessa proporzione 900x675 del desktop */
    margin: 30px auto;
    touch-action: pan-y; /* permette lo swipe orizzontale senza bloccare lo scroll verticale */
  }
}

@media (max-width: 768px) {
  .rotator-container {
    width: calc(100% - 20px);
    margin: 20px auto;
    border-radius: 8px;
  }
  .prev, .next {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 16px;
  }
  .prev { left: 8px; }
  .next { right: 8px; }
  .play-pause {
    top: 8px;
    right: 8px;
    min-height: 36px;
    padding: 6px 10px;
    font-size: 13px;
  }
  .dots-container { bottom: 8px; }
  .dot {
    width: 10px;
    height: 10px;
    margin: 0 4px;
  }
}

@media (max-width: 480px) {
  .prev, .next {
    width: 36px;
    height: 36px;
  }
}
