/*
 * rtl.css — Surcharges directionnelles pour l'arabe (dir="rtl")
 * CHUME N'Djamena — Hôpital de la Mère et de l'Enfant
 *
 * Principe : ce fichier est chargé uniquement quand is_rtl == True.
 * Il corrige les propriétés directionnelles sans duppliquer le CSS principal.
 * On utilise les propriétés logiques CSS modernes là où elles sont fiables,
 * et des overrides ciblés là où Bootstrap impose du LTR.
 */

/* ════════════════════════════════════════════
   1. POLICE ARABE — Google Fonts Cairo
   ════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800&family=Scheherazade+New:wght@400;700&display=swap');

:root {
  --font-display: 'Cairo', 'Sora', sans-serif;
  --font-body:    'Cairo', 'DM Sans', sans-serif;
  --font-serif:   'Scheherazade New', Georgia, serif;
}

/* ════════════════════════════════════════════
   2. BODY & HTML
   ════════════════════════════════════════════ */
html[dir="rtl"],
body {
  text-align: right;
}

/* ════════════════════════════════════════════
   3. NAVBAR
   ════════════════════════════════════════════ */
[dir="rtl"] .navbar-brand {
  flex-direction: row-reverse;
}

[dir="rtl"] .navbar-nav {
  padding-right: 0;
}

[dir="rtl"] .ms-auto {
  margin-right: auto !important;
  margin-left: 0 !important;
}

[dir="rtl"] .ms-lg-3 {
  margin-right: 1rem !important;
  margin-left: 0 !important;
}

[dir="rtl"] .me-1,
[dir="rtl"] .me-2,
[dir="rtl"] .me-4 {
  margin-left: 0.25rem !important;
  margin-right: 0 !important;
}

[dir="rtl"] .me-1 { margin-left: 0.25rem !important; }
[dir="rtl"] .me-2 { margin-left: 0.5rem !important; }
[dir="rtl"] .me-4 { margin-left: 1.5rem !important; }

/* ════════════════════════════════════════════
   4. TOPBAR
   ════════════════════════════════════════════ */
[dir="rtl"] .topbar .col-md-4.text-end {
  text-align: left !important;
}

[dir="rtl"] .topbar .col-md-8 {
  text-align: right;
}

[dir="rtl"] .topbar-social {
  margin-left: 0;
  margin-right: 6px;
}

/* ════════════════════════════════════════════
   5. HERO
   ════════════════════════════════════════════ */
[dir="rtl"] .hero-content {
  text-align: right;
}

[dir="rtl"] .hero-btns {
  justify-content: flex-start;
}

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

[dir="rtl"] .hero-scroll {
  left: auto;
  right: 50%;
  transform: translateX(50%);
}

/* ════════════════════════════════════════════
   6. SECTION TAGS & HEADERS
   ════════════════════════════════════════════ */
[dir="rtl"] .section-tag {
  direction: rtl;
}

[dir="rtl"] .text-center .section-tag {
  display: block;
}

/* ════════════════════════════════════════════
   7. QUICK INFO CARDS
   ════════════════════════════════════════════ */
[dir="rtl"] .qi-card {
  flex-direction: row-reverse;
  text-align: right;
}

[dir="rtl"] .qi-card::after {
  right: auto;
  left: 0;
}

/* ════════════════════════════════════════════
   8. SERVICE CARDS
   ════════════════════════════════════════════ */
[dir="rtl"] .svc-link {
  flex-direction: row-reverse;
}

[dir="rtl"] .svc-link i {
  transform: scaleX(-1);
}

[dir="rtl"] .svc-link:hover i {
  transform: scaleX(-1) translateX(-3px);
}

[dir="rtl"] .svc-card::before {
  transform-origin: right;
}

/* ════════════════════════════════════════════
   9. ABOUT SECTION
   ════════════════════════════════════════════ */
[dir="rtl"] .about-stat-badge {
  right: auto;
  left: 0;
}

[dir="rtl"] .about-feature {
  flex-direction: row-reverse;
}

[dir="rtl"] .about-feature:hover {
  transform: translateX(-3px);
}

/* ════════════════════════════════════════════
   10. STATS COUNTER
   ════════════════════════════════════════════ */
[dir="rtl"] .stat-card {
  direction: rtl;
}

/* ════════════════════════════════════════════
   11. ARTICLE CARDS
   ════════════════════════════════════════════ */
[dir="rtl"] .article-cat {
  left: auto;
  right: 12px;
}

[dir="rtl"] .article-read-more {
  flex-direction: row-reverse;
}

[dir="rtl"] .article-read-more i {
  transform: scaleX(-1);
}

[dir="rtl"] .article-date {
  flex-direction: row-reverse;
}

[dir="rtl"] .article-meta {
  border-left: none;
  border-right: 3px solid var(--hme-primary);
}

/* ════════════════════════════════════════════
   12. JOB CARDS
   ════════════════════════════════════════════ */
[dir="rtl"] .job-card::before {
  left: auto;
  right: 0;
  border-radius: 0 4px 4px 0;
}

[dir="rtl"] .job-header {
  flex-direction: row-reverse;
}

[dir="rtl"] .job-dept {
  flex-direction: row-reverse;
}

/* ════════════════════════════════════════════
   13. STEP CIRCUIT PATIENT
   ════════════════════════════════════════════ */
[dir="rtl"] .step-row {
  flex-direction: row-reverse;
}

[dir="rtl"] .step-connector::before {
  left: auto;
  right: 20px;
}

[dir="rtl"] .step-body {
  text-align: right;
}

/* ════════════════════════════════════════════
   14. TIMELINE (Présentation)
   ════════════════════════════════════════════ */
[dir="rtl"] .timeline {
  padding-left: 0;
  padding-right: 32px;
}

