/* ============================================================
   THE THOR Child Theme — Arabic (RTL) Stylesheet
   Loaded automatically by WordPress when dir="rtl" is active
   ============================================================ */

/* Arabic Google Font: Cairo */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700&display=swap');

/* ---- Base font override ---- */
html[dir="rtl"] body,
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] p,
html[dir="rtl"] li,
html[dir="rtl"] a,
html[dir="rtl"] span,
html[dir="rtl"] div,
html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] button,
html[dir="rtl"] label {
    font-family: 'Cairo', 'Arial', 'Helvetica Neue', sans-serif !important;
}

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

/* ---- Header & Navigation ---- */
html[dir="rtl"] .siteHeader__inner,
html[dir="rtl"] .headerInner,
html[dir="rtl"] .header__inner {
    flex-direction: row-reverse;
}

html[dir="rtl"] .globalNav__list,
html[dir="rtl"] .siteHeader__nav > ul,
html[dir="rtl"] .headerNav__list {
    flex-direction: row-reverse;
}

html[dir="rtl"] .globalNav__item,
html[dir="rtl"] .headerNav__item {
    float: right;
}

html[dir="rtl"] .globalNav__item .sub-menu,
html[dir="rtl"] .headerNav__item .sub-menu {
    right: 0;
    left: auto;
    text-align: right;
}

/* ---- Main layout ---- */
html[dir="rtl"] .siteMain,
html[dir="rtl"] .siteMain__body,
html[dir="rtl"] .l-main {
    direction: rtl;
}

/* Sidebar: swap float direction */
html[dir="rtl"] .siteMain__sidebar,
html[dir="rtl"] .widgetArea,
html[dir="rtl"] .l-sidebar {
    float: left !important;
}

html[dir="rtl"] .siteMain__main,
html[dir="rtl"] .siteMain__content,
html[dir="rtl"] .l-content {
    float: right !important;
}

/* ---- Post content ---- */
html[dir="rtl"] .postContent,
html[dir="rtl"] .entry-content,
html[dir="rtl"] .post-content {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] .postContent ul,
html[dir="rtl"] .postContent ol,
html[dir="rtl"] .ep-box ul,
html[dir="rtl"] .ep-box ol {
    padding-right: 1.5em;
    padding-left: 0;
}

html[dir="rtl"] .postContent li,
html[dir="rtl"] .ep-box li {
    text-align: right;
}

/* ---- Balloon (author comment box) ---- */
html[dir="rtl"] .balloon {
    flex-direction: row-reverse;
}

html[dir="rtl"] .balloon__img {
    margin-right: 0;
    margin-left: 15px;
}

html[dir="rtl"] .balloon__img-left {
    margin-right: 0;
    margin-left: 10px;
}

html[dir="rtl"] .balloon__text-right {
    text-align: right;
}

html[dir="rtl"] .balloon__text-right:before,
html[dir="rtl"] .balloon__text-right::before {
    right: auto;
    left: -8px;
    border-right: none;
    border-left: 8px solid #fff;
}

/* ---- Breadcrumbs ---- */
html[dir="rtl"] .breadcrumb,
html[dir="rtl"] .topicPath {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] .breadcrumb__list,
html[dir="rtl"] .topicPath__list {
    flex-direction: row-reverse;
}

/* ---- Share buttons ---- */
html[dir="rtl"] .shareBtns,
html[dir="rtl"] .share-btns,
html[dir="rtl"] .postShare {
    flex-direction: row-reverse;
}

/* ---- Table of Contents ---- */
html[dir="rtl"] .outline,
html[dir="rtl"] .toc {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] .outline__list,
html[dir="rtl"] .toc__list {
    padding-right: 1em;
    padding-left: 0;
}

/* ---- Footer ---- */
html[dir="rtl"] .siteFooter__inner,
html[dir="rtl"] .footerInner,
html[dir="rtl"] .footer__inner {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] .footerNav__list,
html[dir="rtl"] .footer-menu ul,
html[dir="rtl"] .bottomMenu__list {
    flex-direction: row-reverse;
}

html[dir="rtl"] .bottomFooter__menu,
html[dir="rtl"] .footerMenu {
    text-align: right;
}

/* ---- Widget areas ---- */
html[dir="rtl"] .widget,
html[dir="rtl"] .widgetArea {
    text-align: right;
    direction: rtl;
}

html[dir="rtl"] .widgetSearch,
html[dir="rtl"] .widget_search {
    direction: rtl;
}

html[dir="rtl"] .widgetSearch__input,
html[dir="rtl"] .search-field {
    text-align: right;
    direction: rtl;
}

/* ---- Profile / Author box ---- */
html[dir="rtl"] .postProfile,
html[dir="rtl"] .author-box,
html[dir="rtl"] .profileBox {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] .postProfile__inner,
html[dir="rtl"] .profileBox__inner {
    flex-direction: row-reverse;
}

html[dir="rtl"] .postProfile__body,
html[dir="rtl"] .profileBox__body {
    text-align: right;
    padding-right: 15px;
    padding-left: 0;
}

/* ---- ep-box (custom content boxes) ---- */
html[dir="rtl"] .ep-box {
    direction: rtl;
    text-align: right;
}

/* ---- Related posts ---- */
html[dir="rtl"] .postRelated,
html[dir="rtl"] .related-posts {
    direction: rtl;
}

/* ---- Prev/Next navigation ---- */
html[dir="rtl"] .postPrevNext,
html[dir="rtl"] .post-navigation {
    flex-direction: row-reverse;
}

/* ---- Category/tag widgets ---- */
html[dir="rtl"] .widgetCategory__list,
html[dir="rtl"] .widget_categories ul {
    padding-right: 0;
    text-align: right;
}

/* ---- Search form ---- */
html[dir="rtl"] .searchForm,
html[dir="rtl"] .search-form {
    direction: rtl;
}

html[dir="rtl"] .searchForm__input,
html[dir="rtl"] .search-field {
    text-align: right;
}

/* ---- SP (mobile) bottom navigation ---- */
html[dir="rtl"] .bottomNav,
html[dir="rtl"] .spNavBottom {
    direction: rtl;
}

html[dir="rtl"] .bottomNav__list,
html[dir="rtl"] .spNavBottom__list {
    flex-direction: row-reverse;
}

/* ---- Fix for marker spans (highlight) ---- */
html[dir="rtl"] .marker-thickYellow,
html[dir="rtl"] .marker-thickPink,
html[dir="rtl"] .marker-thickBlue {
    direction: rtl;
    unicode-bidi: embed;
}

/* ---- Line height for Arabic ---- */
html[dir="rtl"] body {
    line-height: 2.0;
}

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3 {
    line-height: 1.6;
}
