/* Wide screens: the documents are table-heavy, so use the width. */
.md-grid {
  max-width: 88rem;
}

/* Tables: smaller type, cells that wrap, a header that stays in view while a long
   table scrolls (wide screens), and a first column (the row id, e.g. "K12") in bold. */
.md-typeset table:not([class]) {
  font-size: 0.68rem;
  display: table;
  width: 100%;
}
.md-typeset table:not([class]) th,
.md-typeset table:not([class]) td {
  padding: 0.5em 0.7em;
  vertical-align: top;
  min-width: 4rem;
  overflow-wrap: anywhere;
}
/* The sticky header needs the table's wrapper not to be a scroll container, so it is
   only done where the table fits without scrolling sideways. 2.4rem: the site header. */
@media screen and (min-width: 76.25em) {
  .md-typeset__scrollwrap,
  .md-typeset__table {
    overflow: visible;
  }
  .md-typeset table:not([class]) {
    overflow: visible;
  }
  .md-typeset table:not([class]) th {
    position: sticky;
    top: 2.4rem;
    z-index: 1;
    background-color: var(--md-default-bg-color);
    box-shadow: 0 0.05rem 0 var(--md-typeset-table-color);
  }
}
.md-typeset table:not([class]) th {
  overflow-wrap: normal;
  word-break: normal;
}
.md-typeset table:not([class]) td:first-child {
  font-weight: 700;
}
.md-typeset table:not([class]) tbody tr:nth-child(even) {
  background-color: var(--md-default-fg-color--lightest);
}
.md-typeset table:not([class]) code {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Large diagrams are not shrunk below a readable size (website/hooks.py); they scroll
   sideways instead. */
.md-typeset div.mermaid {
  overflow-x: auto;
  text-align: center;
}

/* The draw.io diagrams (docs/assets/diagrams). Each has its own white background, so it
   reads the same in the light and in the dark theme. A diagram fits the column, on a
   phone too; a click or a tap opens it enlarged (the glightbox plugin), where it can be
   zoomed and dragged. The plugin wraps each image in a link. */
.md-typeset p:has(> a.glightbox > img[src*="diagrams/"]) {
  text-align: center;
}
.md-typeset img[src*="diagrams/"] {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  cursor: zoom-in;
}
.md-typeset p:has(> a.glightbox > img[src*="diagrams/"]) + p > em:only-child {
  display: block;
  text-align: center;
  font-size: 0.68rem;
  color: var(--md-default-fg-color--light);
}

/* The enlarged image. A diagram is an SVG about 1000 pixels wide, which the lightbox
   would show no larger than that: let it fill the window instead, undistorted. Its own
   white background and border are the frame, so the image box itself has none.
   !important: the lightbox writes "width: auto" on the image itself. Not while zoomed
   (a click, in a window narrower than the diagram), when the image has its full size
   and is dragged. On a touch screen the lightbox zooms by pinching, whatever the size. */
.glightbox-container .gslide-image img[src$=".svg"] {
  object-fit: contain;
  background: none;
}
.glightbox-container .gslide:not(.zoomed) .gslide-image img[src$=".svg"] {
  width: 96vw !important;
  max-height: 94vh;
}
/* With one image on a page there is nothing to step to. */
.glightbox-container .gprev.disabled,
.glightbox-container .gnext.disabled {
  display: none;
}
