/* ==========================================================================
   autoResilience RTL Stylesheet (Arabic Edition)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700;800&display=swap');

html[dir="rtl"],
html[dir="rtl"] body {
    direction: rtl;
    text-align: right;
    font-family: 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] h5,
html[dir="rtl"] h6,
html[dir="rtl"] .hero-title,
html[dir="rtl"] .ds-1,
html[dir="rtl"] .ds-2,
html[dir="rtl"] .ds-3,
html[dir="rtl"] .ds-4,
html[dir="rtl"] .font-heading,
html[dir="rtl"] .navbar-nav,
html[dir="rtl"] .btn {
    font-family: 'IBM Plex Sans Arabic', sans-serif !important;
    letter-spacing: 0 !important;
}

/* ==========================================================================
   1. GLOBAL GRID & CONTAINERS: Flow Left-to-Right
      Preserves the exact structural layout of all rows, banners, and grids
   ========================================================================== */
html[dir="rtl"] .container,
html[dir="rtl"] .container-fluid,
html[dir="rtl"] .row,
html[dir="rtl"] header,
html[dir="rtl"] nav.navbar,
html[dir="rtl"] footer,
html[dir="rtl"] .footer,
html[dir="rtl"] #imageCarousel,
html[dir="rtl"] .hero-slide-wrapper {
    direction: ltr !important;
}

html[dir="rtl"] .row {
    flex-direction: row !important;
}

/* Responsive Flex Direction Overrides */
html[dir="rtl"] .flex-column {
    flex-direction: column !important;
}

html[dir="rtl"] .flex-column-reverse {
    flex-direction: column-reverse !important;
}

html[dir="rtl"] .flex-row {
    flex-direction: row !important;
}

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

@media (min-width: 992px) {
    html[dir="rtl"] .flex-lg-row {
        flex-direction: row !important;
    }
    html[dir="rtl"] .flex-lg-row-reverse {
        flex-direction: row-reverse !important;
    }
    html[dir="rtl"] .flex-lg-column {
        flex-direction: column !important;
    }
    html[dir="rtl"] .flex-lg-column-reverse {
        flex-direction: column-reverse !important;
    }
}

/* ==========================================================================
   2. NAVBAR & HEADER
      Logo on left, menu in middle, buttons on right with correct margins
   ========================================================================== */
html[dir="rtl"] nav.navbar > .container {
    direction: ltr !important;
}

html[dir="rtl"] nav.navbar .navbar-nav {
    direction: ltr !important;
}

html[dir="rtl"] .navbar-brand {
    margin-right: 2rem !important;
    margin-left: 0 !important;
}

/* Language switcher button margin (space to the right, between switcher and CTA) */
html[dir="rtl"] .lang-switch-btn {
    margin-right: 0.75rem !important;
    margin-left: 0 !important;
}

/* Dropdown mega-menus text direction */
html[dir="rtl"] .mega-menu-content {
    direction: rtl !important;
    text-align: right !important;
}

html[dir="rtl"] header .dropdown-item {
    justify-content: end;
    padding: .5rem 0 .5rem 2rem;
}

/* Mobile Header Drawer & Menu Expand */
html[dir="rtl"] header .mobile-header-wrapper-style .mobile-header-wrapper-inner .mobile-header-content-area .mobile-menu-wrap nav .mobile-menu li.has-children .menu-expand {
    left: 0;
    right: auto;
}

html[dir="rtl"] header .mobile-header-wrapper-style .mobile-header-wrapper-inner .mobile-header-content-area .mobile-menu-wrap nav .mobile-menu li.has-children .menu-expand i {
    transform: rotate(180deg);
}

/* ==========================================================================
   3. HERO BANNER
      Text on left (over dark gradient), graphic on right (over person)
   ========================================================================== */
html[dir="rtl"] #imageCarousel .col-lg-6.text-start {
    direction: rtl !important;
    text-align: right !important;
}

html[dir="rtl"] #imageCarousel .hero-title,
html[dir="rtl"] #imageCarousel p {
    direction: rtl !important;
    text-align: right !important;
    line-height: 1.4 !important;
}

/* Gradient divider in hero starting from right edge */
html[dir="rtl"] #imageCarousel .col-lg-6 > div[style*="linear-gradient"] {
    margin-right: 0 !important;
    margin-left: auto !important;
}

/* CTAs in hero banner */
html[dir="rtl"] #imageCarousel .col-lg-6 .d-flex.gap-3 {
    direction: rtl !important;
    justify-content: flex-start !important;
}

/* 4 USPs under hero Slide 1 (flow 1, 2, 3, 4 left to right) */
html[dir="rtl"] #imageCarousel .usp-card {
    direction: rtl !important;
    align-items: flex-start !important;
    text-align: right !important;
}

html[dir="rtl"] #imageCarousel .usp-card p {
    text-align: right !important;
}

