/* MkDocs Material extras for xpict docs */

/*
 * Gallery / example figures keep the SVG's intrinsic width/height so every
 * molecule shares one chemical scale (bond length ≈ constant). Do not stretch
 * images to a common card size.
 */
.gallery-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: flex-end;
  margin: 1.5rem 0 2rem;
}

.gallery-grid figure {
  margin: 0;
  padding: 0.75rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.4rem;
  background: var(--md-default-bg-color);
  text-align: center;
  flex: 0 0 auto;
  width: max-content;
  max-width: 100%;
}

.gallery-grid img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  margin: 0 auto 0.5rem;
}

.gallery-grid figcaption {
  font-size: 0.8rem;
  color: var(--md-default-fg-color--light);
}

/* Code walkthrough: resulting SVG under each sample (same scale rule) */
.example-out {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  margin: 0.75rem 0 1.5rem;
}

.example-out figure {
  margin: 0;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.4rem;
  background: var(--md-default-bg-color);
  text-align: center;
  flex: 0 0 auto;
  width: max-content;
  max-width: 100%;
}

.example-out img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  margin: 0 auto 0.35rem;
}

.example-out figcaption {
  font-size: 0.75rem;
  color: var(--md-default-fg-color--light);
}

.api-frame {
  position: relative;
  width: 100%;
  height: min(70vh, 720px);
  margin: 1rem 0 1.5rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.4rem;
  overflow: hidden;
  background: var(--md-default-bg-color);
}

.api-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}
