/* =========================================================================
   IRANSansX Official Typography System for Plato (Website, Blog, Admin & Tiptap)
   Fonts:
   - Regular (400, 500, normal): IRANSansX-Regular_0de11b.woff
   - Bold (600, 700, 800, 900, bold): IRANSansX-Bold_0bfdb4.woff
   - Light / Thin / Variable (100 - 300): IRANSansXV_b680a9.woff
   ========================================================================= */

/* Light / Thin / Variable (100 - 300) */
@font-face {
    font-family: 'IRANSansX';
    font-style: normal;
    font-weight: 100 300;
    font-display: swap;
    src: url('../fonts/IRANSansXV_b680a9.woff') format('woff-variations'),
         url('../fonts/IRANSansXV_b680a9.woff') format('woff'),
         url('/fonts/IRANSansXV_b680a9.woff') format('woff');
}

@font-face {
    font-family: 'IRANSansX';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url('../fonts/IRANSansXV_b680a9.woff') format('woff'),
         url('/fonts/IRANSansXV_b680a9.woff') format('woff');
}

/* Regular (400 - 500, normal) */
@font-face {
    font-family: 'IRANSansX';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/IRANSansX-Regular_0de11b.woff') format('woff'),
         url('/fonts/IRANSansX-Regular_0de11b.woff') format('woff');
}

@font-face {
    font-family: 'IRANSansX';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/IRANSansX-Regular_0de11b.woff') format('woff'),
         url('/fonts/IRANSansX-Regular_0de11b.woff') format('woff');
}

@font-face {
    font-family: 'IRANSansX';
    font-style: normal;
    font-weight: normal;
    font-display: swap;
    src: url('../fonts/IRANSansX-Regular_0de11b.woff') format('woff'),
         url('/fonts/IRANSansX-Regular_0de11b.woff') format('woff');
}

/* Bold (600 - 900, bold) */
@font-face {
    font-family: 'IRANSansX';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/IRANSansX-Bold_0bfdb4.woff') format('woff'),
         url('/fonts/IRANSansX-Bold_0bfdb4.woff') format('woff');
}

@font-face {
    font-family: 'IRANSansX';
    font-style: normal;
    font-weight: bold;
    font-display: swap;
    src: url('../fonts/IRANSansX-Bold_0bfdb4.woff') format('woff'),
         url('/fonts/IRANSansX-Bold_0bfdb4.woff') format('woff');
}

@font-face {
    font-family: 'IRANSansX';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/IRANSansX-Bold_0bfdb4.woff') format('woff'),
         url('/fonts/IRANSansX-Bold_0bfdb4.woff') format('woff');
}

@font-face {
    font-family: 'IRANSansX';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url('../fonts/IRANSansX-Bold_0bfdb4.woff') format('woff'),
         url('/fonts/IRANSansX-Bold_0bfdb4.woff') format('woff');
}

@font-face {
    font-family: 'IRANSansX';
    font-style: normal;
    font-weight: 900;
    font-display: swap;
    src: url('../fonts/IRANSansX-Bold_0bfdb4.woff') format('woff'),
         url('/fonts/IRANSansX-Bold_0bfdb4.woff') format('woff');
}

/* Explicit Variable Font Family */
@font-face {
    font-family: 'IRANSansXV';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/IRANSansXV_b680a9.woff') format('woff-variations'),
         url('../fonts/IRANSansXV_b680a9.woff') format('woff'),
         url('/fonts/IRANSansXV_b680a9.woff') format('woff');
}

/* Explicit Bold Family */
@font-face {
    font-family: 'IRANSansX-Bold';
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
    src: url('../fonts/IRANSansX-Bold_0bfdb4.woff') format('woff'),
         url('/fonts/IRANSansX-Bold_0bfdb4.woff') format('woff');
}

/* Backward-compatible aliasing: map legacy IRANYekanDigits and iranyekan to IRANSansX */
@font-face {
    font-family: 'IRANYekanDigits';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/IRANSansX-Regular_0de11b.woff') format('woff'),
         url('/fonts/IRANSansX-Regular_0de11b.woff') format('woff');
}

@font-face {
    font-family: 'IRANYekanDigits';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url('../fonts/IRANSansXV_b680a9.woff') format('woff'),
         url('/fonts/IRANSansXV_b680a9.woff') format('woff');
}

@font-face {
    font-family: 'IRANYekanDigits';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/IRANSansX-Bold_0bfdb4.woff') format('woff'),
         url('/fonts/IRANSansX-Bold_0bfdb4.woff') format('woff');
}

@font-face {
    font-family: 'iranyekan';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/IRANSansX-Regular_0de11b.woff') format('woff'),
         url('/fonts/IRANSansX-Regular_0de11b.woff') format('woff');
}

