/* BUILD-TAG: bh-academy-shared-header-v1.4-mega-order-horizontal-arrows */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&display=swap');

/*
 * Shared Billion Hopes Academy header treatment.
 * Applied ONLY to the Academy Home page and Student Login / My Account page
 * via the bh-premium-academy-header body class added in functions.php.
 * No destinations, menu items or WordPress navigation data are replaced.
 */
body.bh-premium-academy-header {
  --bh-header-panel:#ffffff;
  --bh-header-border:#e3e6f1;
  --bh-header-text:#171a2e;
  --bh-header-text-dim:#5b6180;
  --bh-header-accent:#4c5fe0;
  --bh-header-accent-2:#0f9fd1;
  --bh-header-accent-soft:rgba(76,95,224,.075);
}

body.bh-premium-academy-header #masthead {
  position:relative;
  z-index:1000;
  background:rgba(255,255,255,.96) !important;
  border-bottom:1px solid rgba(227,230,241,.92);
  box-shadow:0 10px 30px -28px rgba(23,26,46,.50);
  backdrop-filter:blur(16px);
}
body.bh-premium-academy-header .site-main-header-inner-wrap { min-height:76px; }
body.bh-premium-academy-header .site-branding a.brand img {
  max-width:150px !important;
  width:auto !important;
  height:auto !important;
}
body.bh-premium-academy-header .site-branding .site-title {
  font-family:'DM Sans',system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif !important;
  font-size:18px !important;
  line-height:1.2 !important;
  font-weight:700 !important;
  color:var(--bh-header-text) !important;
}

body.bh-premium-academy-header .main-navigation .primary-menu-container > ul > li.menu-item > a {
  font-family:'DM Sans',system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif !important;
  font-size:13px !important;
  line-height:1.25 !important;
  font-weight:600 !important;
  color:var(--bh-header-text-dim) !important;
  background:transparent !important;
  padding:12px 11px !important;
  border-radius:9px !important;
  box-shadow:none !important;
  transition:background .16s ease,color .16s ease,transform .16s ease !important;
}
body.bh-premium-academy-header .main-navigation .primary-menu-container > ul > li.menu-item > a:hover,
body.bh-premium-academy-header .main-navigation .primary-menu-container > ul > li.current-menu-item > a,
body.bh-premium-academy-header .main-navigation .primary-menu-container > ul > li.current_page_item > a {
  color:var(--bh-header-text) !important;
  background:var(--bh-header-accent-soft) !important;
}

/* My Account keeps the subtle accent used on the Home page. */
body.bh-premium-academy-header #menu-item-3541 > a {
  color:var(--bh-header-accent) !important;
}

/* Cart is deliberately NOT a special dark CTA; it behaves like every other menu item. */
body.bh-premium-academy-header #menu-item-3531 > a {
  color:var(--bh-header-text-dim) !important;
  background:transparent !important;
  padding:12px 11px !important;
}
body.bh-premium-academy-header #menu-item-3531 > a:hover,
body.bh-premium-academy-header #menu-item-3531.current-menu-item > a,
body.bh-premium-academy-header #menu-item-3531.current_page_item > a {
  color:var(--bh-header-text) !important;
  background:var(--bh-header-accent-soft) !important;
}

