/* =====================================================================
   Q For Quran — RTL / direction-aware layer (loaded after app+super css)
   The App Translate language engine sets <html dir="rtl"> for Arabic,
   Urdu and Persian. Flex/grid flows flip automatically; this file fixes
   the physical-direction rules that CSS cannot infer (icons, offsets,
   letter-spacing on Arabic script, numeric columns).
   ===================================================================== */

/* Arabic-script interface: tracking must be neutral or calligraphy breaks */
[dir="rtl"] body,
[dir="rtl"] .t,
[dir="rtl"] .pg-t,
[dir="rtl"] .pg-k,
[dir="rtl"] .side a,
[dir="rtl"] .nv button,
[dir="rtl"] .rw b,
[dir="rtl"] .btn,
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 {
    letter-spacing: 0;
}
[dir="rtl"] .pg-k { letter-spacing: .2px; }

/* sidebar rows: icon and text order flip naturally; the active marker was
   a physical left bar — mirror it to the inline-start side */
[dir="rtl"] .side a.on::before,
[dir="rtl"] .side a:hover::before {
    left: auto;
    right: 0;
}

/* directional chevrons/back arrows: flip so "back" points the right way */
[dir="rtl"] .rd-head .ib svg,
[dir="rtl"] .hd-head .ib svg,
[dir="rtl"] .rw>.ic:not([data-flip="none"]),
[dir="rtl"] .bk-ic,
[dir="rtl"] [data-back] svg,
[dir="rtl"] .sh-t .ib svg {
    transform: scaleX(-1);
}
/* never flip content that is inherently directional (play, math, clock) */
[dir="rtl"] svg[aria-hidden="true"][data-noflip],
[dir="rtl"] .pb-info svg,
[dir="rtl"] .nv .ic { transform: none; }

/* transliteration/translation lines and numeric values keep LTR metrics */
[dir="rtl"] .pg-meta b,
[dir="rtl"] .clb,
[dir="rtl"] [data-num] { direction: ltr; unicode-bidi: isolate; }

/* reader: verse numbers and ayah text stay RTL Arabic, translation follows */
[dir="rtl"] .v-tr, [dir="rtl"] .hd-tr { text-align: start; }

/* bottom-sheet slide-up + header are centered — unaffected; the reader
   sticky header used physical paddings, normalise to logical ones */
[dir="rtl"] .rd-head, [dir="rtl"] .hd-head { padding-inline: 12px; }

/* toast stack and toasts */
[dir="rtl"] #toasts { left: 50%; right: auto; transform: translateX(-50%); }

/* hero ornament sits top-right in LTR — mirror to the far side in RTL */
[dir="rtl"] .pg-orn { right: auto; left: 6px; transform: scaleX(-1); }
[dir="rtl"] .pg::before { right: auto; left: -40px; }
[dir="rtl"] .pg .pg-act { right: auto; left: 14px; }

/* language chips bar */
[dir="rtl"] .clb-chips { justify-content: flex-start; }

/* qibla dial: keep the dial itself LTR (it's a compass, not text) */
[dir="rtl"] .qb-dial, [dir="rtl"] .qibla-dial { direction: ltr; }
