/**
 * The following styles get applied inside the editor only.
 */
@import "./sass/_wordpress.scss";
@import "./components/block-edit-modal/editor.scss";

// Carousel inspector controls
@import './features/carousel/editor.scss';

// Query loop
@import './features/core-query/editor.scss';

// Custom style for block's placeholder
.components-placeholder__label {
  align-self: stretch;

  svg {
    max-width: 48px;
  }
}

// Make sure the inserter button is enabled on site editor
.block-editor-iframe__body .cbb-block.is-selected {
  .block-list-appender,
  .block-editor-inserter {
    pointer-events: auto !important;
  }
}

@include break-medium() {
  .interface-interface-skeleton__sidebar {
    &.is-sidebar-mode,
    &.is-fullscreen-editor {
      .components-panel__header {
        display: none;
      }
    }
    &.is-sidebar-mode {
      overflow: hidden;
    }
  }
}

// Show only 1 spacing label
.spacing-panel-item + .spacing-panel-item {
  .spacing-label {
    display: none;
  }
}

// Don't respect content width on the block element on the edit variation screen
.editor-styles-wrapper.post-type-boldblocks_variation .block-editor-block-list__layout.is-root-container > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
  max-width: none;
}

// Remove the margin bottom on readonly wrapper html
.is-editing-disabled.wp-block-html {
  display: flex;
}

// Make the background dropdown behind the media modal popup: 160000
.cbb-settings-dropdown,
.cbb-background-dropdown {
  z-index: 150000;
}

// Fix the margin bottom of some nested VStack components in side PanelBody components
.cbb-settings .components-v-stack > * {
  margin-bottom: 0 !important;

  > p:last-of-type {
    margin-bottom: 0;
  }
}

// Dropdown of custom control in block toolbar.
.cbb-dropdown .components-popover__content {
  min-width: 300px;
  padding: 12px;

  h2 {
    font-size: 13px;
    color: #1e1e1e;
  }
}

// Block edit screen
.cbb-block-settings {
  &.is-opened {
    padding-bottom: 0;
  }
}

// Repeater block settings's label
.cbb-repeater-label {
  display: block;
  margin-top: 20px;
}

// Advanced panel
.cbb-block-advanced {
  > *:last-child {
    margin-bottom: 0;
  }
}

// External resource styles
.dependent-resources-control {
  > .label-help > .label-help__header {
    margin-top: 0 !important;
    border-bottom: 1px solid #e1e1e1;
  }

  .script-module-toggle {
    margin-bottom: 12px !important;
  }

  .components-toggle-control {
    width: 100%;
  }
}

// Custom attributes
.custom-attributes-control {
  .repeater-group__item {
    padding-bottom: 0;
  }

  .group-item-toggle {
    margin-bottom: 8px !important;
  }
}

.components-tools-panel {
  .custom-attributes-control {
    .group-control__body {
      gap: 12px;
    }
  }
}

// Remove spaces for label attributes inside ToolsPanel
.attribute-label {
  *:empty {
    display: none;
  }
}
