/* Belanger – Image Modal (Lightbox) */
:root {
  --bel-modal-backdrop: rgba(0, 0, 0, 0.75);
  --bel-modal-max: 1600px; /* cap both width & height */
}

/* Modal root (hidden by default) */
.bel-img-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  grid-template-areas: "stack";
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s ease, visibility 0s linear .18s;
}

/* Visible state */
.bel-img-lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity .18s ease;
}

/* Dark backdrop */
.bel-img-backdrop {
  grid-area: stack;
  background: var(--bel-modal-backdrop);
}

/* Dialog container centered */
.bel-img-dialog {
  grid-area: stack;
  margin: auto;
  position: relative;
  max-width: min(var(--bel-modal-max), 90vw);
  max-height: min(var(--bel-modal-max), 90vh);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* The enlarged image */
.bel-img-dialog img {
  max-width: 100%;
  max-height: 100%;
  display: block;
  border-radius: 10px;
  box-shadow: 0 12px 36px rgba(0,0,0,.55);
  background: #fff;
}

/* Close button (top-right of the image) */
.bel-img-close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.98);
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  font-size: 26px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  user-select: none;
}

.bel-img-close:hover { filter: brightness(.96); }

/* Loading spinner while hi-res image loads */
.bel-spinner {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.bel-spinner::after {
  content: "";
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.65);
  border-top-color: rgba(255,255,255,.15);
  animation: belspin 1s linear infinite;
}

/* Ensure [hidden] truly hides, even if a global reset overrides it */
.bel-img-lightbox [hidden] { display: none !important; }


@keyframes belspin { to { transform: rotate(360deg); } }

/* Prevent background scroll when open */
body.bel-no-scroll { overflow: hidden; }

.bel-modal-cursor { cursor: zoom-in; }

@media (prefers-reduced-motion: reduce) {
  .bel-img-lightbox { transition: none; }
}
