/* Linkstonic nav + mega menu — standalone (never purge). Loaded via layout.js on every page. */
/* ── Capsule nav → full-width sticky bar on scroll ── */
.nav-capsule {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 16px 160px 0;
  transition: padding 0.35s ease;
  background: transparent;
  pointer-events: none;
}
.nav-capsule > * {
  pointer-events: auto;
}

.nav-capsule-inner,
.nav-capsule .nav-inner {
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
  transition: border-radius 0.35s ease, box-shadow 0.35s ease, max-width 0.35s ease, border-color 0.35s ease;
  overflow: visible;
  display: flex;
  align-items: center;
  height: 64px;
  min-height: 64px;
  max-height: 64px;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  box-sizing: border-box;
}

.nav-capsule.scrolled {
  padding: 0;
}

.nav-capsule.scrolled .nav-capsule-inner,
.nav-capsule.scrolled .nav-inner {
  max-width: none !important;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  overflow-x: visible;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  height: 64px;
  min-height: 64px;
  max-height: 64px;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  /* Full-width bar; content inset like Semrush (centered ~1280px zone) */
  padding-left: max(clamp(1.25rem, 4vw, 3rem), calc((100vw - 80rem) / 2)) !important;
  padding-right: max(clamp(1.25rem, 4vw, 3rem), calc((100vw - 80rem) / 2)) !important;
}

.nav-brand {
  display: flex;
  align-items: center;
  align-self: center;
  line-height: 0;
  margin: 0;
  padding: 0;
}
.nav-brand-logo {
  display: block;
  height: 40px;
  max-height: 40px;
  width: auto;
  max-width: 300px;
  object-fit: contain;
  margin: 0;
  vertical-align: middle;
  border-radius: 6px;
  transition: border-radius 0.35s ease;
}

.nav-capsule.scrolled .nav-brand-logo {
  border-radius: 12px;
}

.nav-cta-btn {
  border-radius: 10px;
  transition: border-radius 0.35s ease, box-shadow 0.35s ease, transform 0.2s ease, background-color 0.2s ease;
}

.nav-capsule.scrolled .nav-cta-btn {
  border-radius: 9999px;
}

@media (max-width: 768px) {
  .nav-capsule:not(.scrolled) {
    padding-left: 12px;
    padding-right: 12px;
  }

  .nav-capsule.scrolled {
    padding: 0;
  }

  .nav-capsule.scrolled .nav-capsule-inner,
  .nav-capsule.scrolled .nav-inner {
    padding-left: max(1rem, calc((100vw - 80rem) / 2)) !important;
    padding-right: max(1rem, calc((100vw - 80rem) / 2)) !important;
  }
}

/* ── Mobile menu: hidden by default on ALL widths (fixes inline link row on desktop) ── */
.mobile-menu {
  display: none;
  flex-direction: column;

  font-size: 1.25rem;
  font-weight: 600;
  color: #000000;
  flex-shrink: 0;
}
.nav-logo-icon {
  width: 36px;
  height: 36px;
  background: #16A34A;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #fff;
}
.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}

/* Wide mega menus: anchor to the whole link cluster so left:50% centers on the bar, not only on "Product". */
.nav-center-cluster {
  position: relative;
}

@media (min-width: 1024px) {
  .nav-center-cluster > .nav-dropdown.nav-dropdown--mega {
    position: static;
  }

  /* Prevent .nav-links flex-grow from widening the cluster on legacy .nav-inner navs.
     Without this, left:50% on the mega panel anchors to the full stretched-cluster width
     instead of the natural max-content width, shifting the dropdown left. */
  .nav-inner > .nav-links {
    flex: 0 0 auto;
    width: max-content;
  }
}

/* Top nav: Product / Solutions / Pricing / Resources */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 9999px;
  color: #64748b;
  background: transparent;
  border: none;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}

.nav-dropdown-trigger .nav-chevron {
  font-size: 0.65rem;
  opacity: 0.65;
  margin-top: 1px;
}

