/* NSAIT shared layout — ONE content-width rule for every public page.
   unify-menu-width-20261124 (stage only). Loaded LAST on every page so it wins
   over the per-page :where(.pg-*) and body.forces-page --max overrides.
   Same max-width and same side padding on desktop and mobile:
     content box = min(100% - 2 x 1rem, 1280px), centred.
   Full-width map canvases (map.html #map, forces.html .fdash-shell) are NOT
   constrained; their header/menu, footer and text panels follow the rule. */

:root {
  --nsait-content-max: 1280px;
  --nsait-content-pad: 1rem;
  --nsait-gutter: max(var(--nsait-content-pad), calc((100% - var(--nsait-content-max)) / 2));
}

/* The shared class (use .nsait-content on any new text/image block). */
.nsait-content,
html .site-header .header-inner,
html body .wrap,
html body .wrap-wide,
html body .status-strip .wrap,
html body .op-shell > .wrap,
html body .forces-wrap {
  box-sizing: border-box;
  width: min(100% - 2 * var(--nsait-content-pad), var(--nsait-content-max));
  max-width: none;
  margin-left: auto;
  margin-right: auto;
  padding-left: 0;
  padding-right: 0;
}

/* A wrap nested in another content box must not be inset twice. */
html body .wrap .wrap,
html body .forces-wrap .wrap,
html body .nsait-content .wrap,
html body .nsait-content .nsait-content {
  width: 100%;
}

/* map.html: the map stays full-bleed; the HUD bars and side panels sit on the
   same content edges as every other page. */
html.pg-map .map-hud-top,
html.pg-map .map-hud-bottom {
  padding-left: var(--nsait-gutter);
  padding-right: var(--nsait-gutter);
}
@media (min-width: 901px) {
  html.pg-map .map-panel { left: var(--nsait-gutter); }
  html.pg-map .hot-flow { right: var(--nsait-gutter); }
}

/* Same X item markup as index; Map's desktop HUD shows 'X' like .site-header
   does at >= 881px, the mobile menu shows 'X · @nsait_desk'. */
@media (min-width: 881px) {
  html.pg-map .map-hud-nav .nav-x-handle { display: none; }
}

/* forces.html: the map row (.fdash-mapwrap) stays full-width
   (min(1440px, 100vw - 32px), as set in forces-layout-20261122.css); the
   text panels below it sit on the shared content edges.
   --nsait-fdash-off = shared gutter - dashboard gutter - dashboard 1px border
   (= -1px on mobile, where both gutters are 1rem). */
html body.forces-page {
  --nsait-fdash-off: calc(max(var(--nsait-content-pad), (100vw - var(--nsait-content-max)) / 2) - max(1rem, (100vw - 1440px) / 2) - 1px);
}
html body.forces-page .fdash-shell > .fdash-panel-toggle,
html body.forces-page .fdash-shell > .fdash-panel {
  box-sizing: border-box;
  justify-self: start;
  width: min(100vw - 2 * var(--nsait-content-pad), var(--nsait-content-max));
  max-width: none;
  min-width: 0;
  margin-left: var(--nsait-fdash-off);
  margin-right: 0;
}
