/* ==================================================================
   PremiumPNG - right-to-left (Arabic)
   Loaded only when the page language is RTL (<html dir="rtl">),
   together with bootstrap.rtl.min.css, which already flips the grid,
   margins (me-/ms-), dropdowns, forms and the navbar.
   This file flips the site's own CSS that uses left/right.
   ================================================================== */

html[dir="rtl"] body,
html[dir="rtl"] .navbar,
html[dir="rtl"] .dropdown-menu,
html[dir="rtl"] .btn,
html[dir="rtl"] input,
html[dir="rtl"] select,
html[dir="rtl"] textarea {
    font-family: "Noto Sans Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
}
html[dir="rtl"] :is(h1, h2, h3, h4, h5, .display-1, .display-2, .display-3, .display-4, .fw-bold.text-dark) {
    font-family: "Noto Kufi Arabic", "Noto Sans Arabic", system-ui, sans-serif;
    letter-spacing: 0;
}
/* Arabic has no capital letters and does not like letter-spacing */
html[dir="rtl"] :is(.text-uppercase, .pp-kicker, .pp-section-kicker, .badge) { letter-spacing: 0 !important; }

/* arrows that point "forward" must point left */
html[dir="rtl"] :is(.fa-arrow-right, .fa-chevron-right, .fa-angle-right, .fa-arrow-right-long, .fa-caret-right, .fa-circle-arrow-right) { transform: scaleX(-1); }
html[dir="rtl"] :is(.fa-arrow-left, .fa-chevron-left, .fa-angle-left, .fa-arrow-left-long, .fa-caret-left) { transform: scaleX(-1); }

/* numbers, codes, file names, e-mails and URLs stay left-to-right inside the RTL text */
html[dir="rtl"] :is(code, kbd, pre, .font-monospace, input[type="email"], input[type="url"], input[type="number"], .pp-ltr) { direction: ltr; unicode-bidi: isolate; }
html[dir="rtl"] input[type="email"], html[dir="rtl"] input[type="url"] { text-align: right; }

/* horizontal scrollers start at the right */
html[dir="rtl"] :is(.pp-category-scroll, .category-pills, .pp-latest-grid) { direction: rtl; }

/* hidden spam-trap fields: "left:-9999px" makes an RTL page scroll sideways */
html[dir="rtl"] :is([style*="left:-9999px"], [style*="left: -9999px"]) { left: 0 !important; right: auto !important; width: 1px !important; height: 1px !important; overflow: hidden !important; opacity: 0 !important; pointer-events: none !important; clip-path: inset(50%) !important; }
html[dir="rtl"] body { overflow-x: hidden; }

/* home hero: the numbers sit on the left side (mirror of English) */
html[dir="rtl"] .pp-hero-stats { right: auto; left: 0; }

/* letter-spacing breaks the joined Arabic letters - switch it off everywhere */
html[dir="rtl"] *, html[dir="rtl"] *::before, html[dir="rtl"] *::after { letter-spacing: 0 !important; }

/* contributor portal: language button (icon + "AR") */
html[dir="rtl"] .cb-lang b { margin-left: 0; margin-right: 4px; }

/* English titles inside Arabic pages: cut at the end ("Friedel Crafts…"), not at the start */
html[dir="rtl"] .text-truncate { unicode-bidi: plaintext; }
