/* Frontend Prose Content Fix - Ensures CMS inline styles take precedence */
/* FONT ENFORCEMENT: Only Montserrat and Noto Naskh Arabic allowed */

/* Reset any potential Quill/editor CSS conflicts */
.prose.article-content p:not(.ql-editor p) {
    /* Reset any editor defaults */
    text-align: inherit;
    font-size: inherit;
    line-height: inherit;
    margin: inherit;
}

/* CRITICAL: Let inline styles from CMS take natural precedence EXCEPT font-family */
/* Note: text-align, font-size, and color inline styles are respected naturally */

/* OVERRIDE: Force Montserrat for all elements regardless of CMS inline styles */
.prose.article-content * {
    font-family: "Montserrat", sans-serif !important;
}

/* CRITICAL EXCEPTION: Font Awesome icons must use their own fonts */
.fas, .far, .fab, .fal, .fad, .fa,
[class*="fa-"]:before,
.fa:before,
.fas:before,
.far:before,
.fab:before,
.fal:before,
.fad:before,
i.fas, i.far, i.fab, i.fal, i.fad, i.fa {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 6 Brands", "FontAwesome" !important;
}

/* EXCEPTION: Allow Noto Naskh Arabic for Arabic text only */
.prose.article-content .arabic-text,
.prose.article-content [lang="ar"] {
    font-family: "Noto Naskh Arabic", serif !important;
}

/* Default styling ONLY when no inline style exists */
.prose.article-content p:not([style*="text-align"]) {
    text-align: justify; /* Default if you want justified text */
}

.prose.article-content h1:not([style*="text-align"]),
.prose.article-content h2:not([style*="text-align"]),
.prose.article-content h3:not([style*="text-align"]),
.prose.article-content h4:not([style*="text-align"]),
.prose.article-content h5:not([style*="text-align"]),
.prose.article-content h6:not([style*="text-align"]) {
    text-align: left; /* Default heading alignment */
}

/* Quill/Jodit alignment classes - only if no inline styles */
.prose.article-content .ql-align-left:not([style*="text-align"]) {
    text-align: left;
}

.prose.article-content .ql-align-center:not([style*="text-align"]) {
    text-align: center;
}

.prose.article-content .ql-align-right:not([style*="text-align"]) {
    text-align: right;
}

.prose.article-content .ql-align-justify:not([style*="text-align"]) {
    text-align: justify;
}

/* Arabic text handling - enforced styling */
.prose.article-content
    .arabic-text:not([style*="text-align"]):not([style*="direction"]) {
    direction: rtl;
    text-align: right;
}

.prose.article-content .arabic-text:not([style*="line-height"]) {
    line-height: 1.6;
}

/* Font size defaults - only when no inline styles */
.prose.article-content p:not([style*="font-size"]) {
    font-size: 16px;
}

/* Ensure all headings use Montserrat */
.prose.article-content h1,
.prose.article-content h2,
.prose.article-content h3,
.prose.article-content h4,
.prose.article-content h5,
.prose.article-content h6 {
    font-family: "Montserrat", sans-serif !important;
}

/* Ensure all text elements use Montserrat */
.prose.article-content p,
.prose.article-content span,
.prose.article-content div,
.prose.article-content li,
.prose.article-content td,
.prose.article-content th,
.prose.article-content blockquote,
.prose.article-content strong,
.prose.article-content em,
.prose.article-content b,
.prose.article-content i {
    font-family: "Montserrat", sans-serif !important;
}

.prose.article-content h2 {
    font-family: "Montserrat", sans-serif !important;
}

.prose.article-content h2:not([style*="color"]) {
    color: #0047b2;
}

.prose.article-content h2:not([style*="font-size"]) {
    font-size: 18px;
}

.prose.article-content h2:not([style*="font-weight"]) {
    font-weight: bold;
}

.prose.article-content h2:not([style*="margin-top"]) {
    margin-top: 30px;
}

.prose.article-content h2:not([style*="margin-bottom"]) {
    margin-bottom: 15px;
}

/* Note: Inline styles for non-font properties win naturally without !important */

/* List styling that respects inline styles */
.prose.article-content ul:not([style*="list-style-type"]) {
    list-style-type: disc;
}

.prose.article-content ol:not([style*="list-style-type"]) {
    list-style-type: decimal;
}

/* Table styling that respects inline styles */
.prose.article-content table:not([style*="border"]) {
    border-collapse: collapse;
    border: 1px solid #e5e7eb;
}

.prose.article-content td:not([style*="padding"]),
.prose.article-content th:not([style*="padding"]) {
    padding: 8px 12px;
}