.nav-dropdown-trigger:hover,
.nav-dropdown:focus-within .nav-dropdown-trigger {
  color: #0f172a;
  background: rgba(22, 163, 74, 0.08);
}

.nav-top-link {
  font-size: 0.875rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 9999px;
  color: #64748b;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
}

.nav-top-link:hover,
.nav-top-link.active {
  color: #0f172a;
  background: rgba(22, 163, 74, 0.08);
}

.nav-dropdown-panel {
  position: absolute;
  top: calc(100% + 20px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 232px;
  padding: 8px;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.12);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 100;
}

.nav-dropdown:hover .nav-dropdown-panel,
.nav-dropdown:focus-within .nav-dropdown-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Desktop nav cluster: only one dropdown/mega panel when moving between triggers
   (wide Product mega used to stay “open” under the pointer while Solutions opened). */
.nav-center-cluster:has(.nav-dropdown:hover) .nav-dropdown:not(:hover) .nav-dropdown-panel {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.nav-center-cluster .nav-dropdown:hover {
  z-index: 8;
}

@media (min-width: 1024px) {
  .nav-capsule-inner:has(> .nav-center-cluster) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    column-gap: 1rem;
  }

  .nav-capsule-inner:has(> .nav-center-cluster) > a:first-of-type {
    justify-self: start;
  }

  .nav-capsule-inner:has(> .nav-center-cluster) > .nav-center-cluster {
    justify-self: center;
    width: max-content;
    max-width: 100%;
  }

  .nav-capsule-inner:has(> .nav-center-cluster) > .nav-center-cluster + div {
    justify-self: end;
  }

  .nav-inner:has(> .nav-center-cluster) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 16px;
  }

  .nav-inner:has(> .nav-center-cluster) > .nav-logo {
    justify-self: start;
  }

  .nav-inner:has(> .nav-center-cluster) > .nav-center-cluster {
    justify-self: center;
    width: max-content;
    max-width: 100%;
  }

  .nav-inner:has(> .nav-center-cluster) > .nav-cta {
    justify-self: end;
  }
}

.nav-dropdown-item {
  display: block;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #475569;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.nav-dropdown-item:hover {
  background: rgba(22, 163, 74, 0.08);
  color: #0f172a;
}

.nav-dropdown-item.active {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
  font-weight: 600;
}

/* Solutions mega menu (flat stroke icons, no full-color fills) */
.nav-dropdown--mega .nav-dropdown-panel.nav-dropdown-mega {
  min-width: 560px;
  max-width: min(680px, calc(100vw - 40px));
  padding: 0;
  border-radius: 20px;
  box-shadow:
    0 24px 56px rgba(15, 23, 42, 0.12),
    0 0 0 1px rgba(15, 23, 42, 0.05);
}

/* =========================================================
   Products Mega Menu — wide panel, module columns + sub-items
   ========================================================= */

/* The mega panel itself */
.nav-products-mega {
  left: 50%;
  transform: translateX(-50%);
  min-width: min(1120px, calc(100vw - 32px));
  max-width: min(1200px, calc(100vw - 24px));
  padding: 0;
  border-radius: 20px;
  box-shadow:
    0 24px 56px rgba(15, 23, 42, 0.13),
    0 0 0 1px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

/* Featured top: AI SEO Strategist */
.pmega-featured {
  padding: 10px 14px 8px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.05) 0%, rgba(255,255,255,0) 60%);
}

.pmega-featured-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 12px;
  text-decoration: none;
  transition: background 0.15s ease;
}

.pmega-featured-link:hover {
  background: rgba(37, 99, 235, 0.06);
}

.pmega-featured-icon {
  width: 38px !important;
  height: 38px !important;
  border-radius: 11px !important;
}

.pmega-featured-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.pmega-featured-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.pmega-featured-desc {
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.3;
}

.pmega-featured-arrow {
  font-size: 1rem;
  color: #2563eb;
  flex-shrink: 0;
  opacity: 0.7;
  transition: transform 0.15s ease;
}

