/* mega.css — the Services mega menu (2026-10-02).
 *
 * Loaded on every page family that has the menu: Layout pages (Head.tsx)
 * and the legacy static pages (static.tsx), which now render the same
 * markup (Nav.tsx megaMenuHtml). No :root, reset or body{}.
 *
 * Every selector starts at #nav so it wins over home.css's older .mega-*
 * rules and over each legacy page stylesheet's own copy of them, whatever
 * the load order.
 *
 * Why it changed: 35 rows in seven groups on a 95%-opaque blurred panel.
 * It was taller than a laptop screen and the hero showed through it. Now
 * five groups, close siblings on one row, a solid panel that fits.
 */

#nav .nav-dropdown.mega-menu {
  width: min(1180px, calc(100vw - 2rem));
  padding: 1.75rem 1.75rem 0;
  background: #0F0F0F;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
  text-align: left;
}

#nav .mega-menu .mega-groups {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
}
#nav .mega-menu .mega-group {
  padding: 0 1.25rem 1.5rem 0;
  border-left: 0;
}
#nav .mega-menu .mega-group + .mega-group {
  padding-left: 1.25rem;
  border-left: 1px solid rgba(255, 255, 255, 0.07);
}
#nav .mega-menu .mega-group-label {
  display: block;
  margin: 0 0 0.7rem;
  font: 600 0.62rem/1.2 'DM Sans', sans-serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #D97706;
}

/* The legacy static pages style every `.nav-links a` with padding and
   margins of their own; these small links must not inherit them. */
#nav .mega-menu .mega-subs a,
#nav .mega-menu .mega-foot-links a {
  display: inline;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: none !important;
}
#nav .mega-menu .mega-item { margin: 0 0 0.15rem; }
#nav .mega-menu .mega-link {
  display: block;
  margin: 0 -0.5rem;
  padding: 0.42rem 0.5rem;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.15s;
}
#nav .mega-menu a.mega-link:hover { background: rgba(255, 255, 255, 0.06); }
#nav .mega-menu .mega-link-head { cursor: default; }
#nav .mega-menu .mega-link-name {
  display: block;
  font: 600 0.84rem/1.3 'Sora', sans-serif;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.9);
}
#nav .mega-menu a.mega-link:hover .mega-link-name { color: #FFFFFF; }
#nav .mega-menu .mega-link-desc {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.72rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.45);
}

/* Sibling pages on one row: "Meta · Google · TikTok · Pinterest". */
#nav .mega-menu .mega-subs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0;
  margin: -0.1rem 0 0.35rem;
}
#nav .mega-menu .mega-subs a {
  font-size: 0.74rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
}
/* The dot trails each link rather than leading the next, so a row that
   wraps never starts with a stray separator. */
#nav .mega-menu .mega-subs a:not(:last-child)::after {
  content: '·';
  margin: 0 0.45rem;
  color: rgba(255, 255, 255, 0.25);
}
#nav .mega-menu .mega-subs a:hover { color: #FFFFFF; text-decoration: underline; text-underline-offset: 3px; }

/* The bottom row: the pages a browser wants next, and the ask. */
#nav .mega-menu .mega-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 -1.75rem;
  padding: 0.9rem 1.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #141414;
  border-radius: 0 0 14px 14px;
}
#nav .mega-menu .mega-foot-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.6rem; }
#nav .mega-menu .mega-foot-links a {
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
}
#nav .mega-menu .mega-foot-links a:first-child { color: #FFFFFF; }
#nav .mega-menu .mega-foot-links a:hover { color: #FFFFFF; text-decoration: underline; text-underline-offset: 3px; }
#nav .mega-menu .mega-foot-cta {
  flex: none;
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: #B45309;
  color: #FFFFFF;
  font: 600 0.8rem/1 'DM Sans', sans-serif;
  cursor: pointer;
}
#nav .mega-menu .mega-foot-cta:hover { background: #92400E; }
#nav .mega-menu a:focus-visible,
#nav .mega-menu button:focus-visible { outline: 2px solid #D97706; outline-offset: 2px; }

/* Narrow desktops and the iPhone Duo open (769 to 1100): three columns,
   descriptions off, so it still fits a short screen. */
@media (max-width: 1100px) {
  #nav .mega-menu .mega-groups { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 0.5rem; }
  #nav .mega-menu .mega-group:nth-child(3n + 1) { padding-left: 0; border-left: 0; }
  #nav .mega-menu .mega-link-desc { display: none; }
}
@media (max-height: 820px) {
  #nav .mega-menu .mega-link-desc { display: none; }
}

/* ── Breathing room (2026-10-02, Alwaz: "a bit too congested") ─────────
   Descriptions off: with plain names they mostly restated the title, and
   they doubled the lines in every column. More air between rows, wider
   gutters, slightly larger names. */
#nav .mega-menu .mega-link-desc { display: none; }
#nav .nav-dropdown.mega-menu { padding: 2.25rem 2.25rem 0; }
#nav .mega-menu .mega-foot { margin: 0 -2.25rem; padding: 1rem 2.25rem; }
#nav .mega-menu .mega-group { padding: 0 1.75rem 2rem 0; }
#nav .mega-menu .mega-group + .mega-group { padding-left: 1.75rem; }
#nav .mega-menu .mega-group-label { margin-bottom: 1.1rem; }
#nav .mega-menu .mega-item { margin: 0 0 0.55rem; }
#nav .mega-menu .mega-link { padding: 0.3rem 0.5rem; }
#nav .mega-menu .mega-link-name { font-size: 0.9rem; }
#nav .mega-menu .mega-subs { margin: 0 0 0.1rem; }
#nav .mega-menu .mega-subs a { font-size: 0.76rem; color: rgba(255, 255, 255, 0.5); }
@media (max-width: 1100px) {
  #nav .nav-dropdown.mega-menu { padding: 1.75rem 1.75rem 0; }
  #nav .mega-menu .mega-foot { margin: 0 -1.75rem; padding: 0.9rem 1.75rem; }
  #nav .mega-menu .mega-group { padding-right: 1.25rem; padding-bottom: 1.5rem; }
  #nav .mega-menu .mega-group + .mega-group { padding-left: 1.25rem; }
  #nav .mega-menu .mega-group:nth-child(3n + 1) { padding-left: 0; }
}
/* Column widths follow the longest name in each group, so "Conversion
   Optimisation" stays on one line. */
@media (min-width: 1101px) {
  #nav .mega-menu .mega-groups { grid-template-columns: 1fr 1.25fr 1.1fr 0.95fr 0.85fr; }
}
/* Lighter names (2026-10-02, Alwaz: "the texts look bolded"). With the
   descriptions gone, 600 weight at 0.9rem made every row shout. 500 at
   0.86rem and a softer white reads like the old menu's names. */
#nav .mega-menu .mega-link-name { font-weight: 500; font-size: 0.86rem; color: rgba(255, 255, 255, 0.8); }
#nav .mega-menu a.mega-link:hover .mega-link-name { color: #FFFFFF; }
