/* AMANAH AI — right-to-left layout (Arabic). Loaded on every page; every rule is scoped to <html dir="rtl">, which
   js/i18n.js sets only for Arabic, so RU/EN pages are unaffected.
   Most of the layout mirrors by itself: flex/grid follow the direction and the stylesheets use logical properties
   (margin-inline-start, inset-inline-end, text-align: start …). This file holds what logical properties cannot express:
   slide-in transforms, icons that point in a direction, background positions, and Arabic typography. */

/* ── Arabic typography ── Arabic script is never set in italics, and letter-spacing breaks the joining of letters. */
html[lang="ar"] body { line-height: 1.7; }
html[lang="ar"] *:not(.fa):not(.fas):not(.far):not(.fab):not([class^="fa-"]) { font-style: normal !important; letter-spacing: 0 !important; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { line-height: 1.45; }

/* ── values that are read left to right inside Arabic text ── e-mail, phone, URL, codes, IBAN, numbers. */
html[dir="rtl"] input[type="email"], html[dir="rtl"] input[type="tel"], html[dir="rtl"] input[type="url"],
html[dir="rtl"] input[type="number"], html[dir="rtl"] input[inputmode="numeric"], html[dir="rtl"] input[autocomplete="one-time-code"],
html[dir="rtl"] input[name*="iban" i], html[dir="rtl"] input[name*="swift" i], html[dir="rtl"] input[id*="Iban"], html[dir="rtl"] input[id*="Swift"] {
  direction: ltr; text-align: right;
}
html[dir="rtl"] code, html[dir="rtl"] kbd, html[dir="rtl"] .fi-code, html[dir="rtl"] .fi-codes, html[dir="rtl"] .fi-secret { direction: ltr; unicode-bidi: isolate; }

/* ── icons that point in a direction ── "next" points left, "back" points right in Arabic. */
html[dir="rtl"] .fa-arrow-right, html[dir="rtl"] .fa-arrow-left, html[dir="rtl"] .fa-chevron-right, html[dir="rtl"] .fa-chevron-left,
html[dir="rtl"] .fa-angle-right, html[dir="rtl"] .fa-angle-left, html[dir="rtl"] .fa-angle-double-right, html[dir="rtl"] .fa-angle-double-left,
html[dir="rtl"] .fa-angles-right, html[dir="rtl"] .fa-angles-left, html[dir="rtl"] .fa-long-arrow-alt-right, html[dir="rtl"] .fa-long-arrow-alt-left,
html[dir="rtl"] .fa-caret-right, html[dir="rtl"] .fa-caret-left, html[dir="rtl"] .fa-sign-in-alt, html[dir="rtl"] .fa-sign-out-alt,
html[dir="rtl"] .fa-right-from-bracket, html[dir="rtl"] .fa-right-to-bracket, html[dir="rtl"] .fa-external-link-alt,
html[dir="rtl"] .fa-arrow-up-right-from-square, html[dir="rtl"] .fa-share-square, html[dir="rtl"] .fa-reply {
  transform: scaleX(-1);
}
html[dir="rtl"] .fa-spin { transform: none; }

/* ── slide-in side panels (phones): they sit at the right edge and slide in from the right ── */
@media (max-width: 900px) {
  html[dir="rtl"] .sidebar { transform: translateX(100%); }
  html[dir="rtl"] .sidebar.open { transform: translateX(0); }
  html[dir="rtl"] .cab-side { transform: translateX(100%); }
  html[dir="rtl"] .cab-side.open { transform: none; }
}
@media (max-width: 860px) {
  html[dir="rtl"] .cab-sidebar { transform: translateX(100%); }
  html[dir="rtl"] .cab-sidebar.open { transform: translateX(0); }
}

/* ── switches ── the knob moves towards the end of the line (left). */
html[dir="rtl"] .toggle-switch input:checked + .toggle-slider:before { transform: translateX(-20px); }


/* ── select arrows drawn as a background image ── */
html[dir="rtl"] .aw-select { background-position: left 12px center; }

/* ── disclosure triangles ▸ point left when closed ── */
html[dir="rtl"] .ws-sec > summary::before { transform: scaleX(-1); }
html[dir="rtl"] .ws-sec[open] > summary::before { transform: rotate(90deg); }

/* ── charts keep a left-to-right time axis (as in Gulf financial reporting); their labels are Arabic ── */
html[dir="rtl"] canvas { direction: ltr; }

/* ── text arrows in buttons and links are written per language in the texts (←/→); tables of figures keep digits LTR ── */
html[dir="rtl"] .rv-nowrap, html[dir="rtl"] .ws-num, html[dir="rtl"] .inv-num { unicode-bidi: plaintext; }

/* ── what people wrote or what was read from their documents keeps its own direction (a Latin company name
   "Epsilon Gıda Sanayi A.Ş." keeps its final period at the end) ── */
html[dir="rtl"] :is(span, strong, b, em, small, a)[data-user-content] { unicode-bidi: plaintext; }
