/* One restrained, centered portrait preview on mobile and on profile desktop. */
.doctor-profile-page-section .doctor-reference-avatar img[data-doctor-photo-preview] { cursor: zoom-in; }
@media (max-width: 991.98px), (max-width: 1199.98px) and (pointer: coarse) {
    .doctor-page-section .directory-avatar img[data-doctor-photo-preview] { cursor: zoom-in; }
}
img[data-doctor-photo-preview][role="button"]:focus-visible {
    outline: 3px solid #2477dc;
    outline-offset: 2px;
}
html.doctor-photo-preview-open,
body.doctor-photo-preview-open { overflow: hidden; }
.doctor-photo-preview-overlay {
    position: fixed;
    inset: 0;
    z-index: 11000;
    display: grid;
    place-items: center;
    padding: 24px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 240ms ease, visibility 240ms;
}
.doctor-photo-preview-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.doctor-photo-preview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 24, 42, .62);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}
.doctor-photo-preview-dialog {
    position: relative;
    z-index: 1;
    width: min(76vw, 320px);
    max-width: calc(100vw - 48px);
    max-height: calc(100vh - 64px);
    max-height: calc(100dvh - 64px);
    box-sizing: border-box;
    border-radius: 16px;
    background: #f2f4f7;
    box-shadow: 0 22px 70px rgba(0, 0, 0, .28);
    opacity: 0;
    transform: translateY(12px) scale(.97);
    transition: transform 260ms cubic-bezier(.2, .8, .2, 1), opacity 220ms ease;
}
.doctor-photo-preview-overlay.is-open .doctor-photo-preview-dialog {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.doctor-photo-preview-photo {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: calc(100vh - 64px);
    max-height: calc(100dvh - 64px);
    object-fit: contain;
    border-radius: inherit;
}
.doctor-photo-preview-close {
    position: absolute;
    top: -12px;
    inset-inline-end: -12px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: #25364c;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .2);
    cursor: pointer;
    font: 26px/1 sans-serif;
}
.doctor-photo-preview-close:focus-visible {
    outline: 3px solid #2477dc;
    outline-offset: 3px;
}
@media (min-width: 992px) and (pointer: fine), (min-width: 992px) and (pointer: none), (min-width: 1200px) {
    .doctor-photo-preview-dialog { width: min(36vw, 360px); }
}
@media (max-height: 460px) {
    .doctor-photo-preview-dialog { width: min(56vh, 260px); }
}
@media (prefers-reduced-motion: reduce) {
    .doctor-photo-preview-overlay,
    .doctor-photo-preview-dialog { transition: none; }
    .doctor-photo-preview-dialog { transform: none; }
}

/* Profile portraits and opened photo previews: clip a highlight independently of the
   clickable image, availability badge and dialog close button. */
.doctor-profile-page-section .doctor-reference-avatar > .doctor-profile-photo-shine,
.doctor-photo-preview-overlay.is-open .doctor-photo-preview-dialog > .doctor-profile-photo-shine {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    overflow: hidden;
    pointer-events: none;
}
.doctor-profile-page-section .doctor-reference-avatar > .doctor-profile-photo-shine::before,
.doctor-photo-preview-overlay.is-open .doctor-photo-preview-dialog > .doctor-profile-photo-shine::before {
    content: "";
    position: absolute;
    inset: -50%;
    background: linear-gradient(45deg, transparent 38%, rgba(255, 255, 255, .30) 50%, transparent 51%);
    transform: translate(-75%, 75%);
    animation: doctor-profile-photo-shine 3s linear infinite;
}
/* Travel from bottom-left to top-right, then rest offscreen until the next cycle. */
@keyframes doctor-profile-photo-shine {
    0% { transform: translate(-75%, 75%); }
    42%, 100% { transform: translate(75%, -75%); }
}
@media (prefers-reduced-motion: reduce) {
    .doctor-profile-photo-shine { display: none !important; }
    .doctor-profile-photo-shine::before { animation: none !important; }
}
