/**
 * header.css
 * Sticky transparent header matched to WordPress / Elementor (post-2616).
 */

/* Temporary dark field under the fixed header so white logo/links read
   until the homepage hero is implemented. */
body.site-body {
  background-color: #ffffff;
  background-image: linear-gradient(#0c3558 0, #0c3558 240px, #ffffff 240px);
}

/* -------------------------------------------------------------------------- */
/* Header shell — Elementor sticky: top, offset 0, transparent overlay        */
/* -------------------------------------------------------------------------- */

.site-header {
  --header-link: #ffffff;
  --header-link-hover: #54595f;
  --header-link-active: #54595f;
  --header-dropdown-bg: #eeeeee;
  --header-dropdown-link: #215996;
  --header-dropdown-hover: #0069c8;
  --header-max: 1600px;
  --header-pad-x: 0px;
  --header-pad-y: 0px;
  --nav-item-gap: 2.5px; /* Elementor --e-nav-menu-horizontal-menu-item-margin */

  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 99; /* Elementor sticky active z-index */
  width: 100%;
  margin: 0;
  padding: 0;
  background-color: transparent;
  color: var(--header-link);
  box-shadow: none;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Scrolled: solid white bar + branding-blue logo/links */
.site-header.is-scrolled {
  background-color: #ffffff;
  box-shadow: 0 1px 12px rgba(15, 47, 79, 0.08);
  --header-link: #215996;
  --header-link-hover: #0069c8;
  --header-link-active: #215996;
  color: var(--header-link);
}

.site-header.is-scrolled .site-nav__toggle {
  color: #215996;
}

.site-header.is-scrolled .site-logo__text {
  color: #215996;
}

.site-header.is-scrolled .lang-switch__sep {
  color: rgba(33, 89, 150, 0.35);
}

.site-header__inner {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  max-width: var(--header-max);
  min-height: 0;
  margin-inline: auto;
  padding: var(--header-pad-y) var(--header-pad-x);
  box-sizing: border-box;
}

/* -------------------------------------------------------------------------- */
/* Logo column — desktop: 28% × img 70% ≈ 19.6% of 1600px ≈ 314px            */
/* -------------------------------------------------------------------------- */

.site-header__brand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex: 0 0 53%;
  max-width: 53%;
  padding: 15px;
  box-sizing: border-box;
}

.site-logo {
  position: relative;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  color: #ffffff;
  text-decoration: none;
}

.site-logo__image {
  display: block;
  width: 55%;
  max-width: 190px;
  height: auto;
  transition: opacity 0.3s ease;
}

.site-logo__image--brand {
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  width: 55%;
  max-width: 190px;
  opacity: 0;
  pointer-events: none;
}

.site-header.is-scrolled .site-logo__image--light {
  opacity: 0;
}

.site-header.is-scrolled .site-logo__image--brand {
  opacity: 1;
}

.site-logo__text {
  font-family: var(--font-ar);
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
}

/* -------------------------------------------------------------------------- */
/* Mobile toggle — Elementor menu-toggle (transparent, icon ~25px)            */
/* -------------------------------------------------------------------------- */

.site-nav__toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  margin-inline-start: auto;
  margin-inline-end: 15px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #ffffff;
}

.site-nav__toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.site-nav__toggle[aria-expanded="true"] .site-nav__toggle-bar:nth-child(2) {
  transform: translateY(7px) rotate(45deg);
}

.site-nav__toggle[aria-expanded="true"] .site-nav__toggle-bar:nth-child(3) {
  opacity: 0;
}

.site-nav__toggle[aria-expanded="true"] .site-nav__toggle-bar:nth-child(4) {
  transform: translateY(-7px) rotate(-45deg);
}

/* -------------------------------------------------------------------------- */
/* Nav panel — mobile                                                         */
/* -------------------------------------------------------------------------- */

.site-header__nav {
  flex: 1 1 auto;
}

.site-nav-panel {
  position: absolute;
  inset-inline: 0;
  top: 100%;
  z-index: 99;
  display: block;
  width: 100%;
  max-height: 0;
  padding: 0;
  overflow: hidden;
  background-color: var(--header-dropdown-bg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transform-origin: top center;
  transition:
    max-height 0.35s ease,
    opacity 0.3s ease,
    transform 0.3s ease,
    visibility 0.3s ease;
}

.site-nav-panel.is-open {
  max-height: min(80vh, 640px);
  overflow-y: auto;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.site-nav__list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav__item + .site-nav__item {
  margin-top: 0;
}

.site-nav__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 15px 28px;
  font-family: var(--font-ar);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  color: var(--header-dropdown-link);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.25s ease, background-color 0.25s ease;
}

.site-nav__link:hover,
.site-nav__link:focus-visible {
  color: var(--header-dropdown-hover);
  background-color: #ffffff;
}

.site-nav__link.is-active,
.site-nav__item.is-active > .site-nav__link {
  color: var(--header-dropdown-hover);
  background-color: var(--header-dropdown-bg);
}

.site-nav__caret {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-top: -2px;
  border-inline-end: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.25s ease;
  opacity: 0.9;
}

.site-nav__item.is-open > .site-nav__link .site-nav__caret {
  transform: rotate(-135deg);
  margin-top: 2px;
}

/* Dropdown — Elementor: #EEEEEE bg, 14px/500, pad 15×28, hover #0069C8 */
.site-nav__dropdown {
  display: block;
  margin: 0;
  padding: 0;
  list-style: none;
  background-color: var(--header-dropdown-bg);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transform-origin: top center;
  transition:
    max-height 0.3s ease,
    opacity 0.3s ease,
    transform 0.3s ease,
    visibility 0.3s ease;
}

.site-nav__item.is-open > .site-nav__dropdown {
  max-height: 320px;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.site-nav__dropdown-link {
  display: block;
  padding: 15px 28px;
  font-family: var(--font-ar);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  color: var(--header-dropdown-link);
  text-decoration: none;
  transition: color 0.25s ease, background-color 0.25s ease;
}

.site-nav__dropdown-link:hover,
.site-nav__dropdown-link:focus-visible {
  color: var(--header-dropdown-hover);
  background-color: #ffffff;
}

.site-nav__dropdown-link.is-active {
  color: var(--header-dropdown-hover);
  background-color: var(--header-dropdown-bg);
}

/* Language switch — styled like WP trailing menu item “ع” */
.lang-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 28px 18px;
  border-top: 1px solid rgba(33, 89, 150, 0.12);
  font-family: var(--font-ar);
  font-size: 14px;
  font-weight: 500;
}

.lang-switch__link {
  color: var(--header-dropdown-link);
  text-decoration: none;
  transition: color 0.25s ease;
}

.lang-switch__link:hover,
.lang-switch__link.is-active {
  color: var(--header-dropdown-hover);
}

.lang-switch__sep {
  color: rgba(33, 89, 150, 0.35);
}

body.nav-open {
  overflow: hidden;
}

.site-main {
  padding-top: 120px;
}

.page-home .site-main {
  padding-top: 0;
}
