$width-feature-link: 320px;

.feature-links {
  list-style-type: none;
  margin-bottom: 2rem;
  padding-top: 0.5rem;

  @media (min-width: 1061px) {
    display: grid;
    grid-gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  }
}

.feature-link {
  background-color: $lbry-white;
  border: 1px solid rgba($lbry-black, 0.1);
  border-radius: 3px;
  cursor: pointer;
  display: inline-block;
  position: relative;
  transition: box-shadow 0.2s;
  vertical-align: top;

  @media (min-width: 1061px) {
    width: $width-feature-link; min-height: 135px;
  }

  @media (max-width: 1060px) {
    min-height: 150px;

    &:not(:last-of-type) {
      margin-bottom: 1rem;
    }
  }

  @media (min-width: 681px) and (max-width: 1060px) {
    width: calc(50% - 1rem);

    &:nth-of-type(odd) {
      margin-right: 1rem;
    }
  }

  @media (max-width: 680px) {
    width: 100%;
  }

  &:not(:hover) {
    .feature-link__background {
      filter: brightness(0.5);
    }
  }

  &:hover {
    box-shadow: 0 0 15px $lbry-gray-1;

    .feature-link__title {
      color: $lbry-teal-3;
    }
  }
}

.feature-link__title {
  top: 85px;

  font-size: 1rem;
  font-weight: normal;
  position: relative;
  text-align: center;
  transition: color 0.2s;
  z-index: 1;
}

.feature-link__title-inner {
  padding: 0.25rem 0.5rem;

  background-color: $lbry-white;
  border: 1px solid $lbry-gray-1;
  border-radius: 3px;
  box-decoration-break: clone;
  box-shadow: 0 2px 5px rgba($lbry-gray-5, 0.1);
  display: inline-block;
}

.feature-link__background {
  width: calc(100% + 2px); height: 100px;
  top: -1px; left: -1px;

  background-color: $lbry-teal-3;
  border-top-right-radius: 3px;
  border-top-left-radius: 3px;
  overflow: hidden;
  position: absolute;
  transition: filter 0.2s;
  z-index: 0;

  img {
    width: 100%; height: 100%;

    object-fit: cover;
    object-position: center;
    position: absolute;
  }
}
