
/* ==========================================================
   Metin2 Featured Image Fixer
   Never upscale small images; classify by intrinsic ratio.
   ========================================================== */

img.m2fif-featured{
  display:block!important;
  width:auto!important;
  height:auto!important;
  max-width:100%!important;
  margin-left:auto!important;
  margin-right:auto!important;
  object-fit:contain!important;
  border-radius:6px;
}

/* Portrait / NPC / character cutouts */
img.m2fif-featured.m2fif-portrait{
  max-height:var(--m2fif-portrait-h,340px)!important;
  width:auto!important;
}

/* Square or nearly-square illustrations */
img.m2fif-featured.m2fif-square{
  max-height:var(--m2fif-square-h,420px)!important;
  width:auto!important;
}

/* Standard article landscape image */
img.m2fif-featured.m2fif-landscape{
  max-width:min(100%,var(--m2fif-landscape-w,860px))!important;
  max-height:var(--m2fif-landscape-h,480px)!important;
  width:auto!important;
}

/* Very wide screenshots/banners */
img.m2fif-featured.m2fif-wide{
  max-width:min(100%,var(--m2fif-wide-w,970px))!important;
  max-height:420px!important;
  width:auto!important;
}

/* Critical: low resolution source images must not be stretched */
img.m2fif-featured.m2fif-tiny{
  max-width:min(100%,var(--m2fif-tiny-w,360px))!important;
  width:auto!important;
}

/* Theme wrappers */
.single-post .m2-single-cover,
.single-post .m2-post-cover,
.single-post .post-thumbnail,
.single-post .wp-block-post-featured-image{
  width:100%;
  max-width:100%!important;
  text-align:center;
  overflow:visible!important;
}

.single-post .m2-single-cover img.m2fif-featured,
.single-post .m2-post-cover img.m2fif-featured,
.single-post .post-thumbnail img.m2fif-featured,
.single-post .wp-block-post-featured-image img.m2fif-featured{
  margin:18px auto 28px!important;
}

/* Elementor */
.single-post .elementor-widget-theme-post-featured-image{
  text-align:center!important;
}

.single-post .elementor-widget-theme-post-featured-image img.m2fif-featured,
.single-post .elementor-widget-image img.m2fif-featured{
  margin-left:auto!important;
  margin-right:auto!important;
}

/* Infinite Next Post */
.m2inp-post img.m2fif-featured,
.m2inp-cover img.m2fif-featured{
  margin-left:auto!important;
  margin-right:auto!important;
  object-fit:contain!important;
}

@media(max-width:900px){
  img.m2fif-featured.m2fif-portrait{max-height:min(var(--m2fif-portrait-h,340px),300px)!important}
  img.m2fif-featured.m2fif-square{max-height:min(var(--m2fif-square-h,420px),360px)!important}
  img.m2fif-featured.m2fif-landscape{max-width:92%!important;max-height:400px!important}
  img.m2fif-featured.m2fif-wide{max-width:96%!important;max-height:340px!important}
}

@media(max-width:620px){
  img.m2fif-featured.m2fif-portrait{max-height:260px!important}
  img.m2fif-featured.m2fif-square{max-height:300px!important}
  img.m2fif-featured.m2fif-landscape{max-width:100%!important;max-height:320px!important}
  img.m2fif-featured.m2fif-wide{max-width:100%!important;max-height:260px!important}
  img.m2fif-featured.m2fif-tiny{max-width:min(100%,300px)!important}
}
