@charset "UTF-8";
@import '@craftcms/sass/mixins';

#redactor-overlay {
  filter: alpha(opacity=100);
  -moz-opacity: 1;
  opacity: 1;
  background-color: transparentize($white, 0.25);
}

.lp-editor {
  position: relative;
}

.redactor-source,
.redactor-source:hover,
.redactor-source:focus,
.redactor-statusbar,
.re-button-tooltip,
.redactor-context-toolbar,
.redactor-dropdown-format .redactor-dropdown-item-pre,
.redactor-styles time,
.redactor-styles small,
.redactor-styles var,
.redactor-styles code,
.redactor-styles kbd,
.redactor-styles mark,
.redactor-styles pre {
  @include fixed-width-font;
}

.redactor-toolbar,
.redactor-air,
.redactor-dropdown,
.redactor-modal-box,
.redactor-styles {
  @include sans-serif-font;
}

.redactor-modal {
  @include modal;
  z-index: 1052;
  div.btn {
    margin-right: 10px;
  }
}

.redactor-dropdown {
  font-size: 14px;
  z-index: 102 !important;
}

.redactor-dropdown-format {
  .redactor-dropdown-item-h1,
  .redactor-dropdown-item-h2,
  .redactor-dropdown-item-h3,
  .redactor-dropdown-item-h4,
  .redactor-dropdown-item-h5,
  .redactor-dropdown-item-h6 {
    font-weight: 600;
  }

  .redactor-dropdown-item-h1 {
    font-size: 32px;
  }

  .redactor-dropdown-item-h2 {
    font-size: 24px;
  }

  .redactor-dropdown-item-h3 {
    font-size: 20px;
  }

  .redactor-dropdown-item-h4 {
    font-size: 16px;
  }

  .redactor-dropdown-item-h5 {
    font-size: 14px;
  }

  .redactor-dropdown-item-h6 {
    font-size: 13.6px;
    color: $mediumTextColor;
    text-transform: none;
  }
}

> .menu {
  z-index: 10550;
}

.redactor {
  &.errors > div.redactor-box {
    border: 1px solid $errorColor !important;
  }

  .redactor-box {
    margin-bottom: 0;

    &:not(.redactor-box-fullscreen):not(.redactor-source-view) {
      @include input-styles;

      &.redactor-focus {
        // have to manually copy this because we are competing with Redactor's !important
        border-color: $darkFocusColor !important;
        box-shadow: 0 0 0 2px transparentize($darkFocusColor, 0.5);
      }
    }
  }

  &.normal {
    .redactor-box {
      .redactor-toolbar,
      .redactor-styles {
        padding: 6px 9px;
      }

      .redactor-toolbar {
        a.re-button-icon {
          padding: 6px 14px 5px;
          font-size: 14px;
        }
      }

      .redactor-styles {
        font-size: 14px;
        line-height: 21px;

        h1 {
          margin: 21px 0 14px;
          font-size: 28px;
          line-height: 35px;
        }

        h2 {
          margin: 21px 0 14px;
          font-size: 21px;
          line-height: 26px;
        }

        h3 {
          margin: 21px 0 14px;
          font-size: 18px;
          line-height: 21px;
        }

        blockquote {
          margin: 14px 0;

          &:not(.note) {
            padding: 0 14px;
          }
        }
      }

      .redactor-statusbar {
        padding-left: 0;
        padding-right: 0;
      }
    }
  }
}

.redactor-box,
.redactor-toolbar,
.redactor-box textarea {
  z-index: auto !important;
}

.redactor-box {
  .redactor-toolbar,
  .redactor-air {
    a {
      box-shadow: none;
      background: transparentize($inputColor, 0.85);

      &:focus,
      &:hover {
        background-color: transparentize($inputColor, 0.7);
      }

      &:active,
      &.redactor-button-active {
        background-color: transparentize($inputColor, 0.5);
      }
    }
  }

  .redactor-toolbar {
    top: 0;
    background: none;
    box-shadow: none;

    &.redactor-toolbar-fixed {
      z-index: 5 !important;
      background-color: $white !important;
    }

    &.toolbar-fixed-box {
      @include pane;
      z-index: 102 !important;
    }

    li {
      a {
        color: $textColor;

        &:hover {
          background-color: $lightSelColor;
          color: $textColor;
          text-decoration: none;
        }

        &:active,
        &.redactor-act {
          background-color: $darkSelColor;
          color: $white;
        }
      }

      &:first-child a {
        border-top-left-radius: 2px;
      }
    }
  }

  &:not(.redactor-box-fullscreen) {
    .redactor-layer {
      background: none;
      border: none;
      border-top: 1px solid $hairlineColor;
    }
  }

  textarea {
    display: block;
    border-radius: 0 0 3px 3px;
  }

  .redactor-toolbar,
  .redactor-styles {
    padding: 16px 18px;
  }

  .redactor-toolbar {
    z-index: 102;
    padding-bottom: 0 !important;

    &.redactor-toolbar-fixed {
      padding-top: 8px;
      padding-bottom: 4px !important;
      background-color: hsl(212, 50%, 99%) !important;

      @supports (backdrop-filter: blur(10px)) {
        & {
          background-color: transparentize(hsl(212, 50%, 99%), 0.25) !important;
          backdrop-filter: blur(10px);
        }
      }
    }
  }

  .redactor-styles {
    @include readable;
    color: $textColor;
    font-size: 16px;
    line-height: 22px;

    &:focus {
      border: none;
      box-shadow: none;
    }

    h6 {
      text-transform: none;
    }

    pre,
    time,
    small,
    var,
    code,
    kbd,
    mark {
      color: $textColor;
    }

    small {
      font-size: 0.7em !important;
    }
  }

  .redactor-layer {
    border: none;
    border-top: 1px solid $hairlineColor;
  }

  .redactor-statusbar {
    border-top: 1px solid $hairlineColor;
    background: none;
  }
}

.redactor-link-tooltip {
  z-index: 101;
}

.redactor-dropdown {
  @include menu-styles;
  padding: 0;
  z-index: 102;

  li {
    border-bottom: none;
    background: none;

    a {
      @include menu-option-styles;

      &:hover {
        @include menu-option-active-styles;

        span {
          color: $textColor !important;
        }
      }
    }
  }
}

.redactor-context-toolbar {
  z-index: 4 !important;
}
body.redactor-element-editor-open .redactor-context-toolbar {
  z-index: 104 !important;
}

#redactor-image-resizer {
  z-index: 3 !important;
}

.redactor-box-fullscreen {
  z-index: 101 !important;
  border: none !important;
  border-radius: 0 !important;
}

.redactor-source-view [contenteditable='true'] {
  display: block !important;
  height: 0 !important;
  min-height: 0 !important;
  width: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.lp-editor-container {
  header {
    z-index: 6 !important;
  }
}
