@import "styles/_variables";
@import "styles/mixins";

.wrapper {
  max-width: var(--bp-xl);
  padding-top: 54px;
  margin: 0 auto;
}

.inner {
  display: flex;
  flex-direction: column;

  .card + .card {
    margin-top: 15px;
  }
}

.card {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  padding: 15px;
  border: 1px solid #ccc;
}

.branch-list {
  display: block;
}

.branch-list-header {
  display: grid;
  grid-template-columns: 24px 300px 100px 200px auto;
  grid-gap: 15px;
  padding: 15px;

  @include md-down {
    grid-template-columns: 24px 1fr 100px 1fr 1fr;
  }

  @include sm-down {
    display: none;
  }
}

.branch-list-header div {
  font-size: 11px;
  font-weight: 700;
  line-height: 14px;
  text-transform: uppercase;
  user-select: none;
}

.branch-list-item {
  display: grid;
  grid-template-columns: 24px 300px 100px 200px auto;
  grid-gap: 15px;

  // border-radius: 4px;
  // border-left: 4px solid var(--color-success-light);

  padding: 19px 15px;
  margin-bottom: 10px;
  text-align: left;
  background: var(--background-card);
  border-radius: 10px;
  box-shadow: 0 0 1px var(--shadow-4), 0 0.5px 2px var(--shadow-5);

  &:hover {
    box-shadow: 0 1px 6px -3px var(--shadow-2);
    box-shadow: 2px 0 -3px var(--shadow-4), 0 2px 2px var(--shadow-5);
  }

  @include md-down {
    grid-template-columns: 24px 1fr 100px 1fr 1fr;
  }

  @include sm-down {
    display: flex;
    flex-wrap: wrap;

    .commit {
      margin-left: auto;
    }

    .message {
      flex: 1 1 100%;
    }
  }

  @include xs-down {
    .target {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }

  @include xxs-down {
    .target {
      flex: 0 0 85%;
    }

    .commit {
      margin-left: 0;
    }
  }
}

.branch-list-item div {
  display: flex;
  align-items: center;
  color: var(--color-item);

  &:nth-child(2) {
    color: var(--color-text);
  }

  &:nth-child(5) {
    overflow: hidden;

    span {
      min-width: 0;
      max-width: 500px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }

  .avatar {
    width: 24px;
    height: 24px;
    margin-right: 10px;
    border-radius: 50%;
  }
}

.branch-list a {
  text-decoration: none;
  cursor: pointer;
}
