/**
 * @file
 * Layout Builder UI styling.
 */

.layout-builder {
  padding: 1.5em 1.5em 0.5em;
  border: 3px solid #2f91da;
  background-color: #fff;
}

.layout-builder__add-section {
  width: 100%;
  margin-bottom: 1.5em;
  padding: 1.5em 0;
  text-align: center;
  outline: 2px dashed #979797;
  background-color: #f7f7f7;
}

.layout-builder__link--add {
  padding-inline-start: 1.3em;
  color: #686868;
  border-bottom: none;
  background: url(../../../misc/icons/787878/plus.svg) transparent center left / 1em no-repeat; /* LTR */

  &:dir(rtl) {
    background-position-x: right;
  }

  &:hover,
  &:active {
    color: #000;
    border-bottom-style: none;
  }
}

.layout-builder__section {
  margin-bottom: 1.5em;

  & .ui-sortable-helper {
    outline: 2px solid #f7f7f7;
    background-color: #fff;
  }

  & .ui-state-drop {
    margin: 20px;
    padding: 30px;
    outline: 2px dashed #fedb60;
    background-color: #ffd;
  }
}

.layout-builder__region {
  outline: 2px dashed #2f91da;
}

.layout-builder__add-block {
  padding: 1.5em 0;
  text-align: center;
  background-color: #eff6fc;
}

.layout-builder__link--remove {
  position: relative;
  z-index: 2;
  display: inline-block;
  box-sizing: border-box;
  width: 26px;
  height: 26px;
  margin-inline: -10px 6px;
  padding: 0;
  white-space: nowrap;
  text-indent: -9999px;
  border: 1px solid #ccc;
  border-radius: 26px;
  background: url(../../../misc/icons/bebebe/ex.svg) #fff center center / 16px 16px no-repeat;
  font-size: 1rem;

  &:hover {
    background-image: url(../../../misc/icons/787878/ex.svg);
  }
}

.layout-builder-block {
  padding: 1.5em;
  cursor: move;
  background-color: #fff;

  & [tabindex="-1"] {
    pointer-events: none;
  }

  @nest .layout-builder--content-preview-disabled & {
    margin: 0;
    border-bottom: 2px dashed #979797;
  }
}

/*
 * Layout Builder messages.
 */
.layout-builder__message .messages {
  background-repeat: no-repeat;
}
.layout-builder__message--defaults .messages {
  background-image: url("../../../misc/icons/73b355/globe.svg");
}
.layout-builder__message--overrides .messages {
  background-image: url("../../../misc/icons/73b355/location.svg");
}

/* Label when "content preview" is disabled. */
.layout-builder-block__content-preview-placeholder-label {
  margin: 0;
  text-align: center;
  font-size: 1.429em;
  line-height: 1.4;
}

.layout-builder__add-section.is-layout-builder-highlighted {
  margin-bottom: calc(1.5em - 8px);
  outline: none;
}

.layout-builder__layout.is-layout-builder-highlighted,
.layout-builder-block.is-layout-builder-highlighted,
.layout-builder__add-block.is-layout-builder-highlighted {
  position: relative;
  z-index: 1;
  margin: -4px -2px;
}

.layout-builder__add-block.is-layout-builder-highlighted,
.layout-builder__add-section.is-layout-builder-highlighted,
.layout-builder__layout.is-layout-builder-highlighted:before,
.layout-builder__layout.is-layout-builder-highlighted,
.layout-builder-block.is-layout-builder-highlighted {
  border: 4px solid #000;
}

.layout-builder__region-label,
.layout-builder__section-label {
  display: none;
}

.layout-builder--move-blocks-active .layout-builder__region-label {
  display: block;
}

.layout-builder--move-blocks-active .layout-builder__section-label {
  display: inline;
}

.layout__region-info {
  padding: 0.5em;
  text-align: center;
  border-bottom: 2px dashed #979797;
}

/**
 * Remove "You have unsaved changes" warning because Layout Builder always has
 * unsaved changes until "Save layout" is submitted.
 * @todo create issue for todo.
 */
.layout-builder-components-table .tabledrag-changed-warning {
  display: none !important;
}
