/* ===== Silver Lang RTL Support (Arabic & Hebrew) ===== */
/* Applied when lang attribute starts with "ar" or "he" */

:is(html[lang^="ar"], html[lang^="he"]) {
  direction: rtl;
}

/* -- Header -- */
:is(html[lang^="ar"], html[lang^="he"]) .header-nav a {
  /* gap handled by flex */
}

/* -- Language Selector: custom div-based control handles its own RTL (see custom-select.css) -- */

/* -- Modes grid -- */
:is(html[lang^="ar"], html[lang^="he"]) .mode-card {
  text-align: right;
}

/* -- Bento card top border gradient flip -- */
:is(html[lang^="ar"], html[lang^="he"]) .bento-card::before {
  background: linear-gradient(270deg, transparent, var(--color-accent-subtle), transparent);
}

/* -- Section headers -- */
:is(html[lang^="ar"], html[lang^="he"]) .section-header {
  text-align: right;
}

/* -- Hero -- */
:is(html[lang^="ar"], html[lang^="he"]) .hero {
  text-align: right;
}

:is(html[lang^="ar"], html[lang^="he"]) .hero-actions {
  justify-content: flex-start;
}

:is(html[lang^="ar"], html[lang^="he"]) .hero-motto {
  letter-spacing: normal;
}

/* -- CTA section -- */
:is(html[lang^="ar"], html[lang^="he"]) .cta-section {
  text-align: right;
}

/* -- Footer -- */
:is(html[lang^="ar"], html[lang^="he"]) .footer-brand {
  text-align: right;
}

:is(html[lang^="ar"], html[lang^="he"]) .footer-links {
  text-align: right;
}

:is(html[lang^="ar"], html[lang^="he"]) .footer-bottom {
  text-align: right;
}

/* -- Docs Layout -- */
:is(html[lang^="ar"], html[lang^="he"]) .docs-layout {
  direction: rtl;
}

:is(html[lang^="ar"], html[lang^="he"]) .docs-sidebar {
  left: auto;
  right: 0;
  border-right: none;
  border-left: 1px solid var(--color-border-secondary);
}

:is(html[lang^="ar"], html[lang^="he"]) .docs-nav-section a {
  border-left: none;
  border-right: 2px solid transparent;
}

:is(html[lang^="ar"], html[lang^="he"]) .docs-nav-section a.active {
  border-left-color: transparent;
  border-right-color: var(--color-accent);
}

:is(html[lang^="ar"], html[lang^="he"]) .docs-nav-section h3 {
  text-align: right;
}

:is(html[lang^="ar"], html[lang^="he"]) .docs-search-field .search-icon {
  left: auto;
  right: var(--space-3);
}

:is(html[lang^="ar"], html[lang^="he"]) .docs-search-field input {
  padding: var(--space-2) var(--space-8) var(--space-2) var(--space-4);
}

:is(html[lang^="ar"], html[lang^="he"]) .docs-content {
  text-align: right;
}

:is(html[lang^="ar"], html[lang^="he"]) .docs-welcome {
  text-align: right;
}

:is(html[lang^="ar"], html[lang^="he"]) .docs-topic-grid {
  text-align: right;
}

/* -- Docs prev/next nav flip -- */
:is(html[lang^="ar"], html[lang^="he"]) .docs-nav-prev {
  align-items: flex-end;
  text-align: right;
}

:is(html[lang^="ar"], html[lang^="he"]) .docs-nav-next {
  align-items: flex-start;
  text-align: left;
  margin-left: 0;
  margin-right: auto;
}

/* -- Code block header -- */
:is(html[lang^="ar"], html[lang^="he"]) .code-block-header {
  text-align: right;
}

:is(html[lang^="ar"], html[lang^="he"]) .code-block pre {
  direction: ltr;
  text-align: left;
}

:is(html[lang^="ar"], html[lang^="he"]) .bento-card-code pre {
  direction: ltr;
  text-align: left;
}

:is(html[lang^="ar"], html[lang^="he"]) .hero-code-preview pre {
  direction: ltr;
  text-align: left;
}

:is(html[lang^="ar"], html[lang^="he"]) .hero-code-preview code {
  direction: ltr;
}

/* -- Code blocks always LTR -- */
:is(html[lang^="ar"], html[lang^="he"]) .code-block code {
  direction: ltr;
  text-align: left;
}

:is(html[lang^="ar"], html[lang^="he"]) .bento-card-code code {
  direction: ltr;
  text-align: left;
}

/* -- Speed bar gradient flip -- */
:is(html[lang^="ar"], html[lang^="he"]) .mode-card .speed-fill {
  background: linear-gradient(270deg, var(--color-success), var(--color-accent));
}/* -- Docs sidebar toggle button -- */
:is(html[lang^="ar"], html[lang^="he"]) .docs-sidebar-toggle {
    left: auto;
    right: var(--space-4);
}

/* -- Mobile sidebar slide direction -- */
:is(html[lang^="ar"], html[lang^="he"]) .docs-sidebar {
    transform: translateX(100%);
}

:is(html[lang^="ar"], html[lang^="he"]) .docs-sidebar.open {
    transform: translateX(0);
}

/* -- TOC -- */
:is(html[lang^="ar"], html[lang^="he"]) .docs-toc {
  text-align: right;
}

:is(html[lang^="ar"], html[lang^="he"]) .docs-toc ul {
  justify-content: flex-start;
}

/* -- No results -- */
:is(html[lang^="ar"], html[lang^="he"]) .no-results {
  text-align: right;
}
