/* Fit editorial frames to each original bitmap. Keep source pixels intact. */
figure:has(> [data-photo-frame]) { --image-max-height: 640px; min-width: 0; }
.event-photo { --image-max-height: 300px !important; }
.event-photo.is-artwork { --image-max-height: 240px !important; }
.member-portrait { --image-max-height: 280px !important; }
.activity-image { --image-max-height: 230px !important; }
.award-image { --image-max-height: 300px !important; }
.dome-artwork { --image-max-height: 240px !important; }
.day2-portrait { --image-max-height: 560px !important; }
.event--reunion .event-photo,
.event--day2 .event-photo,
#event-original-28 .event-photo,
#event-original-57 .event-photo,
#event-kr-20130615-kamiliaawards .event-photo { --image-max-height: 640px !important; }
/* High specificity is intentional: legacy event sheets set image sizes by ID. */
figure > a[data-photo-frame] {
  display: block !important;
  box-sizing: border-box;
  width: min(100%, calc(var(--image-max-height) * var(--image-aspect))) !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid var(--line, #edb99e) !important;
  border-radius: 4px;
  background: transparent !important;
  overflow: hidden;
}
figure > a[data-photo-frame] > img {
  display: block !important;
  box-sizing: border-box;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  aspect-ratio: var(--image-aspect) !important;
  object-fit: contain !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}
figure:has(> [data-photo-frame]) > figcaption {
  margin-top: 9px;
  overflow-wrap: anywhere;
}
figure figcaption > .image-kind-link {
  display: table !important;
  max-width: 100%;
  margin: 0 0 7px !important;
  border: 0 !important;
  text-decoration: none;
}
.image-kind-link > :is(.photo-kind, .award-image-kind) {
  position: static !important;
  display: inline-block;
  padding: 3px 7px;
  border-radius: 2px;
  font-size: 9px;
  line-height: 1.6;
}
.image-kind-link:focus-visible,
figure > a[data-photo-frame]:focus-visible { outline: 2px solid var(--accent, #b75e38); outline-offset: 4px; }
/* Keep the five journey cards aligned, but put each outline on its image.
   In particular, the widescreen reunion teaser should not have a square box. */
.journey-visual {
  background: transparent;
  border: 0;
  overflow: visible;
}
.journey-visual img {
  box-sizing: border-box;
  width: 100%;
  height: auto;
  border: 1px solid var(--line, #edb99e);
  border-radius: 4px;
}
@media (max-width: 760px) {
  .event-photo:not(.is-artwork) { --image-max-height: 400px !important; }
  .member-portrait { --image-max-height: 220px !important; }
  .activity-image { --image-max-height: 220px !important; }
  .award-image { --image-max-height: 400px !important; }
}
