@use '../styles/defaults' as *;
@use '../styles/variables' as *;

@mixin inlineTextButton {
  height: 1.75em;
  border: none;
  background-color: transparent;
  padding: 0 0 0 0.25em;
  margin: 0;
  vertical-align: baseline;

  > svg {
    height: 0.75em;
    margin: 0;
    padding: 0;
  }
}

.editTitleButton {
  @include inlineTextButton;
}

.article {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;

  column-gap: 2em;
  row-gap: 0.15em;

  padding: 1rem;
  position: relative;

  .title,
  .renamingForm {
    cursor: pointer;
    flex: 250px 1;
  }

  .inlineField {
    flex: 1;
  }

  .title {
    display: inline-flex;
    align-items: center;
    text-wrap: balance;
  }

  .renamingForm {
    display: flex;
  }

  .actionButtons {
    flex-shrink: 1;
    text-align: right;
  }

  .metadata,
  .deleteArticle {
    width: 100%;
    margin-left: 0.5em;
  }

  .metadata {
    h4 {
      margin-bottom: 0.25rem;
    }

    > p:not(:last-child) {
      margin-bottom: 1rem;
    }
  }

  .metadataAuthoring {
    font-size: 0.9em;
  }

  .versions {
    margin-bottom: 1.5rem;
  }

  .tagChip {
    font-size: 0.6rem;
    display: inline-block;
    padding: 0.25rem;
    margin-right: 0.5rem;
    border-radius: 100% 100%;
  }

  .author {
    font-style: italic;
  }

  .contributors {
    padding-left: 0.5em;
  }

  .editTags {
    > ul {
      display: flex;
      flex-wrap: wrap;

      > li {
        margin: 0 0.5rem 0.5rem 0;
      }
    }

    margin-top: 0.5rem;
    margin-bottom: 1rem;
  }
}

.sendText,
.sendIcon {
  vertical-align: middle;
}

.sendIcon {
  height: 1em;
  width: 1em;
}

.icon {
  display: flex;
}

.contributorNames {
  display: inline-flex;
}

.momentsAgo {
  opacity: 0.5;
  margin-left: 0.5em;
}

.workspaces {
  display: flex;
  flex-wrap: wrap;

  > li:not(:last-child) {
    margin-right: 0.5em;
  }

  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

.corpusList {
  display: flex;
  flex-wrap: wrap;

  > li:not(:last-child) {
    margin-right: 0.5em;
  }

  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

.note {
  margin-top: 0.5rem;
  padding: 0.5rem;
  border: 1px solid;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.note.important {
  border-color: $warn-color;
  color: $warn-color;
  font-weight: 500;
}

.note.important:before {
  display: inline-flex;
  content: '⚠️';
  font-size: 1.25rem;
}

.actions {
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.deprecated {
}
