/* ============================================================================
   gg-nav-v3.css — unified global navigation header (mega-menus + drawer)
   Used by all 5 landing/ pages: index.html, contact.html, privacy-policy.html,
   terms-of-service.html, cookie-policy.html. Replaces the previous two
   independent header implementations (`.hv2-header`/`.hnav-*` on the
   homepage, `.site-header`/`.nav-links`/`.menu` on the other four).

   Built on the shared design tokens already defined in gg-theme-v2.css
   (--ent, --wp, --ink*, --line, --paper, --radius*, --shadow, --sans,
   --display, --wrap), which every one of the 5 pages loads before this
   file, so colours/spacing/type stay consistent with the rest of the site
   without redefining anything here.

   Interaction contract (see HEADER-SPEC.md):
   - Each dropdown trigger is a <button aria-haspopup="true" aria-expanded>.
   - Opening one dropdown closes any other (single-open-at-a-time) — this is
     JS-driven via the `.is-open` class (see assets/js/gg-nav.js).
   - :focus-within is unconditional (keyboard access must never depend on
     hover support). :hover is additionally gated on (hover:hover) and
     (pointer:fine) so touchscreens don't get a menu "stuck" open.
   - Below 1024px the whole nav collapses into `.ggnav-drawer`, a slide-down
     panel toggled by the burger button, with per-section <details> so it
     still expands without any JS once the drawer itself is visible.
   - Every link below is a real <a href> in the raw markup — CSS only ever
     hides/shows panels, it never removes anything from the DOM, so the nav
     stays fully crawlable with JS disabled.
   ========================================================================== */

.ggnav-header{
  position:sticky;top:0;z-index:200;
  background:rgba(253,253,255,.92);
  backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);
  border-bottom:1px solid var(--line);
}

.ggnav-bar{
  display:flex;align-items:center;gap:28px;
  max-width:var(--wrap);margin:0 auto;padding:0 24px;
  min-height:72px;
}

/* ---- logo ---- */
.ggnav-logo{display:flex;align-items:center;flex:0 0 auto}
.ggnav-logo img{height:26px;width:auto;display:block}

/* ---- primary nav ---- */
.ggnav-primary{flex:1;min-width:0}
.ggnav-list{display:flex;align-items:center;gap:22px;list-style:none;margin:0;padding:0}
.ggnav-item{position:relative}

/* The 14px gap between trigger and menu is dead space the pointer has to
   cross; this bridge placed on the wrapper covers that gap so hover is maintained. */
.ggnav-item.is-open::after,
.ggnav-item:focus-within::after {
  content: ''; position: absolute; top: 100%; left: 0; right: 0; height: 24px; z-index: 50;
}
@media(hover:hover) and (pointer:fine){
  .ggnav-item:hover::after {
    content: ''; position: absolute; top: 100%; left: 0; right: 0; height: 24px; z-index: 50;
  }
}
.ggnav-trigger{
  display:inline-flex;align-items:center;gap:5px;
  background:none;border:0;padding:10px 2px;margin:0;
  font:inherit;font-family:var(--sans);font-size:14.5px;font-weight:500;
  color:var(--ink-2);white-space:nowrap;cursor:pointer;
  position:relative;z-index:210;
}
.ggnav-trigger:hover,
.ggnav-item.is-open>.ggnav-trigger{color:var(--ent)}
.ggnav-caret{flex:0 0 auto;transition:transform .15s ease}
.ggnav-item.is-open>.ggnav-trigger .ggnav-caret{transform:rotate(180deg)}
@media(hover:hover) and (pointer:fine){
  .ggnav-item:hover>.ggnav-trigger .ggnav-caret{transform:rotate(180deg)}
}

.ggnav-link{
  font-family:var(--sans);font-size:14.5px;font-weight:500;
  color:var(--ink-2);text-decoration:none;white-space:nowrap;
  position:relative;z-index:210;
}
.ggnav-link:hover{color:var(--ent)}

