/* NexStepia V1.5 — one bilingual header across all sixteen routes.
   Physical layout never flips when html[dir] changes: brand RIGHT, language LEFT.
   Intentionally high-specificity overrides the previous inline language CSS. */
html body > header {height:auto!important;min-height:78px;overflow:visible!important;}
html body > header > :is(.nav,.compare-shell),
html body.compare-page > header.compare-head > .compare-shell {
  box-sizing:border-box;display:flex!important;flex-direction:row!important;
  direction:rtl!important;align-items:center!important;
  justify-content:space-between!important;flex-wrap:nowrap!important;
  position:relative!important;min-height:76px;gap:clamp(8px,1.2vw,18px)!important;
  width:min(1450px,calc(100% - 42px))!important;max-width:1450px!important;
  margin-inline:auto!important;padding:0!important;
}
html body > header > :is(.nav,.compare-shell) > :is(.brand,.compare-brand),
html body.compare-page > header.compare-head > .compare-shell > .compare-brand {
  box-sizing:border-box;order:0!important;position:static!important;inset:auto!important;
  transform:none!important;display:inline-flex!important;align-items:center!important;
  flex:0 0 auto!important;direction:rtl!important;max-width:min(305px,36vw);
  margin:0!important;white-space:nowrap!important;min-width:0;
}
html body > header > :is(.nav,.compare-shell) > .mw-language-toggle,
html body.compare-page > header.compare-head > .compare-shell > .mw-language-toggle {
  box-sizing:border-box;order:3!important;position:relative!important;inset:auto!important;
  top:auto!important;right:auto!important;left:auto!important;transform:none!important;
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  flex:0 0 auto!important;gap:3px!important;direction:ltr!important;
  margin:0!important;padding:3px 7px!important;min-height:46px;
  width:max-content!important;border:1px solid rgba(255,255,255,.35)!important;
  border-radius:999px!important;background:#FFFFFF!important;
  box-shadow:0 4px 14px rgba(0,0,0,.10)!important;white-space:nowrap!important;z-index:6;
}
html body > header .mw-language-toggle button,
html body > header .mw-language-toggle button[aria-pressed="true"],
html body > header .mw-language-toggle button[aria-pressed="false"] {
  box-sizing:border-box;display:inline-flex!important;align-items:center!important;
  justify-content:center!important;flex:0 0 auto!important;
  margin:0!important;padding:7px 8px!important;min-height:38px!important;
  border:0!important;border-radius:0!important;background:transparent!important;
  color:#164A43!important;box-shadow:none!important;text-shadow:none!important;
  opacity:1!important;font-size:15px!important;font-weight:700!important;
  line-height:1.25!important;letter-spacing:0!important;white-space:nowrap!important;
}
html body > header .mw-language-toggle button[lang="en"] {font-family:var(--nx-font,'Cairo',sans-serif)!important;}
html body > header .mw-language-toggle button[lang="ar"] {font-family:var(--nx-font,'Cairo',sans-serif)!important;font-size:15px!important;}
html body > header .mw-language-toggle button[aria-pressed="true"] {text-decoration:underline!important;text-decoration-thickness:1.5px!important;text-underline-offset:5px!important;}
html body > header .mw-language-toggle button:hover {color:#0E332F!important;}
html body > header .mw-language-toggle .mw-language-toggle__divider {color:#687D73!important;font-size:15px!important;}
html body > header > :is(.nav,.compare-shell) > .navlinks {
  order:1!important;flex:1 1 auto;min-width:0;margin:0!important;
  display:flex!important;align-items:center!important;justify-content:center!important;
  gap:clamp(8px,1.1vw,18px)!important;white-space:nowrap;
}
html[lang="en"] body > header .navlinks {direction:ltr!important;}
html[lang="ar"] body > header .navlinks {direction:rtl!important;}
html body > header > .nav > a:not(.brand) {order:1;min-width:0;flex:0 1 auto;}
/* Keep logo/languages in the FIRST row, place long navigation in the second row. */
@media(max-width:1060px) {
 html body > header > .nav:has(.navlinks) {
   display:grid!important;direction:rtl!important;
   grid-template-columns:minmax(0,1fr) auto!important;grid-template-rows:auto auto!important;
   gap:5px 12px!important;padding-block:11px!important;
 }
 html body > header > .nav:has(.navlinks) > .brand {grid-column:1!important;grid-row:1!important;justify-self:start;}
 html body > header > .nav:has(.navlinks) > .mw-language-toggle {grid-column:2!important;grid-row:1!important;justify-self:end;}
 html body > header > .nav:has(.navlinks) > .navlinks {
   grid-column:1/-1!important;grid-row:2!important;min-width:0;max-width:100%;
   overflow-x:auto;scrollbar-width:thin;justify-content:center!important;padding:4px 0;
 }
}
@media(max-width:640px) {
 html body > header > :is(.nav,.compare-shell),
 html body.compare-page > header.compare-head > .compare-shell {
   width:calc(100% - 24px)!important;min-height:66px;gap:6px!important;
 }
 html body > header > :is(.nav,.compare-shell) > :is(.brand,.compare-brand) {
   max-width:calc(100vw - 174px);font-size:clamp(15px,3.9vw,19px)!important;
   gap:6px!important;white-space:nowrap!important;
 }
 html body > header .brand :is(.brand-name,.brand-tagline) {
   max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
 }
 html body > header > :is(.nav,.compare-shell) > .mw-language-toggle {
   min-height:40px;padding:2px 4px!important;
 }
 html body > header .mw-language-toggle button,
 html body > header .mw-language-toggle button[lang="ar"] {
   font-size:13px!important;min-height:34px!important;padding:5px!important;
 }
 html body > header > .nav:not(:has(.navlinks)) {flex-wrap:wrap!important;padding-block:8px!important;}
}

/* NexStepia logo lockup, applied consistently in page headers. */
html body > header :is(a.brand,a.compare-brand,.brand a,.compare-brand a){display:inline-flex!important;align-items:center!important;justify-content:center!important;min-width:122px!important;min-height:65px!important;position:relative!important;font-size:0!important;line-height:0!important;white-space:nowrap}
html body > header :is(a.brand,a.compare-brand,.brand a,.compare-brand a)::before{content:"";display:block;width:124px;height:70px;flex:none;background:transparent url('/images/nexstepia-green-logo.svg') center/contain no-repeat}
html body > header :is(a.brand,a.compare-brand,.brand a,.compare-brand a) :is(span,strong,small){font-size:0!important;line-height:0!important}
@media(max-width:520px){html body > header :is(a.brand,a.compare-brand,.brand a,.compare-brand a){min-width:93px!important;min-height:56px!important}html body > header :is(a.brand,a.compare-brand,.brand a,.compare-brand a)::before{width:96px;height:54px}}

/* Simple header markup on profession pages */
html body > header > a[href="/"]:first-child{display:inline-flex!important;align-items:center!important;justify-content:center!important;font-size:0!important;min-width:124px;min-height:70px;vertical-align:middle}
html body > header > a[href="/"]:first-child::before{content:"";display:block;width:124px;height:70px;background:url('/images/nexstepia-green-logo.svg') center/contain no-repeat}
