/* ============================================================
   Right-to-left overrides — loaded only when the active locale
   declares dir:rtl in config/locales.php (Arabic today).

   style.css is the source of truth for everything else; this file
   only flips the handful of rules there that are written with
   physical left/right rather than logical inline-start/end.
   ============================================================ */

/* -------------------------------------------------------------- type */
/* Plus Jakarta Sans has no Arabic coverage, so Arabic text would fall
   through to whatever the OS picked — often a mismatched default. Naming
   the platform Arabic faces explicitly keeps the page looking deliberate.
   The Latin face stays first so brand words and figures are unaffected. */
[dir="rtl"] body{
  font-family:"Plus Jakarta Sans","Noto Sans Arabic","Geeza Pro","Segoe UI",
              Tahoma,"Arabic Typesetting",system-ui,sans-serif;
}

/* Money and monospaced figures stay left-to-right inside an otherwise RTL
   line, so "$12,500.00" is not re-ordered around its symbol and separators.
   unicode-bidi:isolate rather than a display change — .stat b and .side-bal b
   are display:block in style.css and must stay that way.

   The block figures then need text-align:right put back explicitly: with
   direction:ltr on the element, an inherited 'start' would resolve to the
   left edge and pull the number away from the RTL card's leading edge. */
[dir="rtl"] code,
[dir="rtl"] .mono{direction:ltr;unicode-bidi:isolate}
[dir="rtl"] .stat b,
[dir="rtl"] .side-bal b{direction:ltr;unicode-bidi:isolate;text-align:right}

/* ---------------------------------------------------------- skip link */
[dir="rtl"] .skip{left:auto;right:-9999px}
[dir="rtl"] .skip:focus{left:auto;right:8px}

/* ------------------------------------------------------ header / nav */
[dir="rtl"] .main-nav{margin-left:0;margin-right:auto}

@media (max-width:1060px){
  [dir="rtl"] .burger{margin-left:0;margin-right:auto}
}

/* -------------------------------------------------------------- hero */
/* The two background glows are decorative; swapping them keeps the light
   falling from the same side of the composition as it does in LTR. */
[dir="rtl"] .hero::before{right:auto;left:-260px}
[dir="rtl"] .hero::after{left:auto;right:-240px}

/* ---------------------------------------------------------- crumbs */
[dir="rtl"] .crumbs li+li::before{margin-right:0;margin-left:.5rem}

/* -------------------------------------------------- tables and forms */
[dir="rtl"] thead th{text-align:right}
[dir="rtl"] .dl dd{text-align:left}

/* The select chevron is a background image pinned to one edge. */
[dir="rtl"] select{background-position:left 1rem center;
  padding-right:.9rem;padding-left:2.4rem}

/* ------------------------------------------------------- dashboard */
[dir="rtl"] .side{border-right:0;border-left:1px solid var(--line-soft)}
[dir="rtl"] .dash-user{margin-left:0;margin-right:auto}

@media (max-width:980px){
  /* Off-canvas sidebar slides in from the right instead of the left. */
  [dir="rtl"] .side{inset:0 0 0 auto;transform:translateX(100%)}
  [dir="rtl"] .side.open{transform:none}
}

[dir="rtl"] .panel-head .btn{margin-left:0;margin-right:auto}
[dir="rtl"] .legend i{margin-right:0;margin-left:.4rem}
[dir="rtl"] .modal-x{margin-left:0;margin-right:auto}
[dir="rtl"] .feed .when{margin-left:0;margin-right:auto;text-align:left}

/* --------------------------------------------------------- toolbar */
[dir="rtl"] .toolbar .search input{padding-left:.9rem;padding-right:2.35rem}
[dir="rtl"] .toolbar .search .ic{left:auto;right:.8rem}
[dir="rtl"] .toolbar .spacer{margin-left:0;margin-right:auto}
[dir="rtl"] .seg button .n{margin-left:0;margin-right:.3rem}

/* ----------------------------------------------------------- prose */
[dir="rtl"] .prose ul,
[dir="rtl"] .prose ol{padding-left:0;padding-right:1.2rem}
[dir="rtl"] .founder-quote{padding-left:0;padding-right:1.1rem;
  border-left:0;border-right:2px solid var(--gold)}

/* ---------------------------------------------------------- toasts */
[dir="rtl"] .toasts{right:auto;left:1.25rem}

/* ------------------------------------------------- decorative scene */
/* The 3D hero scene is aria-hidden and purely ornamental; mirroring it
   avoids the shards appearing to point into the text column. */
[dir="rtl"] .scene{transform:scaleX(-1)}
