@import '~wix-rich-content-common/dist/statics/styles/palette';
@import '~wix-rich-content-common/dist/statics/styles/consts';
@import '~wix-rich-content-common/dist/statics/styles/fonts';
@import './general';

.wrapper {
  @extend .fontElementMap;
  position: relative;
  height: 100%;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  * {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  }

  .editor {
    tab-size: 40px;
    box-sizing: border-box;
    *,
    *:before,
    *:after {
      box-sizing: inherit;
    }
    input {
      box-sizing: border-box;
    }
  }
}

.editor {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  line-height: 1.5;
  font-size: $paragraphFontSize;
  color: $primary-text-color;
  background-color: $background-color-container;

  &::after {
    content: '';
    display: table;
    clear: both;
    line-height: 0;
  }

  @include container-max-width {
    font-size: $paragraphFontSizeMobile;
  }
}

.atomic {
  margin: 2px 0;
}

.toolbar {
  margin-top: 20px;
}

.block {
  & + & {
    margin-top: 20px;
  }
}

.elementSpacing {
  margin: 0;

  @include container-max-width {
    margin: 0;
    clear: both;
  }
}

.blockStyleSpacing {
  margin: 15px 18px;

  @include container-max-width {
    margin: 15px calc((18px + (100% - #{$textMobileWidth}) / 2));
  }
}

.text {
  composes: elementSpacing;
  @include ricosTypography('p', false);

  &:empty {
    height: 24px;
  }
}

.justify {
  & > * {
    white-space: pre-wrap !important;
    text-align: justify !important;
  }
}

.quote {
  composes: blockStyleSpacing;
  border-inline-start-width: $ricos-quote-border-width;
  border-inline-start-style: solid;
  font-size: $quoteFontSize;
  line-height: $quoteLineHeight;
  padding-top: $ricos-quote-padding-top;
  padding-bottom: $ricos-quote-padding-bottom;
  padding-inline-start: $ricos-quote-padding-inline-start;
  font-style: normal;
  border-left-color: $ricos-quote-border-color;
  border-right-color: $ricos-quote-border-color;
  color: $ricos-quote-color;
  @include ricosTypography('quote', false);
}

.headerOne,
.headerTwo,
.headerThree,
.headerFour,
.headerFive,
.headerSix {
  composes: elementSpacing;
  font: inherit;
}

@each $headerName in $headerNames {
  $i: index($headerNames, $headerName);
  .header#{$headerName} {
    @include ricosTypography('h#{$i}', false);
    color: var(--ricos-custom-h#{$i}-color, $primary-text-color);
    @at-root #{'& > *'} {
      background-color: var(--ricos-custom-h#{$i}-background-color, unset);
    }
  }
}

.code,
.codeBlock {
  composes: blockStyleSpacing;
  background-color: rgba($primary-text-color-tuple, 0.06);
  font-family: 'Inconsolata', 'Menlo', 'Consolas', monospace;
  font-size: $ricos-code-block-font-size;
  line-height: $ricos-code-block-line-height;
  padding: $ricos-code-block-padding;
  margin: $ricos-code-block-margin;
  white-space: pre-wrap;

  .renderedInTable & {
    margin: 0;
  }
}

.transformed {
  transform: translate3d(0, 0, 0);
}