/* ---- dropdown / mega-menu panels ----
   Bridges the gap between trigger and panel with ::before so a mouse
   travelling straight down doesn't cross dead space and fire mouseleave
   before it reaches the panel (same trick already used by .has-menu and
   .hnav-dropdown elsewhere in this codebase). */
.ggnav-panel{
  position:absolute;top:calc(100% + 14px);left:0;
  margin:0;padding:10px;list-style:none;
  background:#fff;border:1px solid var(--line);border-radius:var(--radius);
  box-shadow:var(--shadow);
  opacity:0;visibility:hidden;pointer-events:none;
  transform:translateY(-6px);
  transition:opacity .15s ease,transform .15s ease,visibility .15s;
  z-index:60;
  /* A long panel (mega-menu with split columns, or a tall single-column
     dropdown) can otherwise overflow the viewport bottom - scroll
     internally instead of clipping. .ggnav-bar is 72px tall plus the 14px
     gap above, so that's the room to leave at the top. */
  max-height:calc(100vh - 86px);
  overflow-y:auto;
}
/* Gap bridge moved to wrapper */
.ggnav-panel--right{left:auto;right:0}

/* Keyboard access must never depend on hover support. */
.ggnav-item:focus-within>.ggnav-panel{
  opacity:1;visibility:visible;pointer-events:auto;transform:translateY(0);
}
@media(hover:hover) and (pointer:fine){
  .ggnav-item:hover>.ggnav-panel{
    opacity:1;visibility:visible;pointer-events:auto;transform:translateY(0);
  }
}
/* JS-driven: click-to-open/close, single-open-at-a-time, Escape. */
.ggnav-item.is-open>.ggnav-panel{
  opacity:1;visibility:visible;pointer-events:auto;transform:translateY(0);
}

/* ---- mega menu (two columns: Enterprise left, WordPress right) ---- */
.ggnav-panel--mega{display:flex;gap:8px 32px;min-width:560px;padding:20px}
.ggnav-col{flex:1 1 0;min-width:240px}
.ggnav-col+.ggnav-col{border-left:1px solid var(--line);padding-left:18px;margin-left:-18px}
/* Products/Solutions columns that contain a 2-sub-column split need more
   room than a plain 2-column menu (Pricing) - per the Figma source's
   wider Products/Solutions panels. */
.ggnav-panel--wide{min-width:1160px}
.ggnav-panel--wide .ggnav-col-split ul{min-width:170px}
/* Resources is the one mega-menu with 3 columns (General / WordPress
   Resources / Enterprise Resources), per the Figma source - Products,
   Solutions and Pricing stay at 2. */
.ggnav-panel--3col{min-width:900px}
/* Column heading (e.g. "Guardian Gaze for Enterprise") - 18px semibold
   #202020 per the Figma source, not a small uppercase eyebrow label. */
.ggnav-col-title{
  margin:0 0 12px;padding:0 10px;
  font-family:var(--sans);font-size:18px;font-weight:600;color:#202020;
}
.ggnav-col ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:1px}
.ggnav-col ul li a{
  display:block;padding:8px 10px;border-radius:var(--radius-sm);
  font-family:var(--sans);font-size:14px;color:var(--ink);text-decoration:none;
}
/* Hover only recolors the text and arrow (via currentColor) - no
   background fill. */
.ggnav-col ul li a:hover{color:var(--ent)}
/* Leading arrow on every dropdown-panel link - the exact SVG asset from
   the Figma file (Arrow 9, 9x7.36396). Rendered via mask (not a plain
   background image) so background-color: currentColor picks up the
   link's own color on hover - the arrow and the text change color
   together, matching the design. Gap to the text is 15px, measured
   from the Figma source's own coordinates, not 8px. */
