@import "../../../sass/webpack_deps";

.modal {
  $close-button-size: 7.2rem;
  background-color: $color-white;
  box-shadow: 0 .5rem 5rem rgba($color-black, .5);
  left: 0;
  opacity: 0;
  position: absolute;
  right: 0;
  top: 0;
  transition: transform 400ms, opacity 400ms;
  z-index: z("modal");

  @media (min-width: $min-720) {
    left: 50%;
    max-width: 1200px;
    position: fixed;
    top: 18rem;
    transform: translate(-50%, -0%);
    width: 70%;
  }

  &--visible {
    opacity: 1;
  }

  &__close {
    background-color: transparent;
    border: 0;
    cursor: pointer;
    display: block;
    font-size: 2rem;
    height: 4rem;
    line-height: 4rem;
    outline: 0;
    padding: 0;
    position: absolute;
    right: ($gutter / 2);
    text-align: left;
    text-indent: -9999px;
    top: ($gutter / 2);
    width: 4rem;
    z-index: z("modal") + 1;

    &::before {
      bottom: 0;
      display: block;
      left: 0;
      position: absolute;
      right: 0;
      text-align: center;
      text-indent: 0;
      top: 0;
    }

    @media (min-width: $min-720) {
      background-color: $color-white;
      border-radius: 50%;
      box-shadow: 0 2.2rem 4.5rem rgba($color-black, .75);
      font-size: 2.6rem;
      height: $close-button-size;
      left: 50%;
      line-height: $close-button-size;
      margin-left: (-$close-button-size / 2);
      text-align: center;
      top: 0;
      transition: transform 400ms 1000ms;
      user-select: none;
      width: $close-button-size;
      z-index: z("modal") - 1;
    }
  }

  &--visible &__close {
    @media (min-width: $min-720) {
      transform: translateY(-($close-button-size + $gutter));
      transition: transform 400ms 400ms;
    }
  }

  &__content {
    $top-places-content-mq: (strip-units($max-width) * 10) + (strip-units($gutter) * 10 * 4);
    background-color: $color-white;
    left: 0;
    margin: 0 auto;
    max-width: $max-width;
    overflow-x: hidden;
    overflow-y: auto;
    padding: $gutter $gutter 0;
    position: absolute;
    right: 0;
    top: 0;
    z-index: z("modal");

    @media (min-width: $min-720) {
      bottom: auto;
      left: auto;
      max-height: calc(100vh - #{($close-button-size + $gutter * 2)});
      padding: 4rem ($gutter * 2) ($gutter * 2);
      position: relative;
      right: auto;
      top: auto;
    }

    @media (min-width: #{$top-places-content-mq * .0625}em) {
      padding-left: 0;
      padding-right: 0;
    }
  }

  &__wrap {
    @media (min-width: $min-1024) {
      display: flex;
    }

    .no-flexbox & {
      overflow: hidden;
    }
  }

  &__column--left {
    @media (min-width: $min-720) {
      padding-right: 1rem;
    }

    margin-left: auto;
    margin-right: auto;
    max-width: 30rem;
    width: 100%;

    &:not(:first-child) {
      @media (max-width: $max-720) {
        margin-top: ($gutter * 2);
      }
    }

    .no-flexbox & {
      @media (min-width: $min-960) {
        float: left;
        width: calc(50% - #{$gutter});
      }
    }

  }

  &__column--right {
    margin-left: auto;
    margin-right: auto;
    max-width: 70rem;
    width: 100%;

    &:not(:first-child) {
      @media (max-width: $max-720) {
        margin-top: ($gutter * 2);
      }
    }

    .no-flexbox & {
      @media (min-width: $min-960) {
        float: left;
        width: calc(50% - #{$gutter});
      }
    }

  }

}

.modal-ebook {
  &__strapline h1 {
    color: $titlegray;
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -.05rem;
    line-height: (36.5 / 27);
    margin-bottom: 3rem;
    padding-top: 1rem;

    @media (min-width: $min-600) {
      font-size: 4.2rem;
      line-height: (70 / 64);
    }
  }

  &__title {
    color: $color-red;
    margin-bottom: 1rem;
  }

  &__copy {
    margin-bottom: 2.5rem;
  }

  &__form-field {
    background-color: $color-white;
    height: 50px;
    margin: 1.5rem .5rem 1rem 0;
    padding: $spacing;
    width: 325px;
  }

  &__download__button--position {
    margin: 1rem;

    &.disabled {
      cursor: default;
      opacity: .4;
    }
  }

  &__modal__terms {
    font-size: 1rem;
    margin-bottom: 1rem;
  }

  &__success {
    margin-top: 5em;
    text-align: center;
  }

  &__success__copy {
    padding: 1.5em;
  }

}
