@import 'variables';

.user-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1em;

  @media screen and (min-width: $screen-lg) {
    grid-template-columns: repeat(3, 1fr);
  }
}

.user-list--user {
  border-radius: 0.4em;
  transition: all 0.2s ease;
  padding: 0.5em;

  &:hover {
    background: lighten($primary, 50%);
  }

  .username {
    font-size: 1.2em;
    word-break: break-word;
  }

  img {
    min-height: 32px;
    min-width: 32px;
  }

  .user--meta {
    display: flex;
    flex-direction: column;
  }
}

.user-profile {
  display: flex;

  .user-profile--image {
    padding: 0.5em;
    align-self: flex-start;
    text-align: center;
    margin: 0.125em;
    background-color: #f3f3f3;

    .user-profile--reputation {
      strong { display: block; }
      font-variant: small-caps;
      color: #666666;
    }
  }
  .user-profile--name {
    flex-grow: 1;
    padding: 1em;
    border-right: 1px solid #ddd;

    h1 {
      word-wrap: break-word;
      overflow: auto;
      margin: 0;
      display: flex;
      align-items: center;

      > * {
        margin: 0 0.2em;
      }
    }
  }
  .user-profile--sidebar {
    padding: 1em;
    max-width: 200px;
    width: 200px;
    min-width: 200px;
  }
}

.profile-text {
  padding: 0.125em;
  line-height: 1.5;
  max-height: 300px;
  overflow: auto;
}

.user-profile-heading {
  padding: 0.5em;
  border-bottom: 1px solid #ddd;
  margin-bottom: 0;
}

@media all and (max-width: 64em) {
  .user-profile {
    flex-wrap: wrap;
    flex-direction: column;
    align-items: stretch;

    .user-profile--image {
      align-self: stretch;
      display: flex;
      justify-content: space-between;
      
      .user-profile--reputation {
        padding: 0.5em;
      }
    }

    .user-profile--name {
      flex-grow: 0;
      border-right: 0;
      padding: 0.5em 0 0.5em 0.5em;
    }

    .user-profile--sidebar {
      border-top: 1px solid #ddd;
      border-bottom: 1px solid #ddd;
      max-width: 100%;
      width: 100%;
      min-width: 100%;
    }
  }

  .profile-text {
    max-height: none;
  }
}

.staff-badge {
  display: inline-block !important;
  padding: 3px 6px !important;
  border-radius: 2px !important;
  font-weight: 700 !important;
}