/* ==========================================================================
   RTL / LTR Specific Adjustments - Al Zehary Law Group
   Architecture: Single Codebase using Logical Properties. 
   This file handles ONLY typography nuances, physical property overrides, 
   and visual direction flips that logical properties cannot solve.
   ========================================================================== */

/* --- Base Directionality --- */
html[dir="rtl"] body { 
    direction: rtl; 
    text-align: right; 
    font-feature-settings: "kern" 1, "liga" 1; /* Better Arabic Ligatures */
}
html[dir="ltr"] body { 
    direction: ltr; 
    text-align: left; 
}

/* ==========================================================================
   Arabic Typography Enhancements (Enterprise Legal Feel)
   Arabic requires slightly more line-height and different letter-spacing 
   than English to look premium and readable.
   ========================================================================== */
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4 {
    letter-spacing: 0; /* English uses negative spacing, Arabic needs 0 */
    line-height: 1.35; /* Slightly looser than English 1.22 for clarity */
}

html[dir="rtl"] body {
    line-height: 1.95; /* More vertical space for Arabic readability */
}

html[dir="rtl"] p {
    line-height: 1.9;
}

/* ==========================================================================
   Physical Property Overrides (For elements not using Logical Properties)
   ========================================================================== */

/* Fixing the original file's bug - removing physical margins */
html[dir="rtl"] .azl-primary-nav,
html[dir="ltr"] .azl-primary-nav {
    margin-inline-start: 0; /* Logical property handles it automatically */
    margin-left: 0; /* Removed the physical property that broke RTL */
    margin-right: 0;
}

/* Checklists & List Items Padding (If not using logical properties) */
html[dir="ltr"] .azl-check-list li,
html[dir="ltr"] .azl-approved-list li,
html[dir="ltr"] .azl-home-team-card li {
    padding-left: 28px;
    padding-right: 0;
}
html[dir="rtl"] .azl-check-list li,
html[dir="rtl"] .azl-approved-list li,
html[dir="rtl"] .azl-home-team-card li {
    padding-right: 28px;
    padding-left: 0;
}

/* FAQ Answer Indent */
html[dir="ltr"] .azl-home-faq-answer { padding-left: 82px; padding-right: 20px; }
html[dir="rtl"] .azl-home-faq-answer { padding-right: 82px; padding-left: 20px; }

/* Outsourcing Panel List Items */
html[dir="ltr"] .azl-outsourcing-panel li { padding-left: 34px; padding-right: 12px; }
html[dir="rtl"] .azl-outsourcing-panel li { padding-right: 34px; padding-left: 12px; }


/* ==========================================================================
   Visual Direction Flips (Arrows, Gradients, Transforms)
   ========================================================================== */

/* Link Arrows (B2C vs B2B) */
html[dir="ltr"] .azl-home-service-card a::after,
html[dir="ltr"] .azl-audience-card a::after { content: "→"; }

html[dir="rtl"] .azl-home-service-card a::after,
html[dir="rtl"] .azl-audience-card a::after { content: "←"; }

/* B2B Gold Links */
html[dir="ltr"] .azl-home-services-b2b-link::after { content: "→"; }
html[dir="rtl"] .azl-home-services-b2b-link::after { content: "←"; }

/* Service Card Links */
html[dir="ltr"] .azl-service-card a::after { content: "→"; }
html[dir="rtl"] .azl-service-card a::after { content: "←"; }

/* Process Step Hover Effect (Push direction) */
html[dir="ltr"] .azl-home-process-step:hover { transform: translateX(-4px); }
html[dir="rtl"] .azl-home-process-step:hover { transform: translateX(4px); }

/* Sidebar Link Hover (Push direction) */
html[dir="ltr"] .azl-service-sidebar a:not(.azl-btn):hover { transform: translateX(-4px); }
html[dir="rtl"] .azl-service-sidebar a:not(.azl-btn):hover { transform: translateX(4px); }

/* Footer Links Hover */
html[dir="ltr"] .azl-footer-links a:hover,
html[dir="ltr"] .azl-footer-contact a:hover { transform: translateX(2px); }
html[dir="rtl"] .azl-footer-links a:hover,
html[dir="rtl"] .azl-footer-contact a:hover { transform: translateX(-2px); }

/* Trust Reason Side Line */
html[dir="ltr"] .azl-trust-reason-item::before { left: 0; right: auto; }
html[dir="rtl"] .azl-trust-reason-item::before { right: 0; left: auto; }

/* Trust Support Blockquote */
html[dir="ltr"] .azl-trust-support { border-left: 4px solid var(--azl-copper); border-right: none; }
html[dir="rtl"] .azl-trust-support { border-right: 4px solid var(--azl-copper); border-left: none; }


/* ==========================================================================
   Shadows & Borders (Physical Fallbacks)
   ========================================================================== */
/* Some complex box-shadows need physical overrides if they are asymmetric */
html[dir="ltr"] .azl-home-about-identity {
    background: linear-gradient(145deg, rgba(255, 255, 255, .82), rgba(255, 253, 248, .72));
}
html[dir="rtl"] .azl-home-about-identity {
    background: linear-gradient(215deg, rgba(255, 255, 255, .82), rgba(255, 253, 248, .72)); /* Reversed angle */
}

/* B2B Value Cards Glow */
html[dir="ltr"] .azl-service-card.is-b2b {
    box-shadow: 5px 12px 30px rgba(212, 175, 55, .1), var(--azl-shadow-soft);
}
html[dir="rtl"] .azl-service-card.is-b2b {
    box-shadow: -5px 12px 30px rgba(212, 175, 55, .1), var(--azl-shadow-soft);
}

/* ==========================================================================
   Form Inputs & Padding Fixes
   ========================================================================== */
html[dir="ltr"] .azl-contact-form input,
html[dir="ltr"] .azl-contact-form select,
html[dir="ltr"] .azl-contact-form textarea {
    padding-left: 14px;
    padding-right: 14px;
}
/* Arabic inputs sometimes need slightly different padding for visual balance */
html[dir="rtl"] .azl-contact-form input,
html[dir="rtl"] .azl-contact-form select,
html[dir="rtl"] .azl-contact-form textarea {
    padding-right: 16px;
    padding-left: 14px;
}

/* ==========================================================================
   Mobile Responsive RTL Adjustments
   ========================================================================== */
@media (max-width: 680px) {
    /* Adjusting vertical margins that might look unbalanced in Arabic on mobile */
    html[dir="rtl"] h1 { margin-bottom: 16px; }
    html[dir="rtl"] .azl-hero-lead p { line-height: 1.8; }
}