/* widget_calendar */
.calendar_wrap {
  width: 100%;
  margin-bottom: 0;
  -webkit-overflow-scrolling: touch;
  -ms-overflow-style: -ms-autohiding-scrollbar;

  @media (min-width: 768px) and (max-width: 992px) {
    & {
      overflow-x: auto;
      overflow-y: hidden;
    }
  }
}

.widget_calendar {
  table {
    margin: 0;
    position: relative;
    text-align: center;
    max-width: 700px;

    //experiment
    display: flex;
    flex-direction: column;
  }

  caption {
    line-height: 1;
    padding: 22px 0 22px;
    text-align: center;
    color: $lightColor;
    background-color: $darkgreyColor;;
  }
  thead {
    background-color: $colorMain2;
    color: $darkColor;

    th {

      &:first-child {
        padding-left: 20px;
      }
      &:last-child {
        padding-right: 20px;
      }
      text-align: center;
      width: 100px;
    }
  }

  tbody {
    border: 1px solid rgba($borderColor, 0.2);
    border-top: none;
    tr {
      &:first-child {
        td {
          padding-top: 30px;
        }
      }
      &:last-child {
        td {
          padding-bottom: 30px;
        }
      }
    }
    td {
      padding: 10px 4px;
      position: relative;
      width: 100px;
      &:first-child {
        padding-left: 20px;
      }
      &:last-child {
        padding-right: 20px;
      }
      a {
        font-weight: 700;
      }
    }
  }

  th {
    color: inherit;
  }

  tfoot {
    td {
      position: absolute;
      top: 0;
      a {
        text-align: center;
        height: 60px;
        line-height: 60px;
        display: inline-block;
        padding: 0 25px;
        font-size: 0;
        color: transparent;
        &:hover {
          background-color: $colorMain;
          border-color: $colorMain;
        }
        &:before,
        &:after {
          color: $lightColor;
          font-size: 14px;
          font-family: 'FontAwesome';
        }
      }
      &.pad {
        display: none;
      }
    }

    //prev
    td:first-child {
      left: 0;
      padding: 0;
      a {
        border-right: 1px solid rgba($lightColor, 0.2);
        &:before {
          content: '\f053';
        }
      }
    }
    //next
    td:last-child {
      right: 0;
      padding: 0;
      a {
        border-left: 1px solid rgba($lightColor, 0.2);
        &:after {
          content: '\f054';
        }
      }
    }
  }
}


/* events calendar */
//for wordpress - unyson events calendar
.fw-shortcode-calendar-wrapper.theme-calendar-wrappper {
  .page-header {
    background-color: #282f39;
    margin-bottom: 0;
    h3, i {
      color: $lightColor;
      font-size: 30px;
    }
    .form-inline {
      display: flex;
      justify-content: space-between;
      align-items: center;
      .btn-group {
        margin: 0;
        &.pull-left {
          border-right: 1px solid rgba($lightColor, 0.1);
        }
        &.pull-right {
          border-left: 1px solid rgba($lightColor, 0.1);
        }
        button[data-calendar-nav] {
          width: 80px;
          height: 80px;
          &:hover {
            background-color: $colorMain;
          }
          &:active {
            top: 0 !important;
          }
          i {
            line-height: 80px;
            font-size: 16px;
          }
        }
      }
    }
  }
  .table-wrap {
    .cal-context {
      .cal-row-fluid.cal-row-head {
        background-color: $colorMain;
        [class*="cal-cell"] {
          background-color: $colorMain;
          color: $lightColor;
          font-size: 14px;
          font-weight: 700;
          border: 0;
          letter-spacing: 1px;
          padding: 18px 0;
        }
      }
    }
    .cal-year-box .row-fluid, .cal-month-box .cal-row-fluid {
      border-bottom: 1px solid rgba($fontColor, 0.2);
    }
    .cal-year-box [class*="span"], .cal-month-box [class*="cal-cell"] {
      border-right: 1px solid rgba($fontColor, 0.2);
      background-color: $greyColor;
    }
    .cal-day-today, .cal-day-today.event-day {
      background-color: $colorMain2;
    }
    .cal-month-day {
      height: 98px;
      display: flex;
      align-items: center;
      justify-content: center;
      span[data-cal-date] {
        color: $darkColor;
        font-size: 24px;
      }
      .text-today {
        top: 4px;
        right: 9px;
        color: $darkColor;
        font-weight: 700;
        font-size: 12px;
      }
      &.cal-day-outmonth {
        background-color: $lightColor;
      }
    }
  }
}

.ds.ms .widget_calendar caption {
  background-color: transparent;
}

.wp-caption .wp-caption-text {
  color: $darkColor;
}