/* Shared marketing nav — used by index.php and auth pages (_marketing-nav.php).
   Sticky nav: brand (left) — Features dropdown + link group (centered) —
   theme toggle + Login/My Account + CTA + mobile hamburger (right). The
   hamburger opens a full-screen sectioned menu (.nav-overlay) on mobile. An
   optional promo-banner slot can sit above the nav (see _marketing-nav.php);
   unused today (no live promo), so it renders nothing unless a page sets
   $GLOBALS['gd_promo_banner'] before including the partial. */

.promo-banner {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #061018;
  text-align: center;
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px clamp(20px, 5vw, 72px);
  line-height: 1.5;
}
.promo-banner a { color: inherit; text-decoration: underline; }

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 16px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
}
.nav-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; text-decoration: none; color: var(--text); }
.nav-brand svg { width: 22px; height: 22px; flex-shrink: 0; color: var(--accent); }

.nav-links { justify-self: center; display: flex; gap: 28px; align-items: center; font-size: 15px; }
.nav-links > a { color: var(--text); text-decoration: none; transition: color .2s; }
.nav-links > a:hover { color: var(--accent); }

/* Features dropdown — chip trigger + card panel (desktop only; mobile uses
   the full-screen #navOverlay's FEATURES section instead). Toggled by
   marketing-nav.js via aria-expanded + the panel's [hidden] attribute. */
.nav-dropdown { position: relative; }
.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: -8px -12px;
  padding: 8px 12px;
  border: none;
  border-radius: var(--radius-m);
  background: none;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: background .16s ease;
}
.nav-dropdown-trigger:hover,
.nav-dropdown-trigger[aria-expanded="true"] { background: var(--accent-tint); }
.nav-dropdown-caret { width: 14px; height: 14px; transition: transform .16s ease; }
.nav-dropdown-trigger[aria-expanded="true"] .nav-dropdown-caret { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) {
  .nav-dropdown-trigger, .nav-dropdown-caret { transition: none; }
}

.nav-dropdown-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 60;
  min-width: 240px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
}
.nav-dropdown-item { display: block; padding: 10px 12px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 14px; }
.nav-dropdown-item:hover { background: var(--surface-2); }
.nav-dropdown-item-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.nav-dropdown-hint { font-size: 12px; color: var(--dim); }

.nav-actions { justify-self: end; display: flex; align-items: center; gap: 12px; }

.nav-login-link, .nav-account-link { color: var(--text); text-decoration: none; font-size: 14px; transition: color .2s; }
.nav-login-link:hover, .nav-account-link:hover { color: var(--accent); }

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(180deg, #5aa7ee, #3f86d4);
  color: #061018;
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
}

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle svg { width: 18px; height: 18px; }
/* Icon shows the theme you'd SWITCH TO (opposite of current): sun in dark
   mode, moon in light mode. */
.theme-toggle .ic-sun { display: block; }
.theme-toggle .ic-moon { display: none; }
html[data-theme="light"] .theme-toggle .ic-sun { display: none; }
html[data-theme="light"] .theme-toggle .ic-moon { display: block; }

.nav-toggle { display: none; flex: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); color: var(--text); width: 38px; height: 38px; align-items: center; justify-content: center; cursor: pointer; }
.nav-toggle svg { width: 20px; height: 20px; }

/* Mobile full-screen menu — replaces the old .nav-links dropdown panel.
   Opened by #navToggle, closed by #navOverlayClose/Escape/outside nav;
   marketing-nav.js toggles [hidden] + .is-open and locks body scroll while
   open. Only reachable via the hamburger, which is mobile-only (below), so
   these rules are unconditional but effectively mobile-only in practice. */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 60;
  flex-direction: column;
  background: var(--bg);
  overflow-y: auto;
  padding: 16px clamp(20px, 5vw, 72px) clamp(20px, 5vw, 72px);
}
.nav-overlay.is-open { display: flex; }
.nav-overlay-top { display: flex; align-items: center; justify-content: space-between; padding: 8px 0 20px; }
.nav-overlay-close {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.nav-overlay-close:hover { border-color: var(--accent); }
.nav-overlay-close svg { width: 18px; height: 18px; }
.nav-overlay-body { display: flex; flex-direction: column; gap: 28px; }
.nav-overlay-label {
  margin-bottom: 4px;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--dim);
}
.nav-overlay-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  font-size: 22px;
  font-weight: 600;
}
.nav-overlay-hint { font-size: 13px; font-weight: 400; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--dim); }
.nav-overlay-cta {
  display: block;
  margin-top: auto;
  padding: 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #5aa7ee, #3f86d4);
  color: #061018;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  font-size: 15px;
}
/* logged-in: bottom-pinned logout form (mirrors dashboard.php's overlay) */
.nav-overlay-logout { margin-top: auto; }
button.nav-overlay-cta { width: 100%; border: none; font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; }

/* 900px (not the sitewide 768px hamburger cutoff) because the six-item
   .nav-links row + CTA button doesn't fit until ~900px wide — tablet
   portrait (e.g. 834px) was overflowing the nav with the 768px cutoff. */
@media (max-width: 900px) {
  .nav { grid-template-columns: auto auto; }
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  /* Mobile bar: theme toggle + hamburger only — Login/My Account/CTA move
     into #navOverlay's sections/footer. */
  .nav-login-link, .nav-account-link, .nav-actions .nav-cta { display: none; }
}
