/* ==========================================================================
   Multilingual UI - loaded on every page (English, ar/, fr/, zh/).
   The language selector markup is generated by tools/i18n/build.py.
   ========================================================================== */

/* Cairo, the site's Arabic typeface. Self-hosted, Arabic subset only; the
   browser downloads it only when Arabic text is rendered in this family. */
@font-face {
  font-family: "Cairo";
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url(../fonts/cairo/cairo-arabic-variable.woff2) format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF,
    U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

/* --- Flags: real flag artwork (imgs/flags) shown as waving fabric -------
   The wave is a clip-path; the light on the crests and the shadow in the
   folds is a soft-light gradient over the artwork. */
.lang-flag {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 24px;
  height: 18px;
  filter: drop-shadow(0 1px 1.2px rgba(4, 13, 23, 0.38));
}
.lang-flag img,
.lang-flag::after {
  position: absolute;
  top: 0;
  left: 0;
  width: 24px;
  height: 18px;
  clip-path: path("M0 3C4 1 8 1 12 3S20 5 24 3V15C20 17 16 17 12 15S4 13 0 15Z");
}
.lang-flag img {
  display: block;
  object-fit: cover;
}
.lang-flag::after {
  content: "";
  background:
    linear-gradient(90deg,
      rgba(0, 0, 0, 0.18) 0%,
      rgba(255, 255, 255, 0.55) 24%,
      rgba(255, 255, 255, 0) 46%,
      rgba(0, 0, 0, 0.38) 74%,
      rgba(0, 0, 0, 0.06) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 45%, rgba(0, 0, 0, 0.22) 100%);
  mix-blend-mode: soft-light;
  pointer-events: none;
}

/* Language names in their own script. */
.lang-switcher [lang="ar"] .lang-native,
.lang-switcher a[lang="ar"],
.lang-current-name:lang(ar) {
  font-family: "Cairo", "Segoe UI", Tahoma, sans-serif;
}
.lang-switcher [lang="zh-Hans"] .lang-native,
.lang-switcher a[lang="zh-Hans"] {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", sans-serif;
}

/* --- Desktop: top-bar button + menu card -------------------------------- */
.lang-dropdown {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 40px;
}
.wrap:has(.lang-menu.show) {
  z-index: 1100; /* the open menu overlaps the navbar below the top bar */
}
.lang-current {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 7px 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-family: "Montserrat", Arial, sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.lang-current:hover,
.lang-current[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--tm-accent-light, #e4c878);
}
.lang-current:focus-visible {
  outline: 2px solid var(--tm-accent-light, #e4c878);
  outline-offset: 2px;
}
.lang-current:lang(ar) .lang-current-name {
  font-size: 13.5px;
}
/* "More languages inside": the other languages' flags peek out of the
   button as a small overlapping stack, spreading apart on hover. */
.lang-peek {
  display: inline-flex;
  align-items: center;
  height: 18px;
  margin-inline-start: 2px;
  padding-inline-start: 9px;
  border-inline-start: 1px solid rgba(255, 255, 255, 0.25);
}
.lang-peek img {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.9);
  transition: margin 0.22s ease;
}
.lang-peek img + img {
  margin-inline-start: -5px;
}
.lang-current:hover .lang-peek img + img,
.lang-current:focus-visible .lang-peek img + img,
.lang-current[aria-expanded="true"] .lang-peek img + img {
  margin-inline-start: 3px;
}
.lang-caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(228, 200, 120, 0.18);
  color: var(--tm-accent-light, #e4c878);
  font-size: 8px;
  transition: transform 0.22s ease, background-color 0.22s ease;
}
.lang-current:hover .lang-caret {
  transform: translateY(1px);
  background: rgba(228, 200, 120, 0.3);
}
.lang-current[aria-expanded="true"] .lang-caret {
  transform: rotate(180deg);
}
@media (prefers-reduced-motion: reduce) {
  .lang-peek img,
  .lang-caret {
    transition: none;
  }
}

.lang-dropdown .lang-menu {
  min-width: 236px;
  margin-top: 6px;
  padding: 6px;
  border: 0;
  border-top: 3px solid var(--accent, #d4af37);
  border-radius: var(--tm-radius-md, 14px);
  background: #f2f4f7; /* a light grey, just off white */
  box-shadow: 0 20px 45px -12px rgba(15, 59, 104, 0.35), 0 2px 8px rgba(15, 59, 104, 0.08);
  font-family: "Montserrat", Arial, sans-serif;
}
.lang-dropdown .lang-menu.show {
  animation: langMenuIn 0.18s ease both;
}
@keyframes langMenuIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .lang-dropdown .lang-menu.show { animation: none; }
}
.lang-menu-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px 6px;
  color: var(--tm-accent-dark, #b8952e);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.lang-menu .lang-option {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: 10px;
  color: var(--text, #0f172a);
  white-space: nowrap;
  text-decoration: none;
}
/* On the grey card, hovered and current rows lift out in white. */
.lang-menu .lang-option:hover,
.lang-menu .lang-option:focus {
  background: #fff;
  color: var(--primary, #0f3b68);
}
.lang-menu .lang-option[aria-current="page"] {
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 59, 104, 0.1);
}
.lang-text {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
  line-height: 1.25;
}
.lang-native {
  color: var(--primary, #0f3b68);
  font-size: 14px;
  font-weight: 700;
}
.lang-local {
  color: var(--muted, #64748b);
  font-family: "Montserrat", "Cairo", Arial, sans-serif;
  font-size: 11.5px;
  font-weight: 500;
}
.lang-check {
  margin-inline-start: auto;
  color: var(--accent, #d4af37);
  font-size: 12px;
}

/* --- Mobile menu (white panel, < 992px): two-by-two grid ---------------- */
.lang-switcher.lang-switcher-mobile {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
  padding: 14px 0 6px;
  border-top: 1px solid var(--border, #e2e8f0);
}
.lang-switcher-mobile a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  background: #fff;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.lang-switcher-mobile a:hover,
.lang-switcher-mobile a:focus-visible {
  border-color: var(--tm-accent-light, #e4c878);
  background: var(--tm-primary-50, #e9eff4);
}
.lang-switcher-mobile a[aria-current="page"] {
  border-color: var(--primary, #0f3b68);
  background: var(--primary, #0f3b68);
  box-shadow: inset 0 -3px 0 var(--accent, #d4af37);
}
.lang-switcher-mobile a[aria-current="page"] .lang-native {
  color: #fff;
}

/* Eyebrow label the theme writes in CSS (theme-modern.css, countries
   section heading): the page language's version of "Global Reach". */
html[lang="ar"] .countries-section > .container > h2::before {
  content: "حضورنا العالمي";
}
html[lang="fr"] .countries-section > .container > h2::before {
  content: "Présence mondiale";
}
html[lang="zh-Hans"] .countries-section > .container > h2::before {
  content: "全球覆盖";
}

/* French menu labels are the longest: slightly tighter links so the menu
   and the full Employee Login badge fit the 1140px container. */
@media (min-width: 1200px) {
  html[lang="fr"] .ftco-navbar-light .navbar-nav > .nav-item > .nav-link {
    padding-left: 11px;
    padding-right: 11px;
  }
}

/* FAQ questions: the theme capitalizes Every Word, which is English
   title case - French questions keep normal sentence case. */
html[lang="fr"] .ftco-faqs .myaccordion .btn {
  text-transform: none;
}
