/* the pan-and-zoom diagram viewer (diagram.js), as in the CalCOFI.io docs book
   (docs/libs/diagram.css) */
/* Quarto's mermaid styles its labels with this variable; it must name the same font as
   diagram.js's themeVariables.fontFamily, which mermaid measures the labels with. Set on
   the <pre> too: mermaid draws (and measures) inside it before Quarto swaps in the <svg> */
pre.mermaid-js, svg.mermaid-js {
  --mermaid-font-family: "Source Sans 3", "Source Sans Pro", "Segoe UI", Helvetica, Arial, sans-serif;
}
.cc-diagram-wrap {
  position: relative;
  width: 100%;
  margin: 0.5rem 0 1rem;
  border: 1px solid var(--bs-border-color, #dddddd);
  border-radius: 8px;
  background: var(--bs-body-bg, #ffffff);
  overflow: hidden;
  cursor: grab;
}
.cc-diagram-wrap:active { cursor: grabbing; }
.cc-diagram-wrap svg { display: block; max-width: none !important; }
/* top-LEFT: quarto's anchor link owns the figure's top-right corner */
.cc-diagram-wrap .cc-diagram-full {
  position: absolute; top: 0.4rem; left: 0.4rem;
  width: 2rem; height: 2rem; line-height: 1.8rem; font-size: 1.1rem; padding: 0;
  border: 1px solid var(--bs-border-color, #dddddd); border-radius: 6px;
  background: var(--bs-body-bg, #ffffff); color: var(--bs-body-color, #182b49);
  cursor: pointer; opacity: 0.85;
}
.cc-diagram-wrap .cc-diagram-full:hover { opacity: 1; }
/* svg-pan-zoom's own +/−/reset icons sit bottom-right */
.cc-diagram-wrap #svg-pan-zoom-controls, .cc-diagram-wrap .svg-pan-zoom-control { opacity: 0.85; }
.cc-diagram-wrap.is-full {
  position: fixed; inset: 0; z-index: 2000; margin: 0;
  height: 100vh !important; width: 100vw;
  border: 0; border-radius: 0;
}
body.cc-diagram-open { overflow: hidden; }
