/*
 * direction.css - the few declarations that have to be logical, everywhere.
 *
 * WHY THIS FILE EXISTS
 *
 * Bootstrap 4 opens with
 *
 *     body { ... text-align: left; ... }
 *
 * and text-align inherits. So on any page that links the left-to-right build
 * of Bootstrap, every element that does not set text-align itself is aligned
 * left - in Arabic as much as in English. The admin side hides this by forking
 * to a mirrored css/rtl/bootstrap.min.css, but a fork only covers the pages
 * somebody remembered to fork, and the sign-in page was not one of them.
 *
 * That was found the hard way. `.welcome` on the sign-in page declared
 * `text-align: start`, the declaration was in the delivered HTML, and Arabic
 * readers still got a heading flush left. The rule itself had been discarded
 * by a CSS syntax error, and what filled the gap was this inherited `left`
 * from three files away. Nobody could find the offending declaration because
 * there was no declaration - only an inheritance.
 *
 * `start` is the fix for the whole class rather than for that one heading:
 * it resolves to right under dir="rtl" and left under dir="ltr", so the
 * direction on <html> decides the alignment instead of which build of a
 * vendor stylesheet a template happened to link.
 *
 * LOADING ORDER MATTERS. `body` and Bootstrap's `body` have the same
 * specificity, so this file only wins by coming later. Link it after the
 * vendor CSS. tests/Feature/Rtl/LogicalDirectionTest.php asserts that.
 *
 * Keep this file small and keep it logical. It is not a place for page
 * styling; it is the direction layer, and every declaration in it must be
 * expressed in logical properties (start/end, *-inline-start, *-inline-end).
 */

body {
    text-align: start;
}

/*
 * Logical counterparts to Bootstrap 4's .text-left / .text-right.
 *
 * Bootstrap 4 has no logical alignment utility - .text-left is physically
 * left in both directions - and Bootstrap 5's .text-start / .text-end do not
 * exist here. These are those two, so a template that means "align where the
 * reader starts" can say so instead of picking a side and being wrong in one
 * of the two languages. Bootstrap's own utilities are left alone: some of
 * them are deliberate physical choices and rewriting them wholesale would
 * change screens nobody has looked at.
 */
.text-start {
    text-align: start !important;
}

.text-end {
    text-align: end !important;
}
