@import './common-style.less';
@import '../variables.less';
@import '../colors.less';

// fontawsome

@import url('https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css');

.reading__section,
.activity__section {
  .container {
    max-width: 1124px;
  }
}

.homepage__banner {
  padding-top: 40%;
  background: url('https://download.pingcap.com/images/community-banner-pc.svg') no-repeat;
}

.banner__content-container {
  position: absolute;
  width: 100%;
  top: 0;

  .gitHub {
    position: absolute;
    top: 0;
    right: 6rem;
    border: 2px solid white;
    cursor: pointer;
    background: transparent;
    color: white;
    font-size: 16px;
    padding: 0.6rem 1rem;
    margin: 1rem 0 6rem;
    transition: all 0.2s ease;
    z-index: 2;

    &:hover {
      border: 2px solid #3351ff;
      background-color: #3351ff;
    }
  }

  .content {
    text-align: center;
    position: relative;
    max-width: 800px;
    margin-left: 9rem;

    .title-image {
      padding: 8rem 4rem 0 0;

      img {
        height: auto;
      }
    }

    .intro {
      padding: 3.5rem 2rem 3rem 0;
      font-size: 18px;
      text-align: left;
      line-height: 1.7;
      color: white;
    }

    .relationship {
      display: none;
    }

    .btns {
      display: flex;
      flex-flow: row wrap;
      justify-content: space-between;
      padding-right: 3rem;

      .btn {
        padding: 0.6rem 1rem;
        color: #fff;
        border: 1px solid #fff;

        &:last-child {
          margin-left: 2rem;
        }
      }

      .community-btns {
        border: 1px solid white;
        color: white;
        width: 175px;
        font-size: 0.8rem;
        padding: 10px;
        margin-top: 2rem;
        background: none;
        position: relative;
        cursor: pointer;

        .arrow {
          width: 13px;
          position: absolute;
          opacity: 0;
          top: 50%;
          left: 2px;
          margin-top: -0.4rem;
          transition: all 0.3s ease;
        }

        .btn-text {
          transition: all 0.3s ease;
        }

        &:hover {
          .arrow {
            opacity: 1;
            left: 10px;
          }

          .btn-text {
            padding: 14px 0 14px 20px;
          }
        }
      }
    }
  }
}

.activity__section {
  text-align: center;

  .current-activity {
    padding: 0 2rem 2rem;
    width: 100%;
    display: flex;
    flex-flow: row wrap;
    justify-content: space-between;

    .signable {
      width: 66%;
      position: relative;
      overflow: hidden;
      cursor: pointer;
      box-shadow: 0 2px 7px #afafaf;

      .overlayCover {
        background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 1));
        position: absolute;
        bottom: 0;
        left: 0;
        height: 40%;
        width: 100%;
      }

      .picture {
        width: 100%;
        height: auto;

        .active_image_mobile {
          display: none;
        }

        img {
          width: 100%;
          display: block;
        }
      }

      .current-activity-content {
        position: absolute;
        left: 1.5rem;
        font-size: 0.7rem;
        text-align: left;
        right: 1rem;
        line-height: 1.7;
        bottom: 0.7rem;
        color: white;

        .current-activity-summary {
          text-align: justify;
        }
      }
    }

    #calendar {
      font-size: 17px;
      width: 32%;
      position: relative;
      box-shadow: 0 2px 9px 0 #ddd;
    }

    .event-list {
      height: 240px;
      width: 100%;
      position: absolute;
      top: 39px;
      display: none;

      .event-banner {
        width: 100%;
        background: #3351ff;
        color: white;
        padding: 10px 5px;
      }

      .close-icon {
        position: absolute;
        top: 0.5rem;
        left: 0.3rem;

        svg {
          width: 1.2em;
          height: 1.2em;

          path {
            fill: #f5f5f5;
          }
        }
      }

      .event {
        width: 100%;
        padding: 0.5rem 0.3rem 0.5rem 1.7rem;
        text-align: left;
        font-size: 0.8rem;
        position: relative;

        &:hover {
          background: #f5f5f5;
          color: #3351ff;
        }
      }

      .event::before {
        content: '';
        display: inline-block;
        width: 6px;
        height: 6px;
        border-radius: 50%;
        border: 1px solid black;
        background: black;
        left: 0.7rem;
        position: absolute;
        top: 50%;
        margin-top: -3px;
      }

      .event:hover::before {
        background: #3351ff;
        border: 1px solid #3351ff;
      }
    }
  }

  .activities__list {
    display: flex;
    flex-flow: row wrap;
    padding: 1rem 2rem 4rem;
    justify-content: space-around;

    .activity {
      box-shadow: 0 2px 9px 0 #ddd;
      width: 30%;
      margin: 16px 0;
      cursor: pointer;
      height: auto;

      .picture {
        width: 100%;
        height: auto;
        overflow: hidden;

        img {
          width: 100%;
          height: 100%;
        }
      }

      p {
        font-size: 13px;
        text-align: left;
      }

      .name {
        padding: 0.7rem 0 0.5rem;
        font-size: 1rem;
        position: relative;
      }

      .summary {
        padding: 0.5rem 0.9rem 1rem;
        font-size: 0.7rem;
        line-height: 1.7;
      }

      &:hover {
        box-shadow: 5px 5px 20px #ddd;
        transition: box-shadow 0.2s ease-in-out;
      }
    }
  }
}

