/**
 * article content reset.
 *
 * @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
 * @version 0.1.1.1, Dec 29, 2017
 */
@import 'mixin';

.pipe-content__reset {
  font-family: $font-family-base;
  word-wrap: break-word;
  overflow: auto;
  line-height: 1.65;
  font-size: 16px;
  word-break: break-all;

  ul,
  ol {
    padding-left: 2em;
    margin-top: 0;
    margin-bottom: 16px;
  }

  li {
    margin-top: 0.25em;
  }

  img {
    cursor: zoom-in;
    @include image-bg;
  }

  img.emoji {
    cursor: auto;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 1.25;
  }

  h1 {
    padding-bottom: 0.3em;
    font-size: 2em;
    border-bottom: 1px solid #eee;
  }

  h2 {
    padding-bottom: 0.3em;
    font-size: 1.5em;
    border-bottom: 1px solid #eee;
  }

  h3 {
    font-size: 1.25em;
  }

  h4 {
    font-size: 1em
  }

  h5 {
    font-size: 0.875em;
  }

  h6 {
    font-size: 0.85em;
  }

  hr {
    height: 0.25em;
    padding: 0;
    margin: 24px 0;
    background-color: #e7e7e7;
    border: 0;
  }

  p {
    margin-top: 0;
    margin-bottom: 16px;
  }

  blockquote {
    padding: 0 1em;
    color: #777;
    border-left: 0.25em solid #ddd;
    margin-bottom: 16px;
  }

  blockquote p {
    margin: 0;
  }

  iframe {
    border: 1px solid $fade;
  }

  table {
    width: 100%;
    border: 1px solid #dedede;
    margin: 15px auto;
    border-collapse: collapse;
    empty-cells: show;
  }

  thead {
    text-align: center;
  }

  td,
  th {
    height: 35px;
    border: 1px solid #dedede;
    padding: 0 10px;
  }

  th {
    font-weight: bold;
    text-align: center !important;
    background: rgba(158, 188, 226, 0.2);
  }

  tbody tr:nth-child(2n) {
    background: rgba(158, 188, 226, 0.12);
  }

  tr:hover {
    background: #efefef;
  }

  code {
    padding: 0.2em 0.4em;
    margin: 0;
    font-size: 85%;
    background-color: rgba(252, 41, 41, 0.12);
    border-radius: 3px;
    color: $black;
    font-family: $font-family-code;
    word-break: break-word;
  }

  pre {
    position: relative;
    &:hover > .pipe-code__copy {
      display: block;
    }
    & > textarea {
      position: absolute;
      left: -100000px;
    }
    & > .pipe-code__copy {
      position: absolute;
      top: 5px;
      background-color: #3b3e43;
      right: 5px;
      display: none;
      cursor: pointer;
      padding: 0 7px;
      color: #fff;
      border-radius: 3px;
    }
    &  > code {
      padding: 0.5em;
      color: $black;
      background-color: rgba(0, 0, 0, 0.04);
      background-size: 20px 20px;
      border-radius: 5px;
      display: block;
      overflow: auto;
    }
  }

  kbd {
    display: inline-block;
    padding: 3px 5px;
    font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace;
    line-height: 10px;
    color: #555;
    vertical-align: middle;
    background-color: #fcfcfc;
    border: solid 1px $fade;
    border-bottom-color: #bbb;
    border-radius: 3px;
    box-shadow: inset 0 -1px 0 #bbb;
  }

  li.task-list-item {
    list-style: none;

    & > input {
      margin-left: -2em;
      vertical-align: middle;
    }
  }
}

.pipe-preview {
  &__img {
    width: 100%;
    height: 100%;
    top: 0;
    z-index: 300;
    overflow: auto;
    cursor: zoom-out;
    transition: background-color .2s ease-in-out;
    img {
      max-width: inherit;
      transition: transform .3s ease-in-out;
    }
  }
}