/*
 * nav-dropdown.css — modern, consistent mega-menu dropdowns.
 *
 * Overrides the legacy Webflow dropdown look (dim low-contrast text, mismatched
 * per-menu styling, no motion). Loaded AFTER webflow-shared.css so these rules
 * win. Purely visual — markup (Nav.astro) and open/close JS (.w--open on
 * .w-dropdown-list) are untouched.
 *
 * Design: one dark glass surface for every dropdown, bright legible text on
 * RC tokens, a gradient section header, animated icon/link reveal, and a
 * smooth open transition. Tokens come from src/styles/tokens.css (--rc-*).
 */

/* ---------- toggle (the "Solutions ▾" nav item) ---------- */
.header-wrapper .w-dropdown-toggle {
  cursor: pointer;
  transition: color 0.18s ease;
}
.header-wrapper .w-dropdown-toggle > div:first-child {
  transition: color 0.18s ease;
}
.header-wrapper .w-dropdown:hover .w-dropdown-toggle > div:first-child,
.header-wrapper .w-dropdown-toggle.w--open > div:first-child {
  color: var(--rc-lilac, #cdaafb);
}
/* animated caret */
.header-wrapper .dropdown-arrow {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}
.header-wrapper .w-dropdown-toggle.w--open .dropdown-arrow {
  transform: rotate(180deg);
}

/* ---------- panel positioning + open animation ---------- */
.header-wrapper .w-dropdown-list {
  /* keep it in the flow of the sticky header; center under the toggle.
     NOTE: the visual offset below the toggle is PADDING (not margin) so the
     gap is hoverable — margin created a dead zone that fired mouseleave and
     closed the menu while travelling from toggle to panel. */
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  margin-top: 0;
  padding-top: 12px;
  background: transparent;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.22s ease,
    transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0s linear 0.28s;
  z-index: 60;
}
.header-wrapper .w-dropdown-list.w--open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
  transition:
    opacity 0.22s ease,
    transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0s;
}
@media (prefers-reduced-motion: reduce) {
  .header-wrapper .w-dropdown-list,
  .header-wrapper .w-dropdown-list.w--open {
    transition: opacity 0.15s ease, visibility 0s;
    transform: translateX(-50%);
  }
  .header-wrapper .dropdown-arrow { transition: none; }
}

