@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600&display=swap');

/* SWSAM Arabic / Saudi professional RTL layer */
:root { --font-ibm-plex-arabic: "IBM Plex Sans Arabic"; }
html[lang="ar"] { direction: rtl; }
html[lang="ar"] body {
  direction: rtl;
  text-align: right;
  font-family:
    "SF Arabic", "SF Pro AR", "SF Pro Gulf", var(--font-ibm-plex-arabic), "IBM Plex Sans Arabic",
    "Geeza Pro", "Helvetica Neue", sans-serif !important;
  text-rendering: optimizeLegibility;
}

html[lang="ar"] :is(button,input,select,textarea) {
  font-family:
    "SF Arabic", "SF Pro AR", "SF Pro Gulf", var(--font-ibm-plex-arabic), "IBM Plex Sans Arabic",
    "Geeza Pro", "Helvetica Neue", sans-serif !important;
}
html[lang="ar"] :is(.eyebrow,.section-label,.section-kicker,.section-rail,.presence-meta,.detail-label,.story-meta,small) {
  letter-spacing: 0;
}

html[lang="ar"] :is(h1,h2,h3,.lead) {
  letter-spacing: -.025em;
  text-wrap: balance;
}

html[lang="ar"] :is(p,li,dd,.hero-summary,.intro) { line-height: 1.9; }