.pmega-featured-link:hover .pmega-featured-arrow {
  transform: translateX(3px);
  opacity: 1;
}

/* Module columns grid — 5 columns (TrueTrace+Audit share one) */
.pmega-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  padding: 14px 10px 8px;
}

.pmega-col {
  padding: 0 6px 10px;
}

.pmega-col + .pmega-col,
.pmega-col--stacked + .pmega-col {
  border-left: 1px solid rgba(15, 23, 42, 0.06);
}

/* Stacked column: TrueTrace on top, Audit below with divider */
.pmega-col--stacked {
  padding: 0 6px 10px;
  border-left: 1px solid rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
}

.pmega-col-stacked-inner + .pmega-col-stacked-inner {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

/* Column header: module icon + name */
.pmega-col-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 6px 8px;
  margin-bottom: 2px;
}

.pmega-col-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

/* Sub-item link under each column */
.pmega-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 9px;
  text-decoration: none;
  color: inherit;
  transition: background 0.13s ease;
}

.pmega-sub:hover {
  background: rgba(15, 23, 42, 0.04);
}

.pmega-sub-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
}

.pmega-sub-icon svg {
  width: 13px;
  height: 13px;
}

.pmega-sub-icon svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pmega-sub-title {
  font-size: 0.8rem;
  font-weight: 500;
  color: #334155;
  line-height: 1.3;
}

.pmega-sub:hover .pmega-sub-title {
  color: #0f172a;
}

/* Bottom row: RUM Monitor, LinkMind */
.pmega-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px 14px;
  border-top: 1px solid rgba(15, 23, 42, 0.07);
  background: #f8fafc;
}

.pmega-standalone {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 9999px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #fff;
  font-size: 0.84rem;
  font-weight: 600;
  color: #334155;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.pmega-standalone:hover {
  background: rgba(22, 163, 74, 0.07);
  border-color: rgba(22, 163, 74, 0.25);
  color: #15803d;
}

/* Mobile featured item variant */
.mobile-mega-item--featured {
  font-weight: 700 !important;
  color: #0f172a !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
  padding: 14px 0 !important;
}

.mobile-mega-item--sub {
  padding-left: 20px !important;
  font-size: 0.92rem !important;
  font-weight: 500 !important;
  color: #475569 !important;
}

/* Main nav product modules — trigger + submenu panel */
.nav-module-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nav-module-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nav-module-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-module-icon svg {
  width: 16px;
  height: 16px;
}

.nav-module-icon svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-module-icon--purple { background: rgba(124, 58, 237, 0.12); color: #7c3aed; }
.nav-module-icon--green { background: rgba(22, 163, 74, 0.12); color: #16a34a; }
.nav-module-icon--violet { background: rgba(109, 40, 217, 0.12); color: #6d28d9; }
.nav-module-icon--blue { background: rgba(37, 99, 235, 0.12); color: #2563eb; }
.nav-module-icon--orange { background: rgba(234, 88, 12, 0.12); color: #ea580c; }

.nav-dropdown--module .nav-module-panel {
  min-width: 240px;
  padding: 8px;
  border-radius: 16px;
}

.nav-module-sub {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}

.nav-module-sub:hover {
  background: rgba(15, 23, 42, 0.04);
}

.nav-module-sub-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
}

.nav-module-sub-icon svg {
  width: 18px;
  height: 18px;
}

.nav-module-sub-icon svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-module-sub-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.3;
}

.mobile-module-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  list-style: none;
  cursor: pointer;
}

.mobile-nav-group--module summary::-webkit-details-marker {
  display: none;
}

@media (max-width: 1280px) {
  .nav-center-cluster {
    gap: 0;
  }
  .nav-module-trigger,
  .nav-module-top {
    font-size: 0.8125rem;
    padding: 8px 10px;
  }
  .nav-module-icon {
    width: 24px;
    height: 24px;
  }
}

.nav-mega-beta {
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(124, 58, 237, 0.1);
  color: #7c3aed;
  padding: 2px 7px;
  border-radius: 20px;
  margin-left: 6px;
  vertical-align: middle;
}

.nav-dropdown-mega-inner {
  padding: 20px 18px 10px;
}

.nav-dropdown-mega-kicker {
  margin: 0 0 14px 6px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #94a3b8;
}

.mega-solution-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}

.mega-solution-link {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}

.mega-solution-link:hover {
  background: rgba(15, 23, 42, 0.035);
}

.mega-solution-link:hover .mega-solution-title {
  color: #0f172a;
}

.mega-solution-link[aria-current="page"] {
  background: rgba(22, 163, 74, 0.08);
  outline: 1px solid rgba(22, 163, 74, 0.2);
}

.mobile-mega-item[aria-current="page"] {
  font-weight: 600;
  color: #15803d;
}

.mega-solution-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
}

