/* Image lightbox: a native <dialog> opened with showModal(), see Head.astro.
   It renders in the browser's top layer, above every z-index on the site. */
main img:not(a img):not([data-clickable] img) {
  cursor: zoom-in;
}

main img {
  max-width: 100%;
}

#image-lightbox {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 1.5rem;
  border: 0;
  background: transparent;
  cursor: zoom-out;
  overflow: hidden;
}

#image-lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

#image-lightbox::backdrop {
  background: rgba(255, 255, 255, 0.85);
}

[data-theme="dark"] #image-lightbox::backdrop {
  background: rgba(0, 0, 0, 0.85);
}

#image-lightbox img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: zoom-out;
}

#image-lightbox button {
  position: absolute;
  inset-block-start: 0.75rem;
  inset-inline-end: 1rem;
  padding: 0 0.5rem;
  border: 0;
  background: transparent;
  color: var(--foreground, currentColor);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}
