/* Shared Arabic content flow for public pages. Header, utility bar and footer are excluded. */
html[dir="rtl"] main,
body.is-ar main,
html[dir="rtl"] .page-content,
body.is-ar .page-content {
  direction: rtl;
}

/* Normal reading content. Intentionally centered hero/stat/button components are not included. */
html[dir="rtl"] main :is(.content-copy,.section-text,.card-body,.issue-card-body,.step-content,.alert-text,.form-note,.helper-text),
body.is-ar main :is(.content-copy,.section-text,.card-body,.issue-card-body,.step-content,.alert-text,.form-note,.helper-text),
html[dir="rtl"] main :is(.card,.service-card,.feature-card,.journal-card,.article-card,.edition-card,.member-card,.author-card,.format-card,.word-card,.info-card,.side-card,.details-card,.paper-card,.toc-card,.price-card,.pay-card,.scope-info-card,.board-card,.lv-article-card,.lv-featured,.lv-dark-box,.ep-card,.iv-card,.final-card,.indexed-card,.media-card,.intro-card),
body.is-ar main :is(.card,.service-card,.feature-card,.journal-card,.article-card,.edition-card,.member-card,.author-card,.format-card,.word-card,.info-card,.side-card,.details-card,.paper-card,.toc-card,.price-card,.pay-card,.scope-info-card,.board-card,.lv-article-card,.lv-featured,.lv-dark-box,.ep-card,.iv-card,.final-card,.indexed-card,.media-card,.intro-card) {
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] main :is(.card,.service-card,.feature-card,.journal-card,.article-card,.edition-card,.member-card,.author-card,.format-card,.word-card,.info-card,.side-card,.details-card,.paper-card,.toc-card,.price-card,.pay-card,.scope-info-card,.board-card,.lv-article-card,.lv-featured,.lv-dark-box,.ep-card,.iv-card,.final-card,.indexed-card,.media-card,.intro-card) :is(h1,h2,h3,h4,h5,h6,p,label,small,.description,.label,.helper,.meta-label),
body.is-ar main :is(.card,.service-card,.feature-card,.journal-card,.article-card,.edition-card,.member-card,.author-card,.format-card,.word-card,.info-card,.side-card,.details-card,.paper-card,.toc-card,.price-card,.pay-card,.scope-info-card,.board-card,.lv-article-card,.lv-featured,.lv-dark-box,.ep-card,.iv-card,.final-card,.indexed-card,.media-card,.intro-card) :is(h1,h2,h3,h4,h5,h6,p,label,small,.description,.label,.helper,.meta-label) {
  text-align: right;
}

/* Lists and icon/check rows: the first icon remains at the visual right in RTL. */
html[dir="rtl"] main :is(.about-list,.benefit-list,.check-list,.checklist,.feature-list,.icon-list,.topic-list,.price-features,.hero-list,.final-list,.lv-list,.process-list,.requirements,.guidelines),
body.is-ar main :is(.about-list,.benefit-list,.check-list,.checklist,.feature-list,.icon-list,.topic-list,.price-features,.hero-list,.final-list,.lv-list,.process-list,.requirements,.guidelines) {
  direction: rtl;
  text-align: right;
  padding-right: 0;
}

html[dir="rtl"] main :is(.about-list,.benefit-list,.check-list,.checklist,.feature-list,.icon-list,.topic-list,.price-features,.hero-list,.final-list,.lv-list,.process-list,.requirements,.guidelines) > li,
body.is-ar main :is(.about-list,.benefit-list,.check-list,.checklist,.feature-list,.icon-list,.topic-list,.price-features,.hero-list,.final-list,.lv-list,.process-list,.requirements,.guidelines) > li,
html[dir="rtl"] main :is(.benefit-row,.step,.step-item,.submit-step,.final-step,.iv-step,.process-step),
body.is-ar main :is(.benefit-row,.step,.step-item,.submit-step,.final-step,.iv-step,.process-step) {
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] main :is(.benefit-row,.step,.step-item,.submit-step,.final-step,.iv-step,.process-step)[style*="display: flex"],
body.is-ar main :is(.benefit-row,.step,.step-item,.submit-step,.final-step,.iv-step,.process-step)[style*="display: flex"] {
  flex-direction: row;
}

