/* Neo Fields */
.mfp-neo-field {
}

/* Fix the neo tab border */
.mfp-neo-field .mfp-block-type-preview {
  padding: 12px 0 0 0;
  margin: 0;
  border-top: 1px solid #e3e5e8;
}

.mfp-neo-field
  .mfp-block-type-preview
  + .ni_block_content
  > .ni_block_content_tab {
  border: 0;
}

/* Move block preview button to the right */
.mfp-neo-field .mfp-modal-button {
  margin-left: 0;
  position: absolute;
  right: 0;
  top: 0;
}


/*
 * Takeover
 *
 * When "taking over" a neo field, we need to hide the default buttons and
 * show our own.
 *
 * - This needs to work for "top level" blocks
 * - But also needs to work for nested blocks
 *
 * Furthermore, we have a "disable previews for single children" which
 * complicates things. Even on "take over", if there is a nested block that
 * can only have one type of child, we hide our buttons and let the default
 * neo experience take over.
 */

/* Hide neo top-level buttons on takeover */
.mfp-neo-field.mfp-field--takeover .last .ni_buttons .btngroup,
.mfp-neo-field.mfp-field--takeover .last .ni_buttons .menubtn {
  display: none !important;
}

/* Show our button on takeover */
.mfp-neo-field.mfp-field--takeover .mfp-modal-button {
  position: block;
}


/* Move our button into position on takeover */
.mfp-neo-field.mfp-field--takeover .mfp-modal-button {
  position: static;
  margin-left: 0;
}

/* Hide nested neo buttons on takeover */
.mfp-neo-field.mfp-field--takeover > .ni_blocks > .ni_buttons .btngroup,
.mfp-neo-field.mfp-field--takeover > .ni_blocks > .ni_buttons .menubtn, 
.mfp-nested-field--takeover .ni_buttons .btngroup,
.mfp-nested-field--takeover .ni_buttons .menubtn {
  display: none !important;
}

/* Deal with "disable previews for single children" exception */
.mfp-nested-field--disable-single-child .mfp-modal-button {
  display: none !important;
}