/* Shaghaf global header — compact, balanced and aligned with Mahana. */
:root {
  --career-accent: #f15a24;
  --career-accent-dark: #ca430f;
  --career-black: #090909;
  --career-white: #fff;
  --career-text: #111;
  --career-muted: #6e6e73;
  --career-line: #e3e3e6;
  --career-soft: #f5f5f7;
  --career-warm: #fff9f5;
  --career-shadow: 0 18px 48px rgba(17,17,17,.10);
  --career-font: "thmanyahserifdisplay", "Thmanyah Serif Display", Tahoma, Arial, sans-serif;
}

.sj-global-header,
.sj-global-header *,
.sj-global-header *::before,
.sj-global-header *::after { box-sizing: border-box; }

.sj-global-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  direction: rtl;
  color: var(--career-text);
  background: rgba(255,255,255,.98);
  border-bottom: 1px solid var(--career-line);
  font-family: var(--career-font);
  transition: box-shadow .2s ease, border-color .2s ease;
}
body.admin-bar .sj-global-header { top: 32px; }
.sj-global-header a { color: inherit; text-decoration: none; }
.sj-global-header button,
.sj-global-header input { font: inherit; }
.sj-global-wrap { width: min(1320px, calc(100% - 32px)); margin-inline: auto; }

.sj-global-header-in {
  position: relative;
  display: grid;
  grid-template-columns: minmax(205px,1fr) auto minmax(205px,1fr);
  align-items: center;
  gap: clamp(14px,2vw,30px);
  min-height: 74px;
  padding-block: 9px;
}

