﻿/*
  ╔══════════════════════════════════════════════════════════╗
  ║     RTL Overrides — Arabic Version                       ║
  ║     Designed & Developed by Hasan Movahed                ║
  ╚══════════════════════════════════════════════════════════╝
*/

/* ══ ARABIC FONT ══ */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&display=swap');

[dir="rtl"] body {
  font-family: 'Cairo', 'Segoe UI', system-ui, sans-serif;
  direction: rtl;
}

/* ══ LANGUAGE & THEME BAR ══ */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 7px 0;
  position: sticky;
  top: 0;
  z-index: 998;
}
.topbar-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
}
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 13px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid var(--border);
  color: var(--muted);
  transition: border-color .2s, color .2s, background .2s;
  text-decoration: none;
}
.lang-btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.lang-btn.active {
  background: rgba(79,142,247,.12);
  border-color: var(--accent);
  color: var(--accent);
}
.lang-code {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .5px;
  background: var(--border);
  color: var(--muted);
  padding: 1px 5px;
  border-radius: 3px;
}
.lang-btn.active .lang-code {
  background: rgba(79,142,247,.2);
  color: var(--accent);
}

/* theme toggle — now inline in the bar */
.theme-toggle-bar {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  transition: border-color .2s, color .2s;
  font-family: inherit;
}
.theme-toggle-bar:hover { border-color: var(--accent); color: var(--text); }

/* hide the old fixed toggle */
.theme-toggle { display: none !important; }

/* ══ HERO RTL ══ */
[dir="rtl"] .hero-eyebrow {
  flex-direction: row-reverse;
  justify-content: flex-end;
}
[dir="rtl"] .hero-cta-row { flex-direction: row-reverse; }
[dir="rtl"] .hero-hook { text-align: right; }

/* ══ SECTION LABEL RTL ══ */
[dir="rtl"] .section-label {
  flex-direction: row-reverse;
}
[dir="rtl"] .section-label::after {
  order: -1;
}

/* ══ PROOF STRIP ══ */
[dir="rtl"] .proof-item {
  border-right: none;
  border-left: 1px solid var(--border);
}
[dir="rtl"] .proof-item:last-child { border-left: none; }

/* ══ PAGE BODY ══ */
[dir="rtl"] .page-body {
  grid-template-columns: 280px 1fr;
}

/* ══ EXP CARD RTL ══ */
[dir="rtl"] .exp-header { flex-direction: row-reverse; }
[dir="rtl"] .exp-date { text-align: left; }
[dir="rtl"] .exp-company { text-align: right; }

/* ══ PROJECT CARD RTL ══ */
[dir="rtl"] .project-header { flex-direction: row-reverse; }

/* ══ TIMELINE RTL ══ */
[dir="rtl"] .timeline {
  padding-left: 0;
  padding-right: 28px;
}
[dir="rtl"] .timeline::before {
  left: auto;
  right: 7px;
}
[dir="rtl"] .timeline-dot {
  left: auto;
  right: -28px;
}

/* ══ FEATURED PLUGIN RTL ══ */
[dir="rtl"] .fp-header { flex-direction: row-reverse; }
[dir="rtl"] .fp-title-block { text-align: right; }
[dir="rtl"] .fp-stats { flex-direction: row-reverse; }

/* ══ CONTACT RTL ══ */
[dir="rtl"] .contact-inner { direction: rtl; }
[dir="rtl"] .contact-direct-item { flex-direction: row-reverse; }
[dir="rtl"] .tg-cta-block { flex-direction: row-reverse; }
[dir="rtl"] .contact-pitch h2 { text-align: right; }
[dir="rtl"] .contact-pitch p { text-align: right; }

/* ══ FORM RTL ══ */
[dir="rtl"] .form-row label { text-align: right; }
[dir="rtl"] .form-row input,
[dir="rtl"] .form-row select,
[dir="rtl"] .form-row textarea {
  text-align: right;
  direction: rtl;
}

/* ══ SIDEBAR RTL ══ */
[dir="rtl"] .link-item { flex-direction: row-reverse; }
[dir="rtl"] .avail-card { flex-direction: row-reverse; }
[dir="rtl"] .avail-text { text-align: right; }
[dir="rtl"] .skill-group-name { text-align: right; }
[dir="rtl"] .lang-row { flex-direction: row-reverse; }
[dir="rtl"] .tool-item { flex-direction: row-reverse; }

/* ══ TESTIMONIALS RTL ══ */
[dir="rtl"] .testi-author { flex-direction: row-reverse; }
[dir="rtl"] .testi-text { text-align: right; }
[dir="rtl"] .testi-stars { direction: ltr; }

/* ══ SERVICES RTL ══ */
[dir="rtl"] .service-title,
[dir="rtl"] .service-desc { text-align: right; }

/* ══ FOOTER RTL ══ */
[dir="rtl"] footer p { direction: rtl; }

/* ══ RESPONSIVE RTL ══ */
@media (max-width: 720px) {
  [dir="rtl"] .page-body { grid-template-columns: 1fr; }
  [dir="rtl"] .hero-cta-row { flex-direction: column; align-items: flex-end; }
}
