/* ====== Lightbox ====== */
.lightbox[aria-hidden="true"] {
  display: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
}

.lightbox-dialog {
  position: relative;
  z-index: 1;
  height: 100%;
  width: 90%;
  max-width: 1200px;
  margin: auto;
  /*
  display: grid;
  grid-template-columns: fit-content(50px) minmax(200px, 1fr) fit-content(50px);
  align-items: center;
  gap: 8px;
  padding: 16px;
  */
}


.lightbox-figure {
  margin: 0;
  display: grid;
  place-items: center;
  width: 100%;
  height: calc(100vh - 32px);
  padding: 1em;
}
  

#lightbox-img {
  /* Show full image without cropping; constrained to viewport
  max-width: min(800px, 82vw);
  max-height: 92vh;
   */
  width: 100%;
  max-width: min(1000px, 92vw);
  max-height: 92vh;
  height: auto;
  object-fit: contain;
  display: block;
  background: transparent;
  border-radius: var(--border-radius-lg);
}

/*
.lightbox-btn {
  appearance: none;
  background: white; /*rgba(255,255,255,0.12);
  color: gray;
  border-radius: 10px;
  cursor: pointer;
  
  font-size: 28px;
  line-height: 1;
  user-select: none;
}
*/


.lightbox-btn:focus-visible {
  outline: 3px solid rgba(255,255,255,0.8);
  outline-offset: 2px;
}

.lightbox-close {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 2rem;
  font-weight: bold; 
  color: white;
  padding: 1rem;
  border-radius: 50%;
  cursor: pointer;
}


/* Next & previous buttons */
.lightbox-prev,
.lightbox-next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  width: auto;
  padding: 1rem;
  margin-top: -4rem;
  color: white;
  font-weight: bold;
  font-size: 4rem;
  text-shadow: 0px 0px 50px black;
  transition: 0.6s ease;
  border-radius: 0 3px 3px 0;
  user-select: none;
  -webkit-user-select: none;
}

/* Position the "next button" to the right */
.lightbox-next {
  right: 0;
  border-radius: 3px 0 0 3px;
}

/* On hover, add a black background color with a little bit see-through */
.lightbox-prev:hover,
.lightbox-next:hover,
.lightbox-close:hover {
  background-color: rgba(0, 0, 0, 0.8);
}
