/* Shared right-to-left public layout support. Keep Latin identifiers isolated. */
html[dir="rtl"] .shell,
html[dir="rtl"] .site-header {
  direction: rtl;
}

html[dir="rtl"] .topbar {
  direction: rtl;
}

html[dir="rtl"] .brand {
  max-width: 100%;
}

html[dir="rtl"] .brand > span:last-child {
  min-width: 0;
  text-align: start;
}

html[dir="rtl"] .brand-name {
  direction: ltr;
  unicode-bidi: isolate;
  max-width: 100%;
  text-align: end;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  text-overflow: clip;
}

html[dir="rtl"] .brand-eyebrow {
  max-width: 100%;
  letter-spacing: 0.04em;
  text-align: start;
}

html[dir="rtl"] :is(a[href^="tel:"], a[href^="mailto:"], .ltr, [data-keep-ltr]) {
  direction: ltr;
  unicode-bidi: isolate;
}

@media (width <= 760px) {
  html[dir="rtl"] .topbar {
    align-items: center;
    gap: 7px;
  }

  html[dir="rtl"] .brand {
    flex: 1 1 0;
    max-width: calc(100vw - 164px);
    gap: 7px;
  }

  html[dir="rtl"] .brand .logo {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
  }

  html[dir="rtl"] .brand > span:last-child {
    flex: 1 1 auto;
    width: auto;
  }

  html[dir="rtl"] .brand-eyebrow {
    font-size: 8px;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  html[dir="rtl"] .brand-name {
    display: block;
    max-width: 100%;
    overflow: visible;
    font-size: 13px;
    line-height: 1.2;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  html[dir="rtl"] .mobile-header-tools {
    flex: 0 0 auto;
    gap: 6px;
  }

  html[dir="rtl"] .mobile-menu-toggle {
    gap: 6px;
    padding-inline: 10px;
  }
}
