:root {
  --db-background-color: white;
  --db-text-color: black;
  --db-background-image: repeating-linear-gradient(
    45deg,
    oklch(100% 0 0),
    oklch(100% 0 0) 13px,
    var(--sl-color-neutral-100) 13px,
    var(--sl-color-neutral-100) 14px
  );
  --db-background-size: 40px 40px;
  --db-toolbar-height: 75px;
  /* Drupal admin toolbar is 502 */
  --db-z-index: 401;
}

body:has(.display-builder) .dialog-off-canvas-main-canvas {
  /* margin-inline-start: var(--db-body-margin-left, 0); */
  margin-inline-start: var(--drupal-displace-offset-left, 0);
}

/* Fullscreen button toggle @see components/fullscreen_button. */
.display-builder--fullscreen {
  position: fixed;
  z-index: 900;
  top: 0;
  left: 0;
  overflow: auto;
  width: 100%;
  height: 100%;
  /* @todo get the body background color? */
  background-color: var(--db-background-color);
}

/* Olivero fix for fullscreen */
.display-builder-is-fullscreen {
  #toolbar-administration {
    display: none;
  }

  .site-header {
    z-index: 1;
    opacity: 0;
  }
}

.display-builder {
  /* Shoelace avoid clipping before the web components are attached */
  :not(:defined) {
    visibility: hidden;
  }

  /* Disable the builder until htmx is done. */
  /* @see assets/js/display_builder.js */
  &.db-htmx-before-request {
    pointer-events: none;

    > * {
      opacity: 0.6;
    }
  }

  .db-background,
  .db-background::part(panel),
  .db-background.shoelace-button::part(base) {
    background-image: var(--db-background-image);
    background-size: var(--db-background-size);
    box-shadow: var(--sl-shadow-medium);
  }

  .display-builder__main {
    margin-top: 1rem;
    transition: margin-left 0.1s ease;

    .db-message {
      margin: 1rem 0 0 0;
    }

    .display-builder__main_content {
      margin-top: 1rem;
      padding: 0 0.2rem 0 0.2rem;
    }
  }

  .shoelace-tabs__tab[tabindex]:focus {
    outline: 0 none;
    box-shadow: unset;
  }

  /* Keyboard shortcut */
  .db-toolbar code {
    color: var(--sl-color-danger-400);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
  }

  /* Full reset island specifics */
  .db-devel-reset {
    padding: 0.5rem;
  }

  /* Preview Island specific */
  .db-preview-placeholder {
    padding: 0.3rem;
  }
}
