/*
Theme Name: zouhairsaid_theme
Description: Feuille de styles RTL (Right-to-Left) pour la langue Arabe
Version: 4.2.2
*/

html[dir="rtl"],
html.rtl,
body.is-rtl {
  --font-titre: 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  --font-corps: 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  --font-ui:    'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  direction: rtl;
  text-align: right;
  font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

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.rtl h1,
html.rtl h2,
html.rtl h3,
html.rtl h4,
html.rtl h5,
html.rtl h6,
html.rtl .logo-nom {
  font-family: 'Tajawal', sans-serif;
}

html.rtl .hero-titre,
html[dir="rtl"] .hero-titre {
  font-family: 'Tajawal', sans-serif;
  font-size: clamp(1.85rem, 2.9vw, 2.65rem);
  line-height: 1.34;
  letter-spacing: 0;
}

html.rtl .hero-titre .nom-accent,
html[dir="rtl"] .hero-titre .nom-accent {
  font-family: 'Tajawal', sans-serif;
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  line-height: 1.45;
  font-weight: 600;
}

html.rtl .nav-principale,
html.rtl .logo-sous,
html.rtl .hero-grade,
html.rtl .carte-flottante-label,
html.rtl .etiquette,
html.rtl .btn,
html.rtl .badge-annee,
html.rtl .lang-opt,
html.rtl .stat-libelle,
html.rtl .fmpm-badge-date,
html.rtl .fmpm-card-badge,
html.rtl .fmpm-card-pill,
html.rtl .conf-theme-tag {
  font-family: 'Tajawal', sans-serif;
  letter-spacing: 0;
  text-transform: none;
}

html.rtl .hero-grade {
  display: none !important;
}

html.rtl .logo-sous,
html[dir="rtl"] .logo-sous,
html[lang="ar"] .logo-sous {
  display: block !important;
  font-family: 'Tajawal', sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.35;
  margin-top: 2px;
}

/* Header & Navigation */
html.rtl .selecteur-lang.in-header {
  margin: 0 !important;
}

html.rtl .header-actions {
  flex-direction: row;
}

@media (max-width: 991px) {
  html.rtl .nav-principale {
    right: auto;
    left: 0;
    transform: translateX(-100%);
  }
  html.rtl .nav-principale.ouverte {
    transform: translateX(0);
  }
}

/* Hero Section */
html.rtl .hero-bande {
  left: auto;
  right: 0;
}

html.rtl .hero-carte-flottante {
  border-left: 1px solid var(--bleu-petrole-border);
  border-right: 4.5px solid var(--rouge);
}

html.rtl .hero-institution svg {
  margin-left: 6px;
  margin-right: 0;
}

/* Sections & Filets */
html.rtl .en-tete-section .filet-rouge,
html.rtl .en-tete-section .filet-vert,
html.rtl .en-tete-section .filet-bleu,
html.rtl .en-tete-section .filet-violet,
html.rtl .en-tete-section .filet-or {
  margin-right: 0;
  margin-left: auto;
}

/* Affiliations */
html.rtl .carte-affil:hover {
  border-left: 1px solid var(--beige);
  border-right: 3.5px solid var(--rouge);
  transform: translateX(-4px);
}

html.rtl .affil-fleche {
  margin-left: 0;
  margin-right: auto;
}

html.rtl .carte-affil:hover .affil-fleche {
  transform: translate(-2px, -2px);
}

/* Chiffres & Stats */
html.rtl .chiffre-item {
  padding: 0 0 0 var(--s4);
  border-right: none;
  border-left: 1px solid var(--beige);
}

html.rtl .chiffre-item:last-child {
  border-left: none;
  padding-left: 0;
}

html.rtl .stat-cellule {
  border-right: none;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

html.rtl .stat-cellule:last-child {
  border-left: none;
}

@media (max-width: 768px) {
  html.rtl .chiffre-item { padding: 0 0 0 var(--s2); }
  html.rtl .chiffre-item:nth-child(2) { border-left: none; }
  html.rtl .chiffre-item:nth-child(4) { border-left: none; }
  html.rtl .stat-cellule { border-left: 1px solid rgba(255, 255, 255, 0.06); }
  html.rtl .stat-cellule:nth-child(2n) { border-left: none; }
  html.rtl .stat-cellule:last-child { border-left: none; }
}

/* Tableaux & Publications */
html.rtl .photo-apropos-legende {
  text-align: right;
}

html.rtl .tableau-pubs th,
html.rtl .tableau-pubs td {
  text-align: right;
}

html.rtl .tableau-pubs th[style*="text-align:center"],
html.rtl .tableau-pubs td[style*="text-align:center"] {
  text-align: center;
}

html.rtl .retour-haut {
  right: auto;
  left: var(--s8);
}

html.rtl .carte-recherche::before {
  transform-origin: right;
}

/* Liens Profil */
html.rtl .lien-profil {
  text-align: right;
}

html.rtl .lien-profil:hover {
  border-left-color: var(--beige);
  border-right: 3px solid var(--rouge);
  transform: translateX(-3px);
}

html.rtl .profil-fleche {
  margin-left: 0;
  margin-right: auto;
}

html.rtl .lien-profil:hover .profil-fleche {
  transform: translateX(-3px);
}

html.rtl .pied-desc {
  text-align: right;
}

/* Galerie FMPM */
html.rtl .fmpm-galerie-header .en-tete-section {
  text-align: right;
}

html.rtl .fmpm-gal-desc {
  text-align: right;
}

html.rtl .fmpm-card-body {
  text-align: right;
}

html.rtl .fmpm-card-footer {
  flex-direction: row-reverse;
}

html.rtl .fmpm-card-cta:hover svg {
  transform: translateX(-3px);
}

html.rtl .btn-fmpm-plus:hover .btn-fmpm-plus-icon {
  transform: translateX(-3px);
}

html.rtl .fmpm-arrow-btn svg,
html.rtl .btn-fmpm-plus-icon svg {
  transform: scaleX(-1);
}

/* Scroll Hint */
html.rtl .table-scroll-hint svg {
  animation: glisserHorizontalRTL 2s infinite ease-in-out;
}

@keyframes glisserHorizontalRTL {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-6px); }
}

/* Single page fil d'ariane */
html.rtl .fil-ariane svg {
  transform: scaleX(-1);
}
