/*
 * RTL overrides for languages detected by GTranslate.
 * These rules are scoped to the `translated-rtl` helper class injected on <html>.
 */
html.translated-rtl body {
  direction: rtl;
  unicode-bidi: embed;
  text-align: right;
}

html.translated-rtl body ::selection {
  direction: rtl;
}

html.translated-rtl .skiptranslate,
html.translated-rtl input[type="email"],
html.translated-rtl input[type="url"],
html.translated-rtl input[type="tel"],
html.translated-rtl textarea[dir="ltr"] {
  direction: ltr;
  text-align: left;
}

/* Text utilities */
html.translated-rtl .text-left,
html.translated-rtl .md\:text-left {
  text-align: right !important;
}

html.translated-rtl .text-right,
html.translated-rtl .md\:text-right {
  text-align: left !important;
}

/* Space between flex children */
html.translated-rtl .space-x-2 > :not([hidden]) ~ :not([hidden]) {
  margin-right: 0.5rem;
  margin-left: 0;
}

html.translated-rtl .space-x-3 > :not([hidden]) ~ :not([hidden]) {
  margin-right: 0.75rem;
  margin-left: 0;
}

html.translated-rtl .space-x-4 > :not([hidden]) ~ :not([hidden]) {
  margin-right: 1rem;
  margin-left: 0;
}

html.translated-rtl .space-x-6 > :not([hidden]) ~ :not([hidden]) {
  margin-right: 1.5rem;
  margin-left: 0;
}

html.translated-rtl .space-x-8 > :not([hidden]) ~ :not([hidden]) {
  margin-right: 2rem;
  margin-left: 0;
}

/* Margin helpers */
html.translated-rtl .ml-1 {
  margin-right: 0.25rem;
  margin-left: 0;
}

html.translated-rtl .ml-2 {
  margin-right: 0.5rem;
  margin-left: 0;
}

html.translated-rtl .ml-3 {
  margin-right: 0.75rem;
  margin-left: 0;
}

html.translated-rtl .-ml-1 {
  margin-right: -0.25rem;
  margin-left: 0;
}

html.translated-rtl .mr-1 {
  margin-left: 0.25rem;
  margin-right: 0;
}

html.translated-rtl .mr-2 {
  margin-left: 0.5rem;
  margin-right: 0;
}

html.translated-rtl .mr-3 {
  margin-left: 0.75rem;
  margin-right: 0;
}

html.translated-rtl .mr-4 {
  margin-left: 1rem;
  margin-right: 0;
}

/* Padding helpers */
html.translated-rtl .pl-6,
html.translated-rtl .lg\:pl-6 {
  padding-right: 1.5rem;
  padding-left: 0;
}

html.translated-rtl .pl-8,
html.translated-rtl .lg\:pl-8 {
  padding-right: 2rem;
  padding-left: 0;
}

html.translated-rtl .pl-10,
html.translated-rtl .lg\:pl-10 {
  padding-right: 2.5rem;
  padding-left: 0;
}

html.translated-rtl .pr-4,
html.translated-rtl .lg\:pr-4 {
  padding-left: 1rem;
  padding-right: 0;
}

/* Border helpers */
html.translated-rtl .border-l-4 {
  border-right-width: 4px;
  border-left-width: 0;
}

html.translated-rtl .border-l-yellow-400 {
  border-right-color: #facc15;
  border-left-color: transparent;
}

/* Mobile navigation drawer should slide in from the right in RTL */
html.translated-rtl .mobile-menu-content {
  transform: translateX(100%);
}

html.translated-rtl #mobile-menu.active .mobile-menu-content {
  transform: translateX(0);
}
