.modal {
  position: fixed;
  z-index: 3;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  background-color: $color-overlay;

  .modal__dialog {
    padding: $gap;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;

    @include media($medium-screen) {
      padding: $gap * 2;
    }

    @include media($large-screen) {
      padding: $gap * 4;
    }

    .modal__body {
      background-color: $color-white;
      padding: $gap * 2;
      flex-grow: 1;
      overflow-y: auto;
      max-width: 80rem;
      position: relative;

      @include media($medium-screen) {
        padding: $gap * 4;
        flex-grow: 0;
      }

      h1, h2 {
        @include h3;
      }

      > :first-child {
        margin-top: 0;
      }

      .modal__dismiss {
        position: absolute;
        top: 0;
        right: 0;
        width: 8rem;
      }
    }
  }

  &.modal--dismissable {
    .modal__body {
      > :first-child {
        margin-right: 8rem;
      }
    }
  }
}
