* {
  margin: 0;
  padding: 0;
}

html {
  font-size: 12px;
}

body {
  padding: 2rem 5rem;
}

h1 {
  width: 100%;
  font-size: 2rem;
  margin-bottom: 2rem;
  text-align: center;
  font-family: Helvetica, Arial;
}

/* displays the image counter on the top */
.totalImg {
  width: max-content;
  background-color: #abcde2;
  position: fixed;
  top: 0;
  right: 0;
  font-size: 1.8rem;
}

/* main gallery div */
.gallery {
  display: grid;
  grid-gap: 5rem;
  /* align each image div at the center of grid cell - both axis */
  place-items: center;
}

@media (min-width: 800px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 456px) and (max-width: 799px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 455px) {
  .gallery {
    grid-template-columns: repeat(1, 1fr);
  }
}

div div:hover {
  transform: scale(1.02);
}

div div {
  padding: 15px;
  box-shadow: 0 4px 8px 0 rgba(0,0,0,0.5);
  border-radius: 10px;
  /* take full grid cell width */
  width: 100%;
}

img {
  /* fill the complete div */
  width: 100%;
  /* images that are too tall must be visible fully on screen */
  max-height: 95vh;   
  border-radius: 10px;
}