.reading__section {
  text-align: center;
  background-color: #f5f5f5;

  .reading-list {
    padding: 0 2rem 2rem;
    text-align: left;

    .blog__article {
      background: white;
      display: flex;
      flex-flow: row wrap;
      width: 100%;
      margin-bottom: 2rem;
      box-shadow: 0 2px 9px 0 #ddd;

      .logo {
        width: 33%;
        height: auto;

        img {
          width: 100%;
          height: 100%;
        }
      }

      .content {
        max-width: 65%;
        padding: 0 1rem 0 2rem;

        .title {
          font-size: 1rem;
          margin: 2rem 0 1rem;
        }

        .brief {
          overflow: auto;
          font-size: 0.8rem;
          margin: 1rem 0;
        }
      }

      .tags {
        display: flex;
        flex-flow: row wrap;

        .tag {
          color: white;
          padding: 5px 10px;
          font-size: 0.7rem;
          border-radius: 4px;
          margin: 0 15px 15px 0;
        }

        .tidb-tag:hover {
          color: #EB5757;
          background: white !important;
          border: 1px solid #EB5757;
        }

        .tikv-tag:hover {
          color: #1477ED;
          background: white !important;
          border: 1px solid #1477ED;
        }

        .dm-tag:hover {
          color: #1EB5D7;
          background: white !important;
          border: 1px solid #1EB5D7;
        }

        .tidb-binlog-tag:hover {
          color: #E4B613;
          background: white !important;
          border: 1px solid #E4B613;
        }

        .tidb-ecosystem-tools-tag:hover {
          color: #9ECA22;
          background: white !important;
          border: 1px solid #9ECA22;
        }
      }

      &:hover {
        box-shadow: 5px 5px 20px #ddd;
        transition: box-shadow 0.2s ease-in-out;
      }
    }
  }
}

.tidb-planet-robot {
  position: fixed;
  bottom: 46px;
  left: 45px;
  width: 80px;
  height: auto;

  img {
    width: 100%;
    height: 100%;
  }
}

.qr-tooltiptext {
  width: 150px;
  background-color: #3351ff;
  color: white;
  text-align: center;
  padding: 10px;
  position: fixed;
  z-index: 1;
  font-size: 0.6rem;
  line-height: 1.7;
  bottom: 120px;
  border-radius: 5px 5px 5px 0;
  left: 140px;
  opacity: 1;
  -webkit-transition: opacity 0.3s;
  transition: opacity 0.3s;
}

.qr-tooltiptext::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: -10px;
  border-width: 10px;
  border-style: solid;
  border-color: transparent #3351ff #3351ff transparent;
}

.tidb-robot-qrCode {
  width: 80px;
  margin: 0 auto;
  padding-top: 11px;

  img {
    width: 100%;
    height: 100%;
  }
}

@media (max-width: 1700px) {
  .activity__section {
    .current-activity {
      .signable {
        .current-activity-content {
          font-size: 0.8rem;
        }
      }
    }
  }

  .banner__content-container {
    .content {
      .title-image {
        padding: 6rem 5rem 0 0;
      }
    }
  }
}

@media (max-width: 1550px) {
  .activity__section {
    .current-activity .signable .current-activity-content {
      left: 1.7rem;
      right: 1rem;
      bottom: 0.3rem;
      font-size: 0.8rem;
    }

    .activities__list {
      .activity {
        .name {
          font-size: 1.1rem;
        }

        .summary {
          font-size: 0.8rem;
        }
      }
    }
  }

  .banner__content-container {
    .content {
      margin-left: 5rem;

      .title-image {
        padding: 4.5rem 5rem 0 0;
      }

      .intro {
        padding: 3.5rem 2rem 3.5rem 0;
      }

      .btns {
        button {
          font-size: 16px;
          padding: 0.5rem 0;
          width: 160px;
        }
      }
    }
  }

  .list .blog__article .abstract {
    h1 {
      font-size: 0.95rem;
    }

    .brief {
      font-size: 0.8rem;
    }
  }
}

