/* Shared portrait frame for directory cards and public practitioner profiles.
   Keep these selectors above the specificity of the legacy photo variants. */
.app-container .psy-directory-card .psy-compact-heading > .psy-compact-photo,
.psy-profile-page .psy-profile-redesign .psy-profile-header-wrap > .psy-profile-photo-lg {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid #dbe5ef;
  border-radius: 8px;
  background: #f0f5fa;
  color: #466185;
  box-shadow: none;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
}
.app-container .psy-directory-card .psy-compact-heading > .psy-compact-photo {
  width: 56px;
  height: 68px;
  flex-basis: 56px;
}
.psy-profile-page .psy-profile-redesign .psy-profile-header-wrap > .psy-profile-photo-lg {
  width: 80px;
  height: 96px;
  flex-basis: 80px;
}
.psy-portrait-preview-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: inherit;
  text-decoration: none;
}
.psy-directory-card .psy-compact-photo[data-photo-preview],
.psy-portrait-preview-trigger { cursor: zoom-in; }
.app-container .psy-directory-card .psy-compact-heading > .psy-compact-photo img,
.psy-profile-page .psy-profile-redesign .psy-profile-photo-lg img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  filter: grayscale(100%) sepia(18%) hue-rotate(170deg) saturate(85%);
  transform: none;
  transition: none;
}
.psy-directory-card .psy-compact-photo [hidden],
.psy-profile-redesign .psy-profile-photo-lg [hidden] { display: none !important; }
.psy-directory-card .psy-compact-photo:focus-visible,
.psy-portrait-preview-trigger:focus-visible {
  outline: 2px solid #0c54cc;
  outline-offset: -2px;
}
@media (max-width: 520px) {
  .psy-profile-page .psy-profile-redesign .psy-profile-header-wrap {
    grid-template-columns: 64px minmax(0, 1fr);
  }
  .psy-profile-page .psy-profile-redesign .psy-profile-header-wrap > .psy-profile-photo-lg {
    width: 64px;
    height: 80px;
    flex-basis: 64px;
  }
}

/* Native dialog: keyboard focus stays inside; Escape closes the portrait. */
.psy-photo-viewer {
  box-sizing: border-box;
  width: min(720px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  padding: 12px;
  border: 1px solid #dbe5ef;
  border-radius: 14px;
  background: #ffffff;
  color: #243645;
  box-shadow: 0 16px 60px #123e8233;
}
.psy-photo-viewer[open] { display: grid; gap: 8px; }
.psy-photo-viewer::backdrop { background: rgba(15, 23, 42, 0.65); }
.psy-photo-viewer-close {
  justify-self: end;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #dbe5ef;
  border-radius: 8px;
  background: #f0f5fa;
  color: #243645;
  cursor: pointer;
  font: inherit;
}
.psy-photo-viewer-close:focus-visible { outline: 2px solid #0c54cc; outline-offset: 2px; }
.psy-photo-viewer-image {
  display: block;
  width: 100%;
  height: min(70vh, 640px);
  object-fit: contain;
  filter: none;
  border-radius: 8px;
  background: #f5f8fc;
}
.psy-photo-viewer [hidden] { display: none !important; }
.psy-photo-viewer-error { padding: 24px; text-align: center; }
body.psy-photo-viewer-open { overflow: hidden; }
