/* =====================================================
   MERCURY THEME – FULL RTL OVERRIDE
   ===================================================== */

/* ---------- Global ---------- */
/* Generated by script */
@font-face {
  font-family: Vazirmatn;
  src: url('fonts/Vazirmatn-Thin.woff2') format('woff2');
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Vazirmatn;
  src: url('fonts/Vazirmatn-ExtraLight.woff2') format('woff2');
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Vazirmatn;
  src: url('fonts/Vazirmatn-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Vazirmatn;
  src: url('fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Vazirmatn;
  src: url('fonts/Vazirmatn-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Vazirmatn;
  src: url('fonts/Vazirmatn-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Vazirmatn;
  src: url('fonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Vazirmatn;
  src: url('fonts/Vazirmatn-ExtraBold.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Vazirmatn;
  src: url('fonts/webfonts/Vazirmatn-Black.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --fa-font: 'Vazirmatn', system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* 3) اعمال فونت روی اکثر/تمام عناصر رایج */
html, body,
h1, h2, h3, h4, h5, h6,
p, span, div, strong, em, b, i, small,
a, li, ul, ol, dl, dt, dd,
blockquote, q, cite,
table, thead, tbody, tfoot, tr, th, td, caption,
form, label, fieldset, legend,
input, textarea, select, option,
button, .button, [type="button"], [type="submit"], [type="reset"],
nav, header, footer, main, section, article, aside,
figure, figcaption,
details, summary,
code, kbd, pre, samp {
   font-family: 'Vazirmatn', 'IRANSans', sans-serif !important;
}

/* 4) فرم‌ها گاهی فونت جدا می‌گیرن — این خط مطمئن‌ترش می‌کنه */
button, input, select, textarea {
   font-family: 'Vazirmatn', 'IRANSans', sans-serif !important;
}

/* 5) اگر آیکن‌فونت‌ها (FontAwesome/Icomoon) داری، این خط نذاره به‌هم بریزه */
.fa, .fas, .far, .fal, .fab,
[class*=" icon-"], [class^="icon-"] {
  font-family: inherit; /* آیکن‌ها رو تغییر نمی‌دیم */
}

html {
    direction: rtl;
    unicode-bidi: embed;
}

body {
    direction: rtl;
    text-align: right;
    font-family: 'Vazirmatn', 'IRANSans', sans-serif !important;
}

/* Fix floats globally */
.left { float: right !important; }
.right { float: left !important; }

/* ---------- Header ---------- */

.space-header {
    direction: rtl;
}

.space-header-menu ul.main-menu li {
    float: right;
}

.space-header-menu ul.main-menu li ul.sub-menu {
    left: auto;
    right: 0;
    text-align: right;
}

.space-header-menu ul.main-menu li ul.sub-menu li.menu-item-has-children ul {
    left: auto;
    right: 100%;
}

/* Logo alignment */
.space-header-logo {
    float: right;
}

/* Header buttons */
.space-header-button {
    float: left;
}

/* ---------- Breadcrumbs ---------- */

.space-breadcrumbs {
    direction: rtl;
    text-align: right;
}

/* ---------- Content & Layout ---------- */

.space-content,
.space-page-content,
.space-single-content {
    direction: rtl;
    text-align: right;
}

/* Sidebar mirror */
.space-sidebar {
    float: left;
}

.space-content-area {
    float: right;
}

/* ---------- Widgets ---------- */

.space-widget {
    text-align: right;
}

.space-widget ul {
    padding-right: 0;
}

/* ---------- News Blocks ---------- */

.space-news-1-item-title-box-ins,
.space-news-2-item-title-box-ins {
    margin-left: 0 !important;
    margin-right: 115px;
}

.space-news-1-item-img-box,
.space-news-2-item-img-box {
    float: right;
}

/* ---------- Post Meta ---------- */

.space-post-meta {
    text-align: right;
}

.space-post-meta span {
    margin-left: 0;
    margin-right: 10px;
}

/* ---------- Pagination ---------- */

.space-pagination {
    direction: rtl;
    text-align: center;
}

.space-pagination a,
.space-pagination span {
    margin-left: 0;
    margin-right: 5px;
}

/* ---------- Forms ---------- */

input,
textarea,
select {
    text-align: right;
}

input[type="email"],
input[type="url"],
input[type="number"],
input[type="tel"] {
    direction: ltr;
    text-align: left;
}

/* ---------- Comments ---------- */

.space-comments {
    direction: rtl;
}

.space-comments .comment-author {
    float: right;
}

.space-comments .comment-content {
    margin-left: 0;
    margin-right: 80px;
}

/* ---------- Footer ---------- */

.space-footer {
    direction: rtl;
    text-align: right;
}

.space-footer-widget {
    float: right;
}

/* ---------- Buttons ---------- */

.space-button,
button,
input[type="submit"] {
    direction: rtl;
}

/* ---------- Search Box ---------- */

.space-header-search {
    direction: rtl;
}

.space-header-search input {
    text-align: right;
}

/* ---------- Tables ---------- */

table {
    direction: rtl;
    text-align: right;
}

/* ---------- Mobile Menu ---------- */

@media (max-width: 991px) {

    .space-mobile-menu {
        direction: rtl;
    }

    .space-mobile-menu ul li {
        text-align: right;
    }

}

/* ---------- Fix absolute left/right hardcodes ---------- 

[class*="left-"] {
    left: auto !important;
    right: 0 !important;
}

[class*="right-"] {
    right: auto !important;
    left: 0 !important;
}

/* ---------- Icons spacing ---------- */

.space-icon {
    margin-left: 0;
    margin-right: 8px;
}

/* ---------- Fix alignment issues ---------- */

.alignleft {
    float: right;
    margin-right: 0;
    margin-left: 15px;
}

.alignright {
    float: left;
    margin-left: 0;
    margin-right: 15px;
}

.space-organization-header-title-box {
    margin-right: 30px !important;
}

ul.space-mark {
    padding-right: 25px !important;
    padding-left: 0 !important;
}

ul.space-mark li {
    text-align: right !important;
    padding-right: 25px !important;
    padding-left: 0 !important;
}

ul.space-mark li::before {
    right: 0 !important;
    left: auto !important;
}
/* Gutenberg RTL Fix */

.wp-block-group,
.wp-block-columns,
.wp-block-column,
.wp-block-paragraph,
.wp-block-heading,
.wp-block-list {
    direction: rtl !important;
    text-align: right !important;
}
/* Safe Flex Fix */

.space-content .row,
.space-page-content .row {
    flex-direction: row-reverse;
}
.space-header-menu ul.main-menu li ul.sub-menu {
    right: 0 !important;
    left: auto !important;
}

.space-header-menu ul.main-menu li ul.sub-menu li ul {
    right: 100% !important;
    left: auto !important;
}