/*
 * A multi-step modal's flow-stack (layouts/_layout.pug: #onboardModal,
 * #createAppStack). The stack is data-fit: Flow sizes it to the current step
 * (flow-stack.js). Behaviour: ./modalStack.js.
 *
 * Its steps scroll (flow-template and .flow-scroll-y are overflow-y: auto in
 * flow-styles.css), and that is right only when a step is really taller than
 * the modal can be. For a moment on every change the box is SMALLER than its
 * content - while the height animates, while a step slides in - and a
 * scrollbar flashes in and out: the visual jump. So:
 */

.modal-stack {
  transition: height 0.18s ease-in-out;
  /* as tall as the dialog may be (90vh, components/modal.pug), less its
     header and the body's padding - past this, and only past this, a step scrolls */
  max-height: calc(90vh - 8rem);
}

/* no scrollbar while the box is catching up with its content */
.modal-stack.is-fitting flow-template,
.modal-stack.is-fitting .flow-scroll-y,
.modal-stack.animating flow-template,
.modal-stack.animating .flow-scroll-y,
.modal-stack .animating flow-template,
.modal-stack .animating .flow-scroll-y {
  overflow-y: hidden;
}

/* opening: take the first step's height at once, under the fade - not
   animate there from whatever step was showing the last time */
.modal-stack.is-opening {
  transition: none;
}
