.wrapper{
  margin-top: 2em;
  max-width: 1100px;
}
.wrapper nav{
  display: flex;
  justify-content: center;
  width: 100%;
  margin: auto;
}
.wrapper .items{
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}
.items span{
  margin: 4px;
  padding: 6px 16px;
  font-size: 1em;
  font-weight: 400;
  cursor: pointer;
  color: var(--fa-p);
  border-radius: 50px;
  border: 2px solid var(--fa-p);
  transition: all 0.3s ease;
}
.items span.active,
.items span:hover{
  color: #fff;
  background: var(--fa-p);
}

.gallery{
  margin-top: 2em;
  column-count: 5;
  column-gap: 8px;
}
.gallery .image{
  width: auto;
  padding-bottom: 8px;
}
.gallery .image span{
  width: 100%;
  /*
  display: flex;
  overflow: hidden;
  */
}
.gallery .image img{
  width: 100%;
  vertical-align: middle;
  transition: all 0.3s ease;
}
.gallery .image:hover img{
  /*transform: scale(1.1);*/
  animation: anim 0.6s ease;
}
@keyframes anim {
  0%{
    transform: scale(1);
  }
  50%{
    transform: scale(0.95);
  }
  100%{
    transform: scale(1);
  }
}
.gallery .image.hide{
  display: none;
}
.gallery .image.show{
  animation: animate 0.4s ease;
}
@keyframes animate {
  0%{
    transform: scale(0.5);
  }
  100%{
    transform: scale(1);
  }
}

.preview-box{
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: #fff;
  max-width: 700px;
  width: 100%;
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  border-radius: 3px;
  padding: 0 5px 5px 5px;
  box-shadow: 0px 0px 15px rgba(0,0,0,0.2);
}
.preview-box.show{
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(0.75);
  transition: all 0.3s ease;
  background-color: var(--fa-s);
}
.preview-box .details{
  padding: 12px 15px 12px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.details .title{
  display: flex;
  font-weight: 400;
}
.details .title p{
  font-weight: 500;
  margin: 0;
  margin-left: 5px;
}
.details .icon{
  color: var(--fa-p);
  font-style: 22px;
  cursor: pointer;
}
.preview-box .image-box{
  width: 100%;
  display: flex;
}
.image-box img{
  width: 100%;
  border-radius: 0 0 4px 4px;
}
.shadow{
  position: fixed;
  left: 0;
  top: 0;
  height: 100%;
  width: 100%;
  z-index: 2;
  display: none;
  background: rgba(0,0,0,0.4);
}
.shadow.show{
  display: block;
}

@media (max-width: 1000px) {
  .gallery {
    column-count: 4;
  }
}
@media (max-width: 800px) {
  .gallery {
    column-count: 3;
  }
}
@media (max-width: 700px) {
  .wrapper nav .items{
    max-width: 600px;
  }
  nav .items span{
    padding: 7px 15px;
  }
}
@media (max-width: 600px) {
  .wrapper{
    margin: 30px auto;
  }
  .wrapper nav .items{
    flex-wrap: wrap;
    justify-content: center;
  }
  nav .items span{
    margin: 5px;
  }
  .preview-box{
    top: 45%;
  }
  .preview-box.show{
    transform: translate(-50%, -50%) scale(0.75);
  }
}
@media (max-width: 480px) {
  .gallery {
    column-count: 2;
  }
  .preview-box.show{
    transform: translate(-50%, -50%) scale(0.9);
  }
}
