/* Arabic (RTL) — loaded only when UI culture is ar (PageHead) */
/* Cairo font is preloaded in PageHead for ar */

html[dir="rtl"],
html[dir="rtl"] body {
  direction: rtl;
  text-align: right;
  font-family: "Cairo", "Jost", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[dir="rtl"] .text-start { text-align: right !important; }
html[dir="rtl"] .text-end { text-align: left !important; }

/* Bootstrap 5 logical props where theme uses start/end (BS5) */
html[dir="rtl"] .ms-auto { margin-right: auto !important; margin-left: 0 !important; }
html[dir="rtl"] .me-auto { margin-left: auto !important; margin-right: 0 !important; }

/* Common float / flex fixes for LTR-biased theme */
html[dir="rtl"] .float-start { float: right !important; }
html[dir="rtl"] .float-end { float: left !important; }

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

/* Nav / submenus: theme may use left padding */
html[dir="rtl"] .nav,
html[dir="rtl"] .navbar,
html[dir="rtl"] .submenu,
html[dir="rtl"] .main-nav {
  text-align: right;
}

/* Icons that imply direction (chevrons) — optional: mirror where needed */
html[dir="rtl"] .bi-chevron-left::before,
html[dir="rtl"] .fa-chevron-left::before {
  transform: scaleX(-1);
  display: inline-block;
}
html[dir="rtl"] .bi-chevron-right::before,
html[dir="rtl"] .fa-chevron-right::before {
  transform: scaleX(-1);
  display: inline-block;
}

/* Form controls */
html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] select {
  text-align: right;
}
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="url"] {
  direction: ltr; /* keep addresses readable */
  text-align: right;
}

/* Utility: keep numbers/dates in visual order in mixed content */
html[dir="rtl"] .ltr-input {
  direction: ltr;
  unicode-bidi: bidi-override;
  text-align: left;
}
