:root {
    --font-ui-ar: 'Amiri', 'Inter', 'Segoe UI', Tahoma, Arial, sans-serif;
    --font-ui-en: 'Inter', 'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif;
    --font-reading-scale: 1;
    --font-reading-ar: 'Amiri', 'Inter', 'Segoe UI', Tahoma, Arial, sans-serif;
}

html,
body {
    font-family: var(--font-ui-ar) !important;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html[lang="en"],
html[lang="en"] body,
body.lang-en,
[lang="en"],
.en {
    font-family: var(--font-ui-en) !important;
}

body {
    font-size: calc(16px * var(--font-reading-scale));
    line-height: 1.9;
    letter-spacing: 0;
}

body, body *:not(i):not(.fa):not([class^="fa-"]):not([class*=" fa-"]) {
    font-family: inherit;
}

h1, h2, h3, h4, h5, h6,
button,
input,
select,
textarea,
label,
.badge,
.nav-link,
.nav-btn,
.dropdown-item,
.ui-title,
.ui-subtitle,
.card-title,
.modal-title,
.table,
.pagination,
.breadcrumb,
.alert,
small,
summary,
.header,
.navbar,
.main-nav,
.footer,
.sidebar,
.menu,
.dropdown-menu,
.mobile-nav,
.admin-btn {
    font-family: var(--font-ui-ar) !important;
}

p, li, td, th, blockquote, figcaption, .content, .article, .fatwa-content, .fatwa-answer, .fatwa-question, .book-description,
.book-content, .book-meta-value, .book-title, .book-breadcrumb,
.fatwa-text, .fatwa-title, .fatwa-section, .fatwa-section-title,
.article-content, .article-content p, .article-content li, .article-content blockquote,
.post-content, .forum-post-content, .page-hero-text, .content-hero-text,
.library-item-desc, .card-text, .soft-card-text, .muted-text,
.mobile-reader, .reader-content, .ui-card-body {
    font-family: var(--font-reading-ar) !important;
}

.book-page-wrap,
.fatwa-page,
.fatwa-details-page,
.article-content,
.book-content,
.fatwa-content,
.fatwa-text,
.content-panel,
.surface-panel {
    font-size: 1.06rem;
}

.book-title,
.fatwa-title,
.page-hero-title,
.content-hero-title,
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
    letter-spacing: 0;
}

.book-description,
.book-content,
.article-content,
.article-content p,
.article-content li,
.fatwa-text,
.fatwa-hero p,
.fatwa-section,
.page-hero-text,
.content-hero-text {
    line-height: 2.05 !important;
}

.book-description,
.book-content,
.article-content,
.fatwa-text {
    font-size: 1.08rem;
}

.book-meta-label,
.meta-chip,
.keyword-chip,
.book-badge,
.results-hint,
.meta,
.book-breadcrumb,
.fatwa-breadcrumb {
    font-weight: 600;
}

.book-content,
.article-content,
.fatwa-text {
    word-break: break-word;
    overflow-wrap: anywhere;
}

input,
select,
textarea,
button {
    font-size: 1rem;
}

::placeholder {
    font-family: var(--font-ui-ar);
}

@media (max-width: 768px) {
    body {
        font-size: 15.75px;
    }

    .book-page-wrap,
    .fatwa-page,
    .fatwa-details-page,
    .article-content,
    .book-content,
    .fatwa-content,
    .fatwa-text,
    .content-panel,
    .surface-panel {
        font-size: 1.1rem;
    }

    .book-description,
    .book-content,
    .article-content,
    .fawa-text,
    .fatwa-text {
        font-size: 1.02rem;
        line-height: 2 !important;
    }
}


html, body {
    font-weight: 600;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 800 !important;
}

body[dir="rtl"],
html[lang="ar"],
html[lang="ar"] body,
[lang="ar"] {
    font-feature-settings: "kern" 1, "liga" 1;
}

body[dir="rtl"] p,
body[dir="rtl"] li,
body[dir="rtl"] td,
body[dir="rtl"] th,
body[dir="rtl"] blockquote,
body[dir="rtl"] .content,
body[dir="rtl"] .article-content,
body[dir="rtl"] .book-content,
body[dir="rtl"] .fatwa-text {
    font-size: 1.12rem;
    line-height: 2.15 !important;
}

body[dir="rtl"] input,
body[dir="rtl"] select,
body[dir="rtl"] textarea,
body[dir="rtl"] button,
body[dir="rtl"] .badge,
body[dir="rtl"] .nav-link,
body[dir="rtl"] .nav-btn {
    font-size: 1rem;
}

@media (max-width: 768px) {
    body[dir="rtl"] p,
    body[dir="rtl"] li,
    body[dir="rtl"] td,
    body[dir="rtl"] th,
    body[dir="rtl"] blockquote,
    body[dir="rtl"] .content,
    body[dir="rtl"] .article-content,
    body[dir="rtl"] .book-content,
    body[dir="rtl"] .fatwa-text {
        font-size: 1.05rem;
        line-height: 2.05 !important;
    }
}
