
.gallery {
  display: flex;
  padding: 0;
  flex-wrap: wrap;
  --width: attr(data-width px);
  --height: attr(data-height px);
}
.gallery li {
  display: block;
  position:relative;
  margin: 0;
  padding: 0;
  overflow: hidden;
  width: 200px;
  height: 150px;
  width: var(--width);
  height: var(--height);
}
.gallery img {
  margin: 0;
  object-fit: cover;
  width: 100%;
  height: 100%;
  transition: 200ms;
}
.gallery li:hover img {
  margin: -10%;
  width: 120%;
  height: 120%;
}
.gallery li::before {
  content: "";
  display: block;
  position: absolute;
  z-index: 2;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0);
  transition: 200ms;
  pointer-events: none;
}
.gallery li:hover::before {
  background-color: rgba(0, 0, 0, 0.3);
}

.dialog {
  position: fixed;
  z-index: 3;
  top: 0; left: 0; bottom: 0; right: 0;
  margin: 1em;
  padding: 1em;
  opacity: 0;
  background-color: rgba(255,255,255,0.8);
  border: 1px solid rgba(0,0,0,0.2);
  visibility: hidden;
  transition: 200ms;
}
.dialog.show {
  opacity: 1;
  visibility: visible;
}
.view {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
}
.view.show {
  opacity: 1;
  transition: 200ms;
}