/* ===========================================================================
 *  تحسينات عامة لكل صفحات الموقع
 * ---------------------------------------------------------------------------
 *  صفحات الموقع تكتب تنسيقها داخلها، فلم يكن هناك ملف مشترك يجمع القواعد
 *  الأساسية. هذا الملف يُحمَّل في كل صفحة عبر head_tags().
 * ========================================================================= */

/* ---------- ١) وضوح التركيز لمستخدمي لوحة المفاتيح ----------
   لم يكن هناك أي مؤشّر تركيز، فيستحيل تصفّح الموقع بلوحة المفاتيح
   (يهم من لا يستطيع استخدام الفأرة، ومن يتصفّح بسرعة بمفتاح Tab). */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid #f59e0b;
    outline-offset: 3px;
    border-radius: 8px;
}

/* ---------- ٢) رابط "تخطَّ إلى المحتوى" ----------
   يظهر عند الضغط على Tab أول مرة فقط. */
.skip-link {
    position: absolute;
    inset-inline-start: 1rem;
    inset-block-start: -100px;
    z-index: 10000;
    background: #006837;
    color: #fff;
    padding: .7rem 1.2rem;
    border-radius: 0 0 10px 10px;
    font-weight: 700;
    text-decoration: none;
    transition: inset-block-start .2s ease;
}
.skip-link:focus { inset-block-start: 0; }

/* ---------- ٣) الصور: لا تتجاوز حاويتها أبداً ---------- */
img { max-inline-size: 100%; block-size: auto; }

/* ---------- ٤) لا سكرول أفقي للصفحة ---------- */
html, body { max-inline-size: 100%; overflow-x: hidden; }

/* ---------- ٥) تحسين قراءة النص العربي ---------- */
body { text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }

/* ---------- ٦) الأزرار المعطّلة تبدو معطّلة ---------- */
button:disabled, [disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- ٧) تمرير ناعم عند الانتقال إلى مرساة ---------- */
@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
}

/* ---------- ٨) تصحيح تباين الألوان الضعيفة ----------
   بعض ألوان النصوص كانت فاتحة أكثر من اللازم فوق خلفية بيضاء، فتقلّ نسبة
   التباين عن الحد المطلوب (4.5:1) ويصعب قراءتها — خصوصاً على شاشات الهواتف
   في الضوء الساطع، ولمن لديه ضعف بصر أو عمى ألوان.
   القياسات قبل التصحيح:  emerald-600 = 3.58 | rose-600 = 4.00 | green-600 = 3.30
   ------------------------------------------------------------------------ */
.text-emerald-600 { color: #047857 !important; }   /* emerald-700 → 4.9:1  */
.text-rose-600    { color: #be123c !important; }   /* rose-700    → 5.3:1  */
.text-green-600   { color: #15803d !important; }   /* green-700   → 4.7:1  */
.text-amber-500   { color: #b45309 !important; }   /* amber-700   → 4.6:1  */
.text-sky-500     { color: #0369a1 !important; }   /* sky-700     → 4.8:1  */

/* زر واتساب ذو الإطار: كان نصّه الأخضر بنسبة 3.30 فقط */
.btn-outline-green { color: #15803d !important; border-color: #15803d !important; }
.btn-outline-green:hover { background-color: #15803d !important; color: #fff !important; }

/* ---------- ٩) الطباعة: إخفاء ما لا يلزم ---------- */
@media print {
    header, footer, nav, .pt-bar, button, .modal { display: none !important; }
    body { background: #fff !important; color: #000 !important; }
    a[href]::after { content: " (" attr(href) ")"; font-size: .85em; color: #555; }
}