/* Arabic hero: copy stays on the right; the photographic signal field moves left. */
html[lang="ar"] .hero::before {
  inset: 0 34% 0 0;
  transform: scaleX(-1);
  transform-origin: center;
}
html[lang="ar"] .hero::after {
  background: linear-gradient(270deg, #001044 0%, rgba(0,16,68,.97) 35%, rgba(0,16,68,.26) 72%, rgba(0,16,68,.68) 100%);
}
html[lang="ar"] .hero-content :is(.eyebrow,h1,.intro) { animation-name: ar-reveal-right; }
html[lang="ar"] :is(.header-cta,.cta-button) svg { transform: scaleX(-1); }
html[lang="ar"] .header-cta:hover svg { transform: scaleX(-1) translateX(3px); }

/* Header frame stays spatially consistent with the English site: logo left, CTA right. */
html[lang="ar"] .header-shell { direction: ltr; }
html[lang="ar"] .brand { justify-self: start; }
html[lang="ar"] .header-cta { justify-self: end; direction: rtl; }
html[lang="ar"] .desktop-nav { direction: rtl; }
html[lang="ar"] .mobile-menu { direction: rtl; text-align: right; }
html[lang="ar"] .mobile-menu nav a { flex-direction: row; }
html[lang="ar"] .mobile-cta { flex-direction: row; }

/* Editorial grids and rails */
html[lang="ar"] :is(.hero-layout,.positioning-main,.cyber-heading,.products-heading,.systems-heading,.ecosystem-heading,.responsible-shell,.why-heading,.industries-heading,.presence-heading,.insights-heading,.section-head,.intro-grid,.detail-heading,.editorial-head,.contact-layout,.legal-layout) {
  direction: rtl;
}

html[lang="ar"] :is(.positioning-context,.products-intro,.systems-intro,.ecosystem-heading>p,.responsible-summary,.why-heading>p,.industries-heading>p,.presence-heading>p,.insights-intro,.hero-summary) {
  padding-left: 0;
  padding-right: 22px;
  border-left: 0;
  border-right: 1px solid rgba(52,182,255,.5);
}

html[lang="ar"] :is(.section-rail,.cyber-meta,.products-index,.systems-meta,.ecosystem-meta,.why-meta,.industries-meta,.presence-meta,.insights-meta) {
  padding-right: 0;
  padding-left: 22px;
  border-right: 0;
  border-left: 1px solid currentColor;
}

html[lang="ar"] .section-rail span { transform: rotate(180deg); }

/* Cards and component flow */
html[lang="ar"] :is(.product-copy,.system-copy,.insight-copy,.story-content,.feature-copy,.service-card,.number-card,.detail-card,.contact-locations article) {
  text-align: right;
}

html[lang="ar"] :is(.product-logo img,.system-logo img,.product-card img,.cyber-product-logo) {
  object-position: right center;
}

html[lang="ar"] :is(.product-copy>a,.system-copy>a,.text-link,.advisory-link,.responsible-copy>a,.insights-intro>a,.insight-copy>a,.contact-locations article>a) {
  flex-direction: row-reverse;
}

html[lang="ar"] :is(.service-arrow,.industry-arrow,.ecosystem-product>a,.secondary-copy>a) { transform: scaleX(-1); }

html[lang="ar"] .ecosystem-product>a { right: auto; left: 28px; }
html[lang="ar"] .flare-readout { right: auto; left: 0; }

/* Timelines, maps and diagrams */
html[lang="ar"] :is(.lifecycle-map ol,.presence-timeline,.journey-steps,.quantum-track,.usable-grid) { direction: rtl; }
html[lang="ar"] .route-map,
html[lang="ar"] .identity-visual,
html[lang="ar"] .workflow-visual,
html[lang="ar"] .governance-architecture,
html[lang="ar"] .story-graphic,
html[lang="ar"] .feature-signal,
html[lang="ar"] .bazgrid-interface,
html[lang="ar"] .attack-interface,
html[lang="ar"] .ecosystem-graphic,
html[lang="ar"] .flare-console { direction: ltr; }

/* Geographic maps are not mirrored: US remains west/left and Saudi remains east/right. */
html[lang="ar"] .route-city,
html[lang="ar"] .route-coordinate { direction: rtl; }

/* Forms */
html[lang="ar"] .contact-form { direction: rtl; }
html[lang="ar"] .contact-form :is(input,textarea,select) { text-align: right; }
html[lang="ar"] .direct-contact { direction: rtl; }
html[lang="ar"] .form-submit { direction: rtl; }

/* Footer */
html[lang="ar"] :is(.footer-grid,.footer-shell,.footer-nav,.footer-base) { direction: rtl; }
html[lang="ar"] .footer-base>span:last-child { text-align: left; }
html[lang="ar"] .footer-brand-column{align-items:flex-start}
html[lang="ar"] .footer-linkedin{width:38px;height:38px;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;border:1px solid #34B6FF;background:#34B6FF;color:#001044!important;transition:color .25s ease,background-color .25s ease,transform .25s ease}html[lang="ar"] .footer-linkedin svg{width:17px;height:17px;fill:currentColor}html[lang="ar"] .footer-linkedin:hover{color:#001044!important;background:#fff;transform:translateY(-2px)}html[lang="ar"] .footer-linkedin:focus-visible{outline:2px solid #fff;outline-offset:3px}

/* Arabic display sizing: Arabic glyphs are visually denser than Latin. */
html[lang="ar"] .hero h1 { line-height: 1.2; }
html[lang="ar"] .page-hero h1,
html[lang="ar"] .contact-intro h1 { line-height: 1.18; }
html[lang="ar"] :is(.section-head h2,.positioning h2,.cyber-title-group h2,.products-heading h2,.systems-heading h2,.responsible-copy h2,.presence-heading h2,.insights-heading h2) { line-height: 1.18; }

@media (max-width: 900px) {
  html[lang="ar"] .hero::before { inset: 0; }
  html[lang="ar"] .hero::after { background: linear-gradient(270deg, rgba(0,16,68,.98), rgba(0,16,68,.68)); }
  html[lang="ar"] :is(.section-rail,.cyber-meta,.products-index,.systems-meta,.ecosystem-meta,.why-meta,.industries-meta,.presence-meta,.insights-meta) {
    padding: 0 0 22px;
    border-left: 0;
  }
  html[lang="ar"] .hero-summary { padding-right: 18px; }
}

@media (max-width: 560px) {
  html[lang="ar"] :is(.positioning-context,.products-intro,.systems-intro,.ecosystem-heading>p,.responsible-summary,.why-heading>p,.industries-heading>p,.presence-heading>p,.insights-intro) {
    padding-right: 18px;
  }
  html[lang="ar"] .footer-base>span:last-child { text-align: right; }
}

@media (prefers-reduced-motion: reduce) {
  html[lang="ar"] * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@keyframes ar-reveal-right {
  from { opacity: 0; transform: translateX(42px); }
  to { opacity: 1; transform: translateX(0); }
}
