/* The 2x2 overview (Home, Gallery; tools/build_overview.py): two columns, one on phones. */
.isc-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 1rem 0 1.5rem;
}
.isc-overview figure {
  margin: 0;
  width: 100%; /* Material's figures are fit-content: a 256 px movie would not fill its cell */
}
.isc-overview img {
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  border-radius: 4px;
}
.isc-overview figcaption {
  font-size: 0.7rem;
  margin-top: 0.3rem;
  color: var(--md-default-fg-color--light);
}
@media (max-width: 600px) {
  .isc-overview {
    grid-template-columns: 1fr;
  }
}

/* The 3D overview (tools/build_hero.mjs) on Home and at the top of the gallery. */
.isc-hero {
  margin: 1rem 0 0.6rem;
  width: 100%;
}
.isc-hero img {
  width: 100%;
  height: auto;
  border-radius: 4px;
}

/* Physics figures (tools/build_physics_figures.py, injected by tools/build_site.sh). */
.md-typeset .isc-fig {
  width: 100%;
  margin: 1em 0;
}
.md-typeset .isc-fig img {
  width: 100%;
  height: auto;
}
/* Camera images and movies at their own pixels, scaled up by the browser: square pixels, not smoothed. */
.md-typeset .isc-fig img.isc-px {
  image-rendering: pixelated;
}
.md-typeset .isc-fig figcaption {
  max-width: none;
  margin: 0.4em 0 0;
  font-size: 0.7rem;
  font-style: normal;
  text-align: left;
  color: var(--md-default-fg-color--light);
}
/* Comparison tables: one column per level; camera images keep square pixels and share the width between the
   columns (--isc-n, set per table); below their minimum the table scrolls sideways (Material's table wrapper). */
.md-typeset .isc-cmp {
  container-type: inline-size;
}
.md-typeset .isc-cmp table:not([class]) {
  font-size: 0.64rem;
  line-height: 1.3;
}
.md-typeset .isc-cmp table:not([class]) th,
.md-typeset .isc-cmp table:not([class]) td {
  padding: 0.3em 0.35em;
  min-width: 0;
  vertical-align: middle;
}
.md-typeset .isc-cmp th code {
  white-space: nowrap;
}
/* The row labels: small and narrow, so the images get the width. */
.md-typeset .isc-cmp:not(.isc-nolabel) table:not([class]) td:first-child,
.md-typeset .isc-cmp:not(.isc-nolabel) table:not([class]) th:first-child {
  width: 5.5rem;
  max-width: 6.5rem;
  padding-left: 0.1em;
  font-size: 0.58rem;
  font-weight: normal;
  color: var(--md-default-fg-color--light);
}
.md-typeset .isc-cmp img.isc-px {
  image-rendering: pixelated;
  width: clamp(3.5rem, calc((100cqw - 6.5rem) / var(--isc-n, 4) - 0.8rem), 11rem);
  height: auto;
  max-width: none;
  display: block;
  margin: 0 auto;
}
.md-typeset .isc-nolabel img.isc-px {
  width: clamp(3.5rem, calc(100cqw / var(--isc-n, 4) - 0.8rem), 11rem);
}
.md-typeset .isc-small img.isc-px {
  width: clamp(3rem, calc((100cqw - 6.5rem) / var(--isc-n, 4) - 0.8rem), 7rem);
}

/* Navigation links that leave the docs (javascripts/nav-external.js): an "open in new" icon after the title. */
.md-nav__link.isc-ext::after {
  content: "";
  flex: none;
  width: 0.7rem;
  height: 0.7rem;
  margin-left: 0.3rem;
  background-color: currentColor;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z"/></svg>') center / contain no-repeat;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z"/></svg>') center / contain no-repeat;
}

/* The big "open the viewer" button (quickstart.md). */
.md-typeset .isc-launch {
  text-align: center;
  margin: 1.6rem 0 2rem;
}
.md-typeset .isc-launch .md-button {
  font-size: 1rem;
  padding: 0.8em 2.2em;
}
.md-typeset .isc-launch p {
  margin: 0.6rem 0 0;
  font-size: 0.7rem;
  color: var(--md-default-fg-color--light);
}

/* Gallery rows (tools/build_gallery.py): the panels of one comparison side by side, two per line on phones. */
.md-typeset .isc-row {
  display: grid;
  grid-template-columns: repeat(var(--isc-n, 3), minmax(0, 1fr));
  gap: 0.6rem;
  margin: 1rem 0 0.3rem;
}
.md-typeset .isc-row figure {
  margin: 0;
  width: 100%;
}
.md-typeset .isc-row img {
  width: 100%;
  max-width: 20rem;
  height: auto;
  image-rendering: pixelated;
  border-radius: 4px;
}
.md-typeset .isc-row figcaption {
  max-width: none;
  margin: 0.25rem 0 0;
  font-size: 0.68rem;
  font-style: normal;
  color: var(--md-default-fg-color);
}
.md-typeset .isc-row-cap {
  margin: 0.2rem 0 1.4rem;
  font-size: 0.72rem;
  color: var(--md-default-fg-color--light);
}
@media (max-width: 600px) {
  .md-typeset .isc-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
