@import "../../theme.scss";

.ResultCard-cardContainer {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 600px;
  min-height: 110px;
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  font-family: inherit !important;
  gap: 10px;

  a {
    text-decoration: none;
    color: #1a0dab;
    cursor: pointer;
    display: block;
    outline: 0;
  }

  a:hover {
    text-decoration: underline;
  }

  &:hover {
    .ResultCard-hoverContainer {
      transform: translate(-50%, 0);
    }

    &.ResultCard-cardContainer--withActions .ResultCard-hoverBackground {
      display: block;
    }
  }
}

.ResultCard-cardContainer--withActions a {
  pointer-events: none;
}

.ResultCard-hoverBackground {
  display: none;
  position: absolute;
  inset: 0;
  background-color: #ffffff44;
  z-index: 7;
}

.ResultCard-dimmedOverlay {
  position: absolute;
  inset: 0;
  background-color: #ffffff87;
  z-index: 7;
}

.ResultCard-tagsContainer {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;

  .ResultCard-tagSeparator {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background-color: #1a0dab;
  }
}

html:dir(ltr) {
  .ResultCard-cardContainer--rtl {
    flex-direction: row-reverse;
    .ResultCard-category-type-container {
      justify-content: flex-end;
    }
    .ResultCard-tagsContainer {
      justify-content: flex-end;
    }
  }
}

.ResultCard-cardContainer--rtl {
  .ResultCard-cardBodyContainer {
    text-align: right;
  }

  .ResultCard-bodySeparator,
  .ResultCard-date {
    margin-left: 5px;
    margin-right: 0px !important;
  }
}

.ResultCard-category-type-container {
  display: flex;
  align-items: baseline;
  gap: 5px;

  .ResultCard-category {
    color: #202124;
    padding-bottom: 7px;
  }
  .ResultCard-separator {
    width: 0.1px;
    height: 11px;
    border-radius: 50%;
    background-color: #aab7b8;
  }
}

.ResultCard-cardBodyContainer {
  text-align: left;
  line-height: 1.4;
  font-size: 14px;

  .ResultCard-date {
    margin-right: 5px;
  }

  .ResultCard-title {
    font-size: 20px;
    margin-bottom: 7px;
    display: -webkit-box;
    -webkit-line-clamp: 1; /* Limit the title to 1 line */
    -webkit-box-orient: vertical; /* Arrange the text vertically */
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .ResultCard-title--full {
    -webkit-line-clamp: unset; /* Remove line clamping */
    display: block; /* Ensure full display when there's no body */
    white-space: normal; /* Allow title to wrap across multiple lines */
  }
}

a.ResultCard-imageWrapper {
  text-decoration: none;
  display: block;
  width: 90px;
  height: 90px;
  margin-left: 10px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.ResultCard-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ResultCard-bodySeparator {
  margin-right: 5px;
}

.ResultCard-dateAndBody {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #4d5156;
}

.ResultCard-hoverContainer {
  position: absolute;
  bottom: 20px;
  left: 50%;
  border-radius: $border-radius;
  overflow: hidden;
  background-color: #fefefee6;
  z-index: 9;
  display: flex;
  flex-direction: column;
  transform: translate(-50%, 180%);
  transition: transform 0.3s cubic-bezier(0.3, 0.85, 0.4, 0.95);
  box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
}

.ResultCard-actionButtonsContainer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
}

.ResultCard-score {
  background-color: #d0e7c2;

  .ResultCard-scoreLine {
    width: 100%;
    height: 2px;
    background: linear-gradient(
      to right,
      #d0e7c2 0%,
      #6fb545 50%,
      #d0e7c2 100%
    );
  }

  .ResultCard-scoreText {
    padding: 3px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: #5e9c3b;
    font-weight: 600;
    font-size: 12.5px;
  }
}
