/* Fotografie originali sempre intere - layout responsive comune.
   Il contenuto delle immagini non viene modificato: interveniamo solo sulla resa CSS. */
img {
  max-width: 100%;
  object-fit: contain !important;
  object-position: center center !important;
}

/* Ananke e SganziSgatto: le foto seguono le proporzioni naturali,
   senza il taglio 16/10 che nascondeva volti e scene. */
.photo-gallery {
  align-items: start;
}
.photo-gallery figure {
  min-width: 0;
}
.photo-gallery img {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  max-height: none !important;
  min-height: 0 !important;
  aspect-ratio: auto !important;
  object-fit: contain !important;
  background: #111725;
}

/* Gallerie fotografiche di tutti i progetti: niente panoramiche
   4:3 o 16:9 imposte alle immagini d'archivio. */
.gallery img,
.gallery-grid img,
.photos img,
.group-photo img,
.hero-photo img,
.reunion-photo img,
.chapter .photo-slot.real img,
.gallery .photo-grid figure img,
.gallery .gallery-extras img,
.voices figure img,
.keys figure img,
.highlight-photo,
.farewell-photo img,
.project-archive img {
  object-fit: contain !important;
  object-position: center !important;
}

.gallery .photo-grid figure img,
.gallery .photo-grid figure:first-child img,
.gallery .gallery-extras img,
.chapter .photo-slot.real img,
.hero-photo img,
.reunion-photo img,
.highlight-photo,
.project-archive img {
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: auto !important;
}

/* SganziSgatto e Ananke usano figure autonome:
   sopra non devono agire ritagli ereditati da layout precedenti. */
.photo-gallery figure img {
  max-width: 100% !important;
}

/* Famosa Squadra G: foto di gruppo e protagonisti sempre visibili,
   anche nelle miniature e nei capitoli narrativi. */
.hero-image {
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: auto !important;
}
.hero-image img {
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  object-fit: contain !important;
}
.chapter .photo-slot.real {
  aspect-ratio: auto !important;
  height: auto !important;
  overflow: visible !important;
}
.chapter .photo-slot.real figcaption {
  position: static !important;
  background: #142039 !important;
}
.gallery .photo-grid figure img,
.gallery .gallery-extras img {
  max-height: 650px;
  background: #111725;
}
.highlight-photo {
  max-height: 400px !important;
  background: #d8e3f5;
}

/* STOP e Mirko & Raffaele: i riquadri hero non devono
   obbligare le immagini a un'altezza che ne elimina parti. */
.hero-photo,
.hero-photo img {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  aspect-ratio: auto !important;
}
.hero-photo img {
  width: 100% !important;
  display: block !important;
}
.hero-photo {
  overflow: visible !important;
}
.gallery img,
.reunion-photo img {
  aspect-ratio: auto !important;
}

/* CFA: la copertina, le foto di scena e le locandine mantengono
   tutta la composizione, anche nella versione mobile. */
.hero > img {
  object-fit: contain !important;
}
.playlist .playlist-media img,
.playlist-media img,
.video-stage img,
.videocard-thumb img,
.video-tile-photo img {
  object-fit: contain !important;
  object-position: center !important;
}
.gallery-grid img {
  object-fit: contain !important;
}

/* Homepage: card, ritratti, progetti e copertine senza ritagli.
   I contenitori conservano le proporzioni grafiche, aggiungendo
   spazio di fondo quando l'immagine ha forma diversa. */
.portrait-art img,
.past-project-image img,
.cfa-project .past-project-image img,
.project-photo-panel > img,
.vinavil-feature img,
.project-archive img,
.utopia-cover img,
.record-art-real img,
.discography-single-art img,
.discography-single-art > img,
.spotlight-head img,
.release-cover img,
.video-tile-photo img {
  object-fit: contain !important;
  object-position: center !important;
}
.project-archive img {
  max-height: none !important;
}
.past-project-image,
.project-archive,
.photo-gallery figure,
.gallery figure {
  background-color: #111725;
}

/* La galleria non ingrandisce e ritaglia la foto al passaggio del mouse. */
.photo-gallery img:hover,
.gallery img:hover,
.gallery-grid img:hover,
.past-project-image img:hover,
.project-archive img:hover,
.chapter .photo-slot.real img:hover,
.reunion-photo img:hover {
  transform: none !important;
}

/* Altezze che si adattano alla larghezza dello schermo: nessun
   limite verticale ai ritratti storici nella versione mobile. */
@media (max-width: 760px) {
  .photo-gallery {
    grid-template-columns: 1fr !important;
  }
  .photo-gallery img {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
  }
  .hero-image img,
  .hero-photo img,
  .reunion-photo img,
  .chapter .photo-slot.real img,
  .gallery .photo-grid figure img,
  .gallery .gallery-extras img {
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    aspect-ratio: auto !important;
  }
  .hero-photo,
  .chapter .photo-slot.real {
    min-height: 0 !important;
  }
}
