/*
 * Public people portraits: preserve the complete uploaded image.
 * Kept separate from gallery/news imagery and dashboard avatars.
 */
.teacher-reference-summary__grid > .teacher-reference-photo {
  align-self: center;
  justify-self: end;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 440px;
  height: auto;
  min-height: 0;
  max-height: none;
  padding: 12px;
  box-sizing: border-box;
  border: 1px solid #dbe3eb;
  border-radius: 20px;
  background: #f3f6f8;
  box-shadow: 0 8px 24px rgba(8, 29, 52, .08);
}

.teacher-reference-photo > img {
  position: static;
  inset: auto;
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: 560px;
  aspect-ratio: auto;
  object-fit: contain;
  object-position: center;
  border-radius: 12px;
}

/* Same card, separate row: never cover a face with a long designation. */
.teacher-reference-photo > .teacher-reference-badge {
  position: static;
  align-self: center;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
  line-height: 1.5;
}

.regulatory-profile-photo {
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: auto;
  padding: 12px;
  box-sizing: border-box;
  border-radius: 16px;
  background: #f3f6f8;
}

.regulatory-profile-photo > img {
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: 560px;
  aspect-ratio: auto;
  object-fit: contain;
  object-position: center;
  border-radius: 10px;
}

.profile-card:not(.profile-card--detail-media) > img {
  height: auto;
  max-height: 560px;
  aspect-ratio: auto;
  object-fit: contain;
  object-position: center;
  background: #f3f6f8;
}

/* Equal-height archive cards, with the whole portrait inside each frame. */
.collection-page--staffs .cpt-card-media,
.collection-page--it-staffs .cpt-card-media,
.collection-page--regulatory-bodies .cpt-card-media,
.collection-page--administration .cpt-card-media,
.teacher-card__image img,
.department-teacher-card__image img,
.hod-card__image img,
.teacher-profile-photo img,
.verification-photo {
  object-fit: contain !important;
  object-position: center !important;
  background: #f3f6f8;
}

.home-message-photo {
  border-radius: 12px;
  background: #f3f6f8;
}
.home-message-photo img {
  object-fit: contain;
  object-position: center;
}

@media (max-width: 760px) {
  .teacher-reference-summary__grid > .teacher-reference-photo {
    justify-self: center;
    max-width: 380px;
  }
  .regulatory-profile-photo {
    max-width: 380px;
    margin-inline: auto;
  }
  .teacher-reference-photo > img,
  .regulatory-profile-photo > img,
  .profile-card:not(.profile-card--detail-media) > img {
    max-height: 480px;
  }
}
