/* Shared portrait geometry. Keep the original files and the complete top edge. */
.gppk-person-grid {
  align-items: stretch;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}
.gppk-person-card { min-width: 0; }
.gppk-person-card > .gppk-person-card__body { flex: 1 1 auto; min-width: 0; }

/* Explicit wrappers also reserve the same space for the existing initials. */
.gppk-person-card > .ggc-person-portrait,
.gppk-person-card > .relative.aspect-square,
.gppk-person-card > .gprh-person-portrait,
.gppk-person-card > .gppw-person-portrait,
.gppk-person-card > .gppk-content-image-link {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: 4 / 5 !important;
  flex: 0 0 auto;
  overflow: hidden;
}
.ggc-person-portrait > img,
.gppk-person-card > .relative.aspect-square > img,
.gppk-person-card > .gprh-person-portrait > img,
.gppk-person-card > .gppw-person-portrait > img,
.gppk-person-card > .gppk-content-image-link > img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  aspect-ratio: auto !important;
  object-fit: cover !important;
  object-position: 50% 0% !important;
}

/* Older editable people sections may render the image directly on the card. */
.gppk-person-card > img.gppk-person-card__image,
.gppk-person-card > img.gprh-pro-portrait,
.gppk-person-card > img.gppw-pro-portrait {
  display: block;
  width: 100%;
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: 4 / 5 !important;
  object-fit: cover !important;
  object-position: 50% 0% !important;
  flex: 0 0 auto;
}
.gppk-person-card:has(> .gppk-person-card__body:first-child)::before {
  content: "";
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  flex: 0 0 auto;
}

/* A group photograph must retain the people at both edges as well. */
.gppk-person-card img[src*="Bilder-neu-Vorstand-und-Beirat"] {
  object-fit: contain !important;
  object-position: 50% 0% !important;
}

/* Youth contact cards use the same portrait treatment within their split layout. */
.ggc-person-split > img.ggc-person-split__image {
  display: block;
  width: 100%;
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: 4 / 5;
  object-fit: cover !important;
  object-position: 50% 0% !important;
  align-self: start;
}
