.blocks-container {
}

.block-content {
  min-height: 24px;
  max-width: 100%;
  overflow: initial;
  cursor: text;
  word-break: break-word;

  img {
    max-width: 100%;

    /* FIXME: img macros */

    &.left {
      float: left;
    }

    &.right {
      float: right;
    }

    &.loading-asset {
      width: 9px;
    }
  }

  .asset-container {
    display: inline-block;
    position: relative;
    margin-top: .5rem;

    .ctl {
      position: absolute;
      top: 0;
      right: 0;
      padding: 5px;
      z-index: 1;
      display: none;

      > a {
        padding: 3px;
        border-radius: 4px;
        opacity: .4;
        user-select: none;
        background: var(--ls-primary-background-color);

        &.delete {
          svg {
            color: var(--ls-primary-text-color);

            opacity: .5;
            font-weight: normal;
          }
        }

        &:hover {
          opacity: 1;
        }

        &:active {
          opacity: 1;
        }
      }
    }

    &:hover {
      .ctl {
        display: flex;
      }
    }
  }

  .resize {
    display: inline-flex;
    /* Fix chrome missing resize handle issue. Ref: https://github.com/logseq/logseq/pull/1692/files */
    transform: translate3d(0, 0, 0);
  }

  .draw [aria-labelledby="shapes-title"] {
    position: absolute;
    left: 50%;
    transform: translate(-50%);
  }
}

.open-block-ref-link {
  @apply py-0 px-1 rounded opacity-50 hover:opacity-100;
  font-size: 12px;
  line-height: 1em;
  position: relative;
  right: -4px;
}

.block-body {
  blockquote:first-child,
  pre:first-child {
    margin-top: 8px;
    margin-bottom: 8px;
  }
}

.block-children {
  border-left: 1px solid;
  border-left-color: var(--ls-guideline-color, #ddd);

  padding-top: 2px;
  padding-bottom: 3px;

  > .ls-block {
    &:last-child {
      margin-bottom: -5px;
    }
  }
}

.block-control,
.block-control:hover {
  text-decoration: none;
  cursor: pointer;
  font-size: 14px;
  min-width: 10px;
  color: initial;
  user-select: none;
}

.block-ref {
  padding-bottom: 2px;
  border-bottom: 0.5px solid;
  border-bottom-color: var(--ls-block-ref-link-text-color);
  cursor: alias;

  &:hover {
    color: var(--ls-link-text-hover-color)
  }
}

.page-ref {
  color: var(--ls-link-ref-text-color);

  &:hover {
    color: var(--ls-link-ref-text-hover-color);
  }
}

.embed-page {
  @apply py-2 my-2 px-2;

  > section {
    margin-bottom: 5px;
  }

  &.in-sidebar {
    background-color: var(--ls-tertiary-background-color);
  }
}

.blocks-properties {
  background-color: var(--ls-block-properties-background-color, #f0f8ff);
}

.marker-switch {
  font-size: 85%;
  margin-right: 6px;
  margin-left: 2px;
  border-radius: 3px;
  font-weight: 500;
  display: inline-block;
  text-align: center;
  width: 16px;
  height: 18px;
  opacity: 0.5;
  padding: 0 2px 0 2px;
  border: 1px solid;
  line-height: 1.3;
  color: var(--ls-link-text-color, #045591);
  cursor: pointer;

  &:hover {
    color: var(--ls-link-text-hover-color);
    opacity: 1;
  }
}

.ls-block {
  min-height: 24px;
  padding: 2px 0;
  border-bottom: 1px solid transparent;

  &.selected {
    border-bottom-color: var(--ls-primary-background-color);

    &:last-child {
      border-bottom-color: transparent;
    }
  }

  img {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  }
}

.ls-block,
.editor-wrapper {
  margin-right: auto;
  margin-left: auto;
}

.ls-block h1 {
  font-size: 2em;
  margin: 0.67em 0
}

.ls-block h2 {
  font-size: 1.5em;
  margin: 0.75em 0
}

.ls-block h3 {
  font-size: 1.17em;
  margin: 0.83em 0
}

.ls-block h4 {
  margin: 1.12em 0
}

.ls-block h5 {
  font-size: 0.83em;
  margin: 1.5em 0
}

.ls-block h6 {
  font-size: 0.75em;
  margin: 1.67em 0
}

.ls-block h1,
.ls-block h2,
.ls-block h3,
.ls-block h4,
.ls-block h5,
.ls-block h6 {
  font-weight: 600
}

.color-level {
  background-color: var(--color-level-1);
}

.color-level .color-level {
  background-color: var(--color-level-2);
}

.color-level .color-level .color-level {
  background-color: var(--color-level-3);
}

.color-level .color-level .color-level .color-level {
  background-color: var(--color-level-4);
}

.color-level .color-level .color-level .color-level .color-level {
  background-color: var(--color-level-5);
}

.color-level .color-level .color-level .color-level .color-level .color-level {
  background-color: var(--color-level-3);
}

.color-level .color-level .color-level .color-level .color-level .color-level .color-level {
  background-color: var(--color-level-4);
}

.color-level .color-level .color-level .color-level .color-level .color-level .color-level .color-level {
  background-color: var(--color-level-5);
}

.color-level .color-level .color-level .color-level .color-level .color-level .color-level .color-level .color-level {
  background-color: var(--color-level-3);
}

.color-level .color-level .color-level .color-level .color-level .color-level .color-level .color-level .color-level .color-level {
  background-color: var(--color-level-4);
}

.color-level .color-level .color-level .color-level .color-level .color-level .color-level .color-level .color-level .color-level .color-level {
  background-color: var(--color-level-5);
}

.bullet-container {
  display: flex;
  height: 12px;
  width: 12px;
  border-radius: 50%;
  justify-content: center;
  align-items: center;

  .bullet-heading {
    background-color: var(--ls-block-bullet-color, #8fbc8f);
  }

  .bullet {
    border-radius: 50%;
    width: 6px;
    height: 6px;
    background-color: var(--ls-block-bullet-color, #394b59);
    transition: transform .2s;
  }

  &.bullet-closed {
    background-color: var(--ls-block-bullet-border-color, #ced9e0);
  }
}

a:hover > .bullet-container .bullet {
  transform: scale(1.2);
}

.doc-mode {
  margin-left: -16px;

  .block-children {
    border-left: none;
  }

  .hide-inner-bullet .bullet {
    display: none;
  }
}

/* copied from https://github.com/drdogbot7/tailwindcss-responsive-embed */
.embed-responsive {
  position: relative;
  display: block;
  height: 0;
  padding: 0;
  overflow: hidden;

  .embed-responsive-item,
  iframe,
  embed,
  object,
  video {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100%;
    width: 100%;
    border: 0;
  }
}

.embed {
  border-radius: var(--ls-border-radius-low);
}

.embed-header {
  font-weight: 600;
}
