/* === Inline images (in posts) === */

/* Center all inline figures by default */
.content figure.image,
article figure.image {
  margin-left: auto;
  margin-right: auto;
}

/* Keep visible figure captions tidy */
figure.image figcaption {
  text-align: center;
  color: #7a7a7a;          /* Bulma grey */
  font-size: 0.875rem;     /* ~ is-size-7 */
  margin-top: .5rem;
}


/* === Lightbox modal === */

/* Make the modal content centered without covering the full width */
.modal .modal-content {
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: auto;           /* was 100% — let background show around image */
  max-width: 96vw;
  max-height: 92vh;      /* leave room for caption */
  margin: 0;
  padding: 0;
}

/* Stack image + caption and keep them centered */
.modal .modal-content .image {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;              /* remove default figure margins */
}

/* Reserve vertical space for the caption so it doesn't push off-screen */
.modal .modal-content img {
  max-width: 96vw;
  max-height: calc(92vh - 3.25rem);  /* room for caption (~3.25rem) */
  height: auto;
  width: auto;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
}

/* Caption inside the lightbox */
.modal #lb-cap {
  max-width: 90vw;
  margin-top: .5rem;
  text-align: center;
  color: #ddd;
  font-size: 0.95rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

/* Make sure the × button is visible and tappable above modal-content */
.modal .modal-close {
  position: fixed;      /* float it over the content */
  top: calc(1rem + env(safe-area-inset-top));
  right: calc(1rem + env(safe-area-inset-right));
  z-index: 1001;        /* higher than modal-content */
  display: block;
  opacity: 1;           /* ensure visible */
  pointer-events: auto; /* clickable even if content is pointer-events:none */
}

/* Slightly larger hit target on mobile */
@media (max-width: 480px) {
  .modal .modal-close.is-large {
    width: 56px;
    height: 56px;
  }
}

.modal .modal-close span {
  display: block;
  line-height: 1;
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
}