@font-face {
    font-family: 'iranyekan';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/IRANSansX-Bold_0bfdb4.woff') format('woff'),
         url('/fonts/IRANSansX-Bold_0bfdb4.woff') format('woff');
}

/* =========================================================================
   Global Root Typography for Website, Blog & Admin
   ========================================================================= */
html[dir="rtl"],
html[dir="rtl"] body,
html[lang="fa"] body,
html[lang="ar"] body,
.rtl {
    font-family: 'IRANSansX', 'IRANSansXV', sans-serif !important;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =========================================================================
   Localized Digits Typography System for Website, Blog & Admin
   - Persian (fa): IRANSansX OpenType 'ss02' feature (۰ ۱ ۲ ۳ ۴ ۵ ۶ ۷ ۸ ۹)
   - English (en) & Arabic (ar): Standard numerals / Native Arabic Unicode
   ========================================================================= */
html[lang="fa"],
html[lang="fa"] body,
html[lang="fa"] p,
html[lang="fa"] h1,
html[lang="fa"] h2,
html[lang="fa"] h3,
html[lang="fa"] h4,
html[lang="fa"] h5,
html[lang="fa"] h6,
html[lang="fa"] span,
html[lang="fa"] a,
html[lang="fa"] li,
html[lang="fa"] td,
html[lang="fa"] th,
html[lang="fa"] b,
html[lang="fa"] strong,
html[lang="fa"] label,
html[lang="fa"] .badge,
html[lang="fa"] .label,
html[lang="fa"] .btn,
html[lang="fa"] .price,
html[lang="fa"] .pagination,
html[lang="fa"] .pagination *,
html[lang="fa"] .article-content,
html[lang="fa"] .entry-content,
html[lang="fa"] .product-card,
html[lang="fa"] .m3-blog-card {
    font-feature-settings: "ss02" 1 !important;
    -webkit-font-feature-settings: "ss02" 1 !important;
    -moz-font-feature-settings: "ss02" 1 !important;
}

/* LTR / Technical Exclusions for Persian */
html[lang="fa"] code,
html[lang="fa"] code *,
html[lang="fa"] pre,
html[lang="fa"] pre *,
html[lang="fa"] kbd,
html[lang="fa"] samp,
html[lang="fa"] input[type="password"],
html[lang="fa"] input[type="email"],
html[lang="fa"] input[type="url"],
html[lang="fa"] input[name*="slug"],
html[lang="fa"] input[name*="url"],
html[lang="fa"] input[name*="link"],
html[lang="fa"] [dir="ltr"],
html[lang="fa"] [dir="ltr"] *,
html[lang="fa"] .ltr,
html[lang="fa"] .ltr * {
    font-feature-settings: "ss02" 0 !important;
    -webkit-font-feature-settings: "ss02" 0 !important;
    -moz-font-feature-settings: "ss02" 0 !important;
}

/* Arabic & English: Keep ss02 off so Arabic Unicode ٠-٩ and English 0-9 render correctly */
html[lang="ar"],
html[lang="ar"] body,
html[lang="ar"] *,
html[lang="en"],
html[lang="en"] body,
html[lang="en"] * {
    font-feature-settings: "ss02" 0 !important;
    -webkit-font-feature-settings: "ss02" 0 !important;
    -moz-font-feature-settings: "ss02" 0 !important;
}

/* Regular Text Elements (Strictly weight 400) */
html[dir="rtl"] p,
html[dir="rtl"] span:not(.badge):not(.label):not(.bold):not(.font-bold):not(.author-name):not(.price):not(.btn):not(.btn *):not(.badge *):not(.error-digit):not(.m3-maintenance-badge):not(.products-nav-trigger):not(.products-nav-trigger *):not(.nav-caret),
html[dir="rtl"] li:not(.active):not(.nav-item-active),
html[dir="rtl"] .entry-content p,
html[dir="rtl"] .article-content p,
html[dir="rtl"] .product-description p,
html[dir="rtl"] .product-description-body,
html[dir="rtl"] .product-hero-description,
html[dir="rtl"] .m3-page-content-text p,
html[dir="rtl"] input:not([type="submit"]):not([type="button"]),
html[dir="rtl"] textarea,
html[dir="rtl"] select,
html[dir="rtl"] .form-control {
    font-family: 'IRANSansX', 'IRANSansXV', sans-serif !important;
    font-weight: 400 !important;
}

/* Bold Text Elements (Strictly weight 700 with IRANSansX-Bold) */
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] h5,
html[dir="rtl"] h6,
html[dir="rtl"] h1 a,
html[dir="rtl"] h2 a,
html[dir="rtl"] h3 a,
html[dir="rtl"] h4 a,
html[dir="rtl"] h5 a,
html[dir="rtl"] h6 a,
html[dir="rtl"] strong,
html[dir="rtl"] b,
html[dir="rtl"] th,
html[dir="rtl"] .bold,
html[dir="rtl"] .font-bold,
html[dir="rtl"] .error-digit,
html[dir="rtl"] .error-404-title,
html[dir="rtl"] .error-search-btn,
html[dir="rtl"] .error-action-btn,
html[dir="rtl"] .m3-maintenance-title,
html[dir="rtl"] .m3-maintenance-badge,
html[dir="rtl"] .article-main-title,
html[dir="rtl"] .product-hero-title,
html[dir="rtl"] .product-section-title,
html[dir="rtl"] .product-catalog-name,
html[dir="rtl"] .product-catalog-name a,
html[dir="rtl"] .other-product-name,
html[dir="rtl"] .other-product-name a,
html[dir="rtl"] .m3-blog-card-title,
html[dir="rtl"] .m3-blog-card-title a,
html[dir="rtl"] .recent-item-title,
html[dir="rtl"] .recent-item-title a,
html[dir="rtl"] .m3-page-main-title,
html[dir="rtl"] .section-title,
html[dir="rtl"] .entry-title,
html[dir="rtl"] .card-title,
html[dir="rtl"] .modal-title,
html[dir="rtl"] .blog-card-title,
html[dir="rtl"] .author-card-name,
html[dir="rtl"] .author-name,
html[dir="rtl"] .btn,
html[dir="rtl"] .btn-primary,
html[dir="rtl"] .m3-btn,
html[dir="rtl"] .mdl-button,
html[dir="rtl"] .badge,
html[dir="rtl"] .article-cat-badge,
html[dir="rtl"] .category-pill-link,
html[dir="rtl"] .category-label,
html[dir="rtl"] .price,
html[dir="rtl"] .product-price,
html[dir="rtl"] .navbar-nav > li > a,
html[dir="rtl"] .navbar-nav > li > a span,
html[dir="rtl"] .products-nav-trigger,
html[dir="rtl"] .products-nav-trigger span,
html[dir="rtl"] .breadcrumb > .active,
html[dir="rtl"] label,
html[dir="rtl"] [style*="font-weight: bold"],
html[dir="rtl"] [style*="font-weight: 700"],
html[dir="rtl"] [style*="font-weight:bold"],
html[dir="rtl"] [style*="font-weight:700"] {
    font-family: 'IRANSansX-Bold', 'IRANSansX', sans-serif !important;
    font-weight: 700 !important;
}

/* =========================================================================
   Tiptap Rich Text Editor Specific Font Enforcement
   ========================================================================= */
.tiptap-editor-wrapper,
.plato-editor-wrapper,
.tiptap-editor-toolbar,
.tiptap-table-context-bar,
.tiptap-editor-statusbar,
.tiptap-editor-content,
.plato-editor-content,
.tiptap.ProseMirror,
.pe-btn,
.pe-select,
.pe-modal-dialog,
.pe-input,
.pe-textarea,
.pe-modal-btn,
.pe-tab-btn,
.pe-status-info {
    font-family: 'IRANSansX', 'IRANSansXV', Tahoma, sans-serif !important;
}

/* Regular text in Tiptap */
.tiptap.ProseMirror p,
.tiptap.ProseMirror li,
.tiptap-editor-content p,
.tiptap-editor-content li {
    font-family: 'IRANSansX', 'IRANSansXV', sans-serif !important;
    font-weight: 400 !important;
}

/* Bold text in Tiptap (Always IRANSansX-Bold) */
.tiptap.ProseMirror strong,
.tiptap.ProseMirror b,
.tiptap-editor-content strong,
.tiptap-editor-content b,
.tiptap.ProseMirror [style*="font-weight: bold"],
.tiptap.ProseMirror [style*="font-weight: 700"],
.tiptap.ProseMirror [style*="font-weight:bold"],
.tiptap.ProseMirror [style*="font-weight:700"] {
    font-family: 'IRANSansX-Bold', 'IRANSansX', sans-serif !important;
    font-weight: 700 !important;
}

/* Headings in Tiptap (Always IRANSansX-Bold) */
.tiptap.ProseMirror h2, .tiptap-editor-content h2,
.tiptap.ProseMirror h3, .tiptap-editor-content h3,
.tiptap.ProseMirror h4, .tiptap-editor-content h4,
.tiptap.ProseMirror h5, .tiptap-editor-content h5,
.tiptap.ProseMirror h6, .tiptap-editor-content h6,
.tiptap.ProseMirror th, .tiptap-editor-content th,
.pe-modal-header h4,
.pe-tab-btn.active,
.pe-modal-save,
.pe-form-group label {
    font-family: 'IRANSansX-Bold', 'IRANSansX', sans-serif !important;
    font-weight: 700 !important;
}
