// BSRichText 의 iframe 안에 들어가는 container 스타일

:root {
  --body-bg: #ffffff;
  --gray-400: #A9A9A9;
  --primary: #5672EF;
  --icon-font-family: Material Symbols Outlined, monospace;
}

.bs-rich-text-editor {
  width: 100%;
  box-sizing: border-box;
  overflow: auto;
  padding: 8px;
  margin: 0 auto;
  background-color: var(--body-bg);
  align-self: center;
  box-shadow: 2px 0 8px rgba(0, 0, 0, .2);

  > .tiptap {
    width: 100%;
    flex-grow: 1;

    &:focus {
      outline: 0
    }
  }

  /* table */
  table {
    table-layout: fixed;

    td,
    th {
      min-width: 1em;
      position: relative;

      > * {
        margin-bottom: 0;
      }
    }

    th {
      font-weight: bold;
      text-align: left;
    }

    .selectedCell:after {
      background: var(--gray-400);
      opacity: 0.3;
      content: "";
      left: 0;
      right: 0;
      top: 0;
      bottom: 0;
      pointer-events: none;
      position: absolute;
      z-index: 1;
    }

    .column-resize-handle {
      background-color: var(--primary);
      bottom: -2px;
      pointer-events: none;
      position: absolute;
      right: -2px;
      top: 0;
      width: 4px;
      z-index: 2;
    }
  }

  /* image */
  img, video {
    user-select: auto;

    &.ProseMirror-selectednode {
      outline: 3px solid var(--primary);
      position: relative;
      transition: outline 0.15s;
      z-index: 1;
    }
  }

  /* youtube */
  span[data-youtube-video] {
    position: relative;
    cursor: move;

    iframe {
      user-select: auto;
    }

    &.ProseMirror-selectednode iframe {
      outline: 3px solid var(--primary);
      transition: outline 0.15s;
    }

    &::after {
      content: "menu";
      font-family: var(--icon-font-family);
      position: absolute;
      background-color: white;
      border-radius: 4px;
      padding: 4px;
      left: 8px;
      top: 8px;
      font-size: 20px;
      line-height: 1em;
    }
  }
}

