/* Arabic pages only (under /ar/). Layout already flips through style.css, which uses
   logical properties. This file adds the Arabic font and the few details that don't flip alone. */

@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/ibm-plex-sans-arabic-400.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/ibm-plex-sans-arabic-500.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 600 700; font-display: swap; src: url(/fonts/ibm-plex-sans-arabic-600.woff2) format("woff2"); }

html[dir="rtl"] {
  --font-manrope: "IBM Plex Sans Arabic", "Manrope", sans-serif;
  --font-inter: "IBM Plex Sans Arabic", "Inter", sans-serif;
  --font-plex-mono: "IBM Plex Sans Arabic", "Inter", sans-serif;
}

/* Letter spacing breaks joined Arabic letters. The logo keeps its own spacing. */
html[dir="rtl"] body *:not([data-logo] *) { letter-spacing: normal !important; }

/* Arabic reads better with more generous line height. */
html[dir="rtl"] body { line-height: 1.85; }
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4 { line-height: 1.32 !important; font-weight: 600; }
html[dir="rtl"] .annotation { font-size: 0.8125rem; line-height: 1.6; font-weight: 500; }

/* Scrims sit behind the text, which is on the right. */
html[dir="rtl"] .bg-gradient-to-r { --tw-gradient-position: to left in oklab; }
@media (min-width: 64rem) {
  html[dir="rtl"] .lg\:bg-gradient-to-r { --tw-gradient-position: to left in oklab; }
}

/* The mobile drawer slides in from the left. */
html[dir="rtl"] .translate-x-full { --tw-translate-x: -100%; }

/* Forward-pointing arrows point left. */
html[dir="rtl"] .rtl-flip { transform: scaleX(-1); }
html[dir="rtl"] dialog [data-prev] svg,
html[dir="rtl"] dialog [data-next] svg { transform: scaleX(-1); }
html[dir="rtl"] .group:hover .rtl-flip,
html[dir="rtl"] .group\/btn:hover .rtl-flip,
html[dir="rtl"] .group\/link:hover .rtl-flip { translate: -0.25rem 0; }

/* Dropdown arrow on the left. */
html[dir="rtl"] select.field-control { background-position: left 0.9rem center; padding-right: 0.9rem; padding-left: 2.5rem; }

/* Phone and email are typed left to right, aligned with the Arabic form. */
html[dir="rtl"] input[type="tel"],
html[dir="rtl"] input[type="email"] { direction: ltr; text-align: right; }

/* Labels inside the technical drawings keep their position in the drawing. */
html[dir="rtl"] svg text { direction: ltr; font-family: var(--font-inter); }
