/* meetup page */

// import global variables
@import "./variables.less";
// TODO: abstract title style...
@import "./about.less";

@fadeInAttrs: fadeIn 1s; // fadeInAttrs

.layout-text-on-hover {
  width: 100%;
  height: auto;

  .image {
    position: relative;
    width: 100%;
    height: 0;
    overflow: hidden;
    padding-bottom: calc(100% / (1 / 1)); // 1x1 by default: Default to square
    box-shadow: 0 5px 22px rgba(0, 0, 0, 0.1);

    img {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      .customAnimation(@fadeInAttrs);
    }
  }

  .text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 30px;
    background-color: rgba(242, 241, 241, 0.8);
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.25s;

    .inner-title {
      display: inline-block;
      position: absolute;
      bottom: 50%;
      right: 30px;
      opacity: 0;
      font-size: 1.6rem;
      color: @midnightBlue;
      transform: translate3d(40%, 0, 0);
      transition: transform 0s 0.2s, opacity 0.2s;

      &::after {
        content: ' ';
        position: absolute;
        bottom: 10%;
        left: 0;
        width: 100%;
        height: 10px;
        z-index: -1;
        background-color: @tidbRed;
        transform-origin: 0 50%;
        transform: scaleX(0);
      }
    }
  }

  &:hover {
    .text {
      opacity: 1;

      .inner-title {
        opacity: 1;
        transform: translate3d(0, 0, 0);
        transition: transform 0.35s cubic-bezier(0.15, 0.7, 0.54, 0.99), opacity 0.4s;

        &::after {
          transition: transform 0.35s cubic-bezier(0.15, 0.7, 0.54, 0.99) 0.2s;
          transform: scaleX(1);
        }
      }
    }
  }
}

section[class^='meetup-landing-page-'] {
  // padding-top: 2rem !important;

  h3 {
    margin: 25px 0 16px;
    font-size: 1rem;
    color: #3C3C3C;
    text-align: left;
  }

  h4 {
    margin: 10px 0;
    font-size: 0.8rem;
    font-weight: 400;
    color: @purpleBlue;
  }

  p {
    margin: 2px auto;
    font-weight: 300;
    font-size: 0.8rem;
  }

  .meetup-review-title {
    text-align: left;
  }

  .details {
    display: flex;
    flex-flow: row wrap;
    width: 100%;

    .row {
      display: flex;
      flex-flow: row wrap;
      align-items: flex-start;
      justify-content: space-between;
      width: 100%;
    }

    .item {
      position: relative;
      align-items: center;
      margin-bottom: 2rem;

      .link-abs {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 100;
      }
    }
  }

  .layout-text-on-hover {
    .image {
      background: @grayWhite;
    }
  }
}

.meetup-landing-page-banner {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 30rem;
  margin-top: @headerHeight;
  background: url('https://download.pingcap.com/images/banners/meetup-banner-pc.svg') no-repeat;
  background-position: center;
  background-size: cover;

  .mkdf-elements-holder-item-inner {
    position: absolute;
    right: 10rem;
    bottom: 10rem;
    text-align: right;
    color: white;

    h2 {
      font-size: 2rem;
      color: white;
    }

    h2::before {
      display: none;
    }

    h3 {
      margin-bottom: 45px;
    }

    h3,
    h4,
    p {
      color: white;
    }
  }

  .image {
    box-shadow: none;
  }

  .text {
    padding: 30px 70px;

    .inner-title {
      letter-spacing: 4px;
      bottom: 30px;
      right: 70px;
    }
  }
}