@media (min-width:1025px) {
  body.bh-premium-academy-header .main-navigation .menu-courses {
    position:relative !important;
  }

  body.bh-premium-academy-header .main-navigation .menu-courses > .sub-menu {
    position:fixed !important;
    top:76px !important;
    left:50% !important;
    right:auto !important;
    transform:translateX(-50%) !important;
    width:min(1180px,calc(100vw - 52px)) !important;
    max-width:calc(100vw - 52px) !important;
    max-height:calc(100vh - 104px) !important;
    overflow:auto !important;
    display:none;
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    gap:15px !important;
    padding:30px !important;
    box-sizing:border-box !important;
    border:1px solid rgba(76,95,224,.16) !important;
    border-radius:26px !important;
    background:
      radial-gradient(circle at 7% 3%,rgba(76,95,224,.12),transparent 25%),
      radial-gradient(circle at 94% 95%,rgba(15,159,209,.12),transparent 28%),
      linear-gradient(145deg,rgba(255,255,255,.995) 0%,rgba(249,250,255,.995) 48%,rgba(245,252,255,.995) 100%) !important;
    box-shadow:0 34px 90px -28px rgba(23,26,46,.34),0 12px 32px -24px rgba(76,95,224,.30) !important;
    backdrop-filter:blur(22px) saturate(135%);
    visibility:visible !important;
    opacity:1 !important;
    pointer-events:auto !important;
  }

  body.admin-bar.bh-premium-academy-header .main-navigation .menu-courses > .sub-menu {
    top:108px !important;
  }

  body.bh-premium-academy-header .main-navigation .menu-courses:hover > .sub-menu,
  body.bh-premium-academy-header .main-navigation .menu-courses.focus > .sub-menu,
  body.bh-premium-academy-header .main-navigation .menu-courses.bh-mega-open > .sub-menu,
  body.bh-premium-academy-header .main-navigation .menu-courses:focus-within > .sub-menu {
    display:grid !important;
  }

  /* Hover bridge so the panel stays reachable when moving down from Courses. */
  body.bh-premium-academy-header .main-navigation .menu-courses::after {
    content:'';
    position:absolute;
    left:-16px;
    right:-16px;
    top:100%;
    height:22px;
    background:transparent;
    pointer-events:auto;
  }

  body.bh-premium-academy-header .main-navigation .menu-courses > .sub-menu::before {
    content:'Explore Billion Hopes learning paths';
    grid-column:1/-1;
    display:block;
    margin:0 0 3px;
    padding:0 3px 16px;
    border-bottom:1px solid rgba(76,95,224,.11);
    color:var(--bh-header-text);
    font-family:'DM Sans',system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif !important;
    font-size:21px;
    line-height:1.25;
    font-weight:800;
    letter-spacing:-.025em;
  }

  body.bh-premium-academy-header .main-navigation .menu-courses > .sub-menu > li {
    border:0 !important;
    min-width:0 !important;
    background:transparent !important;
  }

  body.bh-premium-academy-header .main-navigation .menu-courses > .sub-menu > li > a {
    position:relative !important;
    width:auto !important;
    min-height:88px !important;
    display:flex !important;
    align-items:center !important;
    padding:20px 58px 20px 24px !important;
    overflow:hidden !important;
    border:1px solid rgba(76,95,224,.12) !important;
    border-radius:18px !important;
    color:var(--bh-header-text) !important;
    font-family:'DM Sans',system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif !important;
    font-size:15px !important;
    line-height:1.35 !important;
    font-weight:700 !important;
    background:linear-gradient(135deg,#f5f6ff 0%,#f8faff 100%) !important;
    box-shadow:0 15px 30px -28px rgba(23,26,46,.35) !important;
    transition:transform .17s ease,border-color .17s ease,box-shadow .17s ease,background .17s ease !important;
  }

  body.bh-premium-academy-header .main-navigation .menu-courses > .sub-menu > li:nth-child(3n+2) > a {
    background:linear-gradient(135deg,#f3fbff 0%,#f0faff 100%) !important;
  }
  body.bh-premium-academy-header .main-navigation .menu-courses > .sub-menu > li:nth-child(3n+3) > a {
    background:linear-gradient(135deg,#f8f6ff 0%,#f4f7ff 100%) !important;
  }

  body.bh-premium-academy-header .main-navigation .menu-courses > .sub-menu > li > a::before {
    content:'';
    position:absolute;
    left:0;
    top:16px;
    bottom:16px;
    width:4px;
    border-radius:0 5px 5px 0;
    background:linear-gradient(180deg,var(--bh-header-accent),#30bce7);
    opacity:.85;
  }

  body.bh-premium-academy-header .main-navigation .menu-courses > .sub-menu > li > a::after {
    content:'' !important;
    position:absolute !important;
    right:16px !important;
    top:50% !important;
    transform:translateY(-50%) !important;
    width:32px !important;
    height:32px !important;
    display:block !important;
    border-radius:11px !important;
    border:1px solid rgba(76,95,224,.18) !important;
    background-color:rgba(255,255,255,.92) !important;
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234c5fe0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7'/%3E%3Cpath d='M7 7h10v10'/%3E%3C/svg%3E") !important;
    background-repeat:no-repeat !important;
    background-position:center !important;
    background-size:17px 17px !important;
    box-shadow:0 8px 18px -14px rgba(76,95,224,.7) !important;
  }

  body.bh-premium-academy-header .main-navigation .menu-courses > .sub-menu > li > a:hover {
    transform:translateY(-2px) !important;
    border-color:rgba(76,95,224,.30) !important;
    background:#fff !important;
    color:var(--bh-header-accent) !important;
    box-shadow:0 18px 34px -25px rgba(23,26,46,.40) !important;
  }

  body.bh-premium-academy-header .main-navigation .menu-courses > .sub-menu > li > a:hover::after {
    background-color:var(--bh-header-accent) !important;
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7'/%3E%3Cpath d='M7 7h10v10'/%3E%3C/svg%3E") !important;
    border-color:var(--bh-header-accent) !important;
    transform:translateY(-50%) translate(2px,-2px) !important;
  }
}

body.bh-premium-academy-header #mobile-drawer .drawer-inner { background:#161a30; }
body.bh-premium-academy-header #mobile-drawer .mobile-navigation a {
  font-family:'DM Sans',system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif !important;
}


/* ============================================================
   v1.4 SHARED HEADER — requested mega-menu content/order + arrow only.
   ============================================================ */
body.bh-premium-academy-header .bh-unified-arrow {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:none;
  line-height:1;
}
body.bh-premium-academy-header .bh-unified-arrow svg {
  width:18px;
  height:18px;
  fill:none;
  stroke:currentColor;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
}

@media (min-width:1025px){
  body.bh-premium-academy-header .main-navigation .menu-courses > .sub-menu::before {
    content:'Explore Billion Hopes courses' !important;
  }

  body.bh-premium-academy-header .main-navigation .menu-courses > .sub-menu > li > a::after {
    content:none !important;
    display:none !important;
  }

  body.bh-premium-academy-header .main-navigation .menu-courses > .sub-menu > li > .bh-mega-card {
    position:relative !important;
    width:auto !important;
    min-height:88px !important;
    display:flex !important;
    flex-direction:column !important;
    align-items:flex-start !important;
    justify-content:center !important;
    padding:18px 58px 18px 24px !important;
    overflow:hidden !important;
    border:1px solid rgba(76,95,224,.12) !important;
    border-radius:18px !important;
    color:var(--bh-header-text) !important;
    font-family:'DM Sans',system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif !important;
    line-height:1.25 !important;
    background:linear-gradient(135deg,#f5f6ff 0%,#f8faff 100%) !important;
    box-shadow:0 15px 30px -28px rgba(23,26,46,.35) !important;
    transition:transform .17s ease,border-color .17s ease,box-shadow .17s ease,background .17s ease,color .17s ease !important;
    box-sizing:border-box !important;
    text-decoration:none !important;
  }
  body.bh-premium-academy-header .main-navigation .menu-courses > .sub-menu > li:nth-child(3n+2) > .bh-mega-card {
    background:linear-gradient(135deg,#f3fbff 0%,#f0faff 100%) !important;
  }
  body.bh-premium-academy-header .main-navigation .menu-courses > .sub-menu > li:nth-child(3n+3) > .bh-mega-card {
    background:linear-gradient(135deg,#f8f6ff 0%,#f4f7ff 100%) !important;
  }
  body.bh-premium-academy-header .main-navigation .menu-courses > .sub-menu > li > .bh-mega-card::before {
    content:'';
    position:absolute;
    left:0;
    top:16px;
    bottom:16px;
    width:4px;
    border-radius:0 5px 5px 0;
    background:linear-gradient(180deg,var(--bh-header-accent),#30bce7);
    opacity:.85;
  }
  body.bh-premium-academy-header .bh-mega-title {
    display:block;
    color:inherit;
    font-size:15px;
    line-height:1.28;
    font-weight:750;
    letter-spacing:-.012em;
  }
  body.bh-premium-academy-header .bh-mega-subtitle {
    display:block;
    margin-top:6px;
    color:#727997;
    font-size:11px;
    line-height:1.25;
    font-weight:600;
    letter-spacing:.01em;
  }
  body.bh-premium-academy-header .main-navigation .menu-courses > .sub-menu > li > .bh-mega-card .bh-unified-arrow {
    position:absolute;
    right:16px;
    top:50%;
    transform:translateY(-50%);
    width:32px;
    height:32px;
    border-radius:11px;
    border:1px solid rgba(76,95,224,.18);
    background:rgba(255,255,255,.92);
    color:var(--bh-header-accent);
    box-shadow:0 8px 18px -14px rgba(76,95,224,.7);
    transition:transform .18s ease,background .18s ease,color .18s ease,border-color .18s ease;
  }
  body.bh-premium-academy-header .main-navigation .menu-courses > .sub-menu > li > a.bh-mega-card:hover {
    transform:translateY(-2px) !important;
    border-color:rgba(76,95,224,.30) !important;
    background:#fff !important;
    color:var(--bh-header-accent) !important;
    box-shadow:0 18px 34px -25px rgba(23,26,46,.40) !important;
  }
  body.bh-premium-academy-header .main-navigation .menu-courses > .sub-menu > li > a.bh-mega-card:hover .bh-unified-arrow {
    transform:translateY(-50%) translateX(2px);
    color:#fff;
    background:var(--bh-header-accent);
    border-color:var(--bh-header-accent);
  }
  body.bh-premium-academy-header .bh-mega-disabled {
    cursor:default !important;
    opacity:.78;
  }
}


/* ============================================================
   v5.4.5 MEGA MENU LAYOUT ONLY
   Convert each existing horizontal row into a vertical column.
   Item content/order/links/text are unchanged.
   ============================================================ */
@media (min-width:1025px){
  body.bh-premium-academy-header .main-navigation .menu-courses > .sub-menu::before{
    grid-column:1 / -1 !important;
    grid-row:1 !important;
  }

  body.bh-premium-academy-header .main-navigation .menu-courses > .sub-menu > li:nth-child(1){grid-column:1 !important;grid-row:2 !important;}
  body.bh-premium-academy-header .main-navigation .menu-courses > .sub-menu > li:nth-child(2){grid-column:1 !important;grid-row:3 !important;}
  body.bh-premium-academy-header .main-navigation .menu-courses > .sub-menu > li:nth-child(3){grid-column:1 !important;grid-row:4 !important;}

  body.bh-premium-academy-header .main-navigation .menu-courses > .sub-menu > li:nth-child(4){grid-column:2 !important;grid-row:2 !important;}
  body.bh-premium-academy-header .main-navigation .menu-courses > .sub-menu > li:nth-child(5){grid-column:2 !important;grid-row:3 !important;}
  body.bh-premium-academy-header .main-navigation .menu-courses > .sub-menu > li:nth-child(6){grid-column:2 !important;grid-row:4 !important;}

  body.bh-premium-academy-header .main-navigation .menu-courses > .sub-menu > li:nth-child(7){grid-column:3 !important;grid-row:2 !important;}
  body.bh-premium-academy-header .main-navigation .menu-courses > .sub-menu > li:nth-child(8){grid-column:3 !important;grid-row:3 !important;}
  body.bh-premium-academy-header .main-navigation .menu-courses > .sub-menu > li:nth-child(9){grid-column:3 !important;grid-row:4 !important;}
}


/* ============================================================
   v5.4.6 MEGA MENU PASTEL COLUMNS ONLY
   Three distinct vertical pastel colour groups.
   No menu order, text, links, sizing or behaviour changed.
   ============================================================ */
@media (min-width:1025px){
  /* Column 1 — soft lavender blue */
  body.bh-premium-academy-header .main-navigation .menu-courses > .sub-menu > li:nth-child(1) > .bh-mega-card,
  body.bh-premium-academy-header .main-navigation .menu-courses > .sub-menu > li:nth-child(2) > .bh-mega-card,
  body.bh-premium-academy-header .main-navigation .menu-courses > .sub-menu > li:nth-child(3) > .bh-mega-card{
    background:linear-gradient(135deg,#f2f0ff 0%,#edf3ff 100%) !important;
  }

  /* Column 2 — soft aqua mint */
  body.bh-premium-academy-header .main-navigation .menu-courses > .sub-menu > li:nth-child(4) > .bh-mega-card,
  body.bh-premium-academy-header .main-navigation .menu-courses > .sub-menu > li:nth-child(5) > .bh-mega-card,
  body.bh-premium-academy-header .main-navigation .menu-courses > .sub-menu > li:nth-child(6) > .bh-mega-card{
    background:linear-gradient(135deg,#edfbf8 0%,#eefbff 100%) !important;
  }

  /* Column 3 — soft blush peach */
  body.bh-premium-academy-header .main-navigation .menu-courses > .sub-menu > li:nth-child(7) > .bh-mega-card,
  body.bh-premium-academy-header .main-navigation .menu-courses > .sub-menu > li:nth-child(8) > .bh-mega-card,
  body.bh-premium-academy-header .main-navigation .menu-courses > .sub-menu > li:nth-child(9) > .bh-mega-card{
    background:linear-gradient(135deg,#fff2f5 0%,#fff7ee 100%) !important;
  }
}

/*
 * Exact Academy Home menu presentation on the three dedicated course pages.
 * Scoped by functions.php so no other page is changed.
 */
body.bh-premium-academy-header.bh-academy-home-menu-match .site-main-header-inner-wrap {
  min-height:82px !important;
}
body.bh-premium-academy-header.bh-academy-home-menu-match .main-navigation .primary-menu-container > ul > li.menu-item > a {
  font-size:14px !important;
  line-height:1.25 !important;
  font-weight:650 !important;
  padding:13px 12px !important;
}
body.bh-premium-academy-header.bh-academy-home-menu-match .main-navigation .menu-courses > .sub-menu {
  top:82px !important;
}
body.admin-bar.bh-premium-academy-header.bh-academy-home-menu-match .main-navigation .menu-courses > .sub-menu {
  top:114px !important;
}
body.bh-premium-academy-header.bh-academy-home-menu-match #menu-item-3531 > a {
  color:var(--bh-header-text-dim) !important;
  background:transparent !important;
  border:1px solid transparent !important;
}
body.bh-premium-academy-header.bh-academy-home-menu-match .bh-home-student-login-item > a {
  color:var(--bh-header-accent) !important;
  background:#fff !important;
  border:1px solid rgba(76,95,224,.30) !important;
  padding-left:16px !important;
  padding-right:16px !important;
  box-shadow:0 10px 22px -18px rgba(76,95,224,.65) !important;
}
body.bh-premium-academy-header.bh-academy-home-menu-match .bh-home-student-login-item > a:hover {
  color:#fff !important;
  background:var(--bh-header-accent) !important;
  border-color:var(--bh-header-accent) !important;
}
body.bh-premium-academy-header.bh-academy-home-menu-match .bh-home-my-learning-item > a {
  color:#fff !important;
  background:linear-gradient(120deg,var(--bh-header-accent),#6f5ff0) !important;
  border:1px solid transparent !important;
  padding-left:16px !important;
  padding-right:16px !important;
  box-shadow:0 14px 28px -20px rgba(76,95,224,.70) !important;
}
body.bh-premium-academy-header.bh-academy-home-menu-match .bh-home-my-learning-item > a:hover {
  color:#fff !important;
  background:linear-gradient(120deg,#4255d7,#6657e8) !important;
}
@media (max-width:767px) {
  body.bh-premium-academy-header.bh-academy-home-menu-match .site-main-header-inner-wrap {
    min-height:78px !important;
  }
}

