.pg-nexus-grid {
  display: grid;
}
.pg-nexus-item {
  position: relative;
  overflow: hidden;
  &:hover {
    .pg-nexus-image-wrap {
      &::before {
        background: rgba(13, 59, 84, 0.8);
        inline-size: 100%;
      }
      &::after {
        box-shadow: inset 0 0 0 10px #0d3b54;
      }
    }
    .pg-nexus-title {
      opacity: 1;
      transform: translateX(0);
    }
    .pg-nexus-readmore {
      opacity: 1;
      transform: translateX(0);
    }
  }
}
.pg-nexus-image-wrap {
  inline-size: 100%;
  block-size: 100%;
  position: relative;
  overflow: hidden;
  &::before {
    position: absolute;
    content: "";
    inline-size: 0;
    block-size: 100%;
    inset-block-end: 0;
    background: transparent;
    z-index: 1;
    transition: all 0.4s cubic-bezier(0.17, 0.73, 0.66, 0.99);
  }
  &::after {
    position: absolute;
    content: "";
    inset-block-start: 0;
    inset-inline-start: 0;
    block-size: 100%;
    inline-size: 100%;
    z-index: 1;
    box-shadow: inset 0 0 0 0 #0f121a;
    transition: box-shadow 0.5s cubic-bezier(0.17, 0.73, 0.66, 0.99);
  }
  .pg-nexus-img {
    inline-size: 100%;
    block-size: 100%;
    object-fit: cover;
    vertical-align: middle;
  }
}
.pg-nexus-title {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  font-size: 30px;
  line-height: 1.4;
  max-inline-size: 280px;
  text-transform: uppercase;
  z-index: 1;
  margin: 30px;
  opacity: 0;
  transform: translateX(150px);
  transition: transform 0.5s cubic-bezier(0.17, 0.73, 0.66, 0.99) 0s,
    z-index 0s step-end, opacity 0.4s ease;
  font-weight: 900;
  color: #fff;
}

.pg-nexus-readmore {
  position: absolute;
  inset-block-end: 0;
  inset-inline-end: 0;
  z-index: 1;
  text-align: end;
  margin: 30px;
  opacity: 0;
  transform: translateX(-150px);
  transition: transform 0.5s cubic-bezier(0.17, 0.73, 0.66, 0.99) 0s,
    z-index 0s step-end, opacity 0.4s ease;
  inline-size: 50%;
  a {
    display: inline-block;
    line-height: 1.4;
    text-transform: uppercase;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    &:hover {
      color: #0d3b54;
    }
  }
}

/* Design: Slide Left — overlay from right, title from left, readmore from right */
.pg-nexus-design-slide-left {
  .pg-nexus-item {
    .pg-nexus-image-wrap::before {
      inset-inline-start: auto;
      inset-inline-end: 0;
    }
    .pg-nexus-title {
      transform: translateX(-150px);
    }
    .pg-nexus-readmore {
      transform: translateX(150px);
    }
    &:hover {
      .pg-nexus-image-wrap::before {
        inline-size: 100%;
      }
      .pg-nexus-title {
        transform: translateX(0);
      }
      .pg-nexus-readmore {
        transform: translateX(0);
      }
    }
  }
}

/* Design: Slide Top — overlay from bottom, title from top, readmore from bottom */
.pg-nexus-design-slide-top {
  .pg-nexus-item {
    .pg-nexus-image-wrap::before {
      inline-size: 100%;
      block-size: 0;
      inset-block-start: auto;
      inset-block-end: 0;
    }
    .pg-nexus-title {
      transform: translateY(-150px);
    }
    .pg-nexus-readmore {
      transform: translateY(150px);
    }
    &:hover {
      .pg-nexus-image-wrap::before {
        block-size: 100%;
      }
      .pg-nexus-title {
        transform: translateY(0);
      }
      .pg-nexus-readmore {
        transform: translateY(0);
      }
    }
  }
}

/* Design: Slide Bottom — overlay from top, title from bottom, readmore from top */
.pg-nexus-design-slide-bottom {
  .pg-nexus-item {
    .pg-nexus-image-wrap::before {
      inline-size: 100%;
      block-size: 0;
      inset-block-start: 0;
      inset-block-end: auto;
    }
    .pg-nexus-title {
      transform: translateY(150px);
    }
    .pg-nexus-readmore {
      transform: translateY(-150px);
    }
    &:hover {
      .pg-nexus-image-wrap::before {
        block-size: 100%;
      }
      .pg-nexus-title {
        transform: translateY(0);
      }
      .pg-nexus-readmore {
        transform: translateY(0);
      }
    }
  }
}
