/* Authentic photos: never display larger than natural size / 1.25
   (retina iPads/phones look soft at 1 CSS px per source px). Also cap
   height so the whole photo fits one iPad-landscape screen, centered
   over the existing same-photo blurred backdrop. */

#welcome.page{--fh-nat-w:480;--fh-nat-h:640}
#resources.page,#news.page{--fh-nat-w:480;--fh-nat-h:640}
#connect.page,#archive.page,#support.page{--fh-nat-w:640;--fh-nat-h:480}
#photos.page{--fh-nat-w:1200;--fh-nat-h:1600}
.page#magazine-back-cover{--fh-nat-w:360;--fh-nat-h:640}

#welcome.page,#resources.page,#news.page,#connect.page,#photos.page,#archive.page,#support.page,
.page#magazine-back-cover{
  --fh-hdr:var(--magazine-header-height, 128px);
  --fh-avail-w:min(calc(var(--fh-nat-w) * 1px / 1.25), 100vw);
  --fh-avail-h:min(calc(var(--fh-nat-h) * 1px / 1.25), calc(100svh - var(--fh-hdr) - 8px), 85svh);
  --fh-band:min(var(--fh-avail-h), calc(var(--fh-avail-w) * var(--fh-nat-h) / var(--fh-nat-w)));
  --fh-disp-w:min(var(--fh-avail-w), calc(var(--fh-band) * var(--fh-nat-w) / var(--fh-nat-h)));
}

#welcome.page::after,#resources.page::after,#news.page::after,#connect.page::after,
#photos.page::after,#archive.page::after,#support.page::after{
  left:0!important;
  right:0!important;
  width:var(--fh-disp-w)!important;
  height:var(--fh-band)!important;
  max-width:calc(var(--fh-nat-w) * 1px / 1.25)!important;
  max-height:min(calc(var(--fh-nat-h) * 1px / 1.25), calc(100svh - var(--fh-hdr) - 8px), 85svh)!important;
  margin-left:auto!important;
  margin-right:auto!important;
  background-size:100% 100%!important;
  background-repeat:no-repeat!important;
  background-position:50% 50%!important;
  background-color:transparent!important;
  -webkit-mask-image:none!important;
  mask-image:none!important;
}

/* Standalone authentic pages (.photo-gap sharp hero). */
body.fh-auth-full{
  --fh-hdr:var(--fh-header-height, 128px);
  --fh-avail-w:min(calc(var(--fh-nat-w) * 1px / 1.25), 100vw);
  --fh-avail-h:min(calc(var(--fh-nat-h) * 1px / 1.25), calc(100svh - var(--fh-hdr) - 8px), 85svh);
}
html body.fh-auth-full.fh-issue-page .photo-gap,
html body.fh-auth-full.fh-portrait-fit .photo-gap,
html body.fh-auth-full.fh-gc-index .photo-gap,
html body.fh-auth-full.fh-support-page .photo-gap{
  width:min(var(--fh-avail-w), calc(var(--fh-avail-h) * var(--fh-nat-w) / var(--fh-nat-h)))!important;
  height:min(var(--fh-avail-h), calc(var(--fh-avail-w) * var(--fh-nat-h) / var(--fh-nat-w)))!important;
  max-width:calc(var(--fh-nat-w) * 1px / 1.25)!important;
  max-height:min(calc(var(--fh-nat-h) * 1px / 1.25), calc(100svh - var(--fh-hdr) - 8px), 85svh)!important;
  margin-left:auto!important;
  margin-right:auto!important;
  background-size:100% 100%!important;
  background-repeat:no-repeat!important;
  background-position:50% 50%!important;
  background-color:transparent!important;
}

/* Magazine back-cover hero: same cap, contain in the gold frame, blur around. */
.page#magazine-back-cover .bc-hero{
  height:var(--fh-band)!important;
  max-height:min(calc(var(--fh-nat-h) * 1px / 1.25), calc(100svh - var(--fh-hdr) - 8px), 85svh)!important;
}
.page#magazine-back-cover .bc-hero img{
  display:block!important;
  width:var(--fh-disp-w)!important;
  height:var(--fh-band)!important;
  max-width:calc(var(--fh-nat-w) * 1px / 1.25)!important;
  max-height:min(calc(var(--fh-nat-h) * 1px / 1.25), calc(100svh - var(--fh-hdr) - 8px), 85svh)!important;
  object-fit:contain!important;
  object-position:center center!important;
  margin:0 auto!important;
}
