/*!
 * مدد — الأساسيات (base.css)
 * الخط المحلي (Readex Pro)، الطباعة، الروابط، التركيز، إمكانية الوصول، وقواعد البروتوتايب العامة.
 * بيعتمد على tokens.css وبيتحمّل بعد Bootstrap.
 */

/* ===== الخط: Readex Pro (محلي، OFL — D25-18، 2026-10-23) =====
   خط واجهات متغيّر الوزن (400–700) بملف واحد لكل نطاق حروف: عربي، لاتيني، لاتيني موسّع.
   اختير لأرقامه الواضحة (الأوقات والمبالغ وأرقام الملفات) وتناسق حروفه العربية واللاتينية وراحته بالقراءة الطويلة. */
@font-face {
  font-family: "Readex Pro";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/ReadexPro-Arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "Readex Pro";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/ReadexPro-Latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Readex Pro";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/ReadexPro-LatinExt.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ===== الصفحة ===== */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--jb-header-h) + var(--sp-4));
}

body {
  font-family: var(--jb-font);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--jb-text);
  background-color: var(--jb-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--jb-font);
  line-height: var(--lh-heading);
  font-weight: 700;
  color: var(--jb-text);
  letter-spacing: 0;
  text-wrap: balance;
}
/* بالإنجليزي فقط: تضييق خفيف للعناوين (ممنوع بالعربي لأنه بيكسر اتصال الحروف) */
html[lang="en"] :is(h1, h2, .h1, .h2) { letter-spacing: -.02em; }

h1, .h1 { font-size: var(--fs-h1); }
h2, .h2 { font-size: var(--fs-h2); }
h3, .h3 { font-size: var(--fs-h3); }

p { margin-block-end: var(--sp-4); text-wrap: pretty; }

/* بالإنجليزي: ارتفاع سطر أقل شوي */
html[lang="en"] body { --lh-body: 1.6; }

img, svg, video, picture { max-width: 100%; height: auto; }
img { display: block; }

a {
  color: var(--jb-primary);
  text-underline-offset: .2em;
  transition: color var(--mo-fast) var(--mo-ease);
}
a:hover { color: var(--jb-primary-hover); }

::selection {
  background: rgba(var(--jb-primary-rgb), .22);
  color: var(--jb-text);
}

/* ===== التركيز المرئي ===== */
:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--jb-primary);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* ===== رابط تخطي إلى المحتوى ===== */
.jb-skip-link {
  position: absolute;
  inset-inline-start: var(--sp-4);
  top: -100px;
  z-index: 2000;
  padding: var(--sp-2) var(--sp-4);
  background: var(--jb-primary);
  color: var(--jb-on-primary);
  border-radius: var(--r-md);
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--sh-md);
  transition: top var(--mo-fast) var(--mo-ease);
}
.jb-skip-link:focus,
.jb-skip-link:focus-visible {
  top: var(--sp-3);
  color: var(--jb-on-primary);
}

/* ===== أدوات عامة ===== */
.jb-ltr { direction: ltr; unicode-bidi: isolate; }
.jb-nowrap { white-space: nowrap; }
.jb-muted { color: var(--jb-text-muted); }

/* الأيقونات الاتجاهية ما بتنعكس لحالها — 10.5 */
[dir="rtl"] .bi-arrow-left,
[dir="rtl"] .bi-arrow-right,
[dir="rtl"] .bi-chevron-left,
[dir="rtl"] .bi-chevron-right,
[dir="rtl"] .bi-arrow-left-short,
[dir="rtl"] .bi-arrow-right-short,
[dir="rtl"] .bi-box-arrow-right,
[dir="rtl"] .bi-box-arrow-left,
[dir="rtl"] .jb-flip-rtl {
  display: inline-block;
  transform: scaleX(-1);
}

.bi { line-height: 1; vertical-align: -.125em; }

/* ===== الترجمة: إخفاء لحظي لحد ما تخلص (boot.js + core.js) ===== */
html[data-i18n-pending] body { visibility: hidden; }

/* ===== التجربة المجانية: إظهار/إخفاء حسب الإعداد (FR-AUTH-04) ===== */
html[data-trial="off"] [data-jb-trial] { display: none !important; }
html:not([data-trial="off"]) [data-jb-trial-alt] { display: none !important; }

/* ===== تقليل الحركة ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
