/* The shared marketing navbar (partials/navbar.html) is a blue bar on every page. The partial
   links this file itself, after blog-nav.css, which already makes the navbar readable on a
   dark bar (white links, a white plate behind the logo, a CSS caret, the sticky header); this
   file swaps navy for blue and fixes what the blue bar needs. It loads after each page's own
   stylesheets, so a page's older navbar colours cannot win. The !important flags match the
   theme rules being overridden. */
nav.navbar-fixed.dark,
nav.navbar-fixed.dark.no-background,
nav.navbar-fixed.dark.sticked { background: #1600ff !important; }
nav.navbar-fixed.dark .dropdown-menu { background: #fff !important; }

/* Hover and current link: pale lilac reads on the blue (the blog's teal does not). */
nav.navbar-fixed.dark #navbar-menu > ul.navbar-nav > li > a:hover,
nav.navbar-fixed.dark #navbar-menu > ul.navbar-nav > li > a:focus-visible,
nav.navbar-fixed.dark #navbar-menu > ul.navbar-nav > li.active > a,
nav.navbar-fixed.dark #navbar-menu > ul.navbar-nav > li > a.nav-link-active,
nav.navbar-fixed.dark #navbar-menu > ul.navbar-nav > li > a[aria-current="page"] { color: #d6d2ff !important; }

/* "Create account": the theme's blue gradient button disappears on the blue bar; make it white. */
nav.navbar.validnavs.navbar-fixed.dark .attr-right .btn.btn-primary {
  border-color: #fff !important;
  background: #fff !important;
  color: #1600ff !important;
  text-shadow: none !important;
}
nav.navbar.validnavs.navbar-fixed.dark .attr-right .btn.btn-primary:hover,
nav.navbar.validnavs.navbar-fixed.dark .attr-right .btn.btn-primary:focus-visible { background: #e5e3ff !important; border-color: #e5e3ff !important; }

/* Phones and tablets: the theme floats the logo (position:absolute) over a 35px bar, which was
   invisible on a white bar but leaves the logo hanging out of a blue one. Keep it in the row. */
@media (max-width: 991.98px) {
  nav.navbar-fixed.dark > div { padding-top: 8px !important; padding-bottom: 8px !important; }
  nav.navbar-fixed.dark .navbar-brand { position: static !important; transform: none !important; margin: 0 !important; }
}

/* Signed-in email and Log out: white on the blue bar, whatever tone the navbar asked for. */
nav.navbar-fixed.dark .attr-right .iai-nav-account,
nav.navbar-fixed.dark #navbar-menu .iai-nav-account { color: #fff; }

/* Keep the full row on one line up to 1700px: signed-in staff see an extra "Admin" link, which
   otherwise wraps to a second row and covers what sits under the bar. */
@media (min-width: 1440px) and (max-width: 1699.98px) {
  nav.navbar-fixed.dark #navbar-menu > ul.navbar-nav > li > a { padding-left: 7px !important; padding-right: 7px !important; font-size: 14.5px !important; }
  nav.navbar-fixed.dark .attr-right .iai-nav-account .iai-nav-account__email { max-width: 150px; }
}

/* ── Pages with navbar colours of their own ─────────────────────────────── */
/* The packages catalogue restyles this navbar as a white bar with dark links
   (business_plan/css/catalogue.css). Same selectors, loaded later, so blue wins. */
.iai-catalogue-shell--nav nav.navbar.validnavs { border-bottom: 0 !important; background: #1600ff !important; }
.iai-catalogue-shell--nav nav.navbar.validnavs #navbar-menu > ul.nav > li > a { color: #fff !important; }
.iai-catalogue-shell--nav nav.navbar.validnavs #navbar-menu > ul.nav > li > a:hover,
.iai-catalogue-shell--nav nav.navbar.validnavs #navbar-menu > ul.nav > li > a.nav-link-active { color: #d6d2ff !important; }
/* The staff-only "AI Studio" link on the blog is dark sky blue on a white bar. */
nav.navbar.validnavs.navbar-fixed.dark .attr-right .nav-link.ai-studio-navlink,
nav.navbar.validnavs.navbar-fixed.dark .attr-right .nav-link.ai-studio-navlink i { border-color: rgba(255, 255, 255, .65) !important; background: transparent !important; color: #fff !important; }

/* ── End to end ─────────────────────────────────────────────────────────── */
/* The theme insets this bar 5% from each side, leaving white strips. The blue now runs edge to
   edge; the row inside keeps its old inset so the logo and links stay where they were. */
nav.navbar.navbar-fixed.dark,
nav.navbar.navbar-fixed.dark.sticked { left: 0 !important; right: 0 !important; width: auto !important; max-width: none !important; border-radius: 0 !important; }
nav.navbar.navbar-fixed.dark > div:first-child { padding-left: calc(5vw + 24px) !important; padding-right: calc(5vw + 24px) !important; }
@media (max-width: 991.98px) {
  nav.navbar.navbar-fixed.dark > div:first-child { padding-left: 16px !important; padding-right: 16px !important; }
}

/* ── Stays at the top on every page ─────────────────────────────────────── */
/* The bar is pinned with position: fixed (the reasons sticky and the theme's own .sticked
   mode fail are in css/sticky-navbar.css). On desktop the theme already lays it over the top
   of the page, so nothing moves. Below 1024px it sits in the page flow, so it gets a fixed
   height and its parent keeps that height as a spacer. The blog is left alone: its header
   is already sticky (blog-nav.css, body > header). */
nav.navbar.navbar-fixed.dark:not(body > header > nav) { position: fixed !important; top: 0; left: 0; right: 0; z-index: 1030 !important; }
@media (max-width: 1023.98px) {
  nav.navbar.navbar-fixed.dark:not(body > header > nav) { height: 84px !important; min-height: 84px !important; }
  nav.navbar.navbar-fixed.dark:not(body > header > nav) > div:first-child { height: 100%; padding-top: 0 !important; padding-bottom: 0 !important; }
  :has(> nav.navbar.navbar-fixed.dark:not(body > header > nav)) { min-height: 84px; }
}

/* No white strip under the bar on phones and tablets. project.css pads .site-main by the bar's
   height so content clears the bar where the theme lays it over the page (desktop). Below
   1024px the bar sits in the page flow (or keeps its height as a spacer, above), so that
   padding only doubled up as an empty strip. */
@media (max-width: 1023.98px) {
  body:has(nav.navbar.navbar-fixed.dark) .site-main { padding-top: 0 !important; }  /* the blog and Features also force 42px inline */
  /* Two pages clear the bar with a top margin of their own instead. */
  body.business-plan-page:has(nav.navbar.navbar-fixed.dark) .banner-area { margin-top: 0 !important; }  /* project.css: 80px */
  body:has(nav.navbar.navbar-fixed.dark) .corp-page > .dl-tabbar { margin-top: 0; }                   /* Excellence: 55px */
}

/* No gap under the bar on desktop either, on the two pages that clear it with a top margin of
   their own (Excellence's tab bar, the Business Plan banner). The bar is 89px tall from 1024px
   (menu-button row) and 109px from 1440px (full link row); .site-main already pads the page by
   --site-nav-h (85px), so each margin is just the difference. */
@media (min-width: 1024px) {
  body:has(nav.navbar.navbar-fixed.dark) { --iai-mkt-nav-h: 89px; }
  body:has(nav.navbar.navbar-fixed.dark) .corp-page > .dl-tabbar { margin-top: calc(var(--iai-mkt-nav-h) - var(--site-nav-h, 85px)); }
  body.business-plan-page:has(nav.navbar.navbar-fixed.dark) .banner-area { margin-top: calc(var(--iai-mkt-nav-h) - var(--site-nav-h, 85px)) !important; }
}
@media (min-width: 1440px) {
  body:has(nav.navbar.navbar-fixed.dark) { --iai-mkt-nav-h: 109px; }
}
