.TagTiles {
  list-style-type: none;
  padding: 0;
  margin: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;

  @media @phone {
    margin: -15px -15px 0;
  }

  @media @tablet {
    grid-template-columns: 1fr 1fr;
  }

  @media @desktop-up {
    grid-template-columns: 1fr 1fr 1fr;
  }

  > li {
    height: 200px;
    overflow: hidden;

    @media @tablet {
      &:first-child {
        border-top-left-radius: var(--border-radius);
      }
      &:nth-child(2) {
        border-top-right-radius: var(--border-radius);
      }
      &:nth-last-child(2):nth-child(even), &:last-child {
        border-bottom-right-radius: var(--border-radius);
      }
      &:nth-last-child(2):nth-child(odd), &:last-child:nth-child(odd) {
        border-bottom-left-radius: var(--border-radius);
      }
    }
    @media @desktop-up {
      &:first-child {
        border-top-left-radius: var(--border-radius);
      }
      &:nth-child(3),
      &:nth-child(2):last-child,
      &:first-child:last-child {
        border-top-right-radius: var(--border-radius);
      }
      &:nth-child(3n):nth-last-child(2),
      &:nth-child(3n):nth-last-child(3),
      &:last-child {
        border-bottom-right-radius: var(--border-radius);
      }
      &:nth-child(3n+1):last-child,
      &:nth-child(3n+1):nth-last-child(2),
      &:nth-child(3n+1):nth-last-child(3) {
        border-bottom-left-radius: var(--border-radius);
      }
    }
  }
}

.TagTile {
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--tag-bg);

  &, a {
    color: var(--control-color);
  }
  &.colored {
    &, a {
      color: var(--contrast-color, var(--body-bg));
    }
  }
}
.TagTile-info, .TagTile-lastPostedDiscussion {
  padding: 20px;
  text-decoration: none !important;
  display: block;
}
.TagTile-info {
  padding-right: 20px;
  transition: background 0.2s;
  overflow: auto;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;

  &:hover {
    background: fade(#000, 5%);
  }
  .icon {
    font-size: 24px;
  }
}
.TagTile-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}
.TagTile-name {
  font-size: 18px;
  margin: 0;
  font-weight: bold;
}
.TagTile-description {
  font-size: 12px;
  margin: 0;
  opacity: 70%;
}
.TagTile-children {
  font-weight: bold;
  font-size: 12px;

  a {
    margin-right: 10px;
  }
}
.TagTile-lastPostedDiscussion {
  height: 42px;
  padding: 7px 0;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  line-height: 21px;
  font-size: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.15);
  margin: 0 20px;
  opacity: 70%;
  flex-shrink: 0;

  &:hover .TagTile-lastPostedDiscussion-title {
    text-decoration: underline;
  }

  time {
    text-transform: uppercase;
    font-size: 11px;
    font-weight: bold;
  }
}
.TagTile-lastPostedDiscussion-title {
  margin-right: 10px;
}
