/*
 * PBE Event Images v1.1.0 — proportional event media on single-event pages.
 * Scoped to the PBE 4-row event template: no homepage, directory, other
 * cards, uploads, global photos, or event content are modified.
 *
 * The legacy PBE single-event template prints a later inline stylesheet with
 * a fixed 470px desktop / 300px mobile image height and object-fit: cover.
 * Use !important narrowly here so original-ratio display wins both versions.
 */

#pbe-single-event .pbe-event-photo-card {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  padding: 0 !important;
  overflow: hidden;
}

#pbe-single-event .pbe-event-photo-card img {
  display: block !important;
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: 640px !important;
  aspect-ratio: auto !important;
  object-fit: contain !important;
  object-position: center !important;
  margin: 0 auto !important;
  vertical-align: middle;
}

/* Remove the template's bottom vignette so flyer text stays legible. */
#pbe-single-event .pbe-event-photo-card::after {
  background: none !important;
}

/* Avoid full-screen tall portrait posters on small screens. */
@media (max-width: 760px) {
  #pbe-single-event .pbe-event-photo-card,
  #pbe-single-event .pbe-event-photo-card img {
    height: auto !important;
    min-height: 0 !important;
  }

  #pbe-single-event .pbe-event-photo-card img {
    max-width: 100% !important;
    max-height: 420px !important;
    width: auto !important;
    object-fit: contain !important;
  }
}
