// The docstring element which reuses parts of the Bulma card component
.docstring {
  margin-bottom: 1em;
  background-color: $documenter-docstring-background;
  border: 1px solid $border;
  box-shadow: $documenter-docstring-shadow;
  max-width: 100%;

  > header {
    display: flex;
    flex-grow: 1;
    align-items: stretch;
    padding: $card-header-padding;

    background-color: $documenter-docstring-header-background;
    box-shadow: $card-header-shadow;
    box-shadow: none;
    border-bottom: 1px solid $border;

    code {
      background-color: transparent;
    }

    .docstring-binding {
      margin-right: 0.3em;
    }
    .docstring-category {
      margin-left: 0.3em;
    }
  }

  > section {
    position: relative;
    padding: $card-content-padding;

    border-bottom: 1px solid $border;
    &:last-child {
      border-bottom: none;
    }

    > a.docs-sourcelink {
      transition: opacity 0.3s;
      opacity: 0;
      position: absolute;
      right: $card-content-padding-h / 2;
      bottom: $card-content-padding-v / 2;
      @extend .tag;
      @extend .is-primary;
      @extend .is-size-7;
    }
  }

  &:hover > section > a.docs-sourcelink {
    opacity: 0.2;
  }

  & > section:hover a.docs-sourcelink {
    opacity: 1;
  }
}
