/* ============================================================
   إذاعة القرآن الكريم — Base
   إعادة ضبط + أساسيات RTL والتايبوغرافي
   يعتمد كليًا على متغيرات tokens.css — لا قيم مطلقة هنا
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  padding-bottom: var(--player-h); /* تفادي تغطية المشغّل الثابت لآخر المحتوى */
}

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

h1, h2, h3, h4, .display {
  font-family: var(--font-display);
  line-height: var(--leading-tight);
  margin: 0 0 var(--space-4);
  font-weight: 500;
}
h1 { font-size: var(--step-4); font-weight: 800; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }
p  { margin: 0 0 var(--space-4); }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }

:lang(en) { font-family: var(--font-latin); }

/* آيات المصحف — خط مصحفي مخصص، لا خط الواجهة أبدًا */
.qr-quran-text {
  font-family: var(--font-quran);
  direction: rtl;
}

/* حالة التركيز الموحّدة — لا تُزال أبدًا عن أي عنصر تفاعلي */
:focus-visible {
  outline: 2px solid var(--qr-gold);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* إخفاء بصري مع بقاء العنصر متاحًا لقارئ الشاشة */
.qr-sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* رابط تخطي إلى المحتوى — أول عنصر قابل للتركيز في الصفحة */
.qr-skip-link {
  position: fixed;
  inset-inline-start: var(--space-4);
  top: var(--space-4);
  transform: translateY(-160%);
  background: var(--qr-ink);
  color: var(--color-on-dark);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  z-index: var(--z-toast);
  transition: top var(--motion-base) var(--easing-standard);
}
.qr-skip-link:focus { transform: translateY(0); }

/* الحد الأدنى لأهداف اللمس — ui-ux-pro-max: touch ≥ 44×44px */
button, a.qr-btn, .qr-icon-btn {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* بلا رابط بث لا يُطبع المشغّل الثابت (footer.php)، فيلغى الحشو الذي كان
   يتفادى تغطيته — وإلا بقي فراغ 76px أسفل كل صفحة بلا سبب. */
body.qr-no-player { padding-bottom: 0; }
