.root {
  font-family: var(--fontFamily);
  box-sizing: border-box;
  padding: var(--padding);
  border-bottom: var(--borderWidth) solid var(--borderColor);
  flex: 1;
  display: flex;
  align-items: center;
  color: var(--color);
  line-height: var(--lineHeight);
  &.small {
    align-items: flex-start;
  }
}

.completed,
.avatar,
.icon,
.layout {
  box-sizing: border-box;
}

.completed {
  width: 1.375rem;
  margin-inline-start: var(--gutterWidth);
}

.activityIndicator {
  padding-inline-end: 0;
  padding-inline-start: 0;
}

.activityIndicator + .completed {
  margin-inline-start: calc(var(--gutterWidth) - var(--activityIndicatorWidth))
}

.icon {
  color: var(--iconColor);
  margin: 0 var(--gutterWidth);

  > svg { /* stylelint-disable-line selector-no-type */
    display: block;
  }
}

.avatar {
  /* adjust margin so <Avatar size="small"> fits in same space as the icon */
  margin: 0 calc(var(--gutterWidth) - ((1em*2.5) - var(--iconFontSize))/2);
}

.layout {
  display: flex;
  flex-direction: column;
  flex: 1 0;
  min-width: 1px;
}
.innerLayout {
  display: flex;
  flex: 1 0;
  align-items: center;
  min-width: 1px;
  min-height: 2.5rem; /* or ie11 smashes it down */
}

.details {
  flex: 0 0 50%;
  margin-bottom: 0;
  box-sizing: border-box;
  min-width: 1px;
  &.details_no_badges {
     flex: 0 0 75%;
   }
}

.secondary {
  flex: 0 0 50%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 1px;
  &.secondary_no_badges {
     flex: 0 0 25%;
   }
}

.type {
  box-sizing: border-box;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.0625rem;
  margin-bottom: var(--typeMargin);
}

.title {
  box-sizing: border-box;
  line-height: var(--titleLineHeight);
}

.metrics {
  box-sizing: border-box;
  text-align: end;
  flex: 0 0 10rem;
  min-width: 1px;
  padding-inline-start: var(--metricsPadding);
  &.with_end_time {
    flex-basis: 14rem;
    .due {
      text-transform: none;
    }
  }
}

.due,
.score {
  box-sizing: border-box;
  text-transform: uppercase;
  letter-spacing: 0.0625rem;
  line-height: 1;
  white-space: nowrap;
}

.badges {
  flex: 1;
  text-align: end;
  min-width: 1px;
}

.feedback {
  display: flex;
  align-items: center;
  min-height: 40px;   /* height of the avater, so ie11 doesn't squish it */

  .feedbackAvatar {
    flex-shrink: 0;
    margin-inline-end: var(--gutterWidth);
  }
  .feedbackComment {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
}

.small, .medium {
  .title {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    padding-inline-end: 0.5rem;
  }
}

.small {
  padding-left: 0;
  padding-right: 0;
  
  .completed {
    margin-inline-start: 6px;
  }
  .innerLayout {
    flex-direction: column;
    align-items:flex-start;
    margin-inline-start: 1rem;
  }
  .details {
    margin-bottom: 1rem;
    flex: 1 0 auto;
    width: 100%
  }
  .secondary {
    flex: 1 0 auto;
    width: 100%;
  }
  .metrics {
    display: flex;
    flex-direction: row-reverse;
    justify-content: space-between;
    align-items: flex-end;
    flex: 1 0 auto;
    text-align: unset;
    padding-inline-start: 0;
  }
  .due {
    width: 100%;
  }
  .icon, .avatar, .badges, .feedback, .editButton {
    display: none;
  }
  .location {
    margin-inline-start: 1rem;
  }
}
