/* Loaded only for RTL editions, including RTL navigation on English fallbacks. */
html[dir="rtl"] :is(h1, h2, h3, button, label) { letter-spacing: normal; }

/* Preserve the navbar's ordering and far-right language switcher. RTL labels
   keep their own reading direction; language names use <bdi> in every edition. */
nav[dir="rtl"] { direction: ltr; }
nav[dir="rtl"] :is(.nav-group-toggle, .nav-sub-toggle, .nav-dropdown a, .nav-button-link) {
    direction: rtl;
}
.language-menu { direction: ltr; }

/* Code, identifiers and email addresses must retain their literal order.
   Prompt blocks use dir=auto, so RTL examples and shell commands both work. */
html[dir="rtl"] :is(code:not([dir]), pre:not([dir]), kbd, samp, input[type="email"], input[type="url"], input[type="tel"]) {
    direction: ltr;
    unicode-bidi: isolate;
}
html[dir="rtl"] code:not([dir]) { display: inline-block; }
html[dir="rtl"] .gg-prompt-body code { display: block; text-align: start; }
html[dir="rtl"] .gg-prompt-head-bare + .gg-prompt-body {
    padding-inline: 1.1rem;
    padding-right: 5.5rem;
}

/* Hide form honeypots beyond the non-scrollable edge in RTL documents. */
html[dir="rtl"] :is(.pc-hp, .dp-hp) {
    left: auto;
    right: -10000px;
}

/* Carousel scroll coordinates and tab arrow-key order are LTR in the scripts. */
html[dir="rtl"] :is(.mwt-carousel, .testimonial-carousel, .mcp-tabs) { direction: ltr; }
html[dir="rtl"] :is(.testimonial-card, .mwt-carousel li) { direction: rtl; }

/* Mirror directional diagrams and custom list markers with the reading order. */
html[dir="rtl"] .rbx-arrow { transform: scaleX(-1); }
html[dir="rtl"] :is(.rbx-side li, .rbx-lane li)::before {
    left: auto;
    inset-inline-start: 0;
}
html[dir="rtl"] .herogallery-video { transform: translateX(-280px); }
@media (min-width: 1101px) {
    html[dir="rtl"] .hero .container { margin: 0 max(2%, calc(50% - 612px)) 0 0; }
}
@media (max-width: 1100px) {
    html[dir="rtl"] .herogallery-video { transform: none; }
}
