/* RTL overrides. WordPress/WPML set the document direction from the active language. */
html[dir="rtl"] { direction: rtl; }
html[dir="rtl"] body { direction: rtl; unicode-bidi: plaintext; text-align: start; }
html[dir="ltr"] body { direction: ltr; text-align: start; }
html[dir="rtl"] .text-left { text-align: right !important; }
html[dir="rtl"] .text-right { text-align: left !important; }
html[dir="rtl"] .ml-auto { margin-left: 0 !important; margin-right: auto !important; }
html[dir="rtl"] .mr-auto { margin-right: 0 !important; margin-left: auto !important; }
/* Mirror common Tailwind physical spacing utilities in RTL. */
html[dir="rtl"] .ml-0 { margin-left: 0 !important; margin-right: 0 !important; }
html[dir="rtl"] .ml-1 { margin-left: 0 !important; margin-right: .25rem !important; }
html[dir="rtl"] .ml-2 { margin-left: 0 !important; margin-right: .5rem !important; }
html[dir="rtl"] .ml-3 { margin-left: 0 !important; margin-right: .75rem !important; }
html[dir="rtl"] .ml-4 { margin-left: 0 !important; margin-right: 1rem !important; }
html[dir="rtl"] .ml-5 { margin-left: 0 !important; margin-right: 1.25rem !important; }
html[dir="rtl"] .ml-6 { margin-left: 0 !important; margin-right: 1.5rem !important; }
html[dir="rtl"] .ml-8 { margin-left: 0 !important; margin-right: 2rem !important; }
html[dir="rtl"] .ml-10 { margin-left: 0 !important; margin-right: 2.5rem !important; }
html[dir="rtl"] .ml-12 { margin-left: 0 !important; margin-right: 3rem !important; }
html[dir="rtl"] .mr-0 { margin-right: 0 !important; margin-left: 0 !important; }
html[dir="rtl"] .mr-1 { margin-right: 0 !important; margin-left: .25rem !important; }
html[dir="rtl"] .mr-2 { margin-right: 0 !important; margin-left: .5rem !important; }
html[dir="rtl"] .mr-3 { margin-right: 0 !important; margin-left: .75rem !important; }
html[dir="rtl"] .mr-4 { margin-right: 0 !important; margin-left: 1rem !important; }
html[dir="rtl"] .mr-5 { margin-right: 0 !important; margin-left: 1.25rem !important; }
html[dir="rtl"] .mr-6 { margin-right: 0 !important; margin-left: 1.5rem !important; }
html[dir="rtl"] .mr-8 { margin-right: 0 !important; margin-left: 2rem !important; }
html[dir="rtl"] .mr-10 { margin-right: 0 !important; margin-left: 2.5rem !important; }
html[dir="rtl"] .mr-12 { margin-right: 0 !important; margin-left: 3rem !important; }
html[dir="rtl"] .pl-1 { padding-left: 0 !important; padding-right: .25rem !important; }
html[dir="rtl"] .pl-2 { padding-left: 0 !important; padding-right: .5rem !important; }
html[dir="rtl"] .pl-3 { padding-left: 0 !important; padding-right: .75rem !important; }
html[dir="rtl"] .pl-4 { padding-left: 0 !important; padding-right: 1rem !important; }
html[dir="rtl"] .pl-5 { padding-left: 0 !important; padding-right: 1.25rem !important; }
html[dir="rtl"] .pl-6 { padding-left: 0 !important; padding-right: 1.5rem !important; }
html[dir="rtl"] .pl-8 { padding-left: 0 !important; padding-right: 2rem !important; }
html[dir="rtl"] .pr-1 { padding-right: 0 !important; padding-left: .25rem !important; }
html[dir="rtl"] .pr-2 { padding-right: 0 !important; padding-left: .5rem !important; }
html[dir="rtl"] .pr-3 { padding-right: 0 !important; padding-left: .75rem !important; }
html[dir="rtl"] .pr-4 { padding-right: 0 !important; padding-left: 1rem !important; }
html[dir="rtl"] .pr-5 { padding-right: 0 !important; padding-left: 1.25rem !important; }
html[dir="rtl"] .pr-6 { padding-right: 0 !important; padding-left: 1.5rem !important; }
html[dir="rtl"] .pr-8 { padding-right: 0 !important; padding-left: 2rem !important; }
/* Align common form fields and content to the logical start in RTL. */
html[dir="rtl"] input:not([type="number"]):not([type="email"]):not([type="url"]), html[dir="rtl"] textarea, html[dir="rtl"] select { text-align: right; }
html[dir="rtl"] .mobile-menu { transform: translateX(-100%); }
html[dir="rtl"] .mobile-menu.active { transform: translateX(0); }
html[dir="ltr"] .mobile-menu { transform: translateX(100%); }
html[dir="ltr"] .mobile-menu.active { transform: translateX(0); }
html[dir="rtl"] .wpml-language-switcher #lang-dropdown { left: 0; right: auto; }
html[dir="ltr"] .wpml-language-switcher #lang-dropdown { right: 0; left: auto; }
/* Keep numbers, URLs, code, and mixed-direction labels readable. */
html[dir="rtl"] .code-line, html[dir="rtl"] code, html[dir="rtl"] pre, html[dir="rtl"] .font-code, html[dir="rtl"] [dir="ltr"] { direction: ltr; unicode-bidi: isolate; }

/* Code examples remain LTR and retain left-side indentation. */
html[dir="rtl"] .code-editor, html[dir="rtl"] .code-editor * { direction: ltr; text-align: left; }
html[dir="rtl"] .code-editor .pl-4 { padding-left: 1rem !important; padding-right: 0 !important; }
html[dir="rtl"] .code-editor .pl-8 { padding-left: 2rem !important; padding-right: 0 !important; }