[dir="rtl"] .timeline::before {
  left: auto;
  right: 10px;
}

[dir="rtl"] .tl-dot {
  left: auto;
  right: -27px;
}

/* ════════════════════════════════════════════
   15. STICKY NAV (Présentation / Infos pratiques)
   ════════════════════════════════════════════ */
[dir="rtl"] .pn-link {
  flex-direction: row-reverse;
  border-left: none;
  border-right: 3px solid transparent;
  border-radius: 8px 0 0 8px;
}

[dir="rtl"] .pn-link:hover,
[dir="rtl"] .pn-link.active {
  border-right-color: var(--hme-primary);
  padding-right: 14px;
}

/* ════════════════════════════════════════════
   16. CHECKLIST DOCUMENTS
   ════════════════════════════════════════════ */
[dir="rtl"] .doc-list li {
  flex-direction: row-reverse;
  text-align: right;
}

/* ════════════════════════════════════════════
   17. VALEURS (liste numérotée)
   ════════════════════════════════════════════ */
[dir="rtl"] .valeur-item {
  flex-direction: row-reverse;
}

[dir="rtl"] .valeur-item:hover {
  padding-left: 0;
  padding-right: 6px;
}

/* ════════════════════════════════════════════
   18. ALERT BOXES
   ════════════════════════════════════════════ */
[dir="rtl"] .alert-hme {
  flex-direction: row-reverse;
  border-left: none;
  border-right: 4px solid;
}

[dir="rtl"] .alert-hme.info   { border-right-color: var(--hme-primary); }
[dir="rtl"] .alert-hme.warn   { border-right-color: var(--hme-gold); }
[dir="rtl"] .alert-hme.urgent { border-right-color: var(--hme-danger); }

[dir="rtl"] .loi-ref {
  border-left: none;
  border-right: 4px solid var(--hme-primary);
  border-radius: var(--radius) 0 0 var(--radius);
}

/* ════════════════════════════════════════════
   19. FORMULAIRES
   ════════════════════════════════════════════ */
[dir="rtl"] .form-control,
[dir="rtl"] .form-select {
  text-align: right;
  direction: rtl;
}

[dir="rtl"] .form-label {
  display: block;
  text-align: right;
}

/* ════════════════════════════════════════════
   20. FOOTER
   ════════════════════════════════════════════ */
[dir="rtl"] .footer-brand {
  flex-direction: row-reverse;
}

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

[dir="rtl"] .footer-links a:hover {
  padding-left: 0;
  padding-right: 4px;
}

[dir="rtl"] .footer-contact li {
  flex-direction: row-reverse;
}

[dir="rtl"] .text-md-end {
  text-align: left !important;
}

/* ════════════════════════════════════════════
   21. BREADCRUMB
   ════════════════════════════════════════════ */
[dir="rtl"] .hero-breadcrumb {
  flex-direction: row-reverse;
}

[dir="rtl"] .hero-breadcrumb .bi-chevron-right::before {
  content: "\f284"; /* bi-chevron-left */
}

/* ════════════════════════════════════════════
   22. BUTTONS — icônes inversées
   ════════════════════════════════════════════ */
[dir="rtl"] .btn-hme-primary .bi-arrow-right::before,
[dir="rtl"] .btn-hme-outline .bi-arrow-right::before,
[dir="rtl"] .service-link .bi-arrow-right::before {
  content: "\f284"; /* bi-chevron-left */
}

/* Direction card icon  */
[dir="rtl"] .dc-header {
  flex-direction: row-reverse;
}

/* Mission card icon */
[dir="rtl"] .mission-card {
  text-align: right;
}

/* ════════════════════════════════════════════
   23. SÉLECTEUR DE LANGUE
   ════════════════════════════════════════════ */
[dir="rtl"] .lang-switcher {
  direction: rtl;
}

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

/* ════════════════════════════════════════════
   24. BOOTSTRAP OVERRIDES CIBLÉS
   ════════════════════════════════════════════ */
[dir="rtl"] .ps-3 { padding-right: 1rem !important; padding-left: 0 !important; }
[dir="rtl"] .ps-4 { padding-right: 1.5rem !important; padding-left: 0 !important; }
[dir="rtl"] .pe-3 { padding-left: 1rem !important; padding-right: 0 !important; }

[dir="rtl"] .ms-1 { margin-left: 0 !important; margin-right: 0.25rem !important; }
[dir="rtl"] .ms-2 { margin-left: 0 !important; margin-right: 0.5rem !important; }
[dir="rtl"] .ms-3 { margin-left: 0 !important; margin-right: 1rem !important; }

[dir="rtl"] .me-1 { margin-right: 0 !important; margin-left: 0.25rem !important; }
[dir="rtl"] .me-2 { margin-right: 0 !important; margin-left: 0.5rem !important; }
[dir="rtl"] .me-3 { margin-right: 0 !important; margin-left: 1rem !important; }

[dir="rtl"] .float-end { float: left !important; }
[dir="rtl"] .float-start { float: right !important; }

/* Collapse navbar mobile */
[dir="rtl"] .navbar-toggler { margin-left: 0; margin-right: auto; }

/* ════════════════════════════════════════════
   25. ANIMATION fadeUp — maintien en RTL
   ════════════════════════════════════════════ */
[dir="rtl"] [data-aos="fade-right"] {
  transform: translateX(40px) !important;
}
[dir="rtl"] [data-aos="fade-right"].aos-animate {
  transform: translateX(0) !important;
}
[dir="rtl"] [data-aos="fade-left"] {
  transform: translateX(-40px) !important;
}
[dir="rtl"] [data-aos="fade-left"].aos-animate {
  transform: translateX(0) !important;
}