@import "base/base";

$small-breakpoint: 767px;
$medium-breakpoint: 1119px;

body.blog.responsive {
  box-sizing: border-box;
  padding: 0 !important;
  .content-wrapper {
    width: 100%;
    padding-left: 0 !important;
    padding-right: 0 !important;
    @media screen and (max-width: $small-breakpoint) {
      padding-left: 10px;
      padding-right: 10px;
    }
    aside {
      max-width: 25%;
      float: right !important;
      display: block;
      @media screen and (max-width: $small-breakpoint) {
        max-width: 100%;
        padding: 1em;
      }
      .blog-sidebar {
        width: 100%;
        .list-group-title {
          border-bottom: 1px solid darken($blue, 10%);
          color: darken($blue, 10%);
          display: block;
          font-size: 0.8em;
          font-style: normal;
          font-weight: bold;
          letter-spacing: 1px;
          line-height: 1.2;
          margin: 0 auto;
          min-width: 100%;
          padding: 0 0 0 0.25em;
          text-transform: uppercase;
          a {
            color: darken($blue, 10%);
            &:hover,
            &:focus {
              cursor: pointer;
            }
          }
        }
        .list-group {
          list-style: none;
          margin: 0 auto;
          padding: 0;
          min-width: 100%;
          display: flex;
          flex-flow: row wrap;
          margin-bottom: 1.5em;
          // border: 1px solid red;
          .list-item {
            min-width: 100%;
            margin: 0;
            padding: 0;
            // background-color: aliceblue;
            a {
              width: 100%;
              padding: 0.25em 0.5em;
              font-size: 0.8em;
              display: inline-block;
              &:hover,
              &:focus {
                cursor: pointer;
                background-color: #f2d1cb;
                color: black;
                text-decoration: none;

              }
            }
            &.list-inline {
              min-width: 33.3333%;
              max-width: 33.3333%;
              text-align: center;
            }
          }
        }
      }
    }
    .main.has-sidebar {
      margin: 0 !important;
      width: 75% !important;
      float: left !important;
      padding-right: 2em;

      @media screen and (max-width: $small-breakpoint) {
        width: 100% !important;
        padding: 1rem; 
      }
    }
    
    .pagination {
      color: #9EABB3;
      font-size: 1.1em;
      margin: 40px auto 20px;
      position: relative;
      text-align: center;
      width: 100%;
      
      a {
        position: absolute;
        display: inline-block;

        &.older-posts {
          right: 0;
        }

        &.newer-posts {
          left: 0;
          
          &.disabled {
            color: $gray-lighter;
            
            &:hover,
            &:focus {
              cursor: not-allowed;
              text-decoration: none;
            }
          }
        }
      }

      .page-number {
        display: inline-block;
        color: #333;
        margin: 0;
      }
    }
  }

  .blog-header--invisible {
    visibility: hidden;
    position: absolute;
  }

  .ember-times-logo {
    background-image: url('/images/brand/ember_Times-Light.png');
    background-position: left center;
    background-color: transparent;
    background-attachment: scroll;
    background-repeat: no-repeat;
    margin: 0 0 0.7em;
    &.large {
      background-size: 75%;
      height: 155px;
      @media screen and (max-width: $small-breakpoint) {
        background-size: 90%;
        height: 100px;
      }
    }
  }
}

.blog {
  .btn {
    background-color: $orange;
    border-radius: 5px;
    box-shadow: 0 1px 0 rgba(255,255,255,0.35);
    color: $white;
    display: block;
    font-size: 0.9em;
    font-weight: bold;
    height: 40px;
    letter-spacing: 1px;
    line-height: 40px;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    transition: all 0.3s ease 0s;
    width: 220px;
    
    &:hover, &:focus {
      background-color: $orange-darker;
      border-bottom: none;
      box-shadow: 0px 2px 4px -1px #666;
      color: $white;
      text-decoration: none;
      transform: translateY(-1px);
      transition: 0.3s translateY;
    }
  }
}
.blog-post {
  .blog-post-header {
    .blog-post-title {
      background-position: left 9px;
      margin-top: 0.7em;
      text-align: left;
      text-transform: none;
    }
    .blog-post-meta {
      display: block;
      font-size: 0.8em;
      font-weight: normal;
      margin-bottom: 0.5em;
      text-transform: uppercase;
      .blog-post-date {
        display: inline-block;
        color: $gray;
        padding: 0 0.25em 0 0;  
      }
      .blog-post-author {
        display: inline-block;
        color: $blue;
        font-weight: bold;
      }
      .blog-post-tag {
        display: block;
        width: 100%;
      }
    }
  }
  .blog-post-body {
    max-width: 100%;
    h2 {
      margin-bottom: 0.5em;
      margin-top: 0.75em;
      text-align: left;
    }
    code {
      // this is different than code in other places. We are making it more readable for the blog.
      background-color: rgba(0,0,0,0.1);
      color: #222;
      font-size: 0.9em;
      padding: 0 4px 1px;
    }
    p {
      @media screen and (max-width: 991px) and (min-width: 0) {
        padding: 0.5em 0;
      }
    }
    ul {
      list-style: disc;
      li {
        max-width: 100% !important;
        word-wrap: break-word;
      }
    }
  }
  .blog-post-footer {
    font-weight: bold;
    color: $blue;
  }
}
article.blog-post {
  h4.anchorable-toc { 
    border-bottom: 1px solid $gray-lighter;
    font-size: 1em;
    font-style: normal;
    font-weight: bold;
    letter-spacing: 1px;
    line-height: 1;
    margin: 3em 0 1.75em 0;
    padding-bottom: 10px;
    text-transform: uppercase;
  }
  li {
    margin: 14px 0;
  }

  ul {
    margin: 25px 0;
  }

  ul > li {
    list-style: disc;
  }

  .chapter {
    ul,
    ol {
      margin-left: $list-indent;
      margin-bottom: 28px;

      li {
        font-size: 15px;
        margin: 10px 0 10px 0;

        p {
          padding-left: 7px;
        }
      }
    }
  }

  table {
    width: 100%;

    margin: 1em 0;

    tbody tr {
      background: rgba(255, 249, 249, 0.56);
      border-bottom: 1px solid rgba(223, 215, 212, 0.28);
    }

    thead {
      background-color: #f9e7e4;
    }

    th {
      font-weight: bold;
    }

    th,
    td {
      padding: 5px 10px;
    }

    &.specific {
      th,
      td {
        padding: 5px 6px;
      }
    }
  }

  .note {
    background: rgba(0,0,0, 0.2);

    &::before {
      content: "Note"
    }
  }
}
