/* ============================================================
   ExpatCalc — RTL Overrides (Arabic pages only)
   Loaded exclusively on pages with dir="rtl" / lang="ar"
   ============================================================ */

/* ---------- Base Direction ---------- */
html[dir="rtl"] body {
  direction: rtl;
  text-align: right;
}

/* ---------- Header / Nav ---------- */
html[dir="rtl"] .header-inner {
  flex-direction: row-reverse;
}

html[dir="rtl"] .nav-links {
  flex-direction: row-reverse;
}

html[dir="rtl"] .site-logo {
  flex-direction: row-reverse;
}

html[dir="rtl"] .mobile-nav a {
  text-align: right;
}

/* ---------- Language Switcher ---------- */
html[dir="rtl"] .lang-switcher .container {
  flex-direction: row-reverse;
}

/* ---------- Breadcrumb ---------- */
html[dir="rtl"] .breadcrumb ol {
  flex-direction: row-reverse;
}

html[dir="rtl"] .breadcrumb-sep::before {
  content: '‹';
}

/* ---------- Hero ---------- */
html[dir="rtl"] .hero h1,
html[dir="rtl"] .hero-sub,
html[dir="rtl"] .hero-eyebrow {
  text-align: right;
}

html[dir="rtl"] .hero-actions {
  flex-direction: row-reverse;
}

/* ---------- Calculator Layout — Input RIGHT, Results LEFT ---------- */
html[dir="rtl"] .calculator-layout {
  direction: rtl;
}

/* ---------- Form Elements ---------- */
html[dir="rtl"] label {
  text-align: right;
  display: block;
}

html[dir="rtl"] .field-error {
  text-align: right;
}

/* Select arrow flip to left side */
html[dir="rtl"] select {
  background-position: left .75rem center;
  padding-left: 2.5rem;
  padding-right: .9rem;
}

/* Currency prefix/suffix swap */
html[dir="rtl"] .input-prefix {
  left: auto;
  right: .9rem;
}
html[dir="rtl"] .input-suffix {
  right: auto;
  left: .9rem;
}
html[dir="rtl"] .input-wrap input {
  padding-left: .9rem;
  padding-right: 3rem;
}
html[dir="rtl"] .input-wrap.has-suffix input {
  padding-right: .9rem;
  padding-left: 3rem;
}

/* ---------- Numbers ALWAYS stay LTR ---------- */
html[dir="rtl"] .result-primary-amount,
html[dir="rtl"] .result-number,
html[dir="rtl"] .breakdown-value,
html[dir="rtl"] .currency-amount,
html[dir="rtl"] input[type="number"],
html[dir="rtl"] .range-value,
html[dir="rtl"] .data-table .mono {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: left;
}

/* Breakdown rows: label right, value left */
html[dir="rtl"] .breakdown-row {
  flex-direction: row-reverse;
}

html[dir="rtl"] .breakdown-label {
  text-align: right;
}

/* ---------- Result Panel ---------- */
html[dir="rtl"] .result-primary-label {
  text-align: right;
}
html[dir="rtl"] .result-primary-note {
  text-align: right;
}
html[dir="rtl"] .result-empty {
  text-align: right;
}
html[dir="rtl"] .breakdown-title {
  text-align: right;
}

/* ---------- Notice Boxes ---------- */
html[dir="rtl"] .notice {
  flex-direction: row-reverse;
  text-align: right;
}

/* ---------- Ad Sidebar ---------- */
html[dir="rtl"] .ad-sidebar {
  float: left;
  margin-left: 0;
  margin-right: 1.5rem;
}

/* ---------- Info Bar ---------- */
html[dir="rtl"] .info-bar {
  flex-direction: row-reverse;
  text-align: right;
}

/* ---------- FAQ ---------- */
html[dir="rtl"] .faq-question {
  flex-direction: row-reverse;
  text-align: right;
}
html[dir="rtl"] .faq-answer {
  text-align: right;
}

/* ---------- Content Section ---------- */
html[dir="rtl"] .content-section {
  text-align: right;
}
html[dir="rtl"] .content-section ul,
html[dir="rtl"] .content-section ol {
  padding-inline-start: 0;
  padding-inline-end: 1.5rem;
}

/* ---------- Data Table ---------- */
html[dir="rtl"] .data-table th,
html[dir="rtl"] .data-table td {
  text-align: right;
}

/* ---------- Calculator Grid Cards ---------- */
html[dir="rtl"] .calc-card {
  text-align: right;
}

html[dir="rtl"] .calc-card-arrow {
  flex-direction: row-reverse;
}

/* ---------- Country Buttons ---------- */
html[dir="rtl"] .country-grid {
  direction: rtl;
}

/* ---------- Why / Feature Cards ---------- */
html[dir="rtl"] .why-card {
  text-align: right;
}

/* ---------- Footer ---------- */
html[dir="rtl"] .footer-grid {
  direction: rtl;
}
html[dir="rtl"] .footer-brand p {
  text-align: right;
}
html[dir="rtl"] .footer-col h4 {
  text-align: right;
}
html[dir="rtl"] .footer-col li,
html[dir="rtl"] .footer-col a {
  text-align: right;
  display: block;
}
html[dir="rtl"] .footer-bottom {
  flex-direction: row-reverse;
}
html[dir="rtl"] .footer-disclaimer {
  text-align: left;
}

/* ---------- Form Actions ---------- */
html[dir="rtl"] .form-actions {
  flex-direction: row-reverse;
}
html[dir="rtl"] .result-actions {
  flex-direction: row-reverse;
}

/* ---------- Step Indicator ---------- */
html[dir="rtl"] .step-indicator {
  flex-direction: row-reverse;
}

/* ---------- Section Headers ---------- */
html[dir="rtl"] .section-header {
  text-align: center; /* centre stays centre */
}

/* ---------- Hero Eyebrow ---------- */
html[dir="rtl"] .hero-eyebrow {
  direction: rtl;
}

/* ---------- Mobile Responsive RTL ---------- */
@media (max-width: 768px) {
  html[dir="rtl"] .hero-actions {
    flex-direction: column;
  }
  html[dir="rtl"] .form-actions {
    flex-direction: column;
  }
  html[dir="rtl"] .result-actions {
    flex-direction: column;
  }
}
