/* Shared by Markdown, imported legacy images, and article headers. No JavaScript. */
.post-image {
  display: block;
  margin: 1.5rem auto .5rem;
  text-align: center;
}
.image-popover-trigger,
.image-original-fallback {
  box-sizing: border-box;
  width: 80%;
  max-width: 640px;
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: zoom-in;
}
.image-popover-trigger { display: none; }
.image-original-fallback { display: block; }
.content .post-image .image-thumbnail {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(65vh, 600px);
  margin: auto;
}
.content p:has(> .post-image) > em,
.content figure:has(.post-image) > figcaption {
  display: block;
  text-align: center;
  font-size: .92em;
}
.image-popover-trigger:focus-visible,
.image-original-fallback:focus-visible,
.image-popover-close:focus-visible {
  outline: 3px solid #0284c7;
  outline-offset: 5px;
}
/* Hide enlarged copies in browsers that do not understand popover. */
.image-popover { display: none; }
@supports selector(:popover-open) {
  .image-popover-trigger { display: block; }
  .image-original-fallback { display: none; }
  .image-popover:popover-open {
    box-sizing: border-box;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: .75rem;
    width: calc(100vw - 2rem);
    max-width: none;
    height: calc(100vh - 2rem);
    height: calc(100dvh - 2rem);
    max-height: none;
    inset: 0;
    margin: auto;
    padding: 3.5rem 1rem 1rem;
    border: 1px solid #64748b;
    border-radius: .5rem;
    background: #101820;
    color: #fff;
  }
  .image-popover::backdrop { background: #000c; }
}
.image-popover-close {
  position: absolute;
  top: .65rem;
  right: .75rem;
  padding: .45rem .8rem;
  border: 1px solid #cbd5e1;
  border-radius: .3rem;
  background: #fff;
  color: #111827;
  font: 1rem system-ui, sans-serif;
  cursor: pointer;
}
.image-popover-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  height: 100%;
}
.content .image-popover-stage img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.image-popover-caption { font: .9rem/1.4 system-ui, sans-serif; }
.image-popover-caption::before { content: attr(data-caption); }
.image-popover-close svg { display: block; }
