/* =============================================================================
 * pp-rtl.css — RTL (Right-to-Left) Support for Arabic/Persian/Hebrew/Urdu
 * Auto-applied when pp-i18n switches to RTL languages
 * ========================================================================== */

/* When pp-rtl class is active on body */
body.pp-rtl {
  direction: rtl;
  text-align: right;
}

/* Flip flex-row direction */
body.pp-rtl .pp-nav,
body.pp-rtl .pp-nav-actions,
body.pp-rtl .pp-hero-mono,
body.pp-rtl .auth-top,
body.pp-rtl .dh-nav,
body.pp-rtl .dh-nav-actions {
  direction: rtl;
}

/* But keep buttons/inputs in their own direction context */
body.pp-rtl input,
body.pp-rtl textarea,
body.pp-rtl select {
  direction: rtl;
  text-align: right;
}

/* Keep Latin text/inputs LTR (e.g. emails, URLs, numbers) */
body.pp-rtl input[type="email"],
body.pp-rtl input[type="url"],
body.pp-rtl input[type="tel"],
body.pp-rtl input[type="number"],
body.pp-rtl input[type="password"],
body.pp-rtl input[inputmode="email"],
body.pp-rtl input[inputmode="numeric"],
body.pp-rtl input[inputmode="tel"] {
  direction: ltr;
  text-align: left;
}

/* Brand stays LTR */
body.pp-rtl .pp-nav-brand,
body.pp-rtl .auth-top-brand,
body.pp-rtl .dh-nav-brand,
body.pp-rtl .pp-boot-brand {
  direction: ltr;
  unicode-bidi: bidi-override;
}

/* Mirror arrows in nav */
body.pp-rtl .auth-top-back::before,
body.pp-rtl .pp-back::before {
  content: '→';
}
body.pp-rtl .auth-top-back,
body.pp-rtl .pp-back {
  /* Visually flip "← Zurück" -> "Zurück →" */
}

/* Mirror padding/margin: use logical properties when possible */
body.pp-rtl .pp-nav-sel {
  background-position: left 8px center !important;
  padding-right: 14px !important;
  padding-left: 28px !important;
}

/* Toast positioning - keep in same visual position regardless of RTL */
body.pp-rtl #ppI18nToast {
  right: auto !important;
  left: 24px !important;
}

/* Persian/Arabic specific: better fonts */
body.pp-rtl {
  font-family: 'Vazirmatn', 'Tahoma', 'Inter', sans-serif;
}

/* Headings still use Playfair (LTR-style) but readable in RTL */
body.pp-rtl h1, body.pp-rtl h2, body.pp-rtl h3,
body.pp-rtl .pp-hero h1,
body.pp-rtl .auth-card h1 {
  font-family: 'Vazirmatn', 'Tahoma', 'Playfair Display', serif;
  letter-spacing: 0;
}

/* Italic styling doesn't work well in RTL languages */
body.pp-rtl i {
  font-style: normal;
  color: #2DD4BF;
}
