/* lessons */
.container__lessons {
  margin-top: 1rem;

  article {
    background-color: #fff;
    padding: 1rem;
  }

  .media {
    margin: $baseline 0;
  }

  aside {
    li {
      display: block;
    }

    li a {
      display: block;
      padding: 0.5rem 1rem;
    }

    li.active {
      background-color: $color-hr;

      a, a:hover, a:active, a:focus {
        color: $color-text1;
      }
    }
  }

  aside,
  .article__lessons article {
    ul {
      list-style: none;
      padding-left: 1rem;
    }
  }

  dl {
    width: auto;
    margin: 1rem auto;
    font-weight: 300;
  }

  dt,
  dd {
    padding: 0.5rem;
  }
}

.tags__lessons {
  display: inline-block;
  padding: 0;

  li {
    cursor: pointer;

    a {
      color: $color-text1;
    }

    a:hover, a:active, a:focus {
      color: $color-text2;
    }

    &:hover, &:focus, &.active {
      background-color: $color-link;
      color: $color-text2;
      transition: all 0.3s ease;
    }
  }

  .label {
    display: inline-block;
    margin-left: 0 !important;
    margin-right: 5px;
    margin-bottom: 5px;
    padding: 5px 7px;
    font-weight: 100;
    border-radius: 1px;
    background-color: $color-hr;
    color: $color-text1;
  }
}

.sidebar__lessons aside {
  &>ul>li>ul>li:first-child {
    margin-top: 0.5rem;
  }

  &>ul>li {
    padding: 0 0 1rem 0;
    margin-bottom: $baseline;
    border-bottom: 1px solid $color-hr;
  }

  &>ul>li:last-child {
    border-bottom: none;
  }
}

/* markdown styling */
.article__lessons article:first-child {
  line-height: 1.6rem;

  li {
    padding: 0.5rem 0;
  }

  ul li {
    &:before {
      content: "# ";
      color: $color-link;
      padding-right: 5px;
      opacity: 0.4;
    }
  }

  pre {
    margin-bottom: $baseline;
  }

  h1 {
    margin-bottom: .8rem;
    margin-top: .5rem;
  }

  h2 {
    margin-top: 1rem;
    margin-bottom: $baseline;
    padding-top: $margin-base;
    border-top: 1px solid $color-hr;
  }

  h4 {
    font-size: 1.2rem;
  }

  h2, h3, h4, h5, h6 {
    &:before {
      color: $color-link;
      content: "# ";
      padding-right: 5px;
      opacity: .4;
    }
    a {
      transition: 250ms linear all;
      &:active,
      &:focus,
      &:hover {
        outline: 0;
      }
    }
  }

  p {
    margin-bottom: $baseline;
  }

  blockquote {
    background-color: $color-hr;
    font-size: 1rem;
    border-radius: 2px;
    box-sizing: border-box;
    margin-bottom: $baseline;
    max-width: 100%;
    padding: 1rem;
    opacity: 0.7;

    p {
      margin-bottom: 0;
    }
  }

  p>img {
    display: inline-block;
    height: auto;
    max-width: 100%;
    padding: 4px;
    margin: 0 auto;
    line-height: 1rem;
    background-color: #fff;
    transition: all .2s ease-in-out
  }

  table {
    width: 100%;
    max-width: 100%;
    overflow-y: hidden;
    overflow-x: auto;
    border-radius: 2px;
    background-color: transparent;
    margin: $baseline auto;

    & > thead > tr > th,
    & > tbody > tr > th,
    & > tfoot > tr > th,
    & > thead > tr > td,
    & > tbody > tr > td,
    & > tfoot > tr > td {
      padding: 0.5rem;
      border-top: 1px solid #eee;
    }

    & > tbody > tr:nth-child(odd) > td,
    & > tbody > tr:nth-child(odd) > th {
      background-color: #efefef;
    }
  }

  ul.pager li {
    &:before {
      content: "" !important;
      color: $color-link;
      padding-right: 5px;
      opacity: 0;
    }
  }
}

div.nav__lessons {
  display: none;
}
