/* Keyword reference tables: the first column holds one identifier. Never
   break inside it - the theme's code spans break words to keep tables
   narrow, which wraps a keyword's last characters onto a second line. The
   description column is where the width should give. */
.md-typeset table:not([class]) td:first-child code {
  white-space: nowrap;
}

/* Center images via `![...](...){ .center }`. The centering comes from the
   paragraph, not from making the image a block - so several .center images
   in one paragraph stay one centered row instead of stacking. The anchor
   variant keeps it working when glightbox wraps the image. */
p:has(> img.center),
p:has(> a > img.center) {
  text-align: center;
}
img.center {
  display: inline-block;
}

/* A figure holding a row of images (several screenshots under one caption):
   the theme's `figure img { display: block }` would stack them, and its
   `width: fit-content` makes percentage widths unresolvable. Only figures with
   more than one image are affected; single-image figures keep the theme's
   styling. The anchor variant is what glightbox produces. */
.md-typeset figure:has(> p > a + a),
.md-typeset figure:has(> p > img + img) {
  width: 100%;
}
.md-typeset figure:has(> p > a + a) img,
.md-typeset figure:has(> p > img + img) img {
  display: inline-block;
  margin: 0;
}
