/* Hide the PSF logo image and the "Python" home link in the breadcrumb */
img[alt="Python logo"],
a[href*="python.org"] { display: none !important; }

/* Optional: also hide the leftover separator right after that link */
a[href*="python.org"] + * { display: none !important; }

/* hide theme's logo img and show our favicon instead */
.nav-logo img {
  display: none !important;
}

/* replace the hidden img with a background image using your favicon (png recommended) */
.nav-logo {
  display: inline-block !important;
  width: 36px;       /* adjust size as needed */
  height: 36px;
  background: url("_static/favicon.png") center/contain no-repeat !important;
  background-size: contain !important;
}

/* Force consistent unexpanded thumbnail allocation for selected figure grids. */
figure.fig-tight-equal-thumb {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

figure.fig-tight-equal-thumb .reference.internal.image-reference {
  position: relative;
  display: block;
  width: 100%;
  height: clamp(220px, 22vw, 300px);
  overflow: hidden;
}

figure.fig-tight-equal-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

figure.fig-tight-single-thumb .reference.internal.image-reference {
  width: min(50%, 420px);
  height: clamp(220px, 22vw, 300px);
  overflow: hidden;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

figure.fig-tight-single-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}