/* ════════════════════════════════════════════════════════════
   lang.css — Bilingual / RTL layout adjustments
   ════════════════════════════════════════════════════════════ */

/* ── Arabic Font ─────────────────────────────────────────── */
html[lang="ar"] body,
html[lang="ar"] input,
html[lang="ar"] textarea,
html[lang="ar"] select,
html[lang="ar"] button {
  font-family: 'IBM Plex Sans Arabic', 'Cairo', 'Segoe UI', system-ui, sans-serif;
}

html[lang="ar"] .section-title,
html[lang="ar"] .hero-title,
html[lang="ar"] .project-title,
html[lang="ar"] .project-hero-title,
html[lang="ar"] .service-title,
html[lang="ar"] .testimonial-name,
html[lang="ar"] .sidebar-year,
html[lang="ar"] .gallery-title {
  font-family: 'IBM Plex Sans Arabic', 'Cairo', serif;
  letter-spacing: 0;
}

/* ── RTL Structural Overrides ────────────────────────────── */
html[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

/* Nav RTL — no overrides, identical to LTR */

/* Hero */
html[dir="rtl"] .hero-container {
  direction: rtl;
}
html[dir="rtl"] .hero-cta {
  flex-direction: row-reverse;
}
html[dir="rtl"] .hero-stats {
  flex-direction: row-reverse;
}

/* Marquee — reverse direction for RTL */
html[dir="rtl"] .marquee-track {
  animation-direction: reverse;
}

/* About grid */
html[dir="rtl"] .about-grid,
html[dir="rtl"] .contact-grid {
  direction: rtl;
}

/* Section label mono font stays LTR */
html[dir="rtl"] .section-label {
  font-family: var(--font-mono);
  direction: ltr;
  text-align: right;
}
html[dir="rtl"] .section-label::before {
  content: '';
}

/* Project cards */
html[dir="rtl"] .project-card-meta {
  flex-direction: row-reverse;
}
html[dir="rtl"] .project-links {
  flex-direction: row-reverse;
}
html[dir="rtl"] .project-techs {
  flex-direction: row-reverse;
}

/* Buttons with icons */
html[dir="rtl"] .btn {
  flex-direction: row-reverse;
}
html[dir="rtl"] .back-link {
  flex-direction: row-reverse;
}
html[dir="rtl"] .back-link svg {
  transform: scaleX(-1);
}

/* Contact form */
html[dir="rtl"] .form-row {
  direction: rtl;
}
html[dir="rtl"] .contact-details li {
  flex-direction: row-reverse;
}
html[dir="rtl"] .contact-social {
  flex-direction: row-reverse;
}

/* Sidebar */
html[dir="rtl"] .project-detail-meta {
  flex-direction: row-reverse;
}
html[dir="rtl"] .sidebar-links .sidebar-link {
  flex-direction: row-reverse;
}
html[dir="rtl"] .sidebar-techs {
  flex-direction: row-reverse;
}

/* Footer */

/* Select arrow position for RTL */
html[dir="rtl"] .form-group select {
  background-position: left 12px center;
  padding-right: 16px;
  padding-left: 36px;
}

/* Service cards */
html[dir="rtl"] .service-card { direction: rtl; }
html[dir="rtl"] .service-number {
  right: auto;
  left: 20px;
}

/* Mobile menu */
html[dir="rtl"] .mobile-menu ul { direction: rtl; }

/* Back link arrow flip */
html[dir="rtl"] .back-link {
  direction: rtl;
}

/* Hero meta tags */
html[dir="rtl"] .project-hero-meta {
  flex-direction: row-reverse;
}
html[dir="rtl"] .project-hero-actions {
  flex-direction: row-reverse;
  justify-content: flex-end;
  width: 100%;
}

/* Lang toggle active states */
html[lang="en"] .lang-label.lang-en { color: var(--accent); }
html[lang="ar"] .lang-label.lang-ar { color: var(--accent); }

/* Testimonial author */
html[dir="rtl"] .testimonial-author {
  flex-direction: row-reverse;
}

/* Description paragraphs */
html[lang="ar"] .desc-en { display: none !important; }
html[lang="ar"] .desc-ar { display: block !important; }
html[lang="en"] .desc-en { display: block !important; }
html[lang="en"] .desc-ar { display: none !important; }

/* Hero scroll hint stays centered */
html[dir="rtl"] .hero-scroll-hint {
  left: 50%;
  right: auto;
}

/* Skill tags row-reverse in RTL */
html[dir="rtl"] .skills-grid {
  flex-direction: row-reverse;
}
html[dir="rtl"] .skill-tag {
  flex-direction: row-reverse;
}

/* Filter bar */
html[dir="rtl"] .filter-bar {
  flex-direction: row-reverse;
}

/* Tech hero strip — counter for mobile hero center */
@media (max-width: 1024px) {
  html[dir="rtl"] .hero-container {
    text-align: center;
  }
  html[dir="rtl"] .hero-cta,
  html[dir="rtl"] .hero-stats {
    justify-content: center;
  }
}

/* Mobile RTL nav: identical to LTR — no overrides needed */

/* ── Navbar: force LTR direction in both languages ── */
html[dir="rtl"] .navbar,
html[dir="rtl"] .nav-container {
  direction: ltr;
}


/* ── Filter bar: center in RTL ── */
html[dir="rtl"] .filter-bar {
  justify-content: center;
}

/* ── Footer RTL: fully centered ── */
html[dir="rtl"] .footer-inner {
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
}
html[dir="rtl"] .footer-brand {
  align-items: center !important;
  text-align: center !important;
}
html[dir="rtl"] .footer-brand p {
  text-align: center !important;
}
html[dir="rtl"] .footer-links {
  justify-content: center !important;
  flex-direction: row !important;
}
html[dir="rtl"] .footer-copy {
  text-align: center !important;
}


/* ── Sidebar links: RTL ── */
html[dir="rtl"] .sidebar-link {
  flex-direction: row-reverse;
  justify-content: flex-end;
}
html[dir="rtl"] .sidebar-techs {
  flex-direction: row-reverse;
}

/* ── Project detail meta: RTL ── */
html[dir="rtl"] .project-detail-meta {
  flex-direction: row-reverse;
  justify-content: flex-end;
}

/* ── Project hero meta tags: RTL ── */
html[dir="rtl"] .project-hero-meta {
  flex-direction: row-reverse;
  justify-content: flex-start;
}

/* ── Back link arrow: RTL ── */
html[dir="rtl"] .back-link {
  flex-direction: row-reverse;
}
html[dir="rtl"] .back-link svg {
  transform: scaleX(-1);
}

/* ── Project hero actions: RTL — أزرار في اليمين ── */
html[dir="rtl"] .project-hero-actions {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  width: 100%;
}
