/* JH Media Group header + main navigation (mirrors jhmediagroup.com Theme Builder header) */
:root {
  --jhmg-header-h: 84px;
  --jhmg-navy: #000a25;
  --jhmg-navy-deep: #000513;
  --jhmg-card: #0f1c41;
  --jhmg-cyan: #1be1f2;
  --jhmg-pink: #ed78ed;
  --jhmg-gold: #ffd700;
}

/* offsets the fixed header (replaces the old 66px BrainLeaf bar) */
body#learn-project-scoping { padding-top: var(--jhmg-header-h); }
.toc-scroll-container { max-height: calc(100vh - var(--jhmg-header-h)); }

.jhmg-header,
.jhmg-header * { box-sizing: border-box; }

.jhmg-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 9990;
  background: var(--jhmg-navy);
  font-family: Helvetica, Arial, sans-serif;
  line-height: 1.7;
}

.jhmg-header ul,
.jhmg-header li { margin: 0; padding: 0; list-style: none; }

.jhmg-header a { text-decoration: none; }

.jhmg-header__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 80%;
  max-width: 1280px;
  height: var(--jhmg-header-h);
  margin: 0 auto;
}

/* logo */
.jhmg-header__logo {
  display: block;
  flex: 0 0 20%;
  max-width: 230px;
}
.jhmg-header__logo img { display: block; width: 140px; height: auto; }

/* main nav */
.jhmg-nav { flex: 1 1 auto; align-self: stretch; display: flex; }
.jhmg-menu { display: flex; align-items: stretch; }
.jhmg-menu > li { display: flex; align-items: stretch; position: static; }

.jhmg-menu > li > a,
.jhmg-menu .jhmg-has-mega > a {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 20px;
  color: #fff;
  font-size: 16px;
  font-weight: 400;
  white-space: nowrap;
}

