.overlay-wrapper {
  background: rgb(222 222 222);
  contain: paint;
  display: flex;
  margin: 0;
  place-content: center center;
  position: relative;
}

.overlay-image {
  object-fit: contain;
  opacity: 0;
  position: relative;
}

.main-image {
  inset: 0;
  position: absolute;
}

.thumbnail-image {
  filter: blur(30px);
}

.plain-image {
  transition: max-height 0.3s ease, max-width 0.3s ease;
}

.overlay-wrapper img[data-loaded="true"] {
  opacity: 1;
  transition: opacity 0.2s ease;
}

.img-description {
  background-color: rgb(255 255 255 / 85%);
  border-radius: 4px;
  display: none;
  font-size: 0.8rem;
  max-width: calc(100% - (2 * 0.45em ) - 24px);
  overflow: hidden;
  padding: 0.15em 0.45em;
  position: absolute;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.img-description.show-center {
  max-width: calc(100% - (2 * 0.45em ) - (2 * 24px));
}

.img-description.show-always {
  display: block;
}

.img-description.show-on-hover.show-top {
  display: block;
  transform: translateY(-100%);
  transition: transform 150ms ease-in;
}

.img-description.show-on-hover.show-bottom {
  display: block;
  transform: translateY(100%);
  transition: transform 150ms ease-in;
}

.img-description.show-right {
  right: 0;
}

.img-description.show-left {
  left: 0;
}

.img-description.show-bottom {
  bottom: 0;
}

.img-description.show-left.show-top {
  left: 24px;
}

.overlay-wrapper:hover .img-description.show-on-hover {
  transform: translateY(0);
}

.overlay-button {
  background-color: rgb(255 255 255 / 0%);
  border: none;
  color: rgb(96 96 96);
  cursor: pointer;
  height: 24px;
  padding: 0;
  position: absolute;
  visibility: hidden;
  width: 24px;
}

.overlay-button-close {
  left: 0;
  top: 0;
}

.overlay-button-left,
.overlay-button-right {
  top: calc(50% - 12px);
}

.overlay-button-left {
  left: 0;
  padding: 0 0 0 6px;
}

.overlay-button-right {
  right: 0;
}

.overlay-wrapper:hover .overlay-button.show-on-hover {
  background-color: rgb(255 255 255 / 50%);
  color: rgb(64 64 64);
  visibility: initial;
}

.overlay-button.show-always {
  background-color: rgb(255 255 255 / 50%);
  color: rgb(64 64 64);
  visibility: initial;
}
