/*
 * Header mega menu (Product / Solutions / Resources dropdowns).
 * Shared by every page via <link id="mm-css" href="/assets/nav-dropdown.css"> — edit this
 * file to change the dropdown design on all pages at once (no rebuild needed).
 * Menu links: infra/build-menus.py → infra/partials/header.html → every page via
 *   python3 infra/build-menus.py && python3 infra/build-header.py
 * Open/close behaviour (hover on desktop, click on touch): assets/js/app.js.
 *
 * Design: classic columns, icon tiles, soft-tint panel, chips for text-only links,
 * centred, slide-in, open menu marked by Cloudairy purple text (main.css .navbar-menu-active).
 */

.dropdown-menu.mm-menu {
  width: min(1160px, calc(100vw - 48px)) !important;
  left: 50% !important;
  margin-top: 9px;
  padding: 0 !important;
  border: 0;
  border-radius: 22px;
  background: #fbfaff;
  box-shadow: 0 24px 48px -26px rgba(103, 98, 254, 0.4), 0 0 0 1px #f0efff;
}
#productMenu2.mm-menu {
  width: min(980px, calc(100vw - 48px)) !important;
}
/* bridges the gap under the navbar so the menu stays open while the pointer crosses it */
.dropdown-menu.mm-menu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -22px;
  height: 22px;
}
.dropdown-menu.mm-menu.show {
  animation: mmIn 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes mmIn {
  from { opacity: 0; transform: translate(-50%, 16px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .dropdown-menu.mm-menu.show { animation: none; }
}

.mm {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 24px 12px;
  text-align: left;
}
.mm-col {
  padding: 0 14px;
  min-width: 0;
}
.mm-h {
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #676879;
  margin: 4px 0 14px;
  padding-left: 10px !important;
}

/* items: icon tile + title + description */
.mm-it {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px;
  margin: 0 0 2px;
  border-radius: 12px;
  text-decoration: none;
  color: #18181b;
  transition: background 0.15s;
}
.mm-it span { min-width: 0; }
.mm-it svg {
  flex: 0 0 36px;
  box-sizing: border-box;
  width: 36px;
  height: 36px;
  padding: 8px;
  border-radius: 10px;
  background: #f0efff;
  stroke: #6762fe;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mm-it b {
  display: block;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 21px;
  color: #18181b;
  transition: color 0.15s;
}
.mm-it small {
  display: block;
  font-size: 13.5px;
  line-height: 1.4;
  color: #676879;
  margin-top: 1px;
}
.mm-it:hover { background: #f6f5ff; }
.mm-it:hover b { color: #524de8; }
.mm-it:focus-visible {
  outline: 2px solid #6762fe;
  outline-offset: 2px;
}

/* text-only links (diagram makers, comparisons) as chips */
.mm-col:has(> .mm-it.plain) {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
}
.mm-col:has(> .mm-it.plain) .mm-h {
  flex-basis: 100%;
  margin-bottom: 6px;
}
.mm-it.plain {
  display: inline-flex;
  margin: 0;
  padding: 8px 13px;
  border: 1px solid #e6e9ef;
  border-radius: 999px;
  background: transparent;
  transition: border-color 0.15s, background 0.15s;
}
.mm-it.plain b {
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.3;
  color: #323338;
}
.mm-it.plain:hover {
  border-color: #6762fe;
  background: #f6f5ff;
}
.mm-it.plain:hover b { color: #524de8; }

/* never taller than the screen: scroll inside the panel instead of being cut off */
.mm {
  max-height: calc(100vh - 150px);
  max-height: calc(100dvh - 150px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
