.pg-spirit-grid {
  display: grid;
}
.pg-spirit-item {
  --pg-dir-factor: -1; // LTR default
  position: relative;
  // height: 440px;
  overflow: hidden;
  cursor: pointer;

  :dir(rtl) & {
    --pg-dir-factor: 1;
  }

  &:hover {
    .pg-spirit-image-wrap {
      .pg-spirit-img {
        transform: translate(calc(50% * var(--pg-dir-factor)), -50%) scale(1);
      }
    }
    .pg-spirit-head-content {
      transform: translateY(-50px);
      opacity: 0;
    }
  }
}
.pg-spirit-image-wrap {
  inline-size: 100%;
  block-size: 100%;
  .pg-spirit-img {
    inline-size: 100%;
    block-size: 100%;
    object-fit: cover;
    position: absolute;
    inset-block-start: 50%;
    inset-inline-start: 50%;
    transform: translate(calc(50% * var(--pg-dir-factor)), -50%) scale(0.5);
    transition: transform 0.4s cubic-bezier(0.455, 0.03, 0.515, 0.955);
    vertical-align: middle;
  }
}
.pg-spirit-head-content,
.pg-spirit-bottom-content {
  position: absolute;
  inset-inline-start: 0;
  inset-inline-end: 0;
  margin: 30px;
}
.pg-spirit-head-content {
  inset-block-start: 0;
  transform: translateY(0);
  opacity: 1;
  transition: transform 0.3s cubic-bezier(0.17, 0.73, 0.66, 0.99) 0s,
    z-index 0s step-end, opacity 0.4s ease !important;
}
.pg-spirit-bottom-content {
  inset-block-end: 0;
}
.pg-spirit-title {
  margin: 0;
  font-size: 25px;
  font-weight: 700;
  text-transform: uppercase;
  color: #fff;
}
.pg-spirit-readmore {
  a {
    text-decoration: none;
    color: rgba(13, 59, 84, 0.8);
    padding: 10px 30px;
    display: inline-flex;
    align-items: center;
    position: relative;
    background-color: #fff;
    justify-content: center;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 600;
    overflow: hidden;
    &::before,
    &::after {
      content: "";
      position: absolute;
      transition: all 300ms ease;
    }
    &::before {
      background-color: #0d3b54;
      inset-inline-start: 0;
      inset-block-start: 0;
      inline-size: 0px;
      block-size: 100%;
    }
    // RTL Mode Animation Fix
    [dir="rtl"] &::before {
      inset-inline-start: auto;
      inset-inline-end: 0;
    }
    &:hover {
      color: #fff;
      &::before {
        inline-size: 100%;
      }
      span {
        transform: translateX(-10px);
        &::before,
        &::after {
          opacity: 1;
        }
      }
    }
    // RTL Mode Fixes
    [dir="rtl"] & {
      &:hover {
        span {
          transform: translateX(10px);
        }
      }
      span {
        &::before,
        &::after {
          inset-inline-end: auto;
          inset-inline-start: -20px;
        }
        &::after {
          border-block-start: 1px solid #fff;
          border-inline-start: 1px solid #fff;
          border-inline-end: none;
          transform: translateY(-50%) rotate(-45deg);
        }
      }
    }

    span {
      display: inline-block;
      transition: all 300ms ease;
      position: relative;
      z-index: 99;
      &::before,
      &::after {
        content: "";
        position: absolute;
        transition: all 300ms ease;
        inset-inline-end: -20px;
        inset-block-start: 50%;
        opacity: 0;
      }
      &::before {
        inline-size: 15px;
        block-size: 1px;
        background-color: #fff;
        transform: translateY(-50%);
      }
      &::after {
        inline-size: 5px;
        block-size: 5px;
        border-block-start: 1px solid #fff;
        border-inline-end: 1px solid #fff;
        transform: translateY(-50%) rotate(45deg);
      }
    }
  }
}
