body {
  margin: 1%;
  /* padding: 14px; */
  background-color: #eee;
  font-family: Arial, Helvetica, sans-serif;
  display: flex;
  flex-wrap: wrap;
}

header, footer {
  width: 100%;
  text-align: center;
  font-size: 12x;
  margin-bottom: 10px;
  font-weight: bold;
  width: 100%;
  height: 5%;
}

#next, #last, #close {
  font-size: 48px;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
  padding: 10px;
}

#close {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 36px;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
}

.viewer {
  width: 95%;
  max-height: 80%;
  overflow: hidden;
  border: 2px solid black;
  height: auto;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: white;
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.viewer.hidden {
  width: 100%;
  border: 2px solid black;
  visibility: hidden
}

.viewer .image,
.viewer .image img {
  height: 60%;
  width: auto;
  max-width: 90%;
}

.viewer .last, .viewer .next {
  z-index: 10001;
} 

article {
  height: 124px;
  display: inline;
  margin: 20px 2px;
}

article a {
  height: 128px;
}

img {
  height: 128px;
  width: 128px;
  opacity: 0.7;
  transform: scale(1);
  transition: transform, 0.1s;
  z-index: 1;
  position: relative;
  /* border: 4px solid, lightgrey; */
  border-radius: 2px;
  margin: 2px;
  /* padding: 1px; */
  cursor: pointer;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  background-color: darkgrey;
  opacity: 0.8;
  visibility: hidden;
  height: 100%;
  width: 100%;
}

.overlay.visible {
  visibility: visible;
}

.reflection {
  opacity: 0.7;
  height: 128px;
  background-repeat: no-repeat;
  background-size: cover;
  position: relative;
  top: -135px;
}

article:hover img {
  opacity: 1;
  transform: scale(1.3);
  z-index: 9001;
  top: -10px;
  border-color: transparent;
  border-bottom: 0;
  --p: 10%;
  /* control the shape (can be percentage) */
  aspect-ratio: 3/2;
  clip-path: polygon(var(--p) 100%, calc(100% - var(--p)) 100%, 100% 0, 0 0);

  background: #542437;
  border-color: transparent
}

article:hover .reflection {
  transform: scaleY(0.3);
  top: -84px;
  box-shadow: 0px -50px 80px 40px rgba(0, 0, 0, 0.5);
  -webkit-box-reflect: below 0 linear-gradient(transparent, white);
}

img.big {
  width: unset;
  transform: scale(7);
  transition: transform, width, 1s;
  z-index: 9000;
  opacity: 1;
  box-shadow: 2px 4px 8px 4px black;
  transition: transform, width, 0.1s;
}


@media (width <=800px) {
  body {
    background-color: grey;
    font-family: Arial, Helvetica, sans-serif;
    padding: 2px;
    margin: 2px;
  }

  img, .reflection {
    height: 85px;
    width: 85px;
    margin: 1px;
    padding: 0px;
  }

  .reflection {
    top: -90px;
  }

  /* img.big {
    width: unset;
    transform: scale(4);
    transition: transform, width, 0.5s;
    z-index: 9000;
    opacity: 1;
    box-shadow: 2px 4px 8px 4px black;
    transition: transform, width, 0.1s;
  } */
}