/* Persian typography — local Vazir with cross-browser fallbacks */

@font-face {
    font-family: 'Vazir';
    src: url('/fonts/persian-fonts/vazir-font-v18.0.0/Vazir.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazir';
    src: url('/fonts/persian-fonts/vazir-font-v18.0.0/Vazir-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazir';
    src: url('/fonts/persian-fonts/vazir-font-v18.0.0/Vazir-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazir';
    src: url('/fonts/persian-fonts/vazir-font-v18.0.0/Vazir-Light.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

:root {
    --app-font-family: 'Vazir', Tahoma, 'Segoe UI', Arial, sans-serif;
    --bs-font-sans-serif: var(--app-font-family);
    --bs-body-font-family: var(--app-font-family);
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

html[dir="rtl"],
body[dir="rtl"],
[dir="rtl"] body {
    direction: rtl;
    text-align: right;
}

/* The compiled Bootstrap bundle ships its own body font stack, so we use
   !important to make sure the local Persian font wins the cascade. Setting it
   on `body` covers all text via inheritance; icon elements (<i class="fa">)
   keep their own font because they are not targeted here. */
body,
button,
input,
select,
textarea,
.form-control,
.form-select,
.btn,
.nav-link,
.dropdown-menu,
.dropdown-item,
.modal-content,
.table,
.navbar,
.card,
.badge,
.alert {
    font-family: var(--app-font-family) !important;
}

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6,
p,
label,
.form-label,
.form-text {
    font-family: var(--app-font-family) !important;
}

.tox-tinymce,
.tox .tox-edit-area__iframe {
    font-family: var(--app-font-family);
}

[dir="rtl"] .form-label {
    text-align: right;
    letter-spacing: normal;
}

[dir="rtl"] .input-group> :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
    margin-right: calc(var(--bs-border-width) * -1);
    margin-left: 0;
    border-top-left-radius: var(--bs-border-radius);
    border-bottom-left-radius: var(--bs-border-radius);
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

[dir="rtl"] .input-group> :not(:last-child):not(.dropdown-toggle):not(.dropdown-menu):not(.form-floating) {
    border-top-right-radius: var(--bs-border-radius);
    border-bottom-right-radius: var(--bs-border-radius);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

html[dir="rtl"] .border-start-0 {
    border-right: 0 !important;
    border-left: unset !important;
}

html[dir="rtl"] .border-end-0 {
    border-left: 0 !important;
    border-right: unset !important;
}

html[dir="rtl"] .ps-0 {
    padding-right: 0 !important;
    padding-left: unset !important;
}

html[dir="rtl"] .pe-0 {
    padding-left: 0 !important;
    padding-right: unset !important;
}




/* استایل راست‌چین برای blog-article-content-card */
.blog-article-content-card {
    direction: rtl;
    text-align: right;
    line-height: 1.8;
    max-width: 100%;
    word-wrap: break-word;
}

.blog-article-content-card h1,
.blog-article-content-card h2,
.blog-article-content-card h3,
.blog-article-content-card h4,
.blog-article-content-card h5,
.blog-article-content-card h6 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    font-weight: 600;
}

.blog-article-content-card p {
    margin-bottom: 1em;
}

.blog-article-content-card a {
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border 0.2s;
}

.blog-article-content-card a:hover {
    border-bottom-color: currentColor;
}

/* لیست‌ها */
.blog-article-content-card ul,
.blog-article-content-card ol {
    margin: 0.75em 1.5em 0.75em 0;
    padding-right: 0;
}

.blog-article-content-card li {
    margin-bottom: 0.25em;
}

/* جدول‌ها */
.blog-article-content-card table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
}

.blog-article-content-card th,
.blog-article-content-card td {
    border: 1px solid #ddd;
    padding: 10px 12px;
    text-align: right;
    vertical-align: top;
}

.blog-article-content-card th {
    font-weight: 600;
}

/* نقل قول */
.blog-article-content-card blockquote {
    margin: 1em 0;
    padding: 0.5em 1.5em;
    border-right: 4px solid;
    font-style: italic;
}

/* کد و pre */
.blog-article-content-card code {
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: monospace;
}

.blog-article-content-card pre {
    padding: 1em;
    overflow-x: auto;
    border-radius: 8px;
    margin: 1em 0;
}

.blog-article-content-card pre code {
    padding: 0;
    background: transparent;
}

/* تصاویر */
.blog-article-content-card img {
    max-width: 100%;
    height: auto;
}

.blog-article-content-card figure {
    margin: 1em 0;
}

.blog-article-content-card figcaption {
    font-size: 0.85em;
    text-align: center;
    margin-top: 0.5em;
}

/* جداکننده */
.blog-article-content-card hr {
    margin: 2em 0;
    border: none;
    height: 1px;
}

/* ریسپانسیو */
@media (max-width: 768px) {
    .blog-article-content-card {
        font-size: 0.95rem;
    }

    .blog-article-content-card table,
    .blog-article-content-card thead,
    .blog-article-content-card tbody,
    .blog-article-content-card tr,
    .blog-article-content-card th,
    .blog-article-content-card td {
        display: block;
    }

    .blog-article-content-card th,
    .blog-article-content-card td {
        text-align: right;
    }
}