$wiki-padding: 8px !default;

// wiki
.controller-wiki {
  div#content {
    & > div.contextual {
      margin-top: 3px;
    }
    & > div.wiki {
      padding: 0 $wiki-padding $wiki-padding $wiki-padding;
    }
  }
}

div.wiki {
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  color: #333;
  font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  line-height: 1.6;
  word-wrap: break-word;

  &:before {
    display: table;
    content: "";
  }

  &:after {
    display: table;
    clear: both;
    content: "";
  }

  a {
    background-color: transparent;
    text-decoration: none;
    text-decoration-skip: objects;

    &:active,
    &:hover {
      text-decoration: underline;
      outline-width: 0;
    }

    &:not([href]) {
      color: inherit;
      text-decoration: none;
    }
  }

  p {
  }

  p, blockquote, ul, ol, dl, table, pre {
    margin-top: 0;
    margin-bottom: 16px;
  }

  ul, ol {
    padding-left: 2em;
    ul, ol {
      margin-top: 8px;
      margin-bottom: 8px;
      ol {
        //list-style-type: lower-alpha;
      }
    }
    ol {
      //list-style-type: lower-roman;
    }
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    margin-top: 1em;
    margin-bottom: 16px;
    font-weight: bold;
    line-height: 1.4;
  }

  h1 {
    //font-size: 30px;
    margin-top: 0;
    padding-bottom: 0.3em;
    font-size: 2.25em;
    line-height: 1.2;
    border-bottom: 1px solid #eee;
  }

  h2 {
    //font-size: 21px;
    padding-bottom: 0.3em;
    font-size: 1.75em;
    line-height: 1.225;
    border-bottom: 1px solid #eee;
  }

  h3 {
    //font-size: 16px;
    font-size: 1.5em;
    line-height: 1.43;
  }
  h4 {
    //font-size: 14px;
    font-size: 1.25em;
  }
  h5 {
    //font-size: 12px;
    font-size: 1em;
  }
  h6 {
    //font-size: 11px;
    font-size: 1em;
    color: #777;
  }

  &.wiki-page {
    & > h2 {
      border-bottom: 1px solid #eee;
    }
  }

  blockquote {
    padding: 0 15px;
    color: #777;
    border-left: 4px solid #ddd;

    &>:first-child {
      margin-top: 0;
    }
    &>:last-child {
      margin-bottom: 0;
    }
  }

  ul.toc {
    padding: 10px;
  }

  img {
    border-style: none;
    max-width: 100%;
  }

  table {
    border-spacing: 0;
    border-collapse: collapse;
    overflow: auto;
    word-break: normal;
    word-break: keep-all;

    th {
      font-weight: bold;
    }
    th, td {
      border: 1px solid #ddd;
      padding: 6px 13px;
    }
    tr {
      background-color: #fff;
      border-top: 1px solid #ccc;
      &:nth-child(2n) {
        background-color: #f8f8f8;
      }
    }

    img {
      background-color: #fff;
      box-sizing: content-box;
      max-width: 100%;
    }
  }

  pre {
    font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
    margin: 15px 0;
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    font-size: 13px;
    line-height: 19px;
    overflow: auto;
    padding: 6px 10px;
    border-radius: 3px;
  }

  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 #ccc;
    border-bottom-color: #bbb;
    border-radius: 3px;
    box-shadow: inset 0 -1px 0 #bbb;
  }

  hr {
    box-sizing: content-box;
    height: 0;
    margin: 15px 0;
    background: transparent;
    border: 0;
    border-bottom: 1px solid #eee;
    overflow: visible;
    &::before {
      content: "";
      display: table;
    }
    &::after {
      clear: both;
      content: "";
      display: table;
    }
  }
}

// wiki-preview since Redmine 4
.tabular {
  .jstEditor {
    .wiki-preview {
      padding: $wiki-padding;
      width: auto;

      p {
        padding: 0 !important;
      }
    }
  }
}



