.home-grid {
  display: grid;
  list-style: none;
  grid-gap: 1.5rem;
  line-height: 0;
  grid-template-columns: repeat(1, 1fr);
  grid-auto-flow: dense;
}
.home-grid li {
  position: relative;
  --cols: 1;
  --rows: 1;

  overflow: hidden;
  background: #000;
  line-height: 0;
  transition:0.6s;
}
.home-grid li:first-child {
  --cols: 2;
  --rows: 2;
}
.home-grid li:nth-child(5) {
  --cols: 2;
}
.home-grid li:nth-child(6) {
  --rows: 2;
}
.home-grid li:nth-child(7) {
  --cols: 2;
}
.home-grid li:nth-child(8) {
  --rows: 2;
}
.home-grid li:hover {
  transform:translate3d(0, 0, -8px) scale(1.02);;
  box-shadow:1px 12px 34px rgba(0,0,0,.31);
}
.home-grid li:hover .example-category {
  background-color: var(--color-black);
}
.home-grid li:hover figcaption {
  background: none;
}
.home-grid li:hover .hover{
  position: absolute;
  overflow: hidden;
  pointer-events: none;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  opacity: 0.9;
  background-color: var(--color-code-red);
}
.home-grid a {
  display: block;
  height: 10rem;
}
.home-grid img {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all .3s;
}
.home-grid figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: absolute;
  color: #fff;
  font-weight: bold;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
  font-size: 1.1rem;
  line-height: 1;
  text-align: left;
  background: rgba(238, 87, 59, .9);
}

.home-grid .example-category {
  background-color: var(--color-code-red);
  color: var(--color-white);
  border-radius: 20px;
  font-size: .7rem;
  font-weight: bold;
  padding: 4px 10px;
  display: block;
  pointer-events: none;
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 4;
  line-height: normal;
}

.home-grid .example-name {
  z-index: 4;
}

@media screen and (min-width: 45em) {
  .home-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .home-grid li {
    grid-column-start: span var(--cols);
    grid-row-start: span var(--rows);
  }
  .home-grid a {
    padding-bottom: 52.65%;
  }
}
@media only screen and (max-width: 40em) {

  .home-grid figcaption {
    padding: 0.9rem;
    font-size: 1rem; 
  }
    .home-grid a {
     height: 12rem;
    }
}
