/* Custom stylesheet for the Composing Programs site. Loaded by the book theme
 * via `site.options.style: custom.css` in myst.yml, so it applies to both the
 * `jupyter book start` dev server and the static export. */

/* This repository is private and the published book is a plain static site:
 * hide the "Download" control the book theme adds to every notebook page.
 * (The static build also strips the underlying source export in build.sh.) */
.myst-fm-downloads-dropdown {
  display: none !important;
}

/* Interface icons (such as the VS Code Extensions icon in section 1.1) appear
 * within a sentence, so size them to the surrounding text rather than letting
 * the theme lay them out as standalone figures. The build renames images with a
 * content hash, hence the substring match on the source file name. */
img[src*="vscode_extension"] {
  display: inline;
  width: auto;
  height: 1.1em;
  margin: 0 0.1em;
  vertical-align: -0.15em;
}

/* MyST wraps every image in a <picture> element, which the theme's prose styles
 * lay out as a block with 2em of margin above and below. Collapse that wrapper
 * for inline icons as well, or the icon still breaks out of the sentence. */
picture:has(img[src*="vscode_extension"]) {
  display: inline;
  margin: 0;
}

/* Environment-diagram iframes render their own chrome; keep them flush. */
iframe.env-diagram {
  border: none;
  width: 100%;
}
