/* 📣 This file is a modified version of "react-mosaic-component/react-mosaic-component.css" for Canvas. */
#canvas-mosaic-container {
  --editor-space-side: 16px;
  --resize-offset: 3px;
}

#canvas-mosaic-container {
  flex-grow: 1;
  height: 100%;

  > div {
    height: 100%;
  }
}

.mosaic-root {
  position: relative;
  height: 100%;
}

.mosaic-split {
  position: absolute;
  z-index: 1;
  touch-action: none;
}

.mosaic-split .mosaic-split-line {
  position: absolute;
}

.mosaic-split.-row {
  width: 6px;
  margin-left: -5px;
  cursor: ew-resize;
}

.mosaic-split.-row .mosaic-split-line {
  top: 0;
  right: 3px;
  bottom: 0;
  left: 3px;
}

.mosaic-split.-column {
  height: 2px;
  margin-top: -5px;
  margin-right: var(--editor-space-side);
  margin-left: var(--editor-space-side);
  cursor: ns-resize;
  background-color: var(--slate-a6);
}

.mosaic-split.-column .mosaic-split-line {
  top: 3px;
  right: 0;
  bottom: 3px;
  left: 0;
}

.mosaic-tile {
  position: absolute;
}

.mosaic-tile:nth-of-type(1) {
  border-right: 1px solid var(--gray-5);
}

.mosaic-tile > * {
  width: 100%;
  height: 100%;
}

.mosaic-window,
.mosaic-preview {
  position: relative;
  display: flex;
  overflow: hidden;
  flex-direction: column;
}

.mosaic-window .mosaic-window-toolbar,
.mosaic-preview .mosaic-window-toolbar {
  z-index: 4;
  display: flex;
  flex-shrink: 0;
  border: 1px white solid;
  background: white;
}

.canvas-mosaic-window-editor .mosaic-window-toolbar {
  height: 80px;
}

.canvas-mosaic-window-editor .mosaic-window-body {
  padding-right: var(--editor-space-side);
  padding-left: var(--editor-space-side);
}

.mosaic-window-controls {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.mosaic-window-controls .mosaic-toggle-layout {
  position: absolute;
  top: calc(var(--editor-space-side) + var(--space-1));
  right: var(--editor-space-side);
}

.mosaic-window-title {
  display: flex;
  overflow: hidden;
  height: 100%;
  min-height: 18px;
  padding-left: var(--editor-space-side);
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: var(--font-size-2);
  font-weight: var(--font-weight-medium);
}

.canvas-mosaic-window-preview .mosaic-window-title,
.canvas-mosaic-window-component-data .mosaic-window-title {
  flex: 1;
  align-items: center;
}

.canvas-mosaic-window-editor .mosaic-window-title,
.canvas-mosaic-window-preview .mosaic-window-title,
.canvas-mosaic-window-component-data .mosaic-window-title {
  margin-top: var(--editor-space-side);
}

.canvas-mosaic-window-preview .mosaic-window-title,
.canvas-mosaic-window-component-data .mosaic-window-title {
  height: auto;
}

.mosaic-window .mosaic-window-body,
.mosaic-preview .mosaic-window-body {
  position: relative;
  z-index: 1;
  overflow: hidden;
  flex: 1;
  height: 0;
  padding-bottom: var(--editor-space-side);
  background: white;
}

.mosaic-window .mosaic-preview,
.mosaic-preview .mosaic-preview {
  position: absolute;
  z-index: 0;
  width: 100%;
  height: 100%;
  max-height: 400px;
  border: 1px solid black;
}

.mosaic-split:hover .mosaic-split-line {
  box-shadow: 0 0 0 1px var(--blue-9);
}

/* Prevent iframe from intercepting mouse events during Mosaic window resize by adding an invisible overlay. */
.iframe-overlay::after {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: block;
  content: "";
}
