/* A figure in a public page's text (docs/plans/physics-page.md M3): an image alone in its paragraph, which Page renders as
   <figure class="c-figure"><img class="c-figure__image" …><figcaption class="c-figure__caption">…</figcaption></figure>.
   The image is as wide as the text block, as a plate in a book is as wide as the type area; an SVG drawing has no size of
   its own and takes that width, a raster image is scaled to it. A tall image (a portrait) is kept within most of the
   window's height, contained and centred in its box, so that it never fills more than a screen. In c-markdown it is a
   break in the running text, with a line of space around it (_markdown.css). */

.c-figure { margin-inline: auto; }

/* A portrait plate (Page adds c-figure--portrait when the image is taller than it is wide): set narrower and centred on the
   text block, as a book sets an engraved portrait, so that it does not fill the page; the caption keeps to its width. On a
   phone the text block is narrow, so the plate takes more of it. */
.c-figure--portrait { width: 58%; }

@media (max-width: 36rem) {
  .c-figure--portrait { width: 78%; }
}

/* width and height attributes (from the file's header) give the box its proportions before a lazily loaded image arrives. */
.c-figure__image { display: block; width: 100%; height: auto; max-height: 85vh; object-fit: contain; }

/* The caption, from the image's title: centred under the image in the text's roman, a little smaller, as a book's legend. */
.c-figure__caption { margin-top: 0.6em; font-size: var(--size-small); line-height: 1.35; text-align: center; text-wrap: balance; hyphens: manual; }
