/*
 * The new services menu on this server's own pages (/start, /start/flow, /track), drawn by
 * assets/js/dg-services-menu.js with the CMS's markup. These rules are the CMS's
 * web-docugulf-cms/src/app/(frontend)/styles/services-menu.css, copied unchanged (one adjustment
 * at the end, for the /start pages' line-height): those pages
 * and the CMS pages share the same base header CSS (.nav-drop, .nav-menu, .nav-sheet), so the
 * menu draws 1:1. Keep the two in step when the CMS's file changes.
 * Every rule needs the menu's own classes, so this file changes nothing while the old
 * dropdown is on the page (the fallback).
 */

/* ---- desktop dropdown ------------------------------------------------------------- */
.nav-menu.mm {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 0;
  padding: 0;
  width: min(1040px, calc(100vw - 48px));
  left: -120px;
  overflow: hidden;
}
.mm-rail {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 10px;
  border-right: 1px solid var(--line);
  max-height: min(70vh, 640px);
  overflow-y: auto;
}
.mm-tab {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.mm-tab:hover { background: var(--mist); }
.mm-tab[aria-selected='true'] { background: var(--brand-ink); color: var(--on-brand, #fff); }
.mm-tab:focus-visible, .mm-svc:focus-visible, .mm-feat:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.mm-count { font-size: 12px; font-weight: 500; opacity: .7; font-variant-numeric: tabular-nums; }
.mm-pane {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 22px 14px;
  min-width: 0;
  max-height: min(70vh, 640px);
  overflow-y: auto;
}
.mm-search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  background: var(--mist);
}
.mm-search-ico { width: 16px; height: 16px; flex: none; color: var(--muted); }
.mm-search input, .mm-m-search input {
  all: unset;
  flex: 1;
  min-width: 0;
  font-size: 14px;
  color: var(--ink);
}
.mm-search input::placeholder, .mm-m-search input::placeholder { color: var(--muted); }
.mm-panel { display: grid; gap: 12px; }
.mm-panel[hidden] { display: none; }
.mm-pop { display: grid; gap: 10px; }
.mm-label {
  margin: 0;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--gold-ink, var(--gold));
}
/* "All <category> services" as a link to the category page (when it has one) */
.nav-menu a.mm-cat-link { justify-self: start; text-decoration: none; }
.nav-menu a.mm-cat-link:hover, .nav-menu a.mm-cat-link:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
.mm-m-cat-link { display: block; padding: 10px 2px; font-weight: 700; color: var(--brand-ink); }
.mm-searching .mm-m-cat-link { display: none; }
.mm-feature { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.nav-menu .mm-feat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  white-space: normal;
}
.mm-feat-n { font-weight: 700; }
.mm-feat small { color: var(--muted); font-weight: 500; font-size: 12.5px; }
.mm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px 18px; }
.nav-menu .mm-svc { overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.nav-menu .mm-svc[hidden] { display: none; }
.mm-empty { color: var(--muted); padding: 12px 0; }
.mm-searching .mm-pop { display: none; }
.nav-menu.mm .nav-all { display: flex; flex-wrap: wrap; gap: 4px 24px; }

/* ---- mobile sheet ----------------------------------------------------------------- */
.mm-m { display: grid; gap: 12px; }
.mm-m-search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--mist);
}
.mm-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mm-tile {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
}
.mm-tile b { font-size: 13.5px; }
.mm-tile small { color: var(--muted); font-size: 12px; }
.mm-tile[aria-expanded='true'] { border-color: var(--brand-ink); box-shadow: inset 0 0 0 1px var(--brand-ink); }
.mm-tile:focus-visible, .mm-seeall:focus-visible { outline: 2px solid var(--gold); }
.mm-searching .mm-tiles { display: none; }
.mm-sheet { display: grid; gap: 0; border-top: 1px solid var(--line); padding-top: 8px; }
.mm-sheet[hidden] { display: none; }
.mm-sheet-h { display: flex; justify-content: space-between; font-weight: 700; padding: 4px 2px 6px; }
.mm-sheet-h span { color: var(--muted); font-weight: 500; }
.mm-m-svc {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-weight: 500;
}
.mm-m-svc small { color: var(--muted); }
.mm-m-svc[hidden] { display: none; }
.mm-sheet:not(.mm-all) .mm-later { display: none; }
.mm-searching .mm-sheet .mm-later:not([hidden]) { display: flex; }
.mm-searching .mm-seeall { display: none; }
.mm-seeall {
  all: unset;
  cursor: pointer;
  padding: 10px 2px;
  font-weight: 700;
  color: var(--gold-ink, var(--gold));
}
.mm-m-empty { color: var(--muted); margin: 0; }
.mm-m-foot { display: grid; gap: 4px; }
.mm-m-foot a { padding: 8px 2px; font-weight: 700; color: var(--brand-ink); }

@media (max-width: 1100px) {
  .nav-menu.mm { left: -60px; }
  .mm-grid, .mm-feature { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .nav-menu.mm { transition: none; }
}

/* ---- old-page adjustment (not in the CMS's file) ------------------------------------ */
/* /start and /start/flow set body line-height 1.65 (their 404.html chrome); the CMS pages
   and /track have 1.7, which the menu's sizes are drawn for. Measured in a browser: every
   row 0.6-1.3px shorter without this. Scoped to the menu's own panels, so the header row
   itself does not move. */
.nav-menu.mm, .mm-m { line-height: 1.7; }

/* Escape closed the panel (dg-services-menu.js): held shut while focus stays on "Services". */
.nav-drop.mm-esc .nav-menu { opacity: 0 !important; visibility: hidden !important; }
.nav-drop.mm-esc .nav-caret { transform: none !important; }
