/* Readable line length.

   sphinx-book-theme overrides pydata's max-width on the article with
   calc(100% - var(--pst-sidebar-secondary)), which assumes a primary sidebar is
   eating the left of the window. Without one the article stretches across the
   whole screen and the lines get far too long to read.

   Cap the column, then cap the text inside it more tightly and centre it, so the
   prose keeps a comfortable measure while the figures still get the full
   column. */
.bd-main .bd-content .bd-article-container {
  max-width: 68rem;
}

.bd-article h1,
.bd-article h2,
.bd-article h3,
.bd-article h4,
.bd-article p,
.bd-article ul,
.bd-article ol,
.bd-article dl,
.bd-article blockquote,
.bd-article table {
  max-width: 46rem;
  margin-left: auto;
  margin-right: auto;
}

/* The figures are shared with the poster: dark ink on a transparent canvas,
   drawn for white paper. Give them their own white plate so they stay readable
   when the theme is in dark mode. */
figure img {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.75rem;
  /* Every figure directive sets :width: to the SVG's viewBox width, so all
     figures render at the same scale (1px per SVG unit) and their fonts come
     out the same size. max-width keeps wide figures inside the column. */
  max-width: 100%;
  height: auto;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

figure figcaption {
  margin-top: 0.6rem;
}