@media (max-width: 1450px) {
  .banner__content-container {
    .content {
      .title-image {
        padding: 4rem 5rem 0 0;
      }

      .intro {
        padding: 3.5rem 2rem 1.5rem 0;
      }

      .btns {
        .community-btns {
          width: 170px;
          font-size: 0.8rem;

          .arrow {
            width: 16px;
            position: absolute;
            top: 50%;
            left: 2px;
            margin-top: -0.4rem;
          }

          &:hover {
            .arrow {
              opacity: 1;
              left: 12px;
            }

            .btn-text {
              padding: 14px 0 14px 20px;
            }
          }
        }
      }
    }
  }
}

@media (max-width: 1400px) {
  .banner__content-container {
    .content {
      .title-image {
        padding: 4rem 5rem 0 0;
      }
    }
  }
}

@media (max-width: 1350px) {
  .banner__content-container {
    .content {
      .title-image {
        padding: 4rem 9rem 0 0;
      }

      .intro {
        padding: 2.5rem 7rem 0 0;
      }

      .btns {
        padding-right: 9rem;

        .community-btns {
          width: 180px;
          font-size: 0.8rem;

          .arrow {
            width: 16px;
            position: absolute;
            top: 50%;
            left: 2px;
            margin-top: -0.4rem;
          }

          &:hover {
            .arrow {
              opacity: 1;
              left: 12px;
            }

            .btn-text {
              padding: 14px 0 14px 20px;
            }
          }
        }
      }
    }
  }
}

@media (max-width: 1250px) {
  .banner__content-container {
    .content {
      .title-image {
        padding: 2.5rem 13rem 0 0;
      }

      .intro {
        font-size: 17px;
      }

      .btns {
        padding-right: 10rem;

        .community-btns {
          margin-top: 1rem;
          width: 175px;
          font-size: 0.8rem;
          padding: 12px;
        }
      }
    }
  }
}

@media (max-width: 1200px) {
  .banner__content-container {
    .content {
      margin-left: 2rem;

      .intro {
        padding: 2rem 8rem 2.5rem 0;
        font-size: 15px;
      }

      .title-image {
        padding: 3rem 13rem 0 0;
      }
    }
  }
}

@media (max-width: 1024px) {
  .banner__content-container {
    .gitHub {
      font-size: 15px;
      padding: 0.4rem 0.5rem;
      margin: 1rem 0;
    }

    .content {
      .intro {
        padding: 2rem 12rem 2.5rem 0;
        font-size: 15px;
      }

      .title-image {
        padding: 3.5rem 17rem 0 0;
      }

      .btns {
        padding-right: 13rem;

        .community-btns {
          margin-top: 1rem;
          width: 164px;
          font-size: 0.8rem;
          padding: 12px;
        }
      }
    }
  }
}

@media (max-width: 970px) {
  .homepage__banner {
    padding-top: 47%;
  }

  .banner__content-container {
    .content {
      .intro {
        padding: 2rem 19rem 2rem 0;
        font-size: 14px;
      }

      .title-image {
        padding: 2.5rem 20rem 0 0;
      }

      .btns {
        padding-right: 15rem;

        .community-btns {
          width: 156px;
          font-size: 0.8rem;
          padding: 12px;
          margin-top: 1rem;
        }
      }
    }
  }

  .activity__section .current-activity .signable .current-activity-content {
    left: 1.5rem;
  }
}

@media (max-width: 800px) {
  .homepage__banner {
    padding-top: 42%;
  }

  .activity__section .current-activity {
    .signable .current-activity-content {
      left: 1.3rem;
      bottom: 0.1rem;
    }

    .event-list {
      .event-banner {
        padding: 15px 5px 7px;
        font-size: 14px;
      }

      .close-icon {
        top: 0.9rem;
      }
    }
  }

  .banner__content-container {
    .gitHub {
      right: 1rem;
    }

    .content {
      .intro {
        padding: 1.5rem 19rem 1.5rem 0;
        font-size: 14px;
      }

      .title-image {
        padding: 2.5rem 22rem 0 0;
      }

      .btns {
        padding-right: 18rem;

        .community-btns {
          margin-top: 1rem;
          width: 119px;
          font-size: 0.8rem;
          padding: 9px;

          .arrow {
            display: none;
          }

          .btn-text {
            transition: none;
          }

          &:hover {
            .btn-text {
              padding: 0;
            }
          }
        }
      }
    }
  }
}

