/* ============================================================
   The language picker, and right-to-left layout for Arabic,
   Persian, Urdu, Sindhi and Uyghur. Linked from every page by i18n/build.
   ============================================================ */

.lang-picker {
  position: absolute;
  top: 14px;
  inset-inline-end: 18px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FFFFFF;
  border: 1px solid #D9D4CD;
  border-radius: 999px;
  padding: 5px 8px 5px 12px;
  box-shadow: 0 2px 10px rgba(58, 58, 60, 0.12);
  font-family: inherit;
}

.lang-picker label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #3A3A3C;
  cursor: pointer;
}

.lang-picker .lang-globe { font-size: 16px; line-height: 1; }

.lang-picker select {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #3A3A3C;
  background: #F5F3F0;
  border: 1px solid #D9D4CD;
  border-radius: 999px;
  padding: 6px 10px;
  min-height: 34px;
  max-width: 13.5em;
  cursor: pointer;
}

.lang-picker select:focus-visible {
  outline: 2px solid #5C6A94;
  outline-offset: 2px;
}

/* Product pages have a fixed sidebar; the picker belongs to the reading area. */
body:has(.app-frame) { position: relative; }

/* Room for the picker above a product page's title. */
.app-frame .content-header,
.app-frame .hero { padding-top: 72px; }

.site-header { padding-top: 56px; }

@media (max-width: 768px) {
  .lang-picker { top: 12px; inset-inline-end: 12px; padding: 4px 6px 4px 10px; }
  .lang-picker .lang-label { display: none; }
  .lang-picker select { max-width: 10.5em; }
}

/* Long things that cannot break - a file path, a package name, a long word in
   a headline - wrap instead of pushing the page wider than a phone. */
.shortcut-desc, .notices td, .notices td.pkg, .content-body code { overflow-wrap: anywhere; }
.shortcut-desc { min-width: 0; }
.hero-title { overflow-wrap: break-word; }

@media (max-width: 768px) {
  .compat-table { display: block; overflow-x: auto; max-width: calc(100vw - 48px); }
}
@media (max-width: 480px) {
  html:not([lang="en"]) .hero-title { font-size: min(2.4rem, 9vw); }
}

/* A translated agreement or privacy statement says which version applies. */
.translation-notice { font-size: 14px; }
p.translation-notice { color: #7A7A7E; margin: 12px 0; }

/* ---- right to left -------------------------------------------------------- */

[dir="rtl"] body { text-align: right; }

[dir="rtl"] .sidebar {
  left: auto;
  right: 0;
  border-right: none;
  border-left: 1px solid var(--border);
}

[dir="rtl"] .content,
[dir="rtl"] .status-bar { margin-left: 0; margin-right: 250px; }

[dir="rtl"] .sidebar-nav a {
  border-left: none;
  border-right: 3px solid transparent;
}
[dir="rtl"] .sidebar-nav a:hover { border-right-color: var(--primary-light); }
[dir="rtl"] .sidebar-nav a.active { border-right-color: var(--primary); }
[dir="rtl"] .sidebar-nav .nav-icon { margin-right: 0; margin-left: 10px; }

[dir="rtl"] .callout {
  border-left: none;
  border-right: 4px solid var(--primary);
  border-radius: 6px 0 0 6px;
}
[dir="rtl"] .callout.tip { border-right-color: var(--accent); }
[dir="rtl"] .callout.warning { border-right-color: var(--warning); }
[dir="rtl"] .callout.danger { border-right-color: var(--danger); }

[dir="rtl"] .never-list li {
  border-left: none;
  border-right: 3px solid var(--danger);
}

[dir="rtl"] .shortcut-key { margin-right: 0; margin-left: 16px; }

[dir="rtl"] .notices th,
[dir="rtl"] .notices td,
[dir="rtl"] .notices caption { text-align: right; padding: 7px 0 7px 12px; }

[dir="rtl"] .mobile-menu-btn { left: auto; right: 14px; }
[dir="rtl"] .sidebar-close { right: auto; left: 14px; }

[dir="rtl"] ul, [dir="rtl"] ol { padding-right: 0; }

/* The company home page. */
[dir="rtl"] .motto { text-align: left; }
[dir="rtl"] .hero-note {
  padding-left: 0;
  padding-right: 16px;
  border-left: none;
  border-right: 2px solid var(--tint);
}
[dir="rtl"] .foot-copy { margin-left: 0; margin-right: auto; }

/* Things that are the same in every language keep their own direction:
   file paths, key names, package names, addresses. */
[dir="rtl"] .shortcut-key,
[dir="rtl"] code,
[dir="rtl"] .pkg,
[dir="rtl"] .ver,
[dir="rtl"] details {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: left;
}

@media (max-width: 768px) {
  [dir="rtl"] .content,
  [dir="rtl"] .status-bar { margin-right: 0; }
  [dir="rtl"] .sidebar { transform: translateX(100%); }
  [dir="rtl"] .sidebar.open { transform: translateX(0); }
}
