/* *** Post Gallery *** */

//remove scroll when gallery is open
html.bb-gl-open {
  overflow: hidden !important;
}

.bb-post-gallery {
  position: relative;
  margin-bottom: 20px;
  cursor: pointer;

  img {
    width: 100%;
  }

  .bb-gallery-link {
    position: absolute;
    z-index: 20;
    top: 15px;
    right: 0;
    min-width: 170px;
    padding: 10px 10px 10px 55px;
    background-color: #192526;
    color: #ffffff;
    font-size: 14px;
    line-height: 1.1em;

    .bb-icon {
      position: absolute;
      left: 12px;
      top: 50%;
      font-size: 30px;
      line-height: 1em;
      margin-top: -15px;
    }
  }
}

.bb-post-gallery-content {
  display: none;

  &.bb-open {
    display: block;
    position: fixed;
    z-index: 100000;
    top: 0;
    left: 0;
    width: 100%;
    padding-top: 80px;
    bottom: 0;
  }

  .bb-gl-header {
    position: absolute;
    z-index: 100;
    display: flex;
    align-items: center;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    padding: 5px 60px 5px 10px;
    overflow: hidden;

    .bb-gl-close {
      position: absolute;
      top: 50%;
      margin-top: -12px;
      right: 20px;
      color: inherit;
      font-size: 25px;
      line-height: 1em;
    }

    .bb-gl-logo {
      display: inline-block;
      margin-right: 10px;
      img {
        max-height: 80px;
        width: auto;
        height: auto;
      }
    }

    .bb-advertisement {
      flex-grow:1;

      .quads-location {
        margin: 0 !important;
        float: none;
      }

      img {
        margin: 0 auto;
        max-height: 80px;
        width: auto;
        height: auto;
      }
    }
  }

  .bb-gl-body {
    position: absolute;
    top: 80px;
    left: 0;
    width: 100%;
    bottom: 0;
  }

  .bb-gl-slide, & .bb-gl-slide li {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    list-style: none;
    margin: 0;
  }

  .bb-gl-slide li {
    opacity: 0;
    z-index: 1;
    max-height: 100%;
    overflow-y: auto;

    &.bb-active {
      opacity: 1;
      z-index: 50;

      img {
        opacity: 1;
      }
    }
  }

  .bb-gl-image {
    padding:  50px 20px 20px;

    img {
      transition: all .15s ease-out;
    }
  }
  .bb-gl-image-text {
    padding: 40px 4%;
  }

  .bb-gl-mode-switcher {
    position: absolute;
    top: 5px;
    left: 20px;
    width: auto;
    border-radius: 20px;
    border: 1px solid #ececec;
    font-size: 0;

    .bb-mode-switcher {
      position: relative;
      display: inline-block;
      padding: 12px 0;
      width: 40px;
      height: 39px;
      line-height: 1em;
      text-align: center;
      vertical-align: middle;
      font-size: 16px;
      color: inherit;

      &:first-child {
        border-right: 1px solid #ececec;
      }
    }
  }

  .bb-gl-meta {
    margin-bottom: 40px;

    .bb-gl-arrow {
      display: inline-block;
      width: 40px;
      height: 40px;
      line-height: 40px;
      border-radius: 50%;
      text-align: center;
      font-size: 16px;
      vertical-align: middle;

      .bb-icon {
        vertical-align: middle;
      }

      &:hover {
        box-shadow: $btn-hover-shadow;
      }
    }
    .bb-gl-pagination {
      display: inline-block;
      margin: 0 10px;
      min-width: 55px;
      text-align: center;
      line-height: 40px;
      vertical-align: middle;

      b {
        font-size: 1.3em;
      }
    }
  }

  .bb-affiliate-content {
    clear: both;
    overflow: hidden;
    margin-bottom: 15px;

    .item-url {
      float: right;
      padding: 8px 10px;
      font-size: 12px;
      line-height: 1em;
      text-transform: uppercase;
      font-weight: 600;
      border-radius: 3px;
    }
  }

  .bb-gl-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-height: 100%;
    overflow-y: auto;

    ul, ul li {
      display: block;
      list-style: none;
      margin: 0;
    }

    ul {
      font-size: 0;
      padding: 50px 20px 20px;
      text-align: center;
      overflow: hidden;
    }

    li {
      float: left;
      padding: 5px;

      a {
        display: block;
        overflow: hidden;
      }

      &:hover a {
        opacity: 0.8;
      }
    }
  }

  .bb-gl-slide,
  .bb-gl-grid {
    opacity: 0;
    visibility: hidden;
    z-index: 1;
    transition: all .2s ease-out;
  }
  &.bb-mode-slide {
    .bb-gl-slide {
      opacity: 1;
      visibility: visible;
      z-index: 2;
    }
  }
  &.bb-mode-grid {
    .bb-gl-grid {
      opacity: 1;
      visibility: visible;
      z-index: 2;
    }
  }

  @media (min-width: $screen-sm-min) {
    &.bb-open {
      padding-top: 110px;
    }
    .bb-gl-header {
      height: 110px;
      padding: 5px 100px 5px 10px;
      .bb-gl-close {
        top:20px;
        margin-top: 0;
        font-size: 33px;
      }
      .bb-gl-logo {
        img {
          max-height: 110px;
        }
      }

      .bb-advertisement {
        img {
          max-height: 110px;
        }
      }
    }
    .bb-gl-body {
      top: 110px;
    }

    .bb-gl-slide li {
      max-height: 100%;
      overflow-y: hidden;
    }
    .bb-gl-image,
    .bb-gl-image-text {
      position: absolute;
      top: 0;
      height: 100%;
    }

    .bb-gl-image {
      left: 0;
      width: 55%;

      img {
        position: absolute;
        top: 50%;
        left: 50%;
        max-width: 70%;
        max-width: calc(100% - 120px);
        max-height: 95%;
        max-height: calc(100% - 40px);
        width: auto;
        height: auto;
        transform: translate(-50%, -50%);
      }
    }
    .bb-gl-image-text {
      right: 0;
      width: 45%;
      height: 100%;
      max-height: 100%;
      overflow-y: auto;
    }

    .bb-gl-image {
      padding: 20px 60px;
    }
    .bb-gl-grid {
      ul {
        padding: 10px 60px;
      }
      li a {
        width: 360px;
        height: 270px;
      }
    }
    .bb-gl-mode-switcher {
      top: 20px;
      left: 10px;
      width: 42px;

      .bb-mode-switcher {
        width: 100%;
        height: 40px;

        &:first-child {
          border-right: 0;
          border-bottom: 1px solid #ececec;
        }
      }
    }
  }
  @media (min-width: $screen-md-min) {
    .bb-gl-image {
      width: 65%;
    }
    .bb-gl-image-text {
      width: 35%;
      max-width: 35%;
    }
  }
  @media (min-width: $screen-lg-min) {
    .bb-gl-image {
      width: 75%;
    }
    .bb-gl-image-text {
      width: 25%;
      max-width: 25%;
    }
  }
}