/* =============================================
   Header & Navigation Styles
   ============================================= */

/* ---- Site Header ---- */
.site-header {
  background: var(--white);
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

/* ---- Single combined logo (2 logos in 1 image) ---- */
.header-logos {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo-combined {
  height: 100px;
  width: auto;
  object-fit: contain;
  display: block;
  background: transparent;
  border: none;
}

/* Fallback circles (kept just in case) */
.logo-circle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  text-align: center;
  line-height: 1.3;
  flex-shrink: 0;
}
.logo-circle.ministry { background: linear-gradient(135deg, #8B0000, #c0392b); }
.logo-circle.doh      { background: linear-gradient(135deg, #0d4f78, #1a6b9a); }

/* ---- Header text ---- */
.header-titles { flex: 1; min-width: 0; padding-left: 16px; }
.header-titles .sub-title {
  font-size: 18px;
  color: #000000;
  font-weight: 400;
  margin-bottom: 4px;
  line-height: 1.5;
}
.header-titles .main-title {
  font-size: 35px;
  font-weight: 700;
  color: #000000;
  line-height: 1.3;
}
.header-titles .main-title em {
  color: #005168;
  font-style: normal;
}

/* ---- Main Navigation ---- */
.main-nav { background: #003d71; overflow: visible; }

.nav-list {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  justify-content: center;
}
.nav-list li { list-style: none; position: relative; }
.nav-list a {
  display: block;
  padding: 13px 18px;
  color: rgba(255,255,255,0.85);
  font-size: 15px;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  text-decoration: none;
}
.nav-list a:hover,
.nav-list a.active {
  background: var(--primary-dark);
  color: #fff;
  border-bottom-color: var(--accent);
}

/* ---- Mobile hamburger bar ---- */
/* Hidden on desktop — only shown by JS on small screens */
.nav-bar {
  display: none; /* JS sets display:flex only on mobile */
  background: var(--primary);
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}
.nav-label { color: rgba(255,255,255,0.8); font-size: 14px; padding: 12px 0; }

.nav-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: #fff;
  display: none; /* shown via JS */
}
.nav-toggle svg { width: 24px; height: 24px; fill: #fff; }

/* ---- Mobile breakpoint ---- */
@media (max-width: 900px) {
  .nav-bar    { display: flex; }   /* always flex on mobile */
  .nav-toggle { display: block; }

  .nav-list {
    flex-direction: column;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .nav-list.open { max-height: 400px; }

  .nav-list a {
    padding: 13px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    border-left: 3px solid transparent;
  }
  .nav-list a.active {
    border-left-color: var(--accent);
    border-bottom-color: transparent;
  }

  .header-titles .sub-title { font-size: 16px; }
  .header-titles .main-title { font-size: 27px; }
  .logo-combined { height: 70px; }
}

@media (max-width: 480px) {
  .header-inner { padding: 10px 14px; gap: 10px; }
  .header-titles .sub-title { font-size: 13px; }
  .header-titles .main-title { font-size: 21px; }
  .logo-combined { height: 40px; }
}

/* =============================================
   Dropdown Sub-menu
   ============================================= */
/* Dropdown trigger arrow */
.nav-list a.has-dropdown::after {
  content: '▾';
  margin-left: 6px;
  font-size: 11px;
  opacity: 0.7;
}

/* Dropdown panel */
.dropdown-menu {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 240px;
  z-index: 9999;
  transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
}

/* Desktop: CSS hover */
.nav-list li:hover > .dropdown-menu {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
  transition: opacity .15s ease, transform .15s ease, visibility 0s linear 0s;
}

.dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text) !important;
  background: var(--white) !important;
  border-bottom: 1px solid var(--primary-light) !important;
  border-left: none !important;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition), padding-left var(--transition);
}
.dropdown-menu a:last-child { border-bottom: none !important; }
.dropdown-menu a:hover {
  background: var(--primary-light) !important;
  color: var(--primary-dark) !important;
  padding-left: 24px !important;
}
.dropdown-menu a .dd-icon {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #6cc3dd;
  flex-shrink: 0;
  display: inline-block;
}
.dropdown-menu a .dd-icon img {
  display: none;
}


/* Bridge between nav item and dropdown - prevents gap hover loss */
.nav-list li:hover > .dropdown-menu::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 8px;
}
/* Mobile: dropdown becomes static list */
@media (max-width: 900px) {
  .dropdown-menu {
    position: static;
    transform: none;
    box-shadow: none;
    border: none;
    border-radius: 0;
    background: rgba(0,0,0,.12);
    animation: none;
    border-top: 1px solid rgba(255,255,255,.1);
  }
  .nav-list li:hover .dropdown-menu { display: none; }
  .nav-list li.open .dropdown-menu  { display: block; }
  .dropdown-menu a {
    color: rgba(255,255,255,.8) !important;
    background: transparent !important;
    border-color: rgba(255,255,255,.08) !important;
    padding: 10px 36px !important;
  }
  .dropdown-menu a:hover {
    background: rgba(255,255,255,.08) !important;
    padding-left: 44px !important;
  }
  .nav-list a.has-dropdown::after { float: right; }
}
