/* ====================================
   تعريف الخطوط - Font Faces
   ==================================== */

/* ===== خطوط الأيقونات ===== */
@font-face {
    font-family: 'MarsadIcons';
    src: url('../fonts/MarsadIcons.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* ===== الخطوط الرئيسية للعناوين ===== */

/* Tajawal - للعناوين الثقيلة والبارزة */
@font-face {
    font-family: 'Tajawal';
    src: url('../fonts/Tajawal-Black.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
}

@font-face {
    font-family: 'Tajawal';
    src: url('../fonts/Tajawal-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'Tajawal';
    src: url('../fonts/Tajawal-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'Tajawal';
    src: url('../fonts/Tajawal-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Tajawal';
    src: url('../fonts/Tajawal-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
}

/* ===== الخطوط الثانوية للفقرات والمحتوى ===== */

/* Cairo - للمحتوى الرئيسي */
@font-face {
    font-family: 'Cairo';
    src: url('../fonts/Cairo-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

/* JannaLT - خط عربي حديث وسهل القراءة */
@font-face {
    font-family: 'JannaLT';
    src: url('../fonts/JannaLT-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'JannaLT';
    src: url('../fonts/JannaLT-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

/* GE SS Two - للعناوين الثانوية والأقسام */
@font-face {
    font-family: 'GE_SS_Two';
    src: url('../fonts/GE_SS_TWO_MEDIUM.OTF') format('opentype');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'GE_SS_Two';
    src: url('../fonts/GE SS TWO BOLD.OTF') format('opentype');
    font-weight: 700;
    font-style: normal;
}

/* Hacen Liner - للتفاصيل والبيانات الصغيرة */
@font-face {
    font-family: 'HacenLiner';
    src: url('../fonts/Hacen_Liner_Screen.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'HacenLiner';
    src: url('../fonts/Hacen_Liner_Screen_Bd.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

/* ===== خطوط إنجليزية أساسية ===== */

/* Roboto - للنصوص الإنجليزية */
@font-face {
    font-family: 'Roboto';
    src: url('../fonts/Roboto-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}

/* Helvetica World - كبديل إنجليزي */
@font-face {
    font-family: 'HelveticaWorld';
    src: url('../fonts/HelveticaWorld-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'HelveticaWorld';
    src: url('../fonts/helvetica-world-bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

/* ===== متغيرات الخطوط (CSS Variables) ===== */
:root {
    /* خط الأيقونات */
    --font-icons: 'MarsadIcons', sans-serif;
    
    /* خطوط العناوين الرئيسية */
    --font-title-primary: 'Tajawal', 'Cairo', sans-serif;
    --font-title-secondary: 'GE_SS_Two', 'Tajawal', sans-serif;
    
    /* خطوط المحتوى */
    --font-body-primary: 'Cairo', 'JannaLT', sans-serif;
    --font-body-secondary: 'JannaLT', 'Cairo', sans-serif;
    
    /* خطوط التفاصيل */
    --font-details: 'HacenLiner', 'Cairo', sans-serif;
    
    /* خطوط إنجليزية */
    --font-english: 'Roboto', 'HelveticaWorld', sans-serif;
}

/* ===== تطبيق الخطوط على العناصر ===== */

/* العناوين الرئيسية (H1) */
h1,
.main-title,
.article-title-pro {
    font-family: var(--font-title-primary);
    font-weight: 900;
    font-size: 42px;
    line-height: 1.3;
}

/* العناوين الثانوية (H2) */
h2,
.section-title,
.comments-title {
    font-family: var(--font-title-secondary);
    font-weight: 700;
    font-size: 28px;
    line-height: 1.4;
}

/* العناوين الثالثة (H3) */
h3,
.article-subtitle {
    font-family: var(--font-title-secondary);
    font-weight: 600;
    font-size: 22px;
    line-height: 1.45;
}

/* العناوين الرابعة (H4) */
h4 {
    font-family: var(--font-title-secondary);
    font-weight: 600;
    font-size: 18px;
    line-height: 1.5;
}

/* الفقرات والمحتوى الرئيسي */
body,
p,
.article-text-pro,
.news-card-text,
.comment-text {
    font-family: var(--font-body-primary);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.95;
}

/* المحتوى في الكروت */
.card-title,
.news-card-title {
    font-family: var(--font-title-secondary);
    font-weight: 700;
    font-size: 18px;
}

.card-description,
.news-card-snippet {
    font-family: var(--font-body-primary);
    font-weight: 400;
    font-size: 15px;
    line-height: 1.6;
}

/* البيانات الصغيرة والتفاصيل */
.meta-info,
.date-badge,
.comments-count-pro,
.views-badge,
.source-name-pro,
small {
    font-family: var(--font-details);
    font-weight: 500;
    font-size: 13px;
}

/* الأزرار والعناصر التفاعلية */
button,
.btn,
.btn-primary,
.share-btn-pro,
.read-source-btn-pro {
    font-family: var(--font-title-secondary);
    font-weight: 700;
    font-size: 14px;
}

/* روابط التنقل */
.nav-link,
a.breadcrumb {
    font-family: var(--font-body-secondary);
    font-weight: 600;
    font-size: 15px;
}

/* الأيقونات - استخدام خط MarsadIcons */
.icon,
[class*="icon-"],
.breadcrumb::before,
.date-badge::before,
.views-badge::before,
.share-btn-pro::before,
.read-source-btn-pro::before {
    font-family: var(--font-icons) !important;
    font-weight: normal;
    font-style: normal;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Inputs والحقول */
input,
textarea,
select,
.comment-form input,
.comment-form textarea {
    font-family: var(--font-body-primary);
    font-size: 14px;
    font-weight: 400;
}

/* الأكواد والبرمجيات */
code,
pre,
.code-block {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    font-weight: 400;
}

/* العناوين في رؤوس الصفحات */
.page-header-title {
    font-family: var(--font-title-primary);
    font-weight: 900;
    font-size: 48px;
}

/* تحسينات الوضوح */
@supports (font-feature-settings: normal) {
    body {
        font-feature-settings: "kern" 1;
    }
    
    h1, h2, h3, h4, h5, h6 {
        font-feature-settings: "kern" 1;
        text-rendering: optimizeLegibility;
    }
}

/* نسخة داكنة - تحسين الوضوح في الأيقونات */
[data-theme="dark"] .icon,
[data-theme="dark"] [class*="icon-"] {
    opacity: 1;
}

/* ===== Responsive Typography ===== */

/* شاشات صغيرة (Mobile) */
@media (max-width: 768px) {
    h1,
    .main-title,
    .article-title-pro {
        font-size: 32px;
    }
    
    h2,
    .section-title {
        font-size: 24px;
    }
    
    h3,
    .article-subtitle {
        font-size: 20px;
    }
    
    body,
    p,
    .article-text-pro {
        font-size: 15px;
    }
    
    .card-title,
    .news-card-title {
        font-size: 16px;
    }
    
    .page-header-title {
        font-size: 36px;
    }
}

/* شاشات كبيرة جداً (Desktop+) */
@media (min-width: 1400px) {
    h1,
    .main-title,
    .article-title-pro {
        font-size: 48px;
    }
    
    h2,
    .section-title {
        font-size: 32px;
    }
    
    body,
    p,
    .article-text-pro {
        font-size: 17px;
        line-height: 2;
    }
}
