/* Block wrapper so max-width % resolves against the content column
   (inline-block + large intrinsic size overflows the page). */
.img-lightbox {
  display: block;
  width: fit-content;
  max-width: 100%;
  cursor: zoom-in;
  text-decoration: none;
  margin-block: 0.75rem;
}

.img-lightbox img,
.post-content img,
article .body img {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
}

/* SVGs often have huge intrinsic viewBoxes — force fit */
.post-content img[src$=".svg"],
article .body img[src$=".svg"],
.img-lightbox img[src$=".svg"] {
  width: 100%;
  max-width: 100%;
  height: auto;
}

.img-caption {
  display: block;
  margin: 0.35rem 0 1rem;
  font-size: 0.9em;
  opacity: 0.8;
  text-align: center;
}

.image-lightbox {
  padding: 0;
  border: 0;
  max-width: min(96vw, 1200px);
  max-height: 96vh;
  background: transparent;
  color: inherit;
}

.image-lightbox::backdrop {
  background: rgba(0, 0, 0, 0.85);
}

.image-lightbox__img {
  display: block;
  max-width: min(96vw, 1200px);
  max-height: 92vh;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 0 auto;
  border-radius: 2px;
}

.image-lightbox__close {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 1;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.7);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.image-lightbox__close:hover,
.image-lightbox__close:focus-visible {
  background: rgba(20, 20, 20, 0.95);
  outline: 2px solid #fff;
  outline-offset: 2px;
}