.prose.article-content th:not([style*="background"]) {
    background: #f9fafb;
}

/* Link styling that respects inline styles */
.prose.article-content a:not([style*="color"]) {
    color: #3b82f6;
}

.prose.article-content a:not([style*="text-decoration"]) {
    text-decoration: underline;
}

/* Image styling that respects inline styles */
.prose.article-content img:not([style*="max-width"]) {
    max-width: 100%;
}

.prose.article-content img:not([style*="height"]) {
    height: auto;
}

/* Blockquote styling that respects inline styles */
.prose.article-content blockquote:not([style*="border-left"]) {
    border-left: 4px solid #10b981;
}

.prose.article-content blockquote:not([style*="background"]) {
    background: #f0fdf4;
}

.prose.article-content blockquote:not([style*="padding"]) {
    padding: 1rem 1.5rem;
}

.prose.article-content blockquote:not([style*="margin"]) {
    margin: 1.5rem 0;
}

/* Code styling that respects inline styles */
.prose.article-content code:not([style*="background"]) {
    background: #f3f4f6;
}

.prose.article-content code:not([style*="color"]) {
    color: #374151;
}

.prose.article-content code:not([style*="padding"]) {
    padding: 0.125rem 0.25rem;
}

.prose.article-content code:not([style*="border-radius"]) {
    border-radius: 0.25rem;
}

.prose.article-content pre:not([style*="background"]) {
    background: #1f2937;
}

.prose.article-content pre:not([style*="color"]) {
    color: #f9fafb;
}

.prose.article-content pre:not([style*="padding"]) {
    padding: 1rem;
}

.prose.article-content pre:not([style*="border-radius"]) {
    border-radius: 0.5rem;
}

.prose.article-content pre:not([style*="overflow-x"]) {
    overflow-x: auto;
}

/* GLOBAL FONT ENFORCEMENT FOR POST SHOW PAGE */
/* Override any CMS font-family inline styles with Montserrat */
.prose.article-content [style*="font-family"] {
    font-family: "Montserrat", sans-serif !important;
}

/* Special handling for Arabic text - override even inline styles */
.prose.article-content [style*="font-family"].arabic-text,
.prose.article-content [style*="font-family"][lang="ar"] {
    font-family: "Noto Naskh Arabic", serif !important;
}

/* Ensure entire post page uses Montserrat */
.min-h-screen {
    font-family: "Montserrat", sans-serif;
}

/* Override any potential framework defaults */
.container * {
    font-family: inherit;
}

/* Specific overrides for common CMS font families */
.prose.article-content [style*="Arial"],
.prose.article-content [style*="Helvetica"],
.prose.article-content [style*="Times"],
.prose.article-content [style*="Georgia"],
.prose.article-content [style*="Verdana"],
.prose.article-content [style*="Tahoma"],
.prose.article-content [style*="Calibri"],
.prose.article-content [style*="sans-serif"],
.prose.article-content [style*="serif"] {
    font-family: "Montserrat", sans-serif !important;
}

/* Preserve Arabic fonts only */
.prose.article-content [style*="Noto Naskh Arabic"],
.prose.article-content [style*="Arabic"] {
    font-family: "Noto Naskh Arabic", serif !important;
}

/* This rule is already covered above - removed to avoid duplication */

/* Re-apply Arabic exception with higher specificity */
.prose.article-content .arabic-text * {
    font-family: "Noto Naskh Arabic", serif !important;
}

.prose.article-content [lang="ar"] * {
    font-family: "Noto Naskh Arabic", serif !important;
}
/* FONT AWESOME ICON FIX - Highest Priority */
/* Ensure Font Awesome icons always use their proper fonts */
.fas, .far, .fab, .fal, .fad, .fa,
i[class*="fa-"],
i.fas, i.far, i.fab, i.fal, i.fad, i.fa,
span[class*="fa-"],
span.fas, span.far, span.fab, span.fal, span.fad, span.fa {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
}

/* Brand icons */
.fab, i.fab, span.fab {
    font-family: "Font Awesome 6 Brands" !important;
    font-weight: 400 !important;
}

/* Regular icons */
.far, i.far, span.far {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 400 !important;
}

/* Ensure pseudo-elements for icons work */
[class*="fa-"]:before,
.fa:before,
.fas:before,
.far:before,
.fab:before,
.fal:before,
.fad:before {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: inherit !important;
}

/* Override any Montserrat enforcement for icons */
* [class*="fa-"],
* .fas, * .far, * .fab, * .fal, * .fad, * .fa {
    font-family: "Font Awesome 6 Free" !important;
}