.mosaic {
  width: 100%;
}

.mosaic-row {
  display: flex;
  margin-bottom: 10px;
}

.mosaic-row img {
  height: 100%;
  width: auto;
  object-fit: cover;
  display: block;
}

.mosaic-row img:not(:last-child) {
  margin-right: 10px;
}

/* IMAGE FADE-IN */
.mosaic img {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mosaic img.loaded {
  opacity: 1;
  cursor: pointer;
}

.mosaic img.loaded:hover,
.mosaic img.loaded.mosaic-hover {
  opacity: 0.8;
}

/* LIGHTBOX */
.mosaic-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.mosaic-lightbox.active {
  display: flex;
}

/* IMAGE */
.mosaic-lightbox img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;

  opacity: 1;
  transition: opacity 0.25s ease;

  /* Safari fix */
  will-change: opacity, transform;
  transform: translateZ(0);
  backface-visibility: hidden;

  z-index: 1;
}

/* fade */
.mosaic-lightbox img.fade-out {
  opacity: 0;
}

/* NAV */
.mosaic-lightbox .nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 28px;
  color: #fff;
  cursor: pointer;
  padding: 10px 16px;
  user-select: none;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  z-index: 2; /* 🔥 important fix */
}

.mosaic-lightbox .nav:hover {
  background: rgba(255, 255, 255, 0.2);
}

.mosaic-lightbox .prev {
  left: 10px;
}

.mosaic-lightbox .next {
  right: 10px;
}

/* CLOSE */
.mosaic-lightbox .close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 42px;
  color: #fff;
  cursor: pointer;
  z-index: 2; /* 🔥 fix */
}