.ggnav-col ul li a::before,
.ggnav-panel--single ul li a::before{
  content:""; display:inline-block; width:9px; height:7.36396px; margin-right:15px;
  background-color:currentColor; opacity:.7;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='7.36396' viewBox='0 0 9 7.36396' fill='none'%3E%3Cpath d='M0.5 3.18198H0V4.18198H0.5V3.68198V3.18198ZM8.85355 4.03553C9.04882 3.84027 9.04882 3.52369 8.85355 3.32843L5.67157 0.146447C5.47631 -0.0488155 5.15973 -0.0488155 4.96447 0.146447C4.7692 0.341709 4.7692 0.658291 4.96447 0.853554L7.79289 3.68198L4.96447 6.51041C4.7692 6.70567 4.7692 7.02225 4.96447 7.21751C5.15973 7.41278 5.47631 7.41278 5.67157 7.21751L8.85355 4.03553ZM0.5 3.68198V4.18198H8.5V3.68198V3.18198H0.5V3.68198Z' fill='%23000'/%3E%3C/svg%3E") no-repeat center / contain;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='7.36396' viewBox='0 0 9 7.36396' fill='none'%3E%3Cpath d='M0.5 3.18198H0V4.18198H0.5V3.68198V3.18198ZM8.85355 4.03553C9.04882 3.84027 9.04882 3.52369 8.85355 3.32843L5.67157 0.146447C5.47631 -0.0488155 5.15973 -0.0488155 4.96447 0.146447C4.7692 0.341709 4.7692 0.658291 4.96447 0.853554L7.79289 3.68198L4.96447 6.51041C4.7692 6.70567 4.7692 7.02225 4.96447 7.21751C5.15973 7.41278 5.47631 7.41278 5.67157 7.21751L8.85355 4.03553ZM0.5 3.68198V4.18198H8.5V3.68198V3.18198H0.5V3.68198Z' fill='%23000'/%3E%3C/svg%3E") no-repeat center / contain;
}
/* Sub-heading inside a column (e.g. "Capabilities"/"Features") - 14px
   semibold #202020 per the Figma source. */
.ggnav-subhead{
  margin:14px 0 4px;padding:0 10px;
  font-family:var(--sans);font-size:13px;font-weight:500;color:var(--ink-3);
}
.ggnav-subhead:first-child{margin-top:0}
/* Two sub-columns side by side within one section, when that section has
   more than 4 items - per the Figma source. */
.ggnav-col-split{display:flex;gap:0 24px}
.ggnav-col-split ul{flex:1 1 0;min-width:0}

/* ---- single-column panels (Company, Sign In, Get Started) ---- */
.ggnav-panel--single{min-width:230px;padding:8px}
.ggnav-panel--single ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:1px}
.ggnav-panel--single ul li a{
  display:block;padding:10px 12px;border-radius:var(--radius-sm);
  font-family:var(--sans);font-size:14px;color:var(--ink);text-decoration:none;
}
.ggnav-panel--single ul li a:hover{color:var(--ent)}
/* Exact per-item text colors from the Figma source (Sign In / Get
   Started panels) - these aren't the general link color, they're
   specific to these CTAs. */
