/**
 * M9 App-ready — Blueprint §3 (92–97٪) · §4.4 لمس · §4.5 حركة.
 * قشرة فقط: لا سياسة محتوى · يُحمَّل آخر السلسلة ليغلب الأسطح.
 */

/* 1) منع أي overflow أفقي — `clip` تحديداً: `hidden` يكسر sticky الهيدر */
html,
body {
  overflow-x: clip;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

img,
svg,
video,
canvas,
iframe,
embed,
object {
  max-width: 100%;
}

.jf-main pre,
.jf-main code {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.jf-main table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

/* روابط طويلة داخل المحتوى لا تمدّ العمود */
.jf-main a[href^="http"] {
  overflow-wrap: anywhere;
}

/* 2) أهداف لمس ≥ 44×44 دون تضخيم بصري */
a,
button,
[role="button"],
input,
select,
textarea {
  -webkit-tap-highlight-color: rgba(227, 0, 15, 0.12);
}

.jf-icon-btn {
  position: relative;
  min-width: 36px;
  min-height: 36px;
}

.jf-icon-btn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--jf-touch, 44px);
  height: var(--jf-touch, 44px);
  transform: translate(-50%, -50%);
}

.jf-btn {
  min-height: 36px;
}

.jf-dock__item {
  min-height: var(--jf-touch, 44px);
}

/* 3) iOS لا يقرّب الشاشة عند التركيز على حقل (<16px) */
@supports (-webkit-touch-callout: none) {
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea {
    font-size: 16px;
  }
}

/* 4) احترام تقليل الحركة */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* 5) سطح المكتب: الـ dock هو التنقّل الوحيد بين الأقسام — يبقى، لكن كشريط عائم متمركز */
@media (min-width: 1024px) {
  .jf-dock {
    inset-inline: auto;
    left: 50%;
    transform: translateX(-50%);
    bottom: 12px;
    width: min(var(--jf-max, 720px), calc(100% - 2rem));
    border: 1px solid var(--jf-border);
    border-radius: var(--jf-radius-pill, 999px);
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.14);
    overflow: hidden;
  }

  body.has-jf-dock {
    padding-bottom: calc(var(--jf-dock-h, 58px) + 24px);
  }

  .jf-ad--sticky_bottom {
    bottom: calc(var(--jf-dock-h, 58px) + 20px);
  }
}

/* 6) لا بانر لاصق يزاحم شريط إرسال نموذج */
body.has-jf-ads-submit-bar .jf-ad--sticky_bottom,
body.has-jf-biz-submit-bar .jf-ad--sticky_bottom {
  display: none;
}

/* 7) لوحات منسدلة لا تُمرِّر التمرير للصفحة (pull-to-refresh يبقى للصفحة) */
.jf-chat-drawer,
.jf-search-panel {
  overscroll-behavior: contain;
}
