*,
*::before,
*::after {
  box-sizing: border-box;
}
* {
  padding: 0;
  margin: 0;
}

.container-gal {
  width: 100%;
  margin: 0px 20px 0px 0px;
  display: grid;
  grid-gap:0px;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
}
.box img {
  width: 100%;
  height: 100%;
  border-radius: 0px;
}
.box {
  position: relative;
}
.box::after,
.box::before {
  content: "";
  position: absolute;
  opacity: 1;
  transition: all 0.4s ease-out;
  top: 1rem;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
}
/*.box::before {
  border-top: 2px solid white;
  border-bottom: 2px solid white;
  transform: scale(0, 1);
}
.box::after {
  border-left: 2px solid white;
  border-right: 2px solid white;
  transform: scale(1, 0);
}*/
/*.box:hover::before {
  background: rgba(0, 0, 0, 1);
  transform: scale(1.05, 1);
}*/
/*.box:hover::after {
  transform: scale(1, 1.05);
}*/
.box .content {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 15px;
  color: white;
  opacity: 0;
  z-index: 3;
  cursor: pointer;
}
.box:hover .content {
  opacity: 1;
}
.box .content h2,
.box .content p {
  padding: 10px;
  font-size: 1.2rem;
}
.box:hover img {
  opacity: 0.4;
}
.box .img-overlay {
    position: absolute;
    height: 100%;
    width: 100%;
    top: 0;
    right: 0;
    left: 0;
    background-color: #004d6f8f;
    z-index: 2;
    opacity: 0;
}
.box:hover .img-overlay {
  opacity: 1;
}