/**
 * Arabic Fonts CSS - Doran & Paykan
 * 
 * This file contains @font-face declarations for Arabic fonts
 * Doran: Used for headings (h1, h2, h3, h4, h5, h6)
 * Paykan: Used for body text (p, a, span, div, etc.)
 * 
 * @package Abajora
 */

/* ========================================
   DORAN FONT FAMILY (FOR HEADINGS)
======================================== */

@font-face {
    font-family: 'Doran';
    src: url('../fonts/doran/Doran-Thin.otf') format('opentype');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}

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

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

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

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

@font-face {
    font-family: 'Doran';
    src: url('../fonts/doran/Doran-ExtraBold.otf') format('opentype');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

/* ========================================
   PAYKAN FONT FAMILY (FOR BODY TEXT)
======================================== */

@font-face {
    font-family: 'Paykan';
    src: url('../fonts/paykan/Paykan-Thin.otf') format('opentype');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}

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

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

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

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

@font-face {
    font-family: 'Paykan';
    src: url('../fonts/paykan/Paykan-ExtraBlack.otf') format('opentype');
    font-weight: 950;
    font-style: normal;
    font-display: swap;
}

/* ========================================
   ARABIC LANGUAGE STYLING
======================================== */

/* Apply Arabic fonts when Arabic language is active */
html[lang="ar"],
html[lang="ar-SA"],
body.lang-ar,
.lang-ar {
    
    /* Headings use Doran font */
    h1, h2, h3, h4, h5, h6,
    .h1, .h2, .h3, .h4, .h5, .h6,
    .heading,
    .title,
    .card-title,
    .product_title,
    .woocommerce-loop-product__title {
        font-family: 'Doran', Arial, sans-serif !important;
        direction: rtl;
        text-align: right;
    }
    
    /* Body text uses Paykan font */
    body,
    p, a, span, div, li, td, th,
    input, textarea, select, button,
    .description,
    .content,
    .text,
    .price,
    .woocommerce .price,
    .woocommerce-product-details__short-description,
    .woocommerce form label,
    .woocommerce table,
    .woocommerce-message,
    .woocommerce-info,
    .woocommerce-error {
        font-family: 'Paykan', Arial, sans-serif !important;
        direction: rtl;
        text-align: right;
    }
    
    /* RTL layout adjustments */
    direction: rtl;
    text-align: right;
}

/* ========================================
   SPECIFIC COMPONENT STYLING FOR ARABIC
======================================== */

/* Navigation menu in Arabic */
html[lang="ar"] .header ul li,
html[lang="ar"] .mobile-header ul li,
body.lang-ar .header ul li,
body.lang-ar .mobile-header ul li {
    font-family: 'Paykan', Arial, sans-serif !important;
}

/* Footer in Arabic */
html[lang="ar"] .footer,
html[lang="ar"] .mobile-footer,
body.lang-ar .footer,
body.lang-ar .mobile-footer {
    direction: rtl;
    text-align: right;
}

html[lang="ar"] .footer *,
html[lang="ar"] .mobile-footer *,
body.lang-ar .footer *,
body.lang-ar .mobile-footer * {
    font-family: 'Paykan', Arial, sans-serif !important;
}

/* Buttons in Arabic */
html[lang="ar"] .button,
html[lang="ar"] .btn,
html[lang="ar"] button,
html[lang="ar"] input[type="submit"],
body.lang-ar .button,
body.lang-ar .btn,
body.lang-ar button,
body.lang-ar input[type="submit"] {
    font-family: 'Paykan', Arial, sans-serif !important;
}

/* Forms in Arabic */
html[lang="ar"] form,
html[lang="ar"] input,
html[lang="ar"] textarea,
html[lang="ar"] select,
body.lang-ar form,
body.lang-ar input,
body.lang-ar textarea,
body.lang-ar select {
    font-family: 'Paykan', Arial, sans-serif !important;
    direction: rtl;
    text-align: right;
}

/* WooCommerce specific Arabic styling */
html[lang="ar"] .woocommerce,
html[lang="ar"] .woocommerce-page,
body.lang-ar .woocommerce,
body.lang-ar .woocommerce-page {
    direction: rtl;
}

html[lang="ar"] .woocommerce .products,
html[lang="ar"] .woocommerce ul.products,
body.lang-ar .woocommerce .products,
body.lang-ar .woocommerce ul.products {
    direction: rtl;
}

html[lang="ar"] .woocommerce .product,
html[lang="ar"] .woocommerce li.product,
body.lang-ar .woocommerce .product,
body.lang-ar .woocommerce li.product {
    text-align: right;
}

/* Podcast pages in Arabic */
html[lang="ar"] .podcast,
html[lang="ar"] .single-podcast,
body.lang-ar .podcast,
body.lang-ar .single-podcast {
    direction: rtl;
}

html[lang="ar"] .podcast .card-title,
html[lang="ar"] .single-podcast .title,
body.lang-ar .podcast .card-title,
body.lang-ar .single-podcast .title {
    font-family: 'Doran', Arial, sans-serif !important;
    text-align: right;
}

/* Services pages in Arabic */
html[lang="ar"] .services,
html[lang="ar"] .single-service,
body.lang-ar .services,
body.lang-ar .single-service {
    direction: rtl;
}

/* ========================================
   RESPONSIVE ADJUSTMENTS FOR ARABIC
======================================== */

@media (max-width: 768px) {
    html[lang="ar"] .mobile-header,
    body.lang-ar .mobile-header {
        direction: rtl;
    }
    
    html[lang="ar"] .mobile-header .navigate,
    body.lang-ar .mobile-header .navigate {
        flex-direction: row-reverse;
    }
    
    html[lang="ar"] .mobile-list,
    body.lang-ar .mobile-list {
        text-align: right;
    }
}

/* ========================================
   FALLBACK FOR NON-ARABIC LANGUAGES
======================================== */

/* Ensure English and other languages use default fonts */
html:not([lang="ar"]):not([lang="ar-SA"]) body:not(.lang-ar) {
    font-family: 'Readex Pro', sans-serif;
    direction: ltr;
    text-align: left;
}

html:not([lang="ar"]):not([lang="ar-SA"]) body:not(.lang-ar) h1,
html:not([lang="ar"]):not([lang="ar-SA"]) body:not(.lang-ar) h2,
html:not([lang="ar"]):not([lang="ar-SA"]) body:not(.lang-ar) h3,
html:not([lang="ar"]):not([lang="ar-SA"]) body:not(.lang-ar) h4,
html:not([lang="ar"]):not([lang="ar-SA"]) body:not(.lang-ar) h5,
html:not([lang="ar"]):not([lang="ar-SA"]) body:not(.lang-ar) h6 {
    font-family: inherit;
    direction: ltr;
    text-align: left;
}

/* ========================================
   PERFORMANCE OPTIMIZATIONS
======================================== */

/* Preload critical Arabic fonts */
html[lang="ar"] body::before,
html[lang="ar-SA"] body::before,
body.lang-ar::before {
    content: '';
    font-family: 'Doran';
    font-weight: 400;
    visibility: hidden;
    position: absolute;
    left: -9999px;
}

html[lang="ar"] body::after,
html[lang="ar-SA"] body::after,
body.lang-ar::after {
    content: '';
    font-family: 'Paykan';
    font-weight: 400;
    visibility: hidden;
    position: absolute;
    left: -9999px;
}

/* ========================================
   ACCESSIBILITY IMPROVEMENTS
======================================== */

/* Improve readability for Arabic text */
html[lang="ar"],
html[lang="ar-SA"],
body.lang-ar {
    line-height: 1.8; /* Increased line height for Arabic */
    letter-spacing: 0.02em; /* Slight letter spacing */
}

html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3,
html[lang="ar"] h4, html[lang="ar"] h5, html[lang="ar"] h6,
body.lang-ar h1, body.lang-ar h2, body.lang-ar h3,
body.lang-ar h4, body.lang-ar h5, body.lang-ar h6 {
    line-height: 1.4; /* Tighter line height for headings */
    letter-spacing: 0.01em;
}

/* ========================================
   PRINT STYLES FOR ARABIC
======================================== */

@media print {
    html[lang="ar"],
    html[lang="ar-SA"],
    body.lang-ar {
        font-family: 'Paykan', Arial, sans-serif !important;
        direction: rtl !important;
    }
    
    html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3,
    html[lang="ar"] h4, html[lang="ar"] h5, html[lang="ar"] h6,
    body.lang-ar h1, body.lang-ar h2, body.lang-ar h3,
    body.lang-ar h4, body.lang-ar h5, body.lang-ar h6 {
        font-family: 'Doran', Arial, sans-serif !important;
    }
}

