/* Fancybox: make images fill the viewport height proportionally (no cropping) */

/* v4 (fancyapps/ui) */
.fancybox__slide { padding: 0 !important; }                 /* remove slide padding */
.fancybox__content { background: transparent !important; }  /* no extra background */
.fancybox__image {
  width: auto !important;     /* keep aspect ratio */
  height: 100vh !important;   /* fill viewport height */
  max-height: 100vh !important;
  object-fit: contain;        /* no distortion, no cropping */
}

/* v3 (legacy) */
.fancybox-slide--image { padding: 0 !important; }
.fancybox-slide--image .fancybox-content {
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
}
.fancybox-image {
  width: auto !important;
  height: 100vh !important;
  max-height: 100vh !important;
  object-fit: contain;
}
/* Let this frame grow naturally (no fixed ratio) */
.mil-image-frame.mil-fw.img-autoheight {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  padding: 0 !important;              /* kills ratio padding hack */
  aspect-ratio: auto !important;
  overflow: visible !important;
}

/* Some themes add ratio via pseudo elements — disable them */
.mil-image-frame.mil-fw.img-autoheight::before,
.mil-image-frame.mil-fw.img-autoheight::after {
  content: none !important;
  display: none !important;
}

/* Critical: beat .mil-image-frame > img from style.css */
.mil-image-frame.mil-fw.img-autoheight > img {
  position: static !important;        /* cancel absolute */
  inset: auto !important;
  width: 100% !important;             /* responsive width */
  height: auto !important;            /* no height limit */
  max-height: none !important;
  max-width: none !important;
  object-fit: contain !important;     /* do not crop */
  display: block !important;
}