/* simple helper so the heading labels the dialog without showing visually */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* hidden by default */
#contactModal {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;

  z-index: 9999;

  align-items: center;
  justify-content: center;

  padding: 1rem;
  box-sizing: border-box;
}

/* open state */
#contactModal.is-open {
  display: flex;
}

/* dark backdrop */
#contactModal .backdrop {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.5);
}

/* dialog layout */
#contactModal .dialog {
  position: relative;
  z-index: 1;
  background: #fff;

  width: 90%;
  max-width: 1120px;
  max-height: 100%;

  padding: 1rem;
  box-sizing: border-box;

  display: flex;
  flex-direction: column;
}

/* close button */
#closeContact {
  align-self: flex-end;
  margin-bottom: 0.5rem;
  cursor: pointer;
}

/* iframe size desktop and tablet */
#contactFrame {
  display: block;
  width: 100%;
  height: 65vh;
  border: 0;
  flex: 1 1 auto;
}

/* mobile layout, dialog fills screen, iframe height tuned for viewport */
@media (max-width: 768px) {
  #contactModal {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
  }

  #contactModal .dialog {
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    border-radius: 0;
    padding: 0.5rem;
  }

  #contactFrame {
    height: calc(100vh - 60px);
  }
}