/*
 * Right-to-left layer for the pages of right-to-left languages (html dir="rtl": Arabic). Loaded
 * only on those pages (application/config/site_languages.php, "stylesheets"), so no other page
 * changes.
 *
 * The page is a left-to-right theme: floats, and decorations placed with left/right offsets that
 * hang off the edges. The viewport stays left to right, so nothing that hangs off the left edge
 * becomes scrollable (in a right-to-left viewport the left overflow would scroll); everything in
 * the body runs right to left: text, lists, inline rows and form fields start at the right.
 */
html[dir="rtl"] { direction: ltr; }
html[dir="rtl"] body { direction: rtl; }

/* What the theme aligns to the left on purpose (the banner, the FAQ buttons, the footer's social
   row, and every paragraph on phones) starts at the right instead. :where() keeps each rule exactly
   as strong as the theme's, so only those texts move; justified text stays justified. */
@media (max-width: 600px) {
    :where(html[dir="rtl"]) p { text-align: right; }
}
:where(html[dir="rtl"]) .banner-txt,
:where(html[dir="rtl"]) .set > button.toggle-click,
:where(html[dir="rtl"]) .right-social ul.social { text-align: right; }

/* Lists keep their markers on the right. */
html[dir="rtl"] .art-content ul,
html[dir="rtl"] .art-content ol { padding-left: 0; padding-right: 40px; }

/* Latin words, URLs and numbers inside Arabic text keep their own order. */
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="tel"],
html[dir="rtl"] input[type="url"] { direction: ltr; text-align: right; }

/* The list filters' arrow sits at the start of the field, so the text that now starts at the
   right does not run under it. */
html[dir="rtl"] .art-dropdownblk select { padding-left: 45px; }
html[dir="rtl"] .art-dropdownblk::after { right: auto; left: 0; border-left: 0; border-right: 1px solid #ddd; margin-right: 0; margin-left: .2em; }

/* Article cards fill each row from the right. */
html[dir="rtl"] .item-blk { float: right; margin-right: 0; margin-left: 4%; }
html[dir="rtl"] .item-blk.col-3 { margin-left: 2%; }
