/*
 * Euryka AI Localiser — RTL sheet (Arabic, Hebrew, …).
 *
 * Loaded only when the active locale is RTL. The full mirror of Breakdance's
 * LTR-assumption CSS (margins/padding/flex/absolute) is not attempted; this sets the
 * baseline document direction + common text alignment so Arabic is legible
 * from day one, plus fixes for the page-builder patterns that break most often.
 */

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

/* Bidi isolation helper: wrap embedded LTR runs (URLs, numbers, brand names)
 * with <span class="ekl-ltr"> to stop them visually scrambling. */
.ekl-ltr {
	unicode-bidi: isolate;
	direction: ltr;
}

/* Arabic font baseline — replace with the project's licensed stack. */
body.ekl-lang-ar {
	font-family: "Noto Naskh Arabic", "Segoe UI", Tahoma, sans-serif;
}

/* Breakdance menus hard-code `text-align: left` on their links, so a label
 * that wraps onto two lines hugs the wrong edge of its column in RTL. */
html[dir="rtl"] .breakdance-menu-list,
html[dir="rtl"] .breakdance-menu-item,
html[dir="rtl"] .breakdance-menu-link,
html[dir="rtl"] .breakdance-dropdown-link {
	text-align: start;
}

/* Phone numbers and e-mail addresses are left-to-right even inside Arabic:
 * without this "+971 4 884 8414" renders as "971 4 884 8414+". */
html[dir="rtl"] a[href^="tel:"],
html[dir="rtl"] a[href^="tel:"] *,
html[dir="rtl"] a[href^="mailto:"],
html[dir="rtl"] a[href^="mailto:"] * {
	unicode-bidi: plaintext;
}

/* Breakdance ships `text-align: left` as the DEFAULT on many elements (Code
 * Block, Div, Section container, Tabs, Breadcrumbs, link containers, post
 * lists), so their text ignores the page direction. Follow the direction
 * instead. Specificity is kept just above the defaults and no higher than an
 * element's own alignment setting, which Breakdance prints later in the page
 * — so an alignment chosen in the builder still wins.
 */
[dir="rtl"] .bde-code-block,
[dir="rtl"] .bde-div,
[dir="rtl"] .bde-container-link,
[dir="rtl"] .bde-breadcrumb,
[dir="rtl"] .bde-breadcrumbs,
[dir="rtl"] .bde-advanced-tab,
[dir="rtl"] .bde-advanced-tabs-content,
[dir="rtl"] .breakdance-text-input__label {
	text-align: start;
}
[dir="rtl"] .bde-section .section-container,
[dir="rtl"] .bde-post-list .ee-post-title,
[dir="rtl"] .bde-post-list .ee-post-content,
[dir="rtl"] .breakdance-table.v-table th {
	text-align: start;
}

/* Mobile (collapsed) menu: the sub-menu arrow is pinned to the right edge,
 * where right-to-left labels start. Pin it to the left edge instead. Has no
 * effect on the desktop menu, where the arrow is not absolutely positioned. */
html[dir="rtl"] .breakdance-menu .breakdance-dropdown-toggle > .breakdance-menu-link-arrow {
	right: auto;
	left: 0;
}
