/* ==================================================================
   Global navigation: ONE stylesheet for all three sites.
   Identical copies:
     client/src/components/gg-global-nav.css
     enterprise-app/src/components/gg-global-nav.css
     landing/assets/css/gg-global-nav.css
   Values from Figma "Global Navigation" (3100:2460). Every class is
   prefixed .ggn- so nothing here collides with the older header styles
   (.site-header / .ggh / .ggnav-*), which are no longer rendered.

   Visibility of every dropdown piece is driven by the .is-open class
   ONLY (set from state), never by :hover / :focus-within, so a closed
   menu can never be half-drawn.
   ================================================================== */

.ggn {
  --ggn-ink: #202020;
  --ggn-navy: #0b0b77;
  --ggn-accent: #2563eb;
  --ggn-bar: #a5a5ae;
  --ggn-wrap: 1360px;   /* same column as every section: 1280px content */
  --ggn-gutter: 40px;
  --ggn-h: 70px;

  position: sticky;
  top: 0;
  z-index: 1000;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ggn-ink);
  -webkit-font-smoothing: antialiased;
}

.ggn *,
.ggn *::before,
.ggn *::after {
  box-sizing: border-box;
}

.ggn ul,
.ggn ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ggn a {
  text-decoration: none;
}

/* List items take the header's own metrics, not the page body's
   line-height (1.6), which made every dropdown row 40px instead of
   Figma's 30px. */
.ggn li {
  margin: 0;
  padding: 0;
  line-height: 16px;
}

.ggn-list > li {
  display: flex;
}

.ggn button {
  font: inherit;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
}

/* Neutralise site-level `nav { ... }` rules. The /wp/ app's legacy
   style.css styles EVERY <nav> as a fixed 60px bar (position:fixed;
   left:0; right:0; padding:0 48px; background; border), which pulled this
   header's menu to the left edge. Scoped here so no site stylesheet can
   reach the header's <nav> elements. */
.ggn nav {
  position: static;
  top: auto;
  left: auto;
  right: auto;
  z-index: auto;
  display: block;
  align-items: normal;
  justify-content: normal;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
}

.ggn .ggn-right > nav {
  height: 100%;
}

.ggn nav.ggn-drawer {
  display: none;
}

.ggn-skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 1100;
  padding: 10px 16px;
  border-radius: 8px;
  background: #0b0b77;
  color: #fff;
  font: 500 14px/1 'Inter', system-ui, sans-serif;
  text-decoration: none;
}

.ggn-skip:focus {
  top: 12px;
}

/* ---- bar (Figma: #fff @40% + background blur, hairline border) ---- */
.ggn-bar {
  background: rgba(255, 255, 255, .4);
  -webkit-backdrop-filter: blur(50px);
  backdrop-filter: blur(50px);
  border-bottom: 1px solid rgba(24, 40, 61, .03);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .ggn-bar { background: rgba(255, 255, 255, .96); }
}

/* Three columns: logo | menu | buttons. The two outer columns are equal
   (1fr each), so the menu sits exactly on the centre of the bar
   regardless of how wide the logo or the buttons are. */
.ggn-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  max-width: var(--ggn-wrap);
  height: var(--ggn-h);
  margin: 0 auto;
  padding: 0 var(--ggn-gutter);
}

.ggn-logo {
  display: inline-flex;
  align-items: center;
  flex: none;
}

.ggn-logo img {
  display: block;
  width: auto;
  height: 30px;
}

/* the menu and the buttons become direct grid items of .ggn-inner */
.ggn-right {
  display: contents;
}

.ggn-logo {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
}

.ggn .ggn-right > nav {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
}

.ggn-actions {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
}

.ggn-burger {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
}

/* ---- top-level items ---- */
.ggn-menu {
  display: flex;
  align-items: stretch;
  gap: 30px;
  height: 100%;
}

.ggn-item {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
}

/* every dropdown is anchored to its own item (centred under it, below) */

.ggn-trigger,
.ggn-toplink {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font-weight: 500;
  font-size: 15px;
  line-height: 18px;
  letter-spacing: -.75px;
  color: var(--ggn-ink);
  white-space: nowrap;
  transition: color .15s ease;
}

.ggn-trigger:hover,
.ggn-toplink:hover,
.ggn-item.is-open > .ggn-trigger {
  color: var(--ggn-accent);
}

