/* ==========================================================================
   CRA Portal – language-specific typography and right-to-left fixes
   ========================================================================== */

/* Urdu – Nastaliq for headings, Naskh for body (more readable at small sizes) */
html[lang="ur"] { --font-body: "Noto Naskh Arabic", "Noto Nastaliq Urdu", Tahoma, sans-serif; --font-head: "Noto Nastaliq Urdu", "Noto Naskh Arabic", serif; }
html[lang="ur"] body { line-height: 1.95; font-size: 1.02rem; }
html[lang="ur"] h1, html[lang="ur"] h2, html[lang="ur"] h3, html[lang="ur"] .h1, html[lang="ur"] .h2, html[lang="ur"] .hero-title { line-height: 1.9; letter-spacing: 0; }
html[lang="ur"] .hero-title { font-size: clamp(2rem, 4.4vw, 3.4rem); padding-bottom: .4em; }
html[lang="ur"] .site-nav .nav-link { font-size: 1rem; line-height: 2; padding-top: .2rem !important; padding-bottom: .2rem !important; }

/* Arabic */
html[lang="ar"] { --font-body: "IBM Plex Sans Arabic", Tahoma, sans-serif; --font-head: "Cairo", "IBM Plex Sans Arabic", sans-serif; }
html[lang="ar"] body { line-height: 1.8; }

/* Chinese */
html[lang="zh"] { --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; --font-head: "Noto Sans SC", "PingFang SC", sans-serif; }
html[lang="zh"] .hero-title, html[lang="zh"] h1, html[lang="zh"] h2 { letter-spacing: 0; }

/* Russian – Manrope headings have full Cyrillic support */
html[lang="ru"] { --font-head: "Manrope", "Inter", sans-serif; }
html[lang="ru"] .site-nav .nav-link { font-size: .84rem; }

/* Uppercase tracking doesn't suit Arabic script or Chinese */
html[lang="ur"] .kicker-pill, html[lang="ar"] .kicker-pill, html[lang="zh"] .kicker-pill,
html[lang="ur"] .brand-mark .name small, html[lang="ar"] .brand-mark .name small { letter-spacing: 0; text-transform: none; }

/* ---------- Right-to-left ---------- */
[dir="rtl"] .bi-arrow-right, [dir="rtl"] .bi-arrow-left, [dir="rtl"] .bi-chevron-right, [dir="rtl"] .bi-chevron-left,
[dir="rtl"] .bi-arrow-up-right, [dir="rtl"] .bi-box-arrow-up-right, [dir="rtl"] .bi-box-arrow-in-right { display: inline-block; transform: scaleX(-1); }
[dir="rtl"] .site-nav .nav-link::after { transform-origin: right; }
[dir="rtl"] .industry-v2::before { left: auto; right: 0; }
[dir="rtl"] .industry-v2 .go { right: auto; left: 1rem; }
[dir="rtl"] .chip-a { left: auto; right: -1.5rem; }
[dir="rtl"] .chip-b { right: auto; left: -1rem; }
[dir="rtl"] .chip-c { right: auto; left: -2.2rem; }
[dir="rtl"] .float-actions { right: auto; left: 18px; }
[dir="rtl"] .marquee-track { animation-name: marquee-rtl; }
@keyframes marquee-rtl { to { transform: translateX(50%); } }
[dir="rtl"] .timeline-item { padding: 0 0 2.5rem 2.5rem; }
[dir="rtl"] .timeline-item:nth-child(even) { margin-left: 0; margin-right: 50%; padding: 0 2.5rem 2.5rem 0; }
[dir="rtl"] .timeline-item::before { right: auto; left: -9px; }
[dir="rtl"] .timeline-item:nth-child(even)::before { left: auto; right: -9px; }
@media (max-width: 767.98px) {
  [dir="rtl"] .timeline::before { left: auto; right: 12px; }
  [dir="rtl"] .timeline-item, [dir="rtl"] .timeline-item:nth-child(even) { margin-right: 0; padding: 0 2.5rem 2rem 0; }
  [dir="rtl"] .timeline-item::before, [dir="rtl"] .timeline-item:nth-child(even)::before { right: 3px; left: auto; }
}
[dir="rtl"] .brand-mark:hover .logo-ring { transform: rotate(6deg) scale(1.04); }
[dir="rtl"] .hero-visual { direction: ltr; }       /* keep the live card and floating chips laid out as designed */
[dir="rtl"] .hero-visual .float-chip { direction: rtl; }
[dir="rtl"] .input-group > .btn-accent { border-radius: 10px 0 0 10px !important; }

/* ---------- Language switcher ---------- */
.lang-menu { min-width: 200px; }
.lang-menu .dropdown-item { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.lang-menu .dropdown-item small { color: var(--muted); font-size: .72rem; }
.lang-menu .dropdown-item.active small { color: rgba(255,255,255,.8); }
.btn-lang { white-space: nowrap; display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; font-size: .8rem; }
.topbar .lang-inline a { padding: 0 .35rem; opacity: .75; }
.topbar .lang-inline a.active, .topbar .lang-inline a:hover { opacity: 1; color: #fff; }
.lang-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .4rem; }
.lang-grid a { padding: .55rem .75rem; border-radius: 10px; background: var(--surface-2); text-decoration: none; color: var(--text); font-weight: 600; font-size: .9rem; text-align: center; }
.lang-grid a.active { background: var(--brand); color: #fff; }

/* ---- Topbar v2: single line, compact language picker ---- */
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding-top: .45rem; padding-bottom: .45rem; flex-wrap: nowrap; }
.topbar .tb-group { display: flex; align-items: center; gap: 1.25rem; min-width: 0; flex-wrap: nowrap; }
.topbar .tb-group > a, .topbar .tb-group > span { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }
.topbar .tb-group i { opacity: .8; }
.topbar .tb-group b { font-weight: 700; color: #fff; }
.topbar .tb-sep { width: 1px; height: 14px; background: rgba(255,255,255,.25); }
.topbar .tb-lang { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); color: #fff; border-radius: 999px; padding: .2rem .75rem; font-size: .78rem; font-weight: 600; line-height: 1.4; transition: background .2s; }
.topbar .tb-lang:hover, .topbar .tb-lang[aria-expanded="true"] { background: rgba(255,255,255,.2); }
.topbar .tb-lang .bi-chevron-down { font-size: .65rem; opacity: .8; }
.topbar .lang-menu { font-size: .875rem; }
