/* ==========================================================================
   IIAM — Arabic / RTL overrides (loaded only when is_rtl())
   The theme uses logical properties (margin-inline, inset-inline) and
   flex/grid, so most of the layout mirrors automatically. These rules
   handle text direction, alignment, and keeping Latin data LTR.
   ========================================================================== */

html, body.iiam { direction: rtl; text-align: right; overflow-x: hidden; }

/* Full-bleed layout must stay edge-to-edge in RTL (beat Astra RTL container rules). */
.iiam-fullwidth #page,
.iiam-fullwidth #content,
.iiam-fullwidth #content .ast-container,
.iiam-fullwidth #primary,
.iiam-fullwidth .ast-container > article {
	width: 100% !important;
	max-width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	float: none !important;
	right: auto !important;
	left: auto !important;
}
.iiam-section, .iiam-hero, .iiam-main { width: 100%; max-width: 100%; }
.iiam-wrap { margin-right: auto; margin-left: auto; }

/* Headings, leads and prose align right */
.iiam h1, .iiam h2, .iiam h3, .iiam h4,
.iiam-lead, .iiam-prose, .iiam-prose p, .iiam-prose li,
.iiam-card p, .iiam-hero-text p { text-align: right; }

/* Centered sections stay centered */
.iiam-center, .iiam-center * { text-align: center; }
.iiam-cta-box, .iiam-cta-box * { text-align: center; }

/* Keep phone numbers, emails and the brand acronym in LTR so they read correctly */
.iiam-topbar a[href^="tel"],
.iiam-topbar a[href^="mailto"],
.iiam-contact-card a[href^="tel"],
.iiam-contact-card a[href^="mailto"],
.iiam-footer a[href^="tel"],
.iiam-footer a[href^="mailto"],
.iiam-hero-meta a[href^="mailto"],
.iiam-brand-name,
.iiam-langs a,
input[type="email"],
input[type="tel"] {
    direction: ltr;
    unicode-bidi: embed;
}
input[type="email"],
input[type="tel"] { text-align: right; }

/* Form labels / fields align right */
.iiam-field label { text-align: right; }
.iiam-consent { flex-direction: row; }

/* Checklist / hero-point ticks point the other way (also set in iiam.css) */
[dir="rtl"] .iiam-checklist li::before,
[dir="rtl"] .iiam-hero-points li::before { transform: rotate(45deg); }
.iiam-checklist li { padding-inline-start: 2rem; padding-inline-end: 0; }

/* Topbar: contact block on the right, location on the left (auto via flex) */
.iiam-topbar .iiam-wrap { flex-direction: row-reverse; }

/* Header: brand on the right, nav on the left (flex auto-mirrors; ensure CTA spacing) */
.iiam-header-cta { margin-inline-start: 0; }

/* Mobile drawer slides in from the left in RTL */
@media (max-width: 1100px) {
    .iiam-nav {
        right: auto;
        left: 0;
        transform: translateX(-100%);
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.3);
    }
    .iiam-nav.iiam-nav--open { transform: translateX(0); }
}

/* Footer bottom: keep items readable */
.iiam-footer-bottom { flex-direction: row-reverse; }
.iiam-footer-note, .iiam-disclaimer { text-align: right; }

/* Timeline numbers already use logical inset; ensure text right */
.iiam-tl-step h3, .iiam-tl-step p, .iiam-step h3, .iiam-step p { text-align: right; }

/* Guard against horizontal overflow from any mirrored shadows */
body.iiam { overflow-x: clip; }