/* Brand */
.sj-global-logo {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 11px;
  min-width: max-content;
  border-radius: 14px;
}
.sj-global-logo-mark {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  overflow: hidden;
  color: #fff;
  background: #050505;
  border: 2px solid var(--career-accent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(241,90,36,.07);
  font-size: 22px;
  font-weight: 950;
}
.sj-global-logo-mark::after {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: inherit;
  content: "";
  pointer-events: none;
}
.sj-global-logo-mark img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.sj-global-logo-copy { display: grid; gap: 3px; line-height: 1; }
.sj-global-logo-name { font-size: clamp(19px,1.3vw,22px); font-weight: 950; letter-spacing: -.015em; white-space: nowrap; }
.sj-global-logo-note { color: var(--career-muted); font-size: 10px; font-weight: 800; line-height: 1; white-space: nowrap; }

/* Main navigation */
.sj-global-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  max-width: 100%;
  min-height: 48px;
  justify-self: center;
  padding: 4px;
  background: var(--career-soft);
  border: 1px solid #e8e8eb;
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85);
}
.sj-global-nav-item { position: relative; display: flex; min-width: 0; }
.sj-global-nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 clamp(14px,1.35vw,21px);
  color: #1b1b1d;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease;
}
.sj-global-nav-link:hover,
.sj-global-nav-link:focus-visible { color: var(--career-accent-dark); background: #fff; border-color: rgba(241,90,36,.18); }
.sj-global-nav-link.is-active {
  color: #fff;
  background: var(--career-black);
  border-color: var(--career-black);
  box-shadow: 0 6px 15px rgba(0,0,0,.13);
}
.sj-global-nav-link.is-active::after {
  position: absolute;
  right: 50%;
  bottom: -7px;
  width: 18px;
  height: 3px;
  border-radius: 99px;
  background: var(--career-accent);
  content: "";
  transform: translateX(50%);
}
.sj-global-caret { display: grid; width: 15px; height: 15px; place-items: center; }
.sj-global-caret svg { display: block; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .16s ease; }
.sj-global-nav-item:hover .sj-global-caret svg,
.sj-global-nav-item:focus-within .sj-global-caret svg { transform: rotate(180deg); }

/* Desktop dropdown */
.sj-global-menu-desktop {
  position: absolute;
  top: calc(100% + 13px);
  right: 50%;
  z-index: 20;
  display: grid;
  gap: 4px;
  width: 250px;
  padding: 9px;
  visibility: hidden;
  opacity: 0;
  background: #fff;
  border: 1px solid var(--career-line);
  border-radius: 16px;
  box-shadow: var(--career-shadow);
  transform: translate(50%,7px);
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
}
.sj-global-menu-desktop::before {
  position: absolute;
  right: 50%;
  bottom: 100%;
  width: 38px;
  height: 14px;
  content: "";
  transform: translateX(50%);
}
.sj-global-nav-item:hover .sj-global-menu-desktop,
.sj-global-nav-item:focus-within .sj-global-menu-desktop { visibility: visible; opacity: 1; transform: translate(50%,0); pointer-events: auto; }
.sj-global-menu-desktop a { display: flex; min-height: 42px; align-items: center; padding: 9px 12px; color: var(--career-muted); border-radius: 10px; font-size: 14px; font-weight: 850; }
.sj-global-menu-desktop a:hover,
.sj-global-menu-desktop a:focus-visible { color: var(--career-accent-dark); background: var(--career-warm); }
.sj-global-menu-desktop a.is-active { color: #fff; background: var(--career-accent); }

/* Actions */
.sj-mobile-search { display: none; }
.sj-global-actions { display: flex; align-items: center; justify-self: end; gap: 8px; }
.sj-global-menu-toggle,
.sj-global-search-toggle,
.sj-global-search-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 13px;
  color: #171719;
  background: #fff;
  border: 1px solid var(--career-line);
  border-radius: 999px;
  cursor: pointer;
  transition: color .16s ease, border-color .16s ease, background .16s ease;
}
.sj-global-menu-toggle { display: none; }
.sj-global-search-toggle:hover,
.sj-global-search-toggle:focus-visible { color: var(--career-accent-dark); background: var(--career-warm); border-color: rgba(241,90,36,.4); }
.sj-global-action-label { font-size: 13px; font-weight: 900; }
.sj-global-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 17px;
  color: #fff !important;
  background: var(--career-accent);
  border: 1px solid var(--career-accent);
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(241,90,36,.18);
  font-size: 14px;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.sj-global-cta b { display: grid; place-items: center; width: 22px; height: 22px; color: var(--career-accent-dark); background: #fff; border-radius: 50%; font-size: 12px; }
.sj-global-cta:hover,
.sj-global-cta:focus-visible { background: var(--career-accent-dark); border-color: var(--career-accent-dark); box-shadow: 0 9px 20px rgba(202,67,15,.2); transform: translateY(-1px); }

/* CSS icons */
.sj-global-icon { position: relative; display: block; width: 19px; height: 19px; }
.sj-global-icon-search::before { position: absolute; top: 1px; right: 1px; width: 10px; height: 10px; border: 1.8px solid currentColor; border-radius: 50%; content: ""; }
.sj-global-icon-search::after { position: absolute; left: 1px; bottom: 3px; width: 7px; height: 1.8px; border-radius: 99px; background: currentColor; content: ""; transform: rotate(-45deg); }
.sj-global-icon-menu::before,
.sj-global-icon-menu::after { position: absolute; right: 1px; width: 17px; height: 2px; border-radius: 99px; background: currentColor; content: ""; }
.sj-global-icon-menu::before { top: 5px; box-shadow: 0 5px 0 currentColor; }
.sj-global-icon-menu::after { top: 15px; }
.sj-global-icon-close::before,
.sj-global-icon-close::after { position: absolute; top: 9px; right: 1px; width: 17px; height: 2px; background: currentColor; content: ""; transform: rotate(45deg); }
.sj-global-icon-close::after { transform: rotate(-45deg); }

/* Search and mobile panels */
.sj-global-search-panel,
.sj-global-menu-panel {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  z-index: 30;
  background: #fff;
  border-bottom: 1px solid var(--career-line);
  box-shadow: 0 20px 40px rgba(17,17,17,.08);
}
.sj-global-search-panel[hidden],
.sj-global-menu-panel[hidden] { display: none !important; }
.sj-global-search-box { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; padding-block: 16px; }
.sj-global-search-form { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 12px; min-height: 54px; padding: 5px 7px 5px 16px; background: var(--career-soft); border: 1px solid var(--career-line); border-radius: 16px; }
.sj-global-search-form input { width: 100%; min-width: 0; padding: 0; color: #111; background: transparent; border: 0; outline: 0; font-size: 16px; }
.sj-global-search-form button { min-height: 42px; padding: 0 22px; color: #fff; background: #000; border: 0; border-radius: 12px; font-weight: 900; cursor: pointer; }
.sj-global-search-close { border-radius: 14px; }

.sj-global-menu-list { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin: 0; padding-block: 16px; list-style: none; }
.sj-global-menu-list > li > a { display: block; padding: 12px 14px; color: #111; background: var(--career-soft); border: 1px solid var(--career-line); border-radius: 12px; font-weight: 900; }
.sj-global-menu-list ul { display: grid; gap: 4px; margin: 6px 0 0; padding: 0; list-style: none; }
.sj-global-menu-list ul a { display: block; padding: 8px 10px; color: var(--career-muted); border-radius: 8px; font-size: 13px; font-weight: 800; }
.sj-global-menu-list a:hover,
.sj-global-menu-list a:focus-visible,
.sj-global-menu-list a.is-active { color: var(--career-accent-dark); }

.sj-global-header.is-scrolled { border-bottom-color: #d9d9dc; box-shadow: 0 8px 28px rgba(17,17,17,.07); }
.sj-global-header.is-scrolled .sj-global-header-in { min-height: 66px; }
.sj-global-header.is-scrolled .sj-global-logo-mark { width: 42px; height: 42px; flex-basis: 42px; }

@media (max-width: 1180px) {
  .sj-global-header-in { grid-template-columns: minmax(54px,1fr) auto minmax(170px,1fr); }
  .sj-global-logo-copy { display: none; }
  .sj-global-nav-link { padding-inline: 13px; font-size: 13px; }
  .sj-global-action-label { display: none; }
  .sj-global-search-toggle { width: 44px; padding: 0; }
}

@media (max-width: 900px) {
  body.admin-bar .sj-global-header { top: 46px; }
  .sj-global-wrap { width: min(100% - 24px,1320px); }
  .sj-global-header-in { grid-template-columns: auto minmax(0,1fr) auto; min-height: 68px; gap: 9px; padding-block: 8px; }
  .sj-global-logo { min-width: 44px; }
  .sj-global-logo-mark { width: 44px; height: 44px; flex-basis: 44px; }
  .sj-global-logo-copy { display: none; }
  .sj-global-nav { display: none; }
  .sj-mobile-search { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; min-width: 0; height: 44px; padding-inline: 13px 4px; background: var(--career-soft); border: 1px solid var(--career-line); border-radius: 14px; }
  .sj-mobile-search:focus-within { border-color: rgba(241,90,36,.55); box-shadow: 0 0 0 3px rgba(241,90,36,.08); }
  .sj-mobile-search input { min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; font-size: 14px; }
  .sj-mobile-search button { display: grid; width: 36px; height: 36px; place-items: center; padding: 0; color: #fff; background: #000; border: 0; border-radius: 11px; }
  .sj-global-menu-toggle { display: inline-flex; width: 44px; padding: 0; border-radius: 13px; }
  .sj-global-search-toggle,
  .sj-global-cta { display: none; }
  .sj-global-menu-list { grid-template-columns: 1fr; max-height: calc(100vh - 90px); overflow: auto; }
  .sj-global-search-panel { display: none !important; }
  .sj-global-header.is-scrolled .sj-global-header-in { min-height: 62px; }
}

@media (max-width: 520px) {
  .sj-global-wrap { width: min(100% - 16px,1320px); }
  .sj-global-header-in { grid-template-columns: auto minmax(0,1fr) auto; }
  .sj-global-logo-mark { width: 42px; height: 42px; flex-basis: 42px; }
  .sj-mobile-search { height: 42px; }
  .sj-global-menu-toggle { width: 42px; min-width: 42px; min-height: 42px; }
}

@media (hover: none) {
  .sj-global-cta:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .sj-global-header *,
  .sj-global-header *::before,
  .sj-global-header *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
