.modal2-is-open {
  overflow: hidden;
}

.modal2 {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;

  /* default overflow mode */
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;

  z-index: 1000;

  &.is-open {
    display: block;
  }
}

.modal2__backdrop {
  @extend .clearfix;

  width: 100%;
  min-height: 100%;

  background: fade($color-black, 50%);

  z-index: -1;

  /* fix collapsing margins */
  float: left;
}

.modal2__close {
  display: block;
  float: right;

  height: 40px;
  width: 40px;

  font-size: 14px;
  text-align: center;
  line-height: 40px;

  background: transparent;
  border: none;
  outline: none;

  cursor: pointer;
}

.modal2__close--inside {
  color: $color-white;

  @include media-breakpoint-up(md) {
    margin-top: 20px;

    font-size: 21px;

    color: $color-gray--darker;

    &:hover,
    &:focus {
      color: $color-blue;
    }
  }
}

.modal2__close--outside {
  position: absolute;
  top: 16px;
  right: 16px;

  color: $color-gray--mid;

  &:hover,
  &:focus {
    color: $color-white;
  }

  .modal2__close__icon {
    width: 20px;
    height: 20px;
    margin-top: 8px;
    margin-left: 8px;
  }

  @include media-breakpoint-up(md) {
    top: 32px;
    right: 32px;

    color: $color-gray--mid;

    &:hover,
    &:focus {
      color: $color-white;
    }
  }
}

.modal2__close__icon {
  margin-top: 8px;
}

.modal2__content {
  max-width: 780px;
  margin: 40px auto 68px;
  background: $color-white;

  &:focus {
    outline: none;
  }
}

/* fullscreen mode mode (overflow hidden) - e.g. utilized by dialogs */
.modal2--fullscreen {
  overflow: hidden;

  .modal2__backdrop {
    height: 100%;
  }

  .modal2__content {
    height: 100%;
    margin-top: 0;
    margin-bottom: 0;

    background: transparent;
  }

  @include media-breakpoint-up(md) {
    .modal2__backdrop {
      padding: 40px 0 68px;
    }
  }
}
