/****************************************************************************** 
* Post/Page
******************************************************************************/

  .page,
  .error404 {

    .post-header {
      margin-top: 2rem;
    }
  }

  div.post {

    .post-header {
      
      h1 {
        margin-top: 1rem;
      }
    }

    .post-title {
      align-items: center;
      display: flex;
      justify-content: space-between;

      .post-share-links {
        display: flex;
        grid-gap: 1rem;

        a {
          align-items: center;
          background-color: $grey-200;
          border: 1px solid rgba($black, 0.06);
          border-radius: 10rem;
          display: flex;
          font-size: 0;
          font-weight: 700;
          height: 3rem;
          justify-content: center;
          letter-spacing: 1px;
          line-height: 1;
          position: relative;
          text-align: center;
          text-decoration: none;
          text-transform: uppercase;
          top: 0.125rem;
          width: 3rem;

          &:hover,
          &:focus,
          &:active {
            background-color: $color-100;
            color: $color-800;
          }

          &::before {
            display: block;
            text-align: center;
          }
        }
      }
    }

    .post-content {
      align-items: stretch;
      display: flex;
      flex-wrap: wrap;
      grid-gap: 2rem;
      justify-content: stretch;
      // margin-top: 3rem;

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

      .post-content-inner {
        flex: 1 1;
        margin-top: 2rem;
        min-width: 100%;

        .post-title {
          margin-bottom: 1rem;
        }

        &:first-child > :not(p) {
          margin-top: 1rem;
        }
      }

      .gallery {
        align-items: flex-start;
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;

        figure {
          padding: 1px;
        }

        figcaption,
        .gallery-caption ,
        .wp-caption,
        .wp-caption-text {
          cursor: pointer;
          min-height: 40px;
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
          width: 100%;
        }

        &.gallery-columns-1 {

          figure {
            margin: 0;
            width: 100%;
          }
        }

        &.gallery-columns-2 {

          figure {
            margin: 0;
            width: 50%;
          }
        }

        &.gallery-columns-3 {

          figure {
            margin: 0;
            width: 33.3333%;
          }
        }

        &.gallery-columns-4 {

          figure {
            margin: 0;
            width: 25%;
          }
        }

        &.gallery-columns-5 {

          figure {
            margin: 0;
            width: 20%;
          }
        }

        &.gallery-columns-6 {

          figure {
            margin: 0;
            width: 16.6667%;
          }
        }

        &.gallery-columns-7 {

          figure {
            margin: 0;
            width: 14.2857%;
          }
        }

        &.gallery-columns-8 {

          figure {
            margin: 0;
            width: 12.5%;
          }
        }

        &.gallery-columns-9 {

          figure {
            margin: 0;
            width: 11.1111%;
          }
        }
      }
    }

    .post-related {
      // background-color: $grey-100;
      border-radius: 0.25rem;
      margin-left: calc((#{$container-width} - 64px - 100vw) / 2);
      width: 100vw;

      .container {
        align-items: stretch;
        display: flex;
        grid-gap: 2rem;
        justify-content: space-between;
      }

      .post-related-item {
        // background-color: rgba($black, 0.03);
        flex: 0 0 calc(33.3333% - 2rem);
        padding: 2rem 0 5rem 0;
        position: relative;

        a {
          text-decoration: none;

          &:hover,
          &:focus,
          &:active {
            color: $color-200;
          }
        }

        .post-related-meta {
          bottom: 1rem;
          left: 0;
          position: absolute;
          right: 0;
        }
      }
    }

    .post-meta {
      background-color: $grey-100;
      border-bottom: 1px solid rgba($black, 0.03);
      border-top: 1px solid rgba($black, 0.03);
      margin-left: calc((#{$container-width} - 4rem - 100vw) / 2);
      min-height: 60px;
      padding: 1rem 0;
      // margin-top: 3rem;
      width: 100vw;

      &.post-meta-top {
      }

      .container {
        align-items: center;
        display: flex;
        flex-wrap: wrap;
        // margin-bottom: 1rem;
        grid-gap: 2rem;
        justify-content: space-between;

        .post-meta-item {
          flex: 0 0 calc(50% - 2rem);
          font-size: 0.875rem;
          font-weight: 700;
          letter-spacing: 1px;
          text-transform: uppercase;

          &:last-of-type {
            text-align: right;
          }

          a, 
          strong {
            font-size: inherit;

            &::before {
              color: rgba($black, 0.24);
              display: inline-block;
              flex: 0 0;
              text-align: left;
              width: 1.5rem;
            }
          }

          .post-meta-categories {

            ul {
              margin: 0;
              padding: 0;

              li {
                display: inline-block;
                list-style-type: none;
                margin-left: 1rem;
              }
            }
          }
        }

        a {
          margin-right: 1rem; 
          text-decoration: none;

          &:hover,
          &:focus,
          &:active {
            color: $color-400;
          }

          &:last-of-type {
            margin-right: 0;  
          }
        }

        strong {
          margin-right: 1rem;
        }
      }
    }

    .post-pagination {
      align-items: center;
      // border-top: 1px solid rgba($black, 0.03);
      display: flex;
      font-size: 1.25rem;
      font-weight: 700;
      grid-gap: 2rem;
      justify-content: space-between;
      letter-spacing: 1px;
      // min-height: 60px;
      padding: 1rem 0 0 0;
      // text-transform: uppercase;

      a {
        flex: 0 0 calc(50% - 2rem);
        padding: 0 1rem;
        position: relative;
        text-decoration: none;

        &::before,
        &::after {
          align-items: center;
          color: $color-800;
          display: flex;
          height: 100%;
          justify-content: center;
          position: absolute;
          top: -1px;
        }

        &::before {
          left: 0;
        }

        &::after {
          right: 0;
        }

        &:first-child {
          align-self: flex-start;
          display: flex;
        }

        &:last-child {
          text-align: right;
        }
      }
    }
  }

  .page-template-template-sidebar {

    .sidebar {
      margin-top: 0;
    }

    div.post {

      .post-title {
        align-items: flex-start;
        flex-direction: column;

        h1 {
          order: 2;
        }

        .post-share-links {
          margin: 0 0 1rem 0;
          order: 1;
        }
      }
    
      .post-content {
      
        .post-content-inner {
          min-width: auto;
        }
      }
    }
  }

/****************************************************************************** 
* Post/Page Mobile
******************************************************************************/

  @media (max-width: $breakpoint-desktop) {

    div.post {

      .post-header {

        h1 {
          font-size: 3rem;
          line-height: 1.25;
        }
      }

      .post-meta {
        margin-left: -2rem;
        padding-right: 1rem;
        width: 100vw;

        .container {
          align-items: flex-start;
          flex-direction: column;
          grid-gap: 0;

          .post-meta-item {

            a, 
            strong {
              display: block;

              &::before {
                width: 2rem;
              }
            }

            .post-meta-categories {

              ul { 
                li {
                  display: flex;
                  margin-left: 0;
                }
              }
            }
          }
        }
      }

      .post-related {
        margin-left: -2rem;
        padding-right: 1rem;
        width: 100vw;
        
        .container {
          align-items: flex-start;
          flex-direction: column;
          grid-gap: 0;
        }

        .post-related-item {
          padding: 2rem 0 0 0;

          .post-related-meta {
            position: static;
          }
        }
      }

      .post-title {
        align-items: flex-start;
        flex-direction: column;
        
        h1 {
          order: 2;
        }

        .post-share-links {
          margin-top: 1rem;
          order: 1;
        }
      }

      .post-content {
        align-items: unset;
        flex-direction: column;
        grid-gap: 0;

        .widgets {
          flex: 1 1;
          width: 100%;
        }
      } 

      .post-pagination {
        align-items: center;
        flex-direction: column;
        grid-gap: 0;
        height: auto; 

        a:first-child {
          align-self: center;
          margin: 0.25rem 0;
          padding-right: 0;
        }

        a:last-child {
          margin: 0.25rem 0;
          padding-left: 0;
          text-align: center;
        }
      }
    }
  }
