/**
 * Arabic RTL overrides — loaded only on /ar routes.
 * IBM Plex Sans Arabic: clean clinical/professional face for aesthetic medicine.
 */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&display=swap');

html[lang="ar"],
html[dir="rtl"],
body.tm-rtl,
body.tm-lang-ar {
  direction: rtl;
  text-align: right;
  --font-sans: "IBM Plex Sans Arabic", "Tahoma", "Segoe UI", sans-serif;
  --font-display: "IBM Plex Sans Arabic", "Tahoma", "Segoe UI", sans-serif;
  font-family: var(--font-sans);
  line-height: 1.75;
}

body.tm-rtl,
body.tm-lang-ar,
body.tm-rtl *,
body.tm-lang-ar * {
  letter-spacing: normal;
}

body.tm-rtl h1,
body.tm-rtl h2,
body.tm-rtl h3,
body.tm-rtl h4,
body.tm-rtl h5,
body.tm-rtl h6 {
  line-height: 1.4;
  letter-spacing: 0 !important;
}

body.tm-rtl p,
body.tm-rtl li,
body.tm-rtl span,
body.tm-rtl a {
  line-height: 1.8;
}

/* Flip common LTR utility patterns used in PHP templates */
body.tm-rtl .text-left {
  text-align: right !important;
}

body.tm-rtl .text-right {
  text-align: left !important;
}

body.tm-rtl .sm\:text-left {
  text-align: right !important;
}

@media (min-width: 640px) {
  body.tm-rtl .sm\:text-left {
    text-align: right !important;
  }
}

body.tm-rtl .lg\:text-left {
  text-align: right !important;
}

@media (min-width: 1024px) {
  body.tm-rtl .lg\:text-left {
    text-align: right !important;
  }
}

/* Spacing mirrors */
body.tm-rtl .ml-auto {
  margin-left: 0 !important;
  margin-right: auto !important;
}

body.tm-rtl .mr-auto {
  margin-right: 0 !important;
  margin-left: auto !important;
}

body.tm-rtl .space-x-2 > :not([hidden]) ~ :not([hidden]),
body.tm-rtl .space-x-3 > :not([hidden]) ~ :not([hidden]),
body.tm-rtl .space-x-4 > :not([hidden]) ~ :not([hidden]) {
  --tw-space-x-reverse: 1;
}

/* Breadcrumbs / chevrons feel natural in RTL */
body.tm-rtl .breadcrumb-sep,
body.tm-rtl [data-breadcrumb-sep],
body.tm-rtl .lucide-chevron-right,
body.tm-rtl .lucide-arrow-right {
  transform: scaleX(-1);
}

body.tm-rtl .lucide-chevron-left,
body.tm-rtl .lucide-arrow-left {
  transform: scaleX(-1);
}

/* Numbers & Phone numbers */
body.tm-rtl .tm-phone,
body.tm-rtl a[href^="tel:"],
body.tm-rtl .tm-numeric {
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
}

/* Language switcher base styles live in custom.css (always loaded). */

/* Soften Latin tracking on Arabic */
body.tm-rtl .tracking-widest,
body.tm-rtl .tracking-wider,
body.tm-rtl .tracking-wide,
body.tm-rtl .uppercase {
  letter-spacing: 0 !important;
  text-transform: none !important;
}

/* Forms stay readable */
body.tm-rtl input,
body.tm-rtl textarea,
body.tm-rtl select {
  text-align: right;
  direction: rtl;
}

/* Keep phone / Instagram icons visually balanced */
body.tm-rtl .mobile-bottom-bar {
  direction: rtl;
}
