/* TicketsFest Ukraine v9.9.96: adaptive event posters without artwork cropping. */

/* Keep every event grid aligned while fitting the complete poster inside it. */
.tfe-instance .tfe-card-inner {
  aspect-ratio: 4 / 5 !important;
  background: #0f172a !important;
}

.tfe-instance .tfe-card-inner > img.tfe-poster {
  position: relative !important;
  inset: auto !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  aspect-ratio: auto !important;
  object-fit: contain !important;
  object-position: center center !important;
  background: #0f172a !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  transform: none !important;
}

/* Event rows shown inside a tour use the same no-crop rule. */
body.single-tour .tfe-event-img {
  background: #0f172a !important;
}

body.single-tour .tfe-event-img img {
  object-fit: contain !important;
  object-position: center center !important;
}

/* The main event page follows the source image ratio instead of forcing 4:5. */
body.single-event .tfe-page-wrapper > .tfe-hero .tfe-poster--adaptive {
  width: 100% !important;
  max-width: 400px !important;
  height: auto !important;
  aspect-ratio: auto !important;
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  justify-self: center !important;
  flex-shrink: 0 !important;
  margin-inline: auto !important;
  overflow: hidden !important;
  border-radius: 16px !important;
  background: #0f172a !important;
}

body.single-event .tfe-page-wrapper > .tfe-hero .tfe-poster--adaptive > .tfe-poster__image {
  position: static !important;
  inset: auto !important;
  display: block !important;
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: min(680px, 72vh) !important;
  aspect-ratio: auto !important;
  object-fit: contain !important;
  object-position: center center !important;
  margin: 0 auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  transform: none !important;
}

@media (max-width: 768px) {
  body.single-event .tfe-page-wrapper > .tfe-hero .tfe-poster--adaptive {
    width: min(82vw, 360px) !important;
    max-width: 360px !important;
    margin: 0 auto 22px !important;
    border-radius: 22px !important;
  }

  body.single-event .tfe-page-wrapper > .tfe-hero .tfe-poster--adaptive > .tfe-poster__image {
    max-height: min(620px, 68vh) !important;
  }
}