html[dir="rtl"] #imageCarousel .carousel-indicators {
    direction: ltr !important;
}

/* ==========================================================================
   4. CLIENT LOGO SLIDER
      Must remain purely LTR for carouselTicker jQuery loop calculations
   ========================================================================== */
html[dir="rtl"] .logo-slider-section,
html[dir="rtl"] .logo-slider-section *,
html[dir="rtl"] .carouselTicker,
html[dir="rtl"] .carouselTicker__list,
html[dir="rtl"] .carouselTicker__item {
    direction: ltr !important;
}

/* ==========================================================================
   5. ALTERNATING FEATURES (Features 1 to 6)
      Rows flow LTR (alternating left/right), text inside is RTL
   ========================================================================== */
html[dir="rtl"] .section-feature-5 .col-lg-6:not(:has(.photo-description)) {
    direction: rtl !important;
    text-align: right !important;
}

html[dir="rtl"] .section-feature-5 h4,
html[dir="rtl"] .section-feature-5 p {
    direction: rtl !important;
    text-align: right !important;
}

/* Flip arrow icons on action links */
html[dir="rtl"] .section-feature-5 svg.ms-2,
html[dir="rtl"] .bi-arrow-right {
    transform: scaleX(-1);
    display: inline-block;
    margin-right: 0.5rem !important;
    margin-left: 0 !important;
}

/* ==========================================================================
   6. PLATFORMS / "FUTURE-PROOF YOUR BUSINESS" CHIPS
   ========================================================================== */
html[dir="rtl"] .platforms-item {
    direction: rtl !important;
}

html[dir="rtl"] .platforms-item span {
    text-align: right !important;
}

/* ==========================================================================
   7. TESTIMONIALS SECTION
   ========================================================================== */
html[dir="rtl"] .section-testimonial-2 .bg-neutral-100 {
    direction: rtl !important;
    text-align: right !important;
}

html[dir="rtl"] .section-testimonial-2 p {
    direction: rtl !important;
    text-align: right !important;
}

html[dir="rtl"] .section-testimonial-2 .flag {
    direction: rtl !important;
    text-align: right !important;
}

/* ==========================================================================
   8. DEMO BANNER SECTION ("Don't wait for a crisis")
      Graphics on left, text on right — exactly matching English
   ========================================================================== */
html[dir="rtl"] .bg-primary-dark .row > div:nth-child(2) {
    direction: rtl !important;
    text-align: right !important;
}

html[dir="rtl"] .bg-primary-dark h3,
html[dir="rtl"] .bg-primary-dark p {
    direction: rtl !important;
    text-align: right !important;
}

/* ==========================================================================
   9. BLOGS SECTION
      Section heading in Arabic, blog cards remain in English layout
   ========================================================================== */
html[dir="rtl"] .section-blog-1 .col-lg-8 h3 {
    direction: rtl !important;
    text-align: right !important;
}

html[dir="rtl"] .section-blog-1 .col-lg-6 {
    direction: ltr !important;
    text-align: left !important;
}

/* ==========================================================================
   10. HCTA SECTION ("Ready to make your organisation resilient?")
   ========================================================================== */
html[dir="rtl"] .hcta-bg-card {
    direction: ltr !important;
}

@media (max-width: 1199.98px) {
    html[dir="rtl"] .hcta-bg-card {
        padding-right: 20px !important;
    }
}

html[dir="rtl"] .hcta-bg-card > div:first-child {
    direction: rtl !important;
    text-align: right !important;
}

html[dir="rtl"] .hcta-right-panel {
    right: -40px !important;
    left: auto !important;
}

/* ==========================================================================
   11. SEO NARRATIVE SECTION
   ========================================================================== */
html[dir="rtl"] .section-padding .col-xl-6 {
    direction: rtl !important;
    text-align: right !important;
}

/* ==========================================================================
   12. FOOTER
   ========================================================================== */
html[dir="rtl"] footer .col-lg-5,
html[dir="rtl"] footer .col-lg-7,
html[dir="rtl"] footer ul {
    direction: rtl !important;
    text-align: right !important;
}

html[dir="rtl"] footer ul.footer-platforms {
    padding-right: 0px;
    direction: ltr !important;
}

html[dir="rtl"] footer .d-flex.flex-column.align-items-start {
    align-items: flex-end !important;
}

html[dir="rtl"] footer .footer-input {
    /* direction: rtl !important; */
}

html[dir="rtl"] footer .footer-policy-links,
html[dir="rtl"] footer ul.d-flex.list-unstyled.justify-content-center.justify-content-lg-end.gap-3.flex-wrap {
    direction: ltr !important;
}

/* Utility fixes */
html[dir="rtl"] .text-start {
    text-align: right !important;
}
html[dir="rtl"] .text-end {
    text-align: left !important;
}