.ggnav-panel--single ul li a.ggnav-link--amber,
.ggnav-panel--single ul li a.ggnav-link--amber:hover{color:#e9af14}
.ggnav-panel--single ul li a.ggnav-link--amber2,
.ggnav-panel--single ul li a.ggnav-link--amber2:hover{color:#e2a609}
.ggnav-panel--single ul li a.ggnav-link--purple,
.ggnav-panel--single ul li a.ggnav-link--purple:hover{color:#6140e7}
/* Get Started's two items have no leading arrow in the Figma source
   (unlike Sign In, which does) - suppress it only here. */
.ggnav-panel--single--no-arrow ul li a::before{display:none}

/* ---- right-hand actions (Sign In / Get Started) ---- */
.ggnav-actions{display:flex;align-items:center;gap:10px;flex:0 0 auto}
.ggnav-item--actions{position:relative}

.ggnav-trigger--ghost{
  padding:9px 14px;border:1.5px solid var(--line);border-radius:var(--radius-sm);
  color:var(--ink);
}
.ggnav-trigger--ghost:hover,
.ggnav-item.is-open>.ggnav-trigger--ghost{
  border-color:var(--ent-soft);background:var(--ent-tint);color:var(--ent);
}

.ggnav-trigger--cta{
  padding:9px 16px;border-radius:var(--radius-sm);
  background:var(--ent);color:#fff;font-weight:600;
  box-shadow:0 8px 20px -8px rgba(11,11,119,.5);
}
.ggnav-trigger--cta:hover,
.ggnav-item.is-open>.ggnav-trigger--cta{background:var(--ent-deep);color:#fff}

/* ---- burger (mobile) ---- */
.ggnav-burger{
  display:none;align-items:center;justify-content:center;
  background:none;border:0;padding:8px;margin-left:4px;color:var(--ink);cursor:pointer;
}

/* ---- mobile drawer ----
   Absolutely positioned below the sticky bar (position:sticky still
   establishes a containing block for absolutely-positioned descendants),
   capped and scrollable so it never runs off the bottom of a short
   viewport with content unreachable below the fold. */
.ggnav-drawer{
  display:none;position:absolute;top:100%;left:0;right:0;
  background:var(--paper);border-bottom:1px solid var(--line);
  box-shadow:0 18px 40px -20px rgba(11,11,119,.25);
  max-height:calc(100vh - 72px);overflow-y:auto;-webkit-overflow-scrolling:touch;
}
.ggnav-drawer.is-open{display:block}

.ggnav-drawer-list{list-style:none;margin:0;padding:12px 24px 0}
.ggnav-drawer-group{border-bottom:1px solid var(--line)}
.ggnav-drawer-group summary{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:14px 0;list-style:none;cursor:pointer;
  font-family:var(--display);font-size:15.5px;font-weight:600;color:var(--ink);
}
.ggnav-drawer-group summary::-webkit-details-marker{display:none}
.ggnav-drawer-group summary::after{
  content:'';flex:0 0 auto;width:8px;height:8px;
  border-right:2px solid var(--ink-3);border-bottom:2px solid var(--ink-3);
  transform:rotate(45deg);transition:transform .15s ease;
}
.ggnav-drawer-group[open]>summary::after{transform:rotate(-135deg)}

.ggnav-drawer-panel{display:flex;flex-direction:column;padding:0 0 14px 2px}
.ggnav-drawer-panel a{
  padding:9px 4px;font-family:var(--sans);font-size:14.5px;color:var(--ink-2);text-decoration:none;
}
.ggnav-drawer-panel a:hover{color:var(--ent)}
.ggnav-drawer-col-title{
  margin:12px 0 2px;padding-left:4px;
  font-family:var(--sans);font-size:11px;font-weight:700;
  text-transform:uppercase;letter-spacing:.05em;color:var(--ink-3);
}
.ggnav-drawer-col-title:first-child{margin-top:2px}
.ggnav-drawer-subhead{
  margin:8px 0 0;padding-left:4px;
  font-family:var(--sans);font-size:11px;font-weight:500;
  text-transform:uppercase;letter-spacing:.04em;color:var(--ink-3);
}

.ggnav-drawer-link{
  display:block;padding:14px 0;border-bottom:1px solid var(--line);
  font-family:var(--display);font-size:15.5px;font-weight:600;color:var(--ink);text-decoration:none;
}

.ggnav-drawer-actions{display:flex;flex-direction:column;padding:4px 24px 20px}
.ggnav-drawer-actions .ggnav-drawer-group:last-child{border-bottom:0}

/* ---- responsive: 1024px collapse (per HEADER-SPEC.md) ---- */
@media(max-width:1024px){
  .ggnav-primary,.ggnav-actions{display:none}
  .ggnav-burger{display:inline-flex}
}
@media(min-width:1025px){
  .ggnav-drawer{display:none!important}
}
