/* Cairo Font Implementation for Arabic Website */

/* Base Font Family - Apply to all elements EXCEPT icon fonts */
*:not([class*="fa-"]):not(.fa):not([class*="icon-"]):not(.dashicons):not(.dashicons-before):not([class*="glyphicon"]) {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
}

/* Body and HTML */
html,
body {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
    font-weight: 400;
    line-height: 1.6;
}

/* All Headings */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.site-title,
.widget-title,
.entry-title,
.page-title,
.post-title {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
    font-weight: 600;
}

/* Paragraphs and Text Elements */
p:not([class*="fa"]):not([class*="icon"]),
span:not([class*="fa"]):not([class*="icon"]),
div:not([class*="fa"]):not([class*="icon"]),
a:not([class*="fa"]):not([class*="icon"]),
li:not([class*="fa"]):not([class*="icon"]),
td, th, label,
input:not([class*="fa"]):not([class*="icon"]),
textarea, select,
button:not([class*="fa"]):not([class*="icon"]),
i:not([class*="fa"]):not([class*="icon"]):not(.dashicons) {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
}

/* Navigation Menus */
.menubar,
.menu-wrap,
.nav-menu,
.navigation,
.navbar,
.menu,
.primary-navigation,
nav {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
}

.menubar a,
.menu-wrap a,
.nav-menu a,
.navigation a,
.navbar a,
.menu a,
nav a {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
    font-weight: 500;
}

/* Form Elements */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="range"],
input[type="date"],
input[type="month"],
input[type="week"],
input[type="time"],
input[type="datetime"],
input[type="datetime-local"],
input[type="color"],
textarea,
select {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
    font-weight: 400;
}

/* Buttons */
button,
.button,
.btn,
input[type="button"],
input[type="reset"],
input[type="submit"],
.wp-block-button__link {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
    font-weight: 500;
}

/* WordPress Specific Elements */
.entry-content,
.entry-summary,
.widget,
.sidebar,
.footer,
.header,
.site-header,
.site-footer,
.site-content,
.wp-block-group,
.wp-block-column,
.wp-block-columns {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
}

/* WooCommerce Elements */
.woocommerce,
.woocommerce-page,
.product,
.shop,
.cart,
.checkout {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
}

/* Gutenberg Blocks */
.wp-block-heading,
.wp-block-paragraph,
.wp-block-list,
.wp-block-quote,
.wp-block-cover__inner-container,
.wp-block-button,
.wp-block-group {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
}

/* Contact Form Elements */
.wpforms-form,
.wpforms-field,
.wpforms-field-label,
.wpforms-field-description,
.wpforms-submit {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
}

/* Footer Elements */
.footer-widget,
.footer-content,
.copyright,
.footer-menu {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
}

/* Theme Specific Classes */
.fiona-blog-content,
.theme-content,
.main-content,
.content-area,
.post-content,
.page-content {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
}

/* Arabic Text Optimization */
[lang="ar"],
[dir="rtl"],
.arabic-text {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
    font-feature-settings: "liga" 1, "kern" 1;
    text-rendering: optimizeLegibility;
}

/* Breadcrumbs */
.breadcrumb,
.breadcrumbs,
.breadcrumb-trail {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
    font-weight: 400;
}

/* Mobile Responsive Font Adjustments */
@media (max-width: 768px) {
    *:not([class*="fa-"]):not(.fa):not([class*="icon-"]):not(.dashicons):not(.dashicons-before):not([class*="glyphicon"]) {
        font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
    }
}

/* Admin Bar */
#wpadminbar,
#wpadminbar *:not([class*="dashicons"]) {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
}

/* Preserve Icon Fonts - FontAwesome and others - CRITICAL - DO NOT OVERRIDE */
[class*="fa-"],
.fa,
[class*="icon-"],
.dashicons,
.dashicons-before,
[class*="glyphicon"],
i[class*="fa"],
i[class*="icon"],
.fa-search,
.fa-share-alt,
.fa-flash,
.fa-bookmark-o,
.fa-bolt,
.fa-calendar,
.fa-clock-o,
i.fa,
span.fa,
em.fa,
.fa::before,
[class*="fa-"]::before,
[class*="icon-"]::before,
i[class*="fa"]::before,
span[class*="fa"]::before {
    font-family: 'FontAwesome' !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-transform: none !important;
    line-height: 1 !important;
    speak: none !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* Ensure all <i> tags with fa classes use FontAwesome */
i.fa,
i[class*="fa-"],
span.fa,
span[class*="fa-"],
em.fa,
em[class*="fa-"] {
    font-family: 'FontAwesome' !important;
}