/* === Modal: animazione apertura e poster ben visualizzato === */
#eventPosterModal .modal-dialog {
  transform: scale(.98);
  opacity: 0;
  transition: transform .22s ease, opacity .22s ease;
}
#eventPosterModal.show .modal-dialog { transform: scale(1); opacity: 1; }

/* Poster box responsive e centrato */
#eventPosterModal .poster-img-box {
  min-height: 60vh;
  max-height: 82vh;
  background: #000;
  display: flex; align-items: center; justify-content: center;
}
#eventPosterModal #modalPosterImg {
  width: 100%; height: 100%; object-fit: contain;
  opacity: 0; transition: opacity .22s ease;
}
#eventPosterModal.img-ready #modalPosterImg { opacity: 1; }

/* Pannello dettagli scrollabile se necessario */
#eventPosterModal .col-lg-5 { max-height: 82vh; overflow: auto; }

/* Feedback al click sulla card (senza traslazioni persistenti) */
.poster-section .poster-card { transition: box-shadow .2s ease; }
.poster-section .poster-card:active { transform: none !important; }

/* Poster grid: dimensioni uniformi per tutte le card */
.poster-section .poster-card { aspect-ratio: 3 / 4; width: 100%; }
.poster-section .poster-card img { display: block; width: 100%; height: 100%; object-fit: cover; transform: none !important; transition: none; }

/* Stabilizza layout card: immagine assoluta e contenitori posizionati */
.poster-section .poster-card { position: relative; overflow: hidden; }
.poster-section .poster-card > img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; transform: translateZ(0);
}
/* L’overlay non interferisce, il click passa al bottone */
.poster-section .poster-card .poster-overlay { pointer-events: none; display: flex; align-items: flex-end; }
/* Il trigger copre l’intera card e non altera il layout */
.poster-section .poster-card .stretched-link { position: absolute; inset: 0; z-index: 3; }
/* Evita outline che possa causare scroll/focus jump */
.poster-section .poster-card .stretched-link:focus { outline: none; box-shadow: none; }

/* Veil HD: leggero velo scuro su tutte le card per migliorare il contrasto */
.poster-section .poster-card::after {
  content: "";
  position: absolute; inset: 0;
  background: rgba(0,0,0,.16);
  pointer-events: none;
  z-index: 1;
  transition: opacity .2s ease;
}
.poster-section .poster-card:hover::after { opacity: .30; }
/* Assicura che overlay/testo restino sopra il velo */
.poster-section .poster-card .poster-overlay { z-index: 2; }
.poster-section .poster-card .stretched-link { z-index: 3; }

/* Overlay: allinea sempre a sinistra e limita la larghezza dei testi */
.poster-section .poster-card .poster-overlay {
  align-items: flex-start !important; /* evita stretch full-width su mobile */
}
.poster-section .poster-overlay .date-badge { display: inline-block; width: auto; }
.poster-section .poster-overlay h5 {
  display: inline-block;
  width: auto;
  max-width: 85%; /* evita di riempire tutta la card */
}
@media (max-width: 575.98px) {
  .poster-section .poster-overlay { padding: .75rem !important; }
  .poster-section .poster-overlay h5 { max-width: 80%; }
}