.mega-solution-icon svg {
  width: 20px;
  height: 20px;
}

.mega-solution-icon svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mega-solution-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.mega-solution-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.mega-solution-desc {
  font-size: 0.75rem;
  line-height: 1.45;
  color: #64748b;
}

.nav-dropdown-mega-footer {
  margin: 4px 10px 10px;
  padding: 14px 16px 16px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.nav-dropdown-mega-footer-link {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #16a34a;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-dropdown-mega-footer-link:hover {
  color: #15803d;
  text-decoration: underline;
}

.nav-dropdown-mega-footer-link.active {
  color: #15803d;
}

/* Mobile: solution rows with flat icons */
.mobile-mega-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0 12px 16px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #334155;
  text-decoration: none;
  border-bottom: none;
}

.mobile-mega-item svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: #64748b;
}

.mobile-mega-item svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mobile-mega-divider {
  margin: 8px 0 4px 16px;
  padding-top: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #94a3b8;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

@media (min-width: 1100px) {
  .nav-links {
    gap: 4px;
  }
  .nav-dropdown-trigger,
  .nav-top-link {
    font-size: 0.9rem;
    padding: 8px 16px;
  }
}

/* ── Responsive nav: replaces missing lg:flex / lg:hidden Tailwind classes ── */
/* Mobile: show hamburger, hide center cluster + CTA group */
.nav-center-cluster--desktop {
  display: none !important;
}
.nav-cta-group {
  display: none !important;
}
.nav-hamburger--responsive {
  display: flex !important;
}

/* Desktop (1024px+): show cluster + CTA, hide hamburger */
@media (min-width: 1024px) {
  .nav-center-cluster--desktop {
    display: flex !important;
  }
  .nav-cta-group {
    display: flex !important;
  }
  .nav-hamburger--responsive {
    display: none !important;
  }
}

/* ── Production hardening (Tailwind preflight + style.css conflicts) ── */
#nav .nav-brand {
  overflow: visible !important;
  flex-shrink: 0;
}
#nav .nav-brand-logo {
  height: 40px !important;
  max-height: 40px !important;
  width: auto !important;
  max-width: min(280px, 40vw) !important;
  object-fit: contain !important;
}
#nav .nav-dropdown-panel.nav-products-mega {
  min-width: min(1120px, calc(100vw - 32px)) !important;
  max-width: min(1200px, calc(100vw - 24px)) !important;
  width: max-content !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  box-sizing: border-box !important;
}
#nav .pmega-grid {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
}
#nav .nav-module-icon,
#nav .pmega-featured-icon,
#nav .pmega-sub-icon,
#nav .mega-solution-icon {
  flex-shrink: 0 !important;
}
#nav .nav-module-icon svg,
#nav .pmega-sub-icon svg,
#nav .mega-solution-icon svg {
  width: 16px !important;
  height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  display: block !important;
}
#nav .pmega-sub-icon svg {
  width: 13px !important;
  height: 13px !important;
  max-width: 13px !important;
  max-height: 13px !important;
}
#nav .nav-module-icon svg path,
#nav .pmega-sub-icon svg path,
#nav .mega-solution-icon svg path,
#nav .pmega-featured-icon svg path {
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.5 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}