/* hover underline pill (pink on hover) */
.jhmg-menu > li > a::after {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  top: calc(50% + 16px);
  height: 5px;
  border-radius: 20px;
  background: var(--jhmg-pink);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.jhmg-menu > li:hover > a::after,
.jhmg-menu > li > a:focus-visible::after,
.jhmg-menu > li.is-open > a::after { opacity: 1; }
.jhmg-menu > li > a[aria-current="page"]::after { opacity: 1; background: var(--jhmg-cyan); }
.jhmg-menu a:focus-visible { outline: 2px solid var(--jhmg-cyan); outline-offset: -2px; }

/* caret on Services */
.jhmg-has-mega > a::before {
  content: "";
  order: 2;
  width: 6px;
  height: 6px;
  margin: -2px 0 0 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

/* Services mega panel */
.jhmg-mega {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: grid;
  grid-auto-flow: column;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto;
  gap: 0;
  padding: 20px 10px 10px;
  background: var(--jhmg-navy-deep);
  border-radius: 0 0 10px 10px;
  visibility: hidden;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}
.jhmg-has-mega:hover > .jhmg-mega,
.jhmg-has-mega:focus-within > .jhmg-mega,
.jhmg-has-mega.is-open > .jhmg-mega {
  visibility: visible;
  opacity: 1;
  transform: none;
}

.jhmg-mega li { padding: 10px; }
.jhmg-mega li a {
  display: block;
  height: 100%;
  min-height: 190px;
  padding: 20px 20px 30px;
  background: var(--jhmg-card);
  border-radius: 10px;
  color: #fff;
  font-size: 16px;
  line-height: 1.5;
  transition: transform 0.2s ease;
}
.jhmg-mega li a:hover { transform: translateY(-2px); }
.jhmg-mega li a:hover::after { display: none; }

.jhmg-mega__title {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--accent, #fff);
}
.jhmg-mega__title::before {
  content: "";
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  margin-right: 10px;
  border-radius: 3px;
  background: var(--accent, #fff);
}
.jhmg-mega__desc { display: block; font-weight: 400; color: #fff; }

.jhmg-mega .is-evaluate { --accent: #ffd700; }
.jhmg-mega .is-build    { --accent: #1bf2ad; }
.jhmg-mega .is-grow     { --accent: #ed78ed; }
.jhmg-mega .is-scale    { --accent: #1be1f2; }
.jhmg-mega .is-exit     { --accent: #abd904; }

/* "See All 120 Services" promo card */
.jhmg-mega .is-all a { background: transparent; display: flex; flex-direction: column; justify-content: center; }
.jhmg-mega .is-all .jhmg-mega__title { display: block; margin-bottom: 20px; font-size: 30px; line-height: 28px; }
.jhmg-mega .is-all .jhmg-mega__title::before { display: none; }
.jhmg-mega .is-all .jhmg-mega__desc {
  align-self: flex-start;
  padding: 10px 30px;
  border: 1px solid #fff;
  border-radius: 250px;
}
.jhmg-mega .is-all a:hover .jhmg-mega__desc { background: #fff; color: var(--jhmg-card); }
.jhmg-mega .is-all .only-mobile { display: none; }

/* Contact Us CTA */
.jhmg-header__cta { flex: 0 0 auto; }
.jhmg-btn {
  display: inline-block;
  width: 140px;
  padding: 10px 30px;
  border: 2px solid #fff;
  border-radius: 40px;
  background: rgba(255, 255, 255, 0);
  color: #fff !important;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.7;
  text-align: center;
  white-space: nowrap;
  transition: all 300ms ease;
}
.jhmg-btn:hover { background: #fff; border-color: #deff4d; color: #0f1c41 !important; }

/* hamburger (mobile only) */
.jhmg-burger {
  display: none;
  width: 40px;
  height: 40px;
  margin: 0 12px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  position: relative;
}
/* beat the legacy BrainLeaf button:hover/focus backgrounds */
.jhmg-header .jhmg-burger:hover,
.jhmg-header .jhmg-burger:focus,
.jhmg-header .jhmg-burger:active { background: transparent; box-shadow: none; }
.jhmg-header .jhmg-burger:focus-visible { outline: 2px solid var(--jhmg-cyan); }
.jhmg-burger span,
.jhmg-burger span::before,
.jhmg-burger span::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  height: 3px;
  border-radius: 2px;
  background: var(--jhmg-gold);
}
.jhmg-burger span { top: 19px; }
.jhmg-burger span::before { left: 0; right: 0; top: -8px; }
.jhmg-burger span::after { left: 0; right: 0; top: 8px; }

/* narrow desktop: row goes full width, like the live site */
@media (min-width: 981px) and (max-width: 1210px) {
  .jhmg-header__inner { width: 100%; padding: 0 20px; }
}

/* tablet + mobile */
@media (max-width: 980px) {
  :root { --jhmg-header-h: 72px; }

  .jhmg-header__inner { width: 100%; padding: 0 20px; }
  .jhmg-header__logo { flex: 1 1 auto; }
  .jhmg-header__logo img { width: auto; max-width: 90px; }
  .jhmg-burger { display: block; }
  .jhmg-btn { width: auto; padding: 8px 22px; font-size: 14px; }

  .jhmg-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    max-height: calc(100vh - var(--jhmg-header-h));
    overflow-y: auto;
    background: var(--jhmg-navy);
    border-top: 3px solid var(--jhmg-gold);
  }
  .jhmg-nav.is-open { display: block; }

  .jhmg-menu { display: block; padding: 10px 0 20px; }
  .jhmg-menu > li { display: block; position: relative; }
  .jhmg-menu > li > a { display: block; padding: 12px 20px; font-weight: 500; white-space: normal; }
  .jhmg-menu > li > a::after { display: none; }

  .jhmg-has-mega > a::before {
    position: absolute;
    right: 24px;
    top: 20px;
    margin: 0;
  }
  .jhmg-has-mega.is-open > a::before { transform: rotate(-135deg); top: 24px; }

  .jhmg-mega {
    position: static;
    display: none;
    visibility: visible;
    opacity: 1;
    transform: none;
    padding: 0 0 6px;
    background: transparent;
    border-radius: 0;
  }
  .jhmg-has-mega:hover > .jhmg-mega,
  .jhmg-has-mega:focus-within > .jhmg-mega { display: none; }
  .jhmg-has-mega.is-open > .jhmg-mega { display: flex; flex-direction: column; }

  .jhmg-mega li { padding: 0; }
  .jhmg-mega li a { min-height: 0; padding: 10px 20px 10px 36px; background: transparent; border-radius: 0; }
  .jhmg-mega li a:hover { transform: none; }
  .jhmg-mega__title { margin: 0; font-size: 16px; font-weight: 500; }
  .jhmg-mega__title::before { display: none; }
  .jhmg-mega__desc { display: none; }

  /* mobile order: Evaluate, Build, Grow, Scale, Exit, All Services */
  .jhmg-mega .is-evaluate { order: 1; }
  .jhmg-mega .is-build    { order: 2; }
  .jhmg-mega .is-grow     { order: 3; }
  .jhmg-mega .is-scale    { order: 4; }
  .jhmg-mega .is-exit     { order: 5; }
  .jhmg-mega .is-all      { order: 6; }
  .jhmg-mega .is-all a { display: block; }
  .jhmg-mega .is-all .jhmg-mega__title { font-size: 16px; line-height: 1.5; }
  .jhmg-mega .is-all .only-desktop { display: none; }
  .jhmg-mega .is-all .only-mobile { display: inline; }
}

@media (max-width: 480px) {
  .jhmg-header__inner { padding: 0 12px; }
  .jhmg-burger { margin-right: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .jhmg-header * { transition: none !important; }
}
