/* ==========================================
   Thmanyah Font Family - @font-face Declarations
   =========================================== */

/* ┌─────────────────────────────────────────┐
   │ THMANYAH SERIF DISPLAY (العناوين)      │
   │ لاستخدام: h1, h2, h3 والعناوين البارزة  │
   └─────────────────────────────────────────┘ */

@font-face {
  font-family: 'Thmanyah Serif Display';
  src: url('fonts/thmanyahserifdisplay/thmanyahserifdisplay-Light.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thmanyah Serif Display';
  src: url('fonts/thmanyahserifdisplay/thmanyahserifdisplay-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thmanyah Serif Display';
  src: url('fonts/thmanyahserifdisplay/thmanyahserifdisplay-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thmanyah Serif Display';
  src: url('fonts/thmanyahserifdisplay/thmanyahserifdisplay-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thmanyah Serif Display';
  src: url('fonts/thmanyahserifdisplay/thmanyahserifdisplay-Black.otf') format('opentype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* ┌─────────────────────────────────────────┐
   │ THMANYAH SERIF TEXT (النصوص)           │
   │ لاستخدام: body, p, span والنصوص العادية │
   └─────────────────────────────────────────┘ */

@font-face {
  font-family: 'Thmanyah Serif Text';
  src: url('fonts/thmanyahseriftext/thmanyahseriftext-Light.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thmanyah Serif Text';
  src: url('fonts/thmanyahseriftext/thmanyahseriftext-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thmanyah Serif Text';
  src: url('fonts/thmanyahseriftext/thmanyahseriftext-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thmanyah Serif Text';
  src: url('fonts/thmanyahseriftext/thmanyahseriftext-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Thmanyah Serif Text';
  src: url('fonts/thmanyahseriftext/thmanyahseriftext-Black.otf') format('opentype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* ==========================================
   GLOBAL FONT ASSIGNMENT
   =========================================== */

/* Headings - Using Thmanyah Serif Display */
h1, h2, h3, h4, h5, h6,
.heading, .title, .hero-title,
.section-title, .card-title {
  font-family: 'Thmanyah Serif Display', serif;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

h1 { font-weight: 700; font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-weight: 700; font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-weight: 600; font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-weight: 600; font-size: clamp(1.25rem, 2.5vw, 1.5rem); }
h5 { font-weight: 500; font-size: clamp(1rem, 2vw, 1.25rem); }
h6 { font-weight: 500; font-size: 1rem; }

/* Body Text - Using Thmanyah Serif Text */
body {
  font-family: 'Thmanyah Serif Text', serif;
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: 0;
}

p, span, a, li,
.text, .description, .body-text,
.content, .article {
  font-family: 'Thmanyah Serif Text', serif;
  line-height: 1.7;
}

/* ==========================================
   UTILITY CLASSES FOR OPENTYPE FEATURES

   ⚠️  CRITICAL RULES (حسب دليل ثمانية):
   - لا تستخدم الكشيدة في النصوص الطويلة
   - لا تستخدم الكشيدة أكثر من مرة في الكلمة
   - استخدم الكشيدة فقط بين آخر حرفين
   - لا تستخدم الخصائص مرتين في الجملة
   =========================================== */

/* Stylistic Alternates - الأحرف المرسلة */
.thmanyah-alt,
.stylistic-alt {
  /* تفعيل الأحرف المرسلة المتناسقة */
  font-feature-settings: "salt" 1;
  /* أو استخدام: font-variant-alternates: stylistic(1); */
}

/* Extended Kashida Utilities - الكشيدة المائلة
   استخدام محدود جداً: العناوين البارزة فقط */

.thmanyah-kashida-1 {
  /* Stylistic Set 1 - fatha-ar 01 */
  font-feature-settings: "ss01" 1;
}

.thmanyah-kashida-2 {
  /* Stylistic Set 2 - fatha-ar 02 */
  font-feature-settings: "ss02" 1;
}

.thmanyah-kashida-3 {
  /* Stylistic Set 3 - fatha-ar 03 */
  font-feature-settings: "ss03" 1;
}

.thmanyah-kashida-4 {
  /* Stylistic Set 4 - fatha-ar 04 */
  font-feature-settings: "ss04" 1;
}

.thmanyah-kashida-5 {
  /* Stylistic Set 5 - fatha-ar 05 */
  font-feature-settings: "ss05" 1;
}

/* Special Combination: Stylistic Alternates + Kashida
   استخدام نادر جداً - للعناوين المهمة فقط */
.thmanyah-premium,
.thmanyah-accent {
  font-feature-settings: "salt" 1, "ss01" 1;
}

/* ==========================================
   TYPOGRAPHY REFINEMENT
   =========================================== */

/* Arabic Typography Adjustments */
html[lang="ar"] {
  direction: rtl;
  text-align: right;
}

/* Prevent text clipping with diacritics */
body, p, span {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-top: 0.2em;
  padding-bottom: 0.2em;
}

/* Line height optimization for Arabic */
p, li, .text-block {
  line-height: 1.75;
  margin-bottom: 1.5em;
}

/* Better spacing for headings with diacritics */
h1, h2, h3, h4, h5, h6 {
  margin-bottom: 0.8em;
  margin-top: 1.2em;
  padding-top: 0.1em;
  padding-bottom: 0.1em;
}

/* ==========================================
   DEVELOPER NOTES & CONSTRAINTS
   =========================================== */

/*
🚨 IMPORTANT RULES - لا تتجاهل:

1. Kashida Rules (قواعد الكشيدة):
   ✗ لا تستخدم .thmanyah-kashida-* في الفقرات الطويلة
   ✗ لا تستخدم الكشيدة أكثر من مرة في نفس الكلمة
   ✓ استخدم الكشيدة فقط بين آخر حرفين (الحرف الأخير والثاني للأخير)
   ✓ استخدم الكشيدة فقط في العناوين والكلمات المهمة

2. Stylistic Alternates Rules (قواعد الأحرف المرسلة):
   ✗ لا تستخدم .thmanyah-alt في كلمات متجاورة
   ✗ لا تستخدمها بكثرة في الجملة الواحدة
   ✓ استخدمها انتقائياً للكلمات المهمة

3. Best Practices:
   ✓ استخدم الخط البسيط (بدون خصائص) للقراءة
   ✓ استخدم الخصائص فقط للعناوين والنصوص البارزة
   ✓ اختبر دائماً على أحجام خطوط مختلفة
   ✓ تأكد من وضوح النصوص قبل التطبيق

4. File Paths:
   اضبط مسارات الخطوط حسب موقع الملفات على السيرفر
   مثال: /assetsfonts/ أو /staticfonts/
*/

/* ==========================================
   COMPONENT-SPECIFIC FONT FIXES
   =========================================== */

/* FAQ Section - Accordion/Toggle Content */
.home-faq-answer,
.home-faq-answer div,
.home-faq-answer p {
  font-family: 'Thmanyah Serif Text', serif !important;
  font-weight: 400;
  line-height: 1.7;
}

/* General accordion/toggle components */
[class*="accordion"] div,
[class*="accordion"] p,
[class*="toggle"] div,
[class*="toggle"] p {
  font-family: 'Thmanyah Serif Text', serif;
}

/* ==========================================
   RESPONSIVE TYPOGRAPHY
   =========================================== */

@media (max-width: 768px) {
  h1 { font-size: clamp(1.5rem, 4vw, 2rem); }
  h2 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
  h3 { font-size: clamp(1rem, 2.5vw, 1.5rem); }

  body, p, span {
    line-height: 1.65;
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  body, p, span {
    line-height: 1.6;
    font-size: 0.9rem;
    letter-spacing: 0.01em;
  }

  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
  h3 { font-size: 1rem; }
}

