/*
** Widgets
*/
aside h2 {
  margin-bottom: 0;
  line-height: 1;
}

aside > * + * {
  margin-top: 60px;
}

.page_footer {
  .widget-title {
    font-size: 30px;
  }

  .widget {
    li.media {
      h3, h4 {
        a {
          color: #c2dfee;

          &:hover {
            color: $lightColor;
          }
        }
      }
    }
  }
}

.widget {
  position: relative;

  & + .widget{
    margin-top: 60px;
  }

  & > h3,
  .widget-title {
    @include widget-title();
    position: relative;
    padding-bottom: 18px;

    &:after {
      content: "";
      background-color: $colorMain;
      width: 30px;
      height: 3px;
      position: absolute;
      bottom: 0;
      left: 0;
    }

    &.text-center:after {
      left: 50%;
      transform: translateX(-50%);
    }
  }

  //for shortcodes demo
  & > h2:last-child {
    line-height: 1;
  }

  //our custom widgets with bootstrap .media element
  .media {
    margin-bottom: 30px;
    background-color: transparent;
    padding-top: 0;
    padding-bottom: 0;
    padding-right: 10px;
    overflow: hidden;

    .item-meta{
      font-size: 12px;
    }

    img {
      max-width: 100px;
      height: 100px;
    }

    h3, h4 {
      font-size: 16px;
      font-family: "Poppins", sans-serif;
      text-transform: none;
      font-weight: 500;
      margin: 0 0 3px;
      overflow: hidden;
      letter-spacing: 0;
      max-height: 48px;
      line-height: 24px;

      a {
        color: $darkgreyColor;
        line-height: 24px;

        &:hover {
          color: $colorMain;
        }
      }
    }

    p {
      line-height: 1.4;
      margin-bottom: 0.5em;
    }
  }

  .page_footer & {
    margin-bottom: 26px;
  }
}

.widget-title.next-image-background {
  position: relative;
  z-index: 2;

  & + img {
    position: absolute;
    left: 0;
    top: -15px;
    opacity: 0.5;
  }

  .text-center & + img {
    left: 50%;
    transform: translateX(-50%);
  }
}

@media(max-width: 991px) {
  aside {
    margin: 60px auto;
  }
}

/* affix-aside */
.affix-aside {
  position: relative;

  &.affix {
    position: fixed;
    //oriented header height
    top: 100px;
  }

  &.affix-bottom {
    position: absolute !important;
  }

  &.affix-top {
    width: inherit !important;
    left: auto !important;
  }

  @media(max-width: 991px) {
    &,
    &.affix-top,
    &.affix,
    &.affix-bottom {
      position: static !important;
      width: 100% !important;
    }
  }
}

//p.stars removed
.stars {
  & > span {
    display: flex;
  }

  a {
    position: relative;
    width: 1em;
    color: transparent;
    text-indent: -999em;

    &:before {
      position: absolute;
      top: 0;
      left: 0;
      width: 1em;
      height: 1em;
      line-height: 1;
      text-indent: 0;
      font-family: "Font Awesome 5 Free", sans-serif;
    }

    &:before,
    &:hover ~ a:before {
      color: $fontColor;
      content: "\f006"
    }
  }

  &.selected a.active:before,
  &:hover a:before {
    content: "\f005";
    color: $colorMain;
    opacity: 1;
  }

  &.selected {
    a.active ~ a:before {
      content: "\f005";
      color: $fontColor;
      opacity: .75
    }

    a:not(.active):before {
      content: "\f005";
      color: $colorMain;
      opacity: 1
    }
  }
}

.star-rating {
  overflow: hidden;
  position: relative;
  height: 1em;
  line-height: 1;
  font-size: 14px;
  width: 6em;
  letter-spacing: 0.1em;
  font-family: "Font Awesome 5 Free", sans-serif;
  color: $colorMain;

  &:before {
    content: '\f005\f005\f005\f005\f005';
    color: $colorMain;
    float: left;
    top: 0;
    left: 0;
    position: absolute;
    font-weight: 400;
  }

  span {
    overflow: hidden;
    float: left;
    top: 0;
    left: 0;
    position: absolute;
    padding-top: 1.5em;

    &:before {
      content: '\f005\f005\f005\f005\f005';
      top: 0;
      position: absolute;
      left: 0;
      font-weight: 900;
    }

  }
}

.ds {
  .widget_twitter {
    .twitter-item {
      .media {
        .media-body {
          a {
            color: $colorMain;

            &:hover {
              color: $lightColor;
            }
          }
        }
      }
    }
  }
}

.widget_twitter {
  .widget-title {
    margin-bottom: 29px;
  }

  .twitter-item {
    .fa {
      color: #55acee;
      font-size: 14px;
    }

    .media {
      align-items: flex-start;

      * + .media-body {
        margin-left: 7px;
      }

      .icon-styled {
        margin-top: 0;
      }

      .media-body {
        & > p {
          margin: 0;

          & + a {
            display: inline-block;
          }
        }

        a {
          color: $colorMain;

          &:hover {
            color: $darkgreyColor !important;
          }
        }
      }

      & + .media {
        margin-top: 20px;
      }
    }
  }
}

.widget_popular_entries,
.widget_recent_posts {
  .media-image {
    position: relative;

    &::before {
      content: '\f130';
      position: absolute;
      font-family: "Font Awesome 5 Free", sans-serif;
      top: 50%;
      left: 50%;
      transform: translateX(-50%) translateY(-50%);
      color: $lightColor;
      font-size: 14px;
      z-index: 2;
      font-weight: 900;
    }

    &::after {
      content: '';
      display: inline-block;
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      top: 0;
      background-color: rgba(#255085, .5);
    }
  }
}

.widget_latest_videos {
  .widget_videos {
    ul {
      display: flex;
      flex-wrap: wrap;
      margin-left: -5px;
      margin-right: -5px;

      li {
        &:first-child {
          width: 100%;
          .photoswipe-link{
            &::before{
              background: url(../images/play.png) no-repeat center/contain;
              height: 24px;
              width: 34px;
            }
          }
        }
        width: 33.3%;
        padding-right: 5px;
        padding-left: 5px;
        .title{
          position: absolute;
          font-size: 16px;
          color: $lightColor;
          font-weight: 500;
          left: 0;
          right: 0;
          bottom: 26px;
          padding: 0 10px;
          line-height: 1;
          text-align: center;
        }
        .photoswipe-link {
          &::before {
            background: url(../images/play_2.png) no-repeat center/contain;
            content: "";
            height: 14px;
            width: 18px;
            left: 50%;
            position: absolute;
            text-align: center;
            top: 50%;
            -webkit-transform: translateX(-50%) translateY(-50%);
            transform: translateX(-50%) translateY(-50%);
            transition: all 0.3s ease-in-out;
            z-index: 2;
          }

          &::after {
            content: '';
            position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
            display: inline-block;
            background-color: rgba(#255085, .5);
          }
        }
      }
    }
  }
}

.widget_banner{
  text-align: center;
}

@import 'widgets/search_mailchimp';
@import 'widgets/nav_cat_arch_meta_pages';
@import 'widgets/calendar';
@import 'widgets/rss';
@import 'widgets/tag_cloud';
@import 'widgets/flickr';
@import 'widgets/instagram';
@import 'widgets/access_press';
@import 'widgets/twitter';
@import 'widgets/post_slider';
@import 'widgets/post_tabs';
@import 'widgets/post_2cols';
