/* Navigator map (00_Overview §3). The map is wide and dense; we ship it as a
   pre-rendered, theme-neutral SVG (crisp vector <text> labels) and let the
   reader pan/zoom it. Two layers, in priority order:

   1. FALLBACK (assets/mermaid-zoom.js or the fetch did not run): the page's
      <img class="nav-map"> shows the SVG as a crisp static image, scaled to fit.
   2. ENHANCED (the script inlined the SVG): a bounded, letterboxed frame that is
      the viewport to pan/zoom within, with visible controls + a caption.

   The SVG is deliberately self-contained (dark node chips + mid-grey edges +
   dark edge-label pills), so it reads on both the light and the dark palette. */

/* ---- 1. Fallback: the static image ---- */
.md-typeset img.nav-map {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1em auto;
}

/* ---- 2. Enhanced: bounded zoom frame (added by the JS) ---- */
.md-typeset .mzoom-frame {
  position: relative;
  width: 100%;
  height: 62vh;
  min-height: 340px;
  max-height: 820px;
  margin: 1em 0;
  overflow: hidden;                 /* letterbox: pan/zoom replaces scrolling */
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.2rem;
  background: var(--md-default-bg-color);
  cursor: grab;
  outline: none;
  touch-action: pan-y;              /* keep vertical page scroll on touch */
}
.md-typeset .mzoom-frame.mzoom-grabbing { cursor: grabbing; }
.md-typeset .mzoom-frame:focus-visible {
  border-color: var(--md-accent-fg-color);
  box-shadow: 0 0 0 2px var(--md-accent-fg-color);
}

/* The element the JS transforms; origin at top-left so fit math is exact.
   No will-change: promoting it to a raster layer blurs the vector on zoom. */
.md-typeset .mzoom-frame .mzoom-inner {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
}
.md-typeset .mzoom-frame .mzoom-inner > svg {
  display: block;
  max-width: none !important;
}

/* ---- Controls: real <button>s, palette-aware, legible in light + dark ---- */
.md-typeset .mzoom-nav {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  z-index: 2;
}
.md-typeset .mzoom-nav .mzoom-btn {
  width: 2rem;
  height: 2rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  color: var(--md-default-fg-color);
  background: var(--md-default-bg-color);
  border: 1px solid var(--md-default-fg-color--light);
  border-radius: 0.2rem;
  box-shadow: var(--md-shadow-z1);
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.md-typeset .mzoom-nav .mzoom-btn:hover {
  background: var(--md-accent-fg-color);
  color: var(--md-accent-bg-color, var(--md-default-bg-color));
  border-color: var(--md-accent-fg-color);
}
.md-typeset .mzoom-nav .mzoom-btn:focus-visible {
  outline: 2px solid var(--md-accent-fg-color);
  outline-offset: 1px;
}

/* ---- Caption under the frame (locale text set by JS) ---- */
.md-typeset .mzoom-caption {
  margin: 0.3rem 0 1em;
  font-size: 0.72rem;
  line-height: 1.3;
  color: var(--md-default-fg-color--light);
  font-style: italic;
  text-align: center;
}

@media screen and (max-width: 44.9em) {
  .md-typeset .mzoom-frame { height: 56vh; min-height: 300px; }
}

@media print {
  .md-typeset .mzoom-frame { height: auto; max-height: none; overflow: visible; border: none; }
  .md-typeset .mzoom-nav, .md-typeset .mzoom-caption { display: none; }
  .md-typeset .mzoom-frame .mzoom-inner { position: static; transform: none !important; }
}