/* ---------- the card surface (consistent for ALL dropdowns) ---------- */
.header-wrapper .card.dropdown {
  position: relative;
  background: linear-gradient(180deg, #26262e 0%, #1a1a1f 100%);
  border: 1px solid #ffffff14;
  border-radius: var(--rc-radius-lg, 20px);
  /* Shadow tuning (iterated with Guillaume): dark drop at ~42%; purple
     under-glow settled at ~36% ("increase a tiny bit" from the 22% cut). */
  box-shadow:
    0 24px 60px -12px #0000006b,
    0 0 0 1px #ffffff08 inset,
    0 30px 85px -44px #694ef75c;
  overflow: hidden;
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  padding: 0;
  /* Consistent sizing across all menus: each column is a fixed track, so a
     2-column menu (Solutions) and a 4-column menu (Use cases) share the same
     rhythm and none feels cramped. Width grows with column count. */
  min-width: 560px;
}
/* Every column gets the same minimum track width → consistent look. */
.header-wrapper .card.dropdown .menu-wrapper {
  min-width: 240px;
}
/* Unifying top accent bar on EVERY dropdown — the single consistent treatment
   for all 3 menus (Solutions/Use cases/Resources). Lilac-forward to match the
   preferred lighter brand tone. */
.header-wrapper .card.dropdown::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(to right, #9777f4, #b79bf5 40%, #cdaafb 70%, #e2b8fa);
  z-index: 2;
}
/* The Solutions menu's "EXPLORE KEY FEATURES" gradient header is dropped for
   consistency — all 3 menus now use only the thin lilac accent bar above.
   (Markup stays in Nav.astro; hidden here so no template churn.) */
.header-wrapper .nav-link-block.gradient {
  display: none;
}

/* ---------- grid + columns ---------- */
.header-wrapper .card.dropdown .grid-nav-menu-dropdown {
  padding: 0;
}
/* EQUAL padding on every column. Webflow's variants are unequal
   (.nav-content._100 = 20px left, ._100.padding = 50px, ._100.last = 20px)
   which made the 3 columns start at different left offsets. The selectors
   below out-specify all three variants and normalize them, and kill
   Webflow's own border-right divider (we draw one border-left instead). */
.header-wrapper .card.dropdown .nav-content,
.header-wrapper .card.dropdown .nav-content._100,
.header-wrapper .card.dropdown .nav-content._100.padding,
.header-wrapper .card.dropdown .nav-content._100.last {
  /* Equal columns with a GENEROUS left inset (per Guillaume): clear air
     between the divider/card edge and the clickable labels. */
  padding: 28px 36px 30px 52px;
  border-right: 0;
}
/* subtle divider between the columns — single consistent system */
.header-wrapper .grid-nav-menu-dropdown + .grid-nav-menu-dropdown .nav-content,
.header-wrapper .menu-wrapper + .menu-wrapper .nav-content {
  border-left: 1px solid #ffffff12;
}

/* ---------- section headings (AGENTIC SYSTEMS / PLATFORM …) ---------- */
.header-wrapper .nav-text-big.mb-20 {
  color: var(--rc-lilac, #cdaafb);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 14px;
  opacity: 0.9;
}

/* ---------- the actual links — HIGH CONTRAST + hover motion ---------- */
.header-wrapper .nav-menu-list-item { margin-bottom: 2px; }
.header-wrapper .nav-link {
  display: inline-flex;
  align-items: center;
  color: #f3f2f8 !important;           /* bright, legible (was dim grey) */
  font-family: var(--rc-font-body, inherit);
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1.2;
  padding: 8px 12px;
  margin: 0 -12px;
  border-radius: var(--rc-radius-sm, 12px);
  text-decoration: none;
  position: relative;
  transition:
    color 0.16s ease,
    background 0.18s ease,
    transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.header-wrapper a.nav-link:hover {
  color: #fff !important;
  background: #ffffff0f;
  transform: translateX(4px);
}
/* little leading accent dash that grows on hover */
.header-wrapper a.nav-link::before {
  content: '';
  width: 0;
  height: 2px;
  margin-right: 0;
  border-radius: 2px;
  background: var(--rc-gradient-primary, linear-gradient(90deg, #cdaafb, #694ef7));
  transition: width 0.2s ease, margin-right 0.2s ease;
}
.header-wrapper a.nav-link:hover::before {
  width: 14px;
  margin-right: 8px;
}

/* coming-soon items: readable but clearly muted, not clickable */
.header-wrapper .nav-link.coming-soon {
  color: #9a9aad !important;
  cursor: default;
  padding: 8px 0;
  margin: 0;
}
.header-wrapper .nav-menu-list-item.add-info {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-wrapper .coming-soon + .coming-soon,
.header-wrapper .add-info .coming-soon:last-child {
  font-size: 0.7rem;
  color: var(--rc-purple, #785ef7);
  background: #785ef71f;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

/* ---------- staggered reveal of columns on open ---------- */
.header-wrapper .w-dropdown-list.w--open .menu-wrapper {
  animation: rc-nav-rise 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.header-wrapper .w-dropdown-list.w--open .grid-nav-menu-dropdown:nth-child(2) .menu-wrapper { animation-delay: 0.05s; }
.header-wrapper .w-dropdown-list.w--open .grid-nav-menu-dropdown:nth-child(3) .menu-wrapper { animation-delay: 0.1s; }
.header-wrapper .w-dropdown-list.w--open .grid-nav-menu-dropdown:nth-child(4) .menu-wrapper { animation-delay: 0.15s; }
@keyframes rc-nav-rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .header-wrapper .w-dropdown-list.w--open .menu-wrapper {
    animation: none;
  }
}

/* ---------- mobile: flatten the fancy panel so it reads in the drawer ---------- */
@media (max-width: 991px) {
  .header-wrapper .w-dropdown-list {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    left: auto;
    margin: 0;
    padding-top: 0; /* the desktop hover-bridge padding is not needed in the drawer */
  }
  .header-wrapper .card.dropdown {
    min-width: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
  }
  .header-wrapper .nav-content { border-left: 0; }
}
