/* Cover focal points are specific to each original artwork. */
.mg-homepage-topic-v2 img[src="/assets/works/S01.webp"]{object-position:50% top}
.mg-course-slide[href="/courses/foundation"]{background-position:65% top}
.mg-course-slide[href="/courses/portrait"]{background-position:50% top}
.mg-course-slide[href="/courses/character"]{background-position:95% top}
.mg-course-slide[href="/courses/software"]{background-position:60% top}
.mg-course-slide[href="/courses/line"]{background-position:76% top}

/* A detail page is for inspecting the artwork, not cropping a second cover. */
.jh-course-detail>img{height:auto;max-height:680px;object-fit:contain;object-position:center;background:#101113}
.jh-profile-works .jh-work-card>img,.jh-topic-works .jh-work-card>img{display:block;width:100%;height:auto;object-fit:contain}
/* Team-page thumbnails fill their mosaic; the viewer still shows the full artwork. */
.jh-staff-block .mg-image-gallery .mg-staff-work-item{overflow:hidden;background:transparent}
.jh-staff-block .mg-image-gallery .mg-staff-work-item>img{display:block;width:100%;height:100%;object-fit:cover;object-position:50% 22%;background:transparent}
.jh-staff-block .mg-image-gallery .mg-staff-work-item>img[src*="/T06"]{object-position:76% top}
.jh-staff-block .mg-image-gallery .mg-staff-work-item>img[src*="/T30"]{object-position:95% top}
.jh-staff-block .mg-image-gallery .mg-staff-work-item>img[src*="/T42"]{object-position:50% top}
.jh-staff-block .mg-image-gallery .mg-staff-work-item>img[src*="/T12"]{object-position:60% top}

/* Consistent circular portraits; keep supplied avatar art and its focal point. */
.mg-staff-card .headimg,.jh-staff-block .info>img.headimg,.jh-profile-heading>img{
 aspect-ratio:1;flex-shrink:0;border-radius:50%;overflow:hidden;box-sizing:border-box;
 border:3px solid #fff;outline:1px solid #00000018;object-fit:cover;
}
.mg-staff-card .headimg{position:static;inset:auto;transform:none;width:88px;height:88px;margin:0 20px 0 0;align-self:center}
.mg-staff-card .headimg>img{display:block;width:100%;height:100%;object-fit:cover;border-radius:50%}
.mg-staff-card .headimg .mask{display:none}
.mg-staff-card .wrapper>div:first-child{align-items:center}
.jh-staff-block .info>img.headimg{width:104px;height:104px;margin-right:32px}
.jh-profile-heading>img{width:144px;height:144px}
.jh-work-teacher-avatar,.jh-viewer-teacher-avatar{aspect-ratio:1;box-sizing:border-box;object-fit:cover}

/* Reserve room for controls and author information, even on short mobile screens. */
#mg-img-viewer{height:100vh;height:100dvh;max-height:100dvh}
#mg-img-viewer .modal,#mg-img-viewer .modal.no-desc{height:100%;padding:64px 76px 20px;box-sizing:border-box}
#mg-img-viewer .detail-wrap{display:flex;flex-direction:column;align-items:center;width:100%;height:100%;max-width:1600px;min-height:0}
#mg-img-viewer .detail-wrap .img-detail-wrap{display:flex;flex:1 1 0%;min-height:0;width:100%;align-items:center;justify-content:center}
#mg-img-viewer .img-detail{display:block;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;object-position:center}
#mg-img-viewer .img-desc{position:static;flex:none;box-sizing:border-box;width:100%;height:auto;min-height:56px;max-height:25%;overflow-y:auto;margin-top:12px;padding:8px 0;background:transparent}
#mg-img-viewer .img-desc p{line-height:1.5}
#mg-img-viewer .img-close{top:12px;right:16px;bottom:auto;width:40px;height:40px;padding:10px;box-sizing:border-box;background:#292b2e;opacity:1}
#mg-img-viewer .img-close img{width:20px;height:20px}
#mg-img-viewer .arrow-wrap{z-index:2;pointer-events:none}
#mg-img-viewer .img-arrow{pointer-events:auto;opacity:1}
@media(max-width:1023px){
 .mg-staff-card .wrapper>div:first-child{padding:8px 20px;gap:16px}
 .mg-staff-card .headimg{width:64px;height:64px;margin:0;border-width:2px}
 .mg-staff-card .headimg+div{padding-left:0;min-width:0}
 .jh-staff-block .info>img.headimg{width:64px;height:64px;margin:0;border-width:2px}
 .jh-profile-heading>img{width:96px;height:96px;border-width:2px}
 .jh-course-detail>img{max-height:70vh}
 #mg-img-viewer .modal,#mg-img-viewer .modal.no-desc{padding:60px 40px max(16px,env(safe-area-inset-bottom))}
 #mg-img-viewer .img-desc{margin-top:10px;min-height:52px}
 #mg-img-viewer .img-close{top:max(10px,env(safe-area-inset-top));right:12px}
 #mg-img-viewer .arrow-wrap{bottom:70px}
}
@media(max-width:380px){.mg-staff-card .wrapper>div:first-child{padding-inline:12px;gap:12px}.mg-staff-card .headimg{width:56px;height:56px}}
.jh-topic-card[href="/topics/student"]>img{object-position:50% 38%}
.jh-topic-card[href="/topics/character"]>img{object-position:50% 25%}
.jh-topic-card[href="/topics/portrait"]>img{object-position:50% 20%}