.ggn-trigger:focus-visible,
.ggn-toplink:focus-visible,
.ggn-btn:focus-visible,
.ggn-link:focus-visible,
.ggn-burger:focus-visible {
  outline: 2px solid var(--ggn-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.ggn-chev {
  width: 10px;
  height: 10px;
  flex: none;
  transition: transform .15s ease;
}

.ggn-item.is-open .ggn-chev,
.ggn-action.is-open .ggn-chev {
  transform: rotate(180deg);
}

/* 3px active underline sitting on the bar's bottom edge */
.ggn-item.is-open > .ggn-trigger::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: var(--ggn-accent);
}

.ggn-item--end.is-open > .ggn-trigger {
  position: relative;
}

/* ---- dropdown panel ---- */
/* Centred under the hovered item. GlobalNav.jsx / gg-global-nav.js then
   nudge it sideways only if centring would push it past the viewport
   (16px margin), so it is always centred on the item when there is room. */
.ggn-panel {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: none;
  max-width: calc(100vw - 32px);
  background: #fff;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 6px 15px rgba(37, 99, 235, .10);
  overflow: hidden;
}


.ggn-item.is-open > .ggn-panel,
.ggn-action.is-open > .ggn-panel {
  display: flex;
}

.ggn-col {
  flex: 1 1 auto;
  padding: 37px 40px 37px;
}

.ggn-col + .ggn-col {
  border-left: 1px solid #f2f3f6;
}

.ggn-col--tint {
  background: rgba(251, 252, 253, .8);
}

.ggn-heading {
  margin: 0 0 16px;
  font-weight: 700;
  font-size: 12px;
  line-height: 14.5px;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--ggn-ink);
}

.ggn-subhead {
  margin: 0 0 14px;
  font-weight: 600;
  font-size: 12px;
  line-height: 14.5px;
  text-transform: uppercase;
  color: rgba(32, 32, 32, .8);
}

.ggn-section + .ggn-section {
  margin-top: 34px;
}

/* list items: 13px text, 3x10 bar, 30px row pitch */
.ggn-list {
  display: grid;
  gap: 14px;
}

.ggn-list--split {
  grid-template-rows: repeat(4, auto);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-flow: column;
  column-gap: 30px;
}

/* each link fills its sub-column, so the hover pill is the same full
   width in both sub-columns (not just as wide as its own label) */
.ggn-list--split .ggn-link {
  flex: 1 1 auto;
  min-width: 0;
}

/* the Company panel (238px) is too narrow for two sub-columns; its
   five links stack in one column instead */
[data-ggn-panel="company"] .ggn-list--split {
  grid-template-rows: none;
  grid-template-columns: none;
  grid-auto-flow: row;
}

.ggn-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 170px;
  margin: -5px -10px;
  padding: 5px 10px;
  border-radius: 8px;
  font-weight: 400;
  font-size: 13px;
  line-height: 16px;
  color: rgba(32, 32, 32, .7);
  white-space: nowrap;
  transition: color .12s ease, background-color .12s ease;
}

.ggn-link::before {
  content: "";
  flex: none;
  width: 3px;
  height: 10px;
  border-radius: 4px;
  background: var(--ggn-bar);
  transition: background-color .12s ease;
}

.ggn-link:hover,
.ggn-link:focus-visible {
  color: var(--ggn-accent);
  background: rgba(37, 99, 235, .06);
}

.ggn-link:hover::before,
.ggn-link:focus-visible::before {
  background: var(--ggn-accent);
}

/* inline row (Overview / Platform / Modules): 14px, 2x10 bar, no pill */
.ggn-list--inline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 30px;
}

.ggn-list--inline .ggn-link {
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  font-weight: 500;
  font-size: 14px;
  line-height: 17px;
  color: rgba(32, 32, 32, .9);
}

.ggn-list--inline .ggn-link::before {
  width: 2px;
}

/* the inline row's own colour rule above out-ranks the generic .ggn-link
   hover, so the text needs its hover colour restated here (the bar alone
   turned blue before) */
.ggn-list--inline .ggn-link:hover,
.ggn-list--inline .ggn-link:focus-visible {
  background: none;
  color: var(--ggn-accent);
}