/* FAQ and accordion copy. */
html[dir="rtl"] main :is(.faq,.faq-list,.faq-grid,.faq-card,.faq-item,.faq-head,.final-faq,.final-faq-item,.final-faq-q,.final-faq-a,.iv-faq,.iv-faq-grid),
body.is-ar main :is(.faq,.faq-list,.faq-grid,.faq-card,.faq-item,.faq-head,.final-faq,.final-faq-item,.final-faq-q,.final-faq-a,.iv-faq,.iv-faq-grid) {
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] main :is(.faq-item,.faq-head,.final-faq-q) > :is(i,svg,.faq-icon,.toggle-icon),
body.is-ar main :is(.faq-item,.faq-head,.final-faq-q) > :is(i,svg,.faq-icon,.toggle-icon) {
  margin-left: 0;
  margin-right: auto;
}

/* Forms. Buttons/actions retain their component's existing alignment. */
html[dir="rtl"] main :is(form,.form-wrap,.form-card,.form-shell,.membership-form,.form-section,.form-grid,.form-group,.form-head),
body.is-ar main :is(form,.form-wrap,.form-card,.form-shell,.membership-form,.form-section,.form-grid,.form-group,.form-head) {
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] main :is(label,.form-note,.helper-text,.validation-message,.error-message),
body.is-ar main :is(label,.form-note,.helper-text,.validation-message,.error-message) {
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] main :is(input:not([type="email"]):not([type="url"]):not([type="tel"]),textarea,select),
body.is-ar main :is(input:not([type="email"]):not([type="url"]):not([type="tel"]),textarea,select) {
  direction: rtl;
  text-align: right;
}

/* Metadata labels use RTL; technical values remain isolated LTR. */
html[dir="rtl"] main :is(.article-meta,.article-meta-row,.journal-meta,.edition-meta,.meta-grid,.meta-box,.details-grid,.jc-meta-item,.iv-meta-row,.iv-meta-box),
body.is-ar main :is(.article-meta,.article-meta-row,.journal-meta,.edition-meta,.meta-grid,.meta-box,.details-grid,.jc-meta-item,.iv-meta-row,.iv-meta-box) {
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] main :is([dir="ltr"],[lang="en"],[data-content-lang="en"],.doi,.issn,.orcid,.email,.phone,.url,a[href^="mailto:"],a[href^="tel:"],input[type="email"],input[type="url"],input[type="tel"]),
body.is-ar main :is([dir="ltr"],[lang="en"],[data-content-lang="en"],.doi,.issn,.orcid,.email,.phone,.url,a[href^="mailto:"],a[href^="tel:"],input[type="email"],input[type="url"],input[type="tel"]) {
  direction: ltr !important;
  unicode-bidi: isolate !important;
  text-align: left;
  overflow-wrap: normal;
  word-break: normal;
}

/* Preserve explicitly centered visual elements. */
html[dir="rtl"] main :is(.text-center,.stat-card,.stats-grid,.hero-badges,.badge,.badges,.form-actions,.card-actions,.cta-actions),
body.is-ar main :is(.text-center,.stat-card,.stats-grid,.hero-badges,.badge,.badges,.form-actions,.card-actions,.cta-actions) {
  text-align: center;
}

html[dir="rtl"] main,
body.is-ar main {
  overflow-wrap: anywhere;
}

/* Never let page-content RTL rules leak into approved global chrome. */
html[dir="rtl"] :is(.vtx-utility-bar,.uhf-topline,.sticky-header-stack,.uhf-header,#vtxSharedHeader,#vu-inner-standard-header,footer),
body.is-ar :is(.vtx-utility-bar,.uhf-topline,.sticky-header-stack,.uhf-header,#vtxSharedHeader,#vu-inner-standard-header,footer) {
  overflow-wrap: normal;
}
