/* Shared header styles; loads after site.css. */

/* 5. Header ---------------------------------------------------------------- */
.utility-bar { background: var(--c-indigo-dark); color: var(--c-white); font-size: 13.5px; line-height: normal; }
.utility-bar__inner {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.utility-bar__note { display: flex; align-items: center; gap: 10px; min-width: 0; }
.utility-bar__note > span:not(.dot) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.utility-bar__links { display: flex; align-items: center; gap: 22px; flex-shrink: 0; }
.util-link { display: inline-flex; align-items: center; gap: 6px; color: var(--c-white); font-weight: 500; text-decoration: none; }
.util-link:hover { color: var(--c-white); opacity: .85; }
.util-link--underline { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--c-white);
  border-bottom: 1px solid var(--c-border);
  box-shadow: 0 1px 0 rgba(42, 36, 112, 0.04);
  line-height: normal;
  transition: box-shadow .2s ease;
}
.site-header.is-compact { box-shadow: 0 6px 20px rgba(42, 36, 112, 0.08); }
.site-header__bar {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 28px;
  transition: height .2s ease;
}
.site-header.is-compact .site-header__bar { height: var(--nav-h-compact); }

.brand { display: flex; align-items: center; gap: 10px; color: var(--c-ink); text-decoration: none; flex-shrink: 0; }
.brand:hover { color: var(--c-ink); }
.brand__mark { display: block; flex-shrink: 0; width: 48px; height: 48px; object-fit: contain; transition: width .2s ease, height .2s ease; }
.site-header.is-compact .brand__mark { width: 36px; height: 36px; }
.brand__name { font-family: var(--font-head); font-size: 19px; font-weight: 900; line-height: 1.2; color: var(--c-indigo-dark); white-space: nowrap; }

.nav-list { list-style: none; display: flex; align-items: center; gap: 4px; flex-grow: 1; }
.nav-item {
  height: 44px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--c-ink);
  font-size: 15.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.nav-item:hover, .nav-item[aria-expanded="true"] { background: var(--c-pale); color: var(--c-indigo-dark); }
.nav-item.is-active { color: var(--c-indigo-dark); box-shadow: inset 0 -3px 0 var(--c-primary); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.nav-item svg { transition: transform .2s ease; }
.nav-item[aria-expanded="true"] svg { transform: rotate(180deg); }
/* A link with its own menu arrow ("الدورات"): the two read as one item. */
.nav-split { display: flex; align-items: center; }
.nav-split > .nav-item:first-child { padding-inline-end: 4px; }
.nav-item--caret { padding: 0 8px; cursor: pointer; }

.site-header__cta { flex-shrink: 0; }

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin-inline-start: auto;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-white);
  color: var(--c-indigo-dark);
}

/* Dropdown panels */
.mega {
  position: absolute;
  top: 100%;
  inset-inline: 0;
  z-index: 60;
  padding: 0 var(--gutter);
}
.mega__panel {
  max-width: 1234px;
  margin: 8px auto 0;
  padding: 28px;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-menu);
}
.mega__panel--courses { display: grid; grid-template-columns: 1.15fr 1.35fr 0.8fr; gap: 28px; }

.mega__featured {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  background: var(--c-pale-2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
}
.mega__featured-title { font-family: var(--font-head); font-size: 21px; font-weight: 800; line-height: 1.35; }
.mega__featured-desc { font-size: 14.5px; line-height: 1.7; color: var(--c-text-2); }
.mega__facts { list-style: none; margin-top: 4px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--c-text-2); }
.mega__facts li { display: flex; align-items: center; gap: 8px; }
.mega__facts svg { color: var(--c-primary); }
.mega__facts strong { color: var(--c-ink); }
.mega__col { display: flex; flex-direction: column; gap: 6px; }
.mega__label { margin-bottom: 6px; font-size: 12.5px; font-weight: 700; color: var(--c-text-3); letter-spacing: 0.3px; }
.mega__aside { display: flex; flex-direction: column; gap: 10px; padding-inline-start: 24px; border-inline-start: 1px solid var(--c-border); }
.mega__aside-title { font-family: var(--font-head); font-size: 16px; font-weight: 800; }
.mega__aside p:not(.mega__aside-title) { font-size: 14px; line-height: 1.7; color: var(--c-text-2); }

.menu-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border-radius: var(--radius);
  color: var(--c-ink);
  text-decoration: none;
}
.menu-row:hover { background: var(--c-pale); color: var(--c-ink); }
.menu-row__title { font-size: 15.5px; font-weight: 700; }
.menu-row__sub { font-size: 13.5px; line-height: 1.6; color: var(--c-text-3); }

/* Mobile drawer */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: var(--c-white);
  overflow-y: auto;
}
.drawer__head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 64px;
  padding: 0 var(--gutter);
  background: var(--c-white);
  border-bottom: 1px solid var(--c-border);
}
.drawer__close {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-white);
  color: var(--c-indigo-dark);
}
.drawer__nav { padding: 8px var(--gutter); }
.drawer__list { list-style: none; display: flex; flex-direction: column; }
.drawer__list > li { border-bottom: 1px solid var(--c-mist); }
.m-row {
  width: 100%;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--c-ink);
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  list-style: none;
  cursor: pointer;
}
.m-row::-webkit-details-marker { display: none; }
.m-row:hover, .m-row:active { color: var(--c-indigo-dark); }
.m-row[aria-current="page"] { color: var(--c-primary); }
details[open] > .m-row svg { transform: rotate(180deg); }
.drawer__sub { list-style: none; padding: 0 12px 12px; display: flex; flex-direction: column; }
.drawer__sub a {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-height: 48px;
  padding: 6px 12px;
  border-radius: var(--radius);
  color: var(--c-text-2);
  font-size: 15.5px;
  font-weight: 600;
  text-decoration: none;
}
.drawer__sub a:hover { background: var(--c-pale-2); color: var(--c-ink); }
.drawer__sub small { font-size: 13px; font-weight: 500; color: var(--c-text-3); }
.drawer__foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px var(--gutter) calc(20px + env(safe-area-inset-bottom));
  background: var(--c-pale-2);
  border-top: 1px solid var(--c-border);
}
.drawer__foot p { font-size: 14px; color: var(--c-text-2); }

@media (max-width: 1100px) {
  .nav-list, .site-header__cta { display: none; }
  .menu-toggle { display: inline-flex; }
  .mega { display: none !important; }
}
@media (max-width: 720px) {
  .utility-bar__links { display: none; }
  .utility-bar__note { font-size: 12.5px; }
  .site-header__bar { height: 60px; }
  .brand__mark { width: 36px; height: 36px; }
  .brand__name { font-size: 17px; }
}