/* ---- header buttons ---- */
.ggn-actions {
  display: flex;
  align-items: stretch;
  gap: 10px;
  height: 100%;
}

.ggn-action {
  position: relative;
  display: flex;
  align-items: center;
}

.ggn-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  line-height: 17px;
  letter-spacing: -.7px;
  white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease;
}

.ggn-btn--solid {
  padding: 0 16px;
  border: 0;
  background: var(--ggn-navy);
  color: #fff;
}

.ggn-btn--solid:hover,
.ggn-action.is-open .ggn-btn--solid {
  background: #13139a;
}

.ggn-btn--outline {
  padding: 0 14px;
  border: 1.5px solid rgba(11, 11, 119, .15);
  background: rgba(11, 11, 119, .02);
  color: var(--ggn-navy);
}

.ggn-btn--outline:hover,
.ggn-action.is-open .ggn-btn--outline {
  background: rgba(11, 11, 119, .02);
  border-color: rgba(11, 11, 119, .3);
}

.ggn-action > .ggn-panel {
  width: 238px;
}

.ggn-panel--groups {
  flex-direction: column;
  padding: 30px 28px 32px;
}

.ggn-group + .ggn-group {
  margin-top: 26px;
}

.ggn-panel--groups .ggn-link {
  font-weight: 500;
  font-size: 13px;
  min-width: 0;
  width: calc(100% + 20px);
}

/* ---- burger + drawer (below 1120px) ---- */
.ggn-burger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1.5px solid rgba(11, 11, 119, .15);
  border-radius: 8px;
  background: rgba(11, 11, 119, .02);
  color: var(--ggn-navy);
  cursor: pointer;
}

.ggn-burger svg {
  width: 20px;
  height: 20px;
}

.ggn-drawer {
  display: none;
}

@media (max-width: 1120px) {
  .ggn .ggn-right > nav,
  .ggn-actions {
    display: none;
  }

  .ggn-burger {
    display: inline-flex;
  }

  .ggn.is-drawer-open nav.ggn-drawer {
    display: block;
    position: fixed;
    top: var(--ggn-h);
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    border-top: 1px solid #eef0f4;
    padding: 8px var(--ggn-gutter) 32px;
  }
}

@media (max-width: 720px) {
  .ggn {
    --ggn-gutter: 20px;
  }
}

.ggn-dsec,
.ggn details.ggn-dsec {
  margin: 0;
  padding: 0;
  border: 0;
  border-bottom: 1px solid #eef0f4;
  border-radius: 0;
  background: none;
}

.ggn-dbody > div + div {
  margin-top: 26px;
}

.ggn-dsec > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: 16px;
  color: var(--ggn-ink);
}

.ggn-dsec > summary::-webkit-details-marker {
  display: none;
}

.ggn-dsec > summary::after {
  content: none;
}

.ggn-dsec[open] > summary {
  color: var(--ggn-accent);
}

.ggn-dsec[open] .ggn-chev {
  transform: rotate(180deg);
}

.ggn-dbody {
  padding: 2px 0 18px;
}

.ggn-dbody .ggn-heading {
  margin-top: 14px;
}

.ggn-dbody .ggn-heading:first-child {
  margin-top: 0;
}

.ggn-dbody .ggn-list,
.ggn-dbody .ggn-list--split {
  display: grid;
  grid-auto-flow: row;
  grid-template-rows: none;
  grid-template-columns: none;
  gap: 4px;
}

.ggn-dbody .ggn-link,
.ggn-dbody .ggn-list--inline .ggn-link {
  display: flex;
  min-width: 0;
  margin: 0;
  padding: 9px 10px;
  font-size: 15px;
  white-space: normal;
}

.ggn-dbody .ggn-subhead {
  margin: 12px 0 6px;
}

.ggn-dlink {
  display: block;
  padding: 16px 0;
  border-bottom: 1px solid #eef0f4;
  font-weight: 600;
  font-size: 16px;
  color: var(--ggn-ink);
}

.ggn-dactions {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.ggn-dactions .ggn-btn {
  justify-content: center;
  width: 100%;
  height: 46px;
  letter-spacing: 0;
  font-size: 15px;
  text-decoration: none;
}

html.ggn-lock,
html.ggn-lock body {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .ggn *,
  .ggn *::before,
  .ggn *::after {
    transition: none !important;
  }
}
