/* ==========================================================================
   École Avicenne — RTL Stylesheet (Arabic)
   ========================================================================== */

html[dir="rtl"] body {
  font-family: var(--font-arabic);
  font-size: 17px;
  line-height: 1.75;
}

html[dir="rtl"] h1, html[dir="rtl"] h2,
html[dir="rtl"] h3, html[dir="rtl"] h4,
html[dir="rtl"] h5, html[dir="rtl"] h6 {
  font-family: var(--font-arabic);
  font-weight: 700;
  letter-spacing: 0;
}

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

html[dir="rtl"] .has-dropdown > .nav-link::after {
  margin-inline-start: 6px;
  margin-inline-end: 0;
}

html[dir="rtl"] .dropdown {
  left: auto;
  right: 0;
}

html[dir="rtl"] .card-link::after {
  content: '←';
}
html[dir="rtl"] .card-link:hover::after {
  transform: translateX(-4px);
}

html[dir="rtl"] .breadcrumbs {
  direction: rtl;
}

html[dir="rtl"] .testimonial::before {
  left: auto;
  right: 24px;
}

/* Form labels */
html[dir="rtl"] .form-control {
  text-align: right;
}
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="tel"],
html[dir="rtl"] input[type="url"] {
  direction: ltr;
  text-align: left;
}

/* Footer */
html[dir="rtl"] .footer-contact > div {
  flex-direction: row;
}

/* Burger menu open mobile */
html[dir="rtl"] .nav-list.open {
  text-align: right;
}

/* Hero arrows */
html[dir="rtl"] .btn .icon-arrow-right {
  transform: rotate(180deg);
}

/* Lang switch */
html[dir="rtl"] .lang-switch {
  font-family: var(--font-base);
}

/* Topbar */
html[dir="rtl"] .topbar {
  direction: rtl;
}

/* Steps numbers should not flip */
html[dir="rtl"] .step-number {
  direction: ltr;
  unicode-bidi: embed;
}

/* Footer credits should align logically */
html[dir="rtl"] .footer-bottom {
  direction: rtl;
}

/* Numeric content stays LTR */
html[dir="rtl"] .ltr {
  direction: ltr;
  text-align: left;
  unicode-bidi: embed;
  display: inline-block;
}

html[dir="rtl"] .accordion-trigger::after {
  margin-inline-start: 16px;
}

/* Tighten Arabic line heights for body */
html[dir="rtl"] p,
html[dir="rtl"] .lead {
  line-height: 1.85;
}

/* Bigger Arabic headings */
html[dir="rtl"] .hero h1 {
  font-size: clamp(2.5rem, 6.5vw, 4rem);
  line-height: 1.2;
}

/* ==========================================================================
   RTL Mobile Menu Fix
   ========================================================================== */
@media (max-width: 1024px) {

  /* Burger blijft rechts van logo in RTL (logo links via row-reverse op .nav) */
  html[dir="rtl"] .nav {
    flex-direction: row-reverse;
  }

  /* Mobile menu: full-width overlay, slide-in van rechts in RTL */
  html[dir="rtl"] .nav-list.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #FAFAFA;
    z-index: 105;
    overflow-y: auto;
    padding: calc(var(--header-h) + 24px) 24px 32px;
    align-items: stretch;
    text-align: right;
    direction: rtl;
    margin: 0;
    list-style: none;
  }

  html[dir="rtl"] .nav-list.open > li {
    width: 100%;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #E0E0E0;
  }

  html[dir="rtl"] .nav-list.open > li:last-child {
    border-bottom: none;
  }

  html[dir="rtl"] .nav-list.open .nav-link {
    display: block;
    width: 100%;
    padding: 16px 4px;
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--color-primary);
    text-align: right;
    border-radius: 0;
    border-bottom: none;
  }

  /* Submenu/Dropdown in RTL: rechts inspringen, gele rand rechts */
  html[dir="rtl"] .nav-list.open .dropdown {
    position: static;
    display: block;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    background: #F5F5F5;
    margin: 0 16px 8px 0;
    padding: 8px 16px 8px 0;
    border-right: 3px solid var(--color-secondary, #FFC107);
    border-left: none;
    border-radius: 0;
    width: auto;
    list-style: none;
  }

  html[dir="rtl"] .nav-list.open .dropdown a {
    text-align: right;
    padding: 10px 0;
    display: block;
  }

  /* Dropdown chevron richting RTL */
  html[dir="rtl"] .nav-list.open .has-dropdown > .nav-link::after {
    content: " ◀";
    float: left;
    margin-inline-start: 8px;
    margin-inline-end: 0;
    font-size: 0.75em;
    color: var(--color-text-light);
  }

  /* CTA knop full width in RTL */
  html[dir="rtl"] .nav-list.open .nav-cta {
    display: block;
    width: 100%;
    margin: 16px 0 0;
    border-bottom: none;
  }

  html[dir="rtl"] .nav-list.open .nav-cta .btn {
    width: 100%;
    justify-content: center;
  }

  /* Burger positie en kleur tijdens open */
  html[dir="rtl"] .burger {
    margin-inline-start: 0;
    margin-inline-end: auto;
  }

  /* Topbar in mobile RTL */
  html[dir="rtl"] .topbar {
    direction: rtl;
    flex-direction: row-reverse;
  }

  /* Body lock when menu open */
  html[dir="rtl"] body.menu-open,
  html[dir="rtl"]:has(.nav-list.open) body {
    overflow: hidden;
  }
}

@media (max-width: 480px) {
  html[dir="rtl"] .nav-list.open {
    padding: calc(var(--header-h) + 16px) 16px 24px;
  }
  html[dir="rtl"] .nav-list.open .nav-link {
    font-size: 1.0625rem;
    padding: 14px 4px;
  }
}
