/* ==========================================================================
   FarsKids – تصاویر «اندازه کامل» داخل نوشته‌ها
   وسط‌چین • نسبت برش حداکثر 828×1092 (عرض نمایش کمی کمتر) • گوشه‌های گرد
   برش فقط با object-fit انجام می‌شود (فایل اصلی دست‌نخورده و بدون افت کیفیت).
   متغیرها را می‌شود از تنظیمات یا بالای همین فایل تغییر داد.
   ========================================================================== */
:root{
  --fk-img-max-w:600px;
  --fk-img-ratio-w:828;
  --fk-img-ratio-h:1092;
  --fk-img-radius:14px;
}

/* لینک تصویر: یک ردیف کامل‌عرض که تصویر را وسط می‌گذارد (flex + justify-content:center).
   این روش مستقل از display قبلی لینک در قالب (inline-flex) و جهت RTL کار می‌کند.
   فقط خود تصویر قابل کلیک است، نه دو طرف خالی. */
html body a.fk-img-link,
html body a:has(> img.fk-img-full){
  display:flex !important;
  justify-content:center !important;
  align-items:flex-start !important;
  width:100% !important;
  max-width:100% !important;
  margin:1.1em 0 !important;
  padding:0 !important;
  float:none !important;
  border:0 !important;
  outline:0 !important;
  box-shadow:none !important;
  background:none !important;
  line-height:0 !important;
  text-align:center !important;
  overflow:visible !important;
  pointer-events:none;
  -webkit-tap-highlight-color:transparent;
}

html body a.fk-img-link img.fk-img-full,
html body img.fk-img-full{
  display:block !important;
  width:min(var(--fk-w,var(--fk-img-max-w)),var(--fk-img-max-w)) !important;
  max-width:100% !important;
  height:auto !important;
  /* پشتیبان برای وقتی که ابعاد تصویر معلوم نیست */
  max-height:calc(var(--fk-img-max-w) * var(--fk-img-ratio-h) / var(--fk-img-ratio-w)) !important;
  margin:0 auto !important;
  flex:0 0 auto !important;
  pointer-events:auto;
  cursor:zoom-in;
  float:none !important;
  object-fit:cover !important;
  object-position:center center !important;
  border:0 !important;
  outline:0 !important;
  box-shadow:none !important;
  border-radius:var(--fk-img-radius) !important;
  image-rendering:auto;
}

/* قاب‌های وردپرس (بلوک تصویر / عنوان کلاسیک) هم وسط و بدون شناور شدن */
html body figure:has(> a.fk-img-link),
html body figure:has(> img.fk-img-full),
html body .wp-caption:has(a.fk-img-link){
  float:none !important;
  display:block !important;
  width:auto !important;
  max-width:100% !important;
  margin:1.2em auto !important;
  text-align:center !important;
  overflow:visible !important;
}
html body figure:has(a.fk-img-link) > figcaption,
html body .wp-caption:has(a.fk-img-link) .wp-caption-text{
  text-align:center !important;
  margin-top:.5em;
  line-height:1.8;
}
html body p:has(> a.fk-img-link:only-child),
html body p:has(> a > img.fk-img-full:only-child){ text-align:center !important; margin-block:0 !important; }
