/* ============================================================
   RTL-Support für Arabisch (dir="rtl")
   Wird nur geladen, wenn _locale == 'ar'. Spiegelt die
   Haupt-Layout-Achsen: Sidebar, Body-Padding, Off-Canvas-Drawer.
   Der dir="rtl"-Attribut am <html> erledigt Textfluss/Flexbox-
   Richtung automatisch; hier nur die physisch gesetzten Achsen.
   ============================================================ */

/* Arabische System-Schriftarten priorisieren (Fallback auf Latin-Fonts) */
[dir="rtl"] body,
[dir="rtl"] input,
[dir="rtl"] textarea,
[dir="rtl"] button,
[dir="rtl"] select {
  font-family: "Noto Naskh Arabic", "Noto Sans Arabic", "Geeza Pro",
               "Tahoma", "Segoe UI", system-ui, sans-serif;
}

/* Ziffern/lateinische Fachbegriffe (IBAN, E-Mail) im RTL-Fluss sauber halten */
[dir="rtl"] input[type="email"],
[dir="rtl"] input[type="tel"],
[dir="rtl"] input[type="url"],
[dir="rtl"] input[type="number"],
[dir="rtl"] input[inputmode="numeric"] {
  direction: ltr;
  text-align: right;
}

/* ---------- Desktop: Sidebar nach rechts, Body-Padding spiegeln ---------- */
[dir="rtl"] body.kd-layout-v2 { padding-left: 0; padding-right: 248px; }

[dir="rtl"] .kd-side {
  left: auto; right: 0;
  border-right: none;
  border-left: 1px solid var(--line);
}

/* Sidebar-Sub-Items: Einrückung nach rechts statt links */
[dir="rtl"] .kd-side__item--sub { padding-left: 0; padding-right: 36px; }

/* iPad Landscape 1024–1366px (240px Sidebar) */
@media (min-width: 1024px) and (max-width: 1366px) {
  [dir="rtl"] body.kd-layout-v2 { padding-left: 0; padding-right: 240px; }
}

/* iPad Pro 11" Landscape coarse (264px Sidebar) */
@media (min-width: 1100px) and (max-width: 1280px) and (pointer: coarse) {
  [dir="rtl"] body.kd-layout-v2 { padding-left: 0; padding-right: 264px; }
}

/* ---------- Mobile: Off-Canvas-Drawer kommt von rechts ---------- */
@media (max-width: 1024px) {
  [dir="rtl"] body.kd-layout-v2 { padding-right: 0; }
  [dir="rtl"] .kd-side { transform: translateX(100%); }
  [dir="rtl"] .kd-side.open { transform: translateX(0); }
}
