/* ==========================================================================
   Language toggle + right-to-left layout.
   Loaded last so it overrides the physical-direction rules in the page CSS.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Language switch — shows the language you'd switch TO, not the current one.
   -------------------------------------------------------------------------- */
.lang-toggle {
  margin-inline-start: 1rem;
  min-width: 3.5rem;
  padding: 0.35rem 0.75rem;
  /* Cairo either way — the button shows "العربية" while the page is still
     English, and Inter has no Arabic glyphs to render it with. */
  font-family: 'Cairo', 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 50px;
  cursor: pointer;
  transition: color 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
}

.lang-toggle:hover,
.lang-toggle:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
  outline: none;
}

.lang-toggle:active {
  transform: scale(0.94);
}

/* The theme switch is a physical object, not text — keep it running one way
   in both languages so the knob doesn't jump sides when the page flips. */
.theme-toggle {
  direction: ltr;
}

/* --------------------------------------------------------------------------
   Arabic typography. Playfair Display and Inter have no Arabic glyphs, so
   without this the browser falls back to a default face and the headings
   lose all their weight and rhythm.
   -------------------------------------------------------------------------- */
[lang="ar"] body,
[lang="ar"] .about-hero,
[lang="ar"] .hero-title,
[lang="ar"] .hero-subtitle,
[lang="ar"] .work-title,
[lang="ar"] .about-title,
[lang="ar"] .about-subtitle,
[lang="ar"] .group-title,
[lang="ar"] .contact-title,
[lang="ar"] .contact-subtitle,
[lang="ar"] .work-cta p,
[lang="ar"] .mobile-menu a,
[lang="ar"] .number-label {
  font-family: 'Cairo', 'Inter', sans-serif;
}

/* Arabic runs shorter than Latin at the same point size and sits lower on the
   line, so it needs a touch more leading to stay readable. */
[lang="ar"] body {
  line-height: 1.8;
}

[lang="ar"] .hero-title,
[lang="ar"] .work-title,
[lang="ar"] .about-title {
  line-height: 1.4;
}

/* The logo stays Latin in both languages. */
[lang="ar"] .logo {
  font-family: 'Playfair Display', serif;
}



/* --------------------------------------------------------------------------
   RTL layout fixes — only where the base CSS uses physical sides.
   Flex and grid containers mirror themselves under dir="rtl".
   -------------------------------------------------------------------------- */

/* Nav underline grows from the correct edge */
[dir="rtl"] .nav-links a::after {
  left: auto;
  right: 0;
}

/* Mobile menu slides in from the right */
[dir="rtl"] .mobile-menu {
  transform: translateX(100%);
}

[dir="rtl"] .mobile-menu.active {
  transform: translateX(0);
}

/* Body copy and bullet lists */
[dir="rtl"] .about-hero-content {
  text-align: right;
}

[dir="rtl"] .about-list {
  padding-left: 0;
  padding-right: 1rem;
}

[dir="rtl"] .about-list li {
  padding-left: 0;
  padding-right: 1.5rem;
}

[dir="rtl"] .about-list li::before {
  left: auto;
  right: 0;
}

/* Cards keep their own text direction so the arabic video titles that carry
   dir="auto" are not fought over by the page direction. */
[dir="rtl"] .video-meta,
[dir="rtl"] .client-card {
  text-align: center;
}

/* --------------------------------------------------------------------------
   Small screens — the toggles share the header strip with the burger.
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .lang-toggle {
    margin-inline-start: 0.5rem;
    min-width: 3rem;
    padding: 0.3rem 0.55rem;
    font-size: 0.78rem;
  }
}

@media (max-width: 420px) {
  .lang-toggle {
    min-width: 2.6rem;
    padding: 0.25rem 0.45rem;
    font-size: 0.72rem;
  }
}