@media (max-width: 700px) {
  .homepage__banner {
    padding-top: 155%;
  }

  .banner__content-container {
    .gitHub {
      padding: 0.5rem 1.5rem;
      font-size: 12px;
      right: 50%;
      top: 8.5rem;
      margin-right: -48px;
    }

    .content {
      padding: 0 0.5rem;
      margin-left: 0;

      .title-image {
        padding: 2.5rem 3rem 0;
      }

      .intro {
        font-size: 14px;
        padding: 1rem 1rem 3rem;
        margin-top: 7rem;
      }

      .btns {
        padding-right: 0;
      }

      .relationship {
        display: block;
        position: relative;
        width: 90%;
        height: auto;
        margin: 3rem auto auto;

        img {
          width: 100%;
          height: 100%;
        }
      }
    }
  }

  .reading__section .reading-list {
    .blog__article {
      .logo {
        width: 100%;
      }

      .content {
        max-width: 100%;
        padding: 0 1rem;

        .title {
          font-size: 1rem;
          margin: 1rem 0;
        }

        .brief {
          overflow: auto;
          font-size: 0.8rem;
          margin: 1rem 0;
        }
      }
    }

    .readMoreBtn button {
      margin: 0 0 3rem;
      font-size: 14px;
      width: 96px;

      .arrow {
        display: none;
      }

      .inner-text {
        margin-top: -10px;
      }
    }
  }

  .activity__section {
    .current-activity {
      padding: 0;
      width: 100%;
      max-width: 286px;
      margin: 1rem auto;

      .event-list {
        top: 29px;

        .event {
          font-size: 0.9rem;
        }
      }

      .signable {
        width: 100%;
        height: 100%;

        .picture {
          .active_image_mobile {
            display: block;
          }

          .active_image_pc {
            display: none;
          }
        }

        .current-activity-content {
          display: none;
        }
      }

      #calendar {
        width: 100%;
        margin-top: -6px;
        height: 254px;
        box-shadow: 0 2px 3px 0 #ddd;
      }
    }

    .activities__list {
      display: block;
      flex: none;
      width: 100%;
      padding: 0 0 4rem;
      justify-content: none;
      text-align: center;

      .activity {
        box-shadow: 0 2px 9px 0 #ddd;
        width: 100%;
        max-width: 286px;
        height: auto;
        margin: 2rem auto;

        .picture {
          width: 100%;
          height: auto;
          overflow: hidden;

          img {
            width: 100%;
            height: 100%;
          }
        }

        .name {
          padding: 0.7rem 0 0.5rem;
          font-size: 1.1rem;
          position: relative;
        }

        .summary {
          padding: 0.5rem 0.9rem 1rem;
          font-size: 0.8rem;
        }

        &:hover {
          box-shadow: 5px 5px 20px #ddd;
          transition: box-shadow 0.2s ease-in-out;
        }
      }
    }
  }
}

@media (max-width: 600px) {
  .homepage__banner {
    padding-top: 166%;
  }
}

@media (max-width: 550px) {
  .homepage__banner {
    padding-top: 180%;
  }

  .banner__content-container {
    .gitHub {
      top: 5.5rem;
    }

    .content {
      .intro {
        margin-top: 5rem;
      }
    }
  }

  .tidb-planet-robot {
    left: 20px;
    width: 53px;
  }

  .qr-tooltiptext {
    bottom: 97px;
    left: 87px;
    padding: 5px;
    width: 120px;
  }
}

@media (max-width: 450px) {
  .homepage__banner {
    padding-top: 200%;
  }
}

@media (max-width: 400px) {
  .banner__content-container {
    .content {
      .intro {
        padding: 1rem;
      }

      .btns {
        padding-right: 0;
        justify-content: space-around;

        .community-btns {
          margin-top: 1rem;
          width: 111px;
          font-size: 0.78rem;
          padding: 10px 0;
        }
      }

      .relationship {
        margin: 2rem auto auto;
      }
    }
  }
}

@media (max-width: 349px) {
  .homepage__banner {
    padding-top: 220%;
  }

  .banner__content-container {
    .gitHub {
      top: 4rem;
    }

    .content {
      padding: 0.3rem;

      .title-image {
        padding: 1.5rem 3rem 0;
      }

      .intro {
        margin-top: 4rem;
        font-size: 13px;
      }

      .btns {
        .community-btns {
          line-height: 1.7;
          margin-top: 1rem;
          width: 100px;
          font-size: 0.78rem;
          padding: 10px 0;
        }
      }
    }
  }
}