.readMore-btn {
  border: 1px solid #3351FF;
  color: #3351FF;
  width: 140px;
  font-size: 0.8rem;
  padding: 14px;
  margin: 3rem 0 0;
  background: none;
  position: relative;
  cursor: pointer;

  .arrow {
    width: 16px;
    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: 12px;
    }

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

.meetup-landing-page-intro {
  padding: 4rem 12px 0 !important;
  min-height: 0 !important;
}

.meetup-landing-page-review {
  .details {
     justify-content: space-between;
     padding: 1rem 2rem 0;

    .item {
      min-height: 380px;
      // width: 32%;
      width: 310px;
    }

    .layout-text-on-hover {
      .image {
        padding-bottom: calc(100% / (3 / 2)); // 1x1 by default
      }

      .text {
        padding: 30px 10px;
      }
    }

    p {
      font-size: 16px;
    }
  }
}

.meetup-landing-page-memoir {
  background: @grayWhite;
  padding: 6rem 0 2.5rem;
  box-sizing: border-box;

  .links-group {
    .link {
      margin: 0.5rem 0;
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 0.8rem;

      .arrow-right {
        opacity: 0;
        display: none;

        svg {
          height: 1em;
        }
      }

      &:hover {
        .arrow-right {
          opacity: 1;
          display: inline-block;
          transition: opacity 0.2s;
        }
      }
    }
  }
}

.meetup-landing-page-lecturer {
  padding: 2rem 12px 0 !important;

  .details {
    .item {
      min-height: 300px;
      flex-basis: 20%;
      padding: 0 @horizontalPadding;

      .layout-text-on-hover {
        .text {
          padding: 40px 20px;
          background-color: #3351FF;

          p {
            opacity: 0;
            // color: @midnightBlue;
            overflow: auto;
            color: white;
            line-height: 1.4;
            font-size: 0.8rem;
            font-weight: 400;
            transform: translate3d(40%, 0, 0);
            transition: transform 0s 0.2s, opacity 0.2s;
          }
        }

        &:hover {
          .text {
            p {
              opacity: 1;
              transform: translate3d(0, 0, 0);
              transition: transform 0.35s cubic-bezier(0.15, 0.7, 0.54, 0.99), opacity 0.4s;
            }
          }
        }
      }
    }
  }
}

.meetup-landing-page-banner-footer {
  .section-container {
    background-image: url("https://download.pingcap.com/images/banners/meetup-footer-banner.png");
    background-size: cover;
    background-position: center;
    width: 100%;
    height: 0;
    padding: 8%;
  }
}

.carousel-indicators {
  position: relative;
}

.carousel-indicators li {
  display: inline-block;
  margin: 0 5px;
}

.carousel-bullet {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid white;
  cursor: pointer;
}

.swiper-container {
  width: 400px !important;
  height: auto;
  padding-top: 10px;
  margin-right: 0 !important;

  @media only screen and (max-width: 768px) {
    width: auto !important;
  }
}

.right-swiper-pagination {
  position: relative !important;
  text-align: right !important;
}

.swiper-pagination-bullets {
  top: 0 !important;
}

.swiper-pagination-bullet {
  width: 12px !important;
  height: 12px !important;
  background: transparent !important;
  border: 1px solid white;
  opacity: 1 !important;
  margin: 0 5px !important;
}

.swiper-pagination-bullet-active {
  background: white !important;
}

.swiper-wrapper {
  margin-top: 25px;
}

.swiper-slide {
  .topic {
    font-size: 1rem;
    letter-spacing: 1px;
  }

  .address,
  .meetup-date {
    font-size: 0.85rem;
    margin-top: 1rem;
    letter-spacing: 1px;

    span:nth-child(1) {
      padding: 0 10px;
    }

    span:nth-child(2) {
      padding-right: 15px;
    }

    span:last-child {
      padding-left: 15px;
    }
  }
}

.meetup-register {
  border: 1px solid white;
  font-size: 0.85rem;
  padding: .6rem 1.1rem;
  background: transparent;
  margin-top: 1rem;
  cursor: pointer;
  color: white;

  &:hover {
    color: #1187B6;
    background: white;
  }
}

.unclickable-btn {
  background: transparent !important;
  color: white !important;
  cursor: not-allowed !important;
}

.meetup-carousel {
    position: relative;
}

.meetup-instructors {
  padding: 0 !important;
}

.meetup-speakers {
  background: #F2F2F2 !important;
}

@media (max-width: 1500px) {
  .meetup-landing-page-banner-footer {
    .section-container {
      padding: 12%;
    }
  }
}

@media (max-width: 1024px) {
  .meetup-landing-page-banner {
    height: 23rem;

    .mkdf-elements-holder-item-inner {
      right: 5rem;
      bottom: auto;
    }
  }

  .meetup-landing-page-review {
    .details .item {
      min-height: 350px;
    }
  }
}

@media (max-width: 800px) {
  .meetup-landing-page-review {
    .details .row {
      justify-content: space-between !important;
    }
  }

  .footer-section {
    padding: 0 !important;
  }

  .meetup-landing-page-banner-footer {
    min-height: auto !important;

    .section-container {
      background-image: url('https://download.pingcap.com/images/banners/meetup-footer-banner-mobile.jpg');
      padding: 15%;
    }
  }
}

@media (max-width: 600px) {
  section[class^=meetup-landing-page-] {
    h3 {
      text-align: center;
    }
  }

  .meetup-landing-page-banner-footer {
    min-height: auto !important;
    padding: 0 !important;
  }

  .meetup-landing-page-lecturer .details .item {
    flex-basis: 50%;
  }

  .meetup-landing-page-review {
    .details .item {
      flex-basis: 100%;
      max-width: 287px;
      min-height: auto;
      margin: 0 auto;

      p {
        margin: 2px 20px;
        text-align: center;
      }
    }

    .layout-text-on-hover {
      // display: none;
      .text {
        display: none;
      }
    }
  }

  .meetup-speakers {
    height: 230px !important;
    margin: 20px 5px !important;
    width: 183px !important;

    .company {
      padding: 0.5rem !important;
    }
  }

  .meetup-landing-page-banner {
    background: url('https://download.pingcap.com/images/banners/meetup-banner-mobile.svg') no-repeat;
    background-position: center;
    background-size: cover;
    padding: 1rem !important;
    height: 33rem;

    .mkdf-elements-holder-item-inner {
      position: relative;
      right: auto;
      bottom: auto;
      text-align: center;

      h2 {
        font-size: 1.5rem;
      }
    }
  }

  .meetup-carousel {
    margin-top: 0;
  }

  .swiper-pagination-bullet {
    width: 8px !important;
    height: 8px !important;
  }

  .swiper-pagination {
    text-align: center !important;
  }

  .swiper-wrapper {
    margin-top: 12px;
  }

  .swiper-container {
    width: auto;
    margin: 0 auto !important;
  }

  .swiper-slide {
    // width: 320px !important;
    .topic {
      margin-bottom: 10px;
    }

    .address,
    .meetup-date {
      margin-top: 10px;
      font-size: 0.9rem;
      display: inline;
    }
  }
}

@media (max-width: 375px) {
  .meetup-speakers {
    width: 165px !important;
    height: 202px !important;

    .name {
      font-size: 0.9rem !important;
    }
  }
}

@media (max-width: 360px) {
  .meetup-speakers {
    width: 158px !important;
  }
}

@media (max-width: 320px) {
  .meetup-landing-page-banner {
    height: 31rem;
  }

  .meetup-speakers {
    height: 240px !important;
    width: 215px !important;
  }
}
