.custom-DraftEditor {
  &-root {
    position: relative;
  }

  &-editor .public-DraftEditor-content {
    min-height: 100px;
  }

  &-editor .public-DraftEditorPlaceholder-inner {
    color: $grey;
  }

  &-hidePlaceholder .public-DraftEditorPlaceholder-root {
    display: none;
  }

  &-editor .public-DraftStyleDefault-pre {
    background-color: $white;
    border: 0;
  }

  &-root {
    background: $white;
    border: 1px solid $grey-light;
    box-shadow: $box-shadow-small;
  }

  &-utils {
    font-size: 0.813rem;
    padding: 10px;
    width: 100%;
    height: auto;
    user-select: none;
    background: $grey-lightest;
  }

  &-controls {
    padding: 15px;
    padding-right: 0;
    & + .custom-DraftEditor-controls {
      padding-top: 0;
    }
  }

  &-inlineControls {
    display: flex;
    align-items: center;
  }

  &-styleButton {
    transition: $animate-default;
    font-weight: 600;
    cursor: pointer;
    padding: 5px;
    margin: 2px;
    border: 1px solid $grey-light;
    border-radius: 5px;
    background-color: $white;
    color: $grey-dark;

    &:hover {
      background-color: $grey-dark;
      color: $white;
    }

    & i {
      margin: 0;
      padding: 0;
    }
  }

  &-activeButton {
    background-color: $grey-dark;
    color: $white;
  }

  &-editor {
    cursor: text;
    padding: 30px;
    font-size: 1rem;
  }

  &-editor &-blockquote {
    position: relative;
    border-left: 4px solid $grey-light;
    color: $grey-dark;
    font-style: italic;
    margin: 16px 0;
    padding: 10px 20px 10px 30px;

    &::before {
      content: "\201C";
      color: $grey-light;
      font-size: 4rem;
      position: absolute;
      left: -3px;
      top: -20px;
    }
  }

  &-images {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
  }

  &-previewImage {
    width: 23%;
    height: 160px;
    cursor: pointer;
    padding: 5px;
    margin: 10px 0 5px 0;
    background: $grey-light;
    position: relative;
    & span {
      position: absolute;
      bottom: -5px;
      right: -5px;
      height: 25px;
      width: 25px;
      border-radius: 50%;
      background: $primary-color;
      & i {
        color: $white;
      }
    }
    & img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      cursor: pointer;
    }
  }
}
.headlineButtonWrapper {
  display: inline-block;
}

.headlineButton {
  background: #fbfbfb;
  color: #888;
  font-size: 18px;
  border: 0;
  padding-top: 5px;
  vertical-align: bottom;
  height: 34px;
  width: 36px;
  &:hover,
  :focus {
    background: #f3f3f3;
  }
}

/*
  Plugin: draft-js-inline-toolbar-plugin
*/

.draftJsToolbar__buttonWrapper__1Dmqh {
  display: inline-block;
}

.draftJsToolbar__button__qi1gf {
  background: #fbfbfb;
  color: #888;
  font-size: 18px;
  border: 0;
  padding-top: 5px;
  vertical-align: bottom;
  height: 34px;
  width: 36px;
}

.draftJsToolbar__button__qi1gf svg {
  fill: #888;
}

.draftJsToolbar__button__qi1gf:hover,
.draftJsToolbar__button__qi1gf:focus {
  background: #f3f3f3;
  outline: 0; /* reset for :focus */
}

.draftJsToolbar__active__3qcpF {
  background: #efefef;
  color: #444;
}

.draftJsToolbar__active__3qcpF svg {
  fill: #444;
}
.draftJsToolbar__separator__3U7qt {
  display: inline-block;
  border-right: 1px solid #ddd;
  height: 24px;
  margin: 0 0.5em;
}
.draftJsToolbar__toolbar__dNtBH {
  left: 50%;
  -webkit-transform: translate(-50%) scale(0);
  transform: translate(-50%) scale(0);
  position: absolute;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0px 1px 3px 0px rgba(220, 220, 220, 1);
  z-index: 2;
  box-sizing: border-box;
}

.draftJsToolbar__toolbar__dNtBH:after,
.draftJsToolbar__toolbar__dNtBH:before {
  top: 100%;
  left: 50%;
  border: solid transparent;
  content: " ";
  height: 0;
  width: 0;
  position: absolute;
  pointer-events: none;
}

.draftJsToolbar__toolbar__dNtBH:after {
  border-color: rgba(255, 255, 255, 0);
  border-top-color: #fff;
  border-width: 4px;
  margin-left: -4px;
}
.draftJsToolbar__toolbar__dNtBH:before {
  border-color: rgba(221, 221, 221, 0);
  border-top-color: #ddd;
  border-width: 6px;
  margin-left: -6px;
}

/*
  Plugin: draft-js-linkify-plugin
*/

.draftJsLinkifyPlugin__link__2ittM,
.draftJsLinkifyPlugin__link__2ittM:visited {
  color: #5e93c5;
  text-decoration: none;
}

.draftJsLinkifyPlugin__link__2ittM:hover,
.draftJsLinkifyPlugin__link__2ittM:focus {
  color: #7eadda;
  outline: 0; /* reset for :focus */
  cursor: pointer;
}

.draftJsLinkifyPlugin__link__2ittM:active {
  color: #4a7bab;
}

.hidden {
  /*hidden but accesible*/
  position: absolute !important;
  clip: rect(1px, 1px, 1px, 1px);
  height: 1px;
  width: 0;
  overflow: hidden;
  opacity: 0;
}

.editor-view {
  margin-bottom: 20px;
  display: grid;

  &__hidden {
    opacity: 0;
  }

  &__wrapper {
    position: relative;
    border: 2px dashed rgba(114, 186, 94, 0.35);
    background: rgba(114, 186, 94, 0.05);
    grid-template-rows: auto;
    z-index: 400;
  }

  &__tooltip {
    &--text {
      font-size: 0.7rem;
      visibility: visible;
      width: 57px;
      background-color: $blue-grey-50;
      color: $nearly-black;
      text-align: center;
      border-radius: 3px;
      padding: 5px 0;
      position: absolute;
      z-index: 1;
      bottom: 120%;
      left: -10%;

      &::after {
        content: "";
        position: absolute;
        top: 100%;
        left: 47%;
        margin-left: -5px;
        border-width: 5px;
        border-style: solid;
        border-color: $blue-grey-50 transparent transparent transparent;
      }
    }
  }

  &__input {
    background: transparent !important;
    border: 1px transparent !important;
    width: min-content !important;
  }

  &__toggle-visibility {
    margin-right: 10px;
  }

  &__button {
    margin-top: 10px;
    margin-bottom: 10px;
    position: relative;

    & > button {
      margin-bottom: 10px;
    }

    &__wrapper {
      position: relative;

      &--overlay {
        top: -53px;
        left: 20px;
        position: absolute;
      }
    }
  }

  &__container {
    display: grid;
    grid-gap: 5px;
    height: 100vh;
  }

  &__columns {
    @include base-component;
    display: grid;
    grid-gap: 10px;
    grid-template-columns: minmax(1fr, fit-content(300px));
    grid-auto-flow: column;
    background: $grey-50;
    padding: 25px 10px 0 10px;
  }

  &__column {
    border: 1px dashed $light-green;
    background: white;
    padding: 25px 21px 50px 21px;
    margin-bottom: 20px;
    min-width: 47%;

    &--tooltip-visible {
      @include tooltip;
      top: -45px;
      left: -22px;
    }

    &--tooltip-hidden {
      @include tooltip;
      opacity: 0;
    }

    &__wrapper {
      position: relative;

      &--overlay {
        top: -80px;
        left: 40%;
        position: absolute;
      }
    }

    &__toolbar--instructions {
      bottom: -40px;
    }
  }

  &__row {
    @include base-component;
    grid-template-columns: minmax(1fr, fit-content(300px));
    padding: 20px;

    &--tooltip-hidden {
      @include tooltip;
      opacity: 0;
    }

    &--tooltip-visible {
      @include tooltip;
      top: -42px;
      left: -22px;
    }

    &__wrapper {
      position: relative;

      &--overlay {
        top: -75px;
        left: 39%;
        position: absolute;
        transition: $animate-default;
      }
    }
  }

  &__image {
    max-width: 600px;
    position: relative;
    grid-template-rows: auto;

    &--tooltip-hidden {
      @include tooltip;
      position: relative;
      top: -1px;
      opacity: 0;
    }

    &--tooltip-visible {
      @include tooltip;
      top: -1px;
      left: 0px;
    }

    &__wrapper {
      position: relative;

      &--overlay {
        top: -40px;
        left: 40%;
        position: absolute;
      }
    }

    &--placeholder {
      text-align: center;
      max-width: 600px;
      background: $blue-grey-50;

      &__icon {
        font-size: 18rem;
        color: white;
      }
    }
  }

  &__modal {
    position: relative;
    grid-template-rows: auto;
    margin-top: 10px;
    margin-bottom: 40px;

    &--tooltip-hidden {
      @include tooltip;
      opacity: 0;
    }

    &--tooltip-visible {
      width: 200px;
      background: azure;
      position: relative;
      opacity: 1;
      top: 0;
    }

    &__wrapper {
      position: relative;

      &--overlay {
        top: 0px;
        left: 23%;
        position: absolute;
      }
    }

    &--placeholder {
      text-align: center;
      max-width: 600px;
      background: $blue-grey-50;

      &__icon {
        font-size: 18rem;
        color: white;
      }
    }
  }

  &__code {
    margin: 25px 0 10px 0;
    border: 1px solid $blue-grey-100;
    grid-template-rows: auto;

    &--tooltip-hidden {
      @include tooltip;
      opacity: 0;
    }

    &--tooltip-visible {
      @include tooltip;
      top: -23px;
      left: -1px;
    }

    &__wrapper {
      position: relative;

      &--overlay {
        top: -60px;
        z-index: 400;
        left: 47%;
        position: absolute;
      }
    }

    @include mq($from: mobile) {
      max-width: 350px;
    }

    @include mq($from: tablet) {
      max-width: 600px;
    }

    @include mq($from: desktop) {
      max-width: 100%;
    }
  }

  &__video {
    margin: 10px 0;
    max-width: 600px;
    grid-template-rows: auto;

    &--tooltip-hidden {
      @include tooltip;
      top: 0;
      opacity: 0;
    }

    &--tooltip-visible {
      @include tooltip;
      opacity: 1;
      top: 0;
    }

    &__wrapper {
      position: relative;

      &--overlay {
        top: -40px;
        z-index: 400;
        left: 47%;
        position: absolute;
      }
    }

    &--placeholder {
      text-align: center;
      max-width: 600px;
      background: $blue-grey-50;

      &__icon {
        font-size: 18rem;
        color: white;
      }
    }
  }

  &__carousel {
    grid-template-rows: auto;

    &--tooltip-hidden {
      @include tooltip;
      top: 41px;
      left: -1px;
      opacity: 0;
    }

    &--tooltip-visible {
      @include tooltip;
      top: 41px;
      left: 0px;
    }

    &__wrapper {
      position: relative;

      &--overlay {
        top: 0;
        left: 47%;
        z-index: 400;
        position: absolute;
      }
    }

    &--list {
      overflow-y: hidden;
      position: relative;
      display: flex;
      /* allow for scrolling */
      overflow-x: auto;
      /* make it smooth on iOS */
      scroll-snap-points-x: repeat(300px);
      scroll-snap-type: mandatory;
      max-width: 70vw;
    }

    &--button--previous {
      position: relative;
      top: 150px;
      left: 5px;
      z-index: 99;
      cursor: pointer;
      transition: all 0.5s ease;
      display: flex;
      align-items: center;
      color: #ffffff;
      background-color: #ffffff;
      border-radius: 47%;
      padding: 15px;
      width: 41px;

      &:hover {
        background-color: rgba($white, 0.5);
        transition: $animate-default;
      }

      @include mq($from: tablet) {
        padding: 15px;
      }

      &__next {
        right: 5px;
        left: auto;
      }

      & p {
        margin: 0 10px 0 0;
        font-size: 0.875rem;
      }
    }

    &--button--next {
      position: relative;
      top: -140px;
      left: calc(100% - 50px);
      z-index: 99;
      cursor: pointer;
      transition: all 0.5s ease;
      display: flex;
      align-items: center;
      color: #ffffff;
      background-color: #ffffff;
      border-radius: 47%;
      padding: 15px;
      width: 41px;

      &:hover {
        background-color: rgba($white, 0.5);
        transition: $animate-default;
      }

      @include mq($from: tablet) {
        padding: 15px;
      }

      &__next {
        right: 5px;
        left: auto;
      }

      & p {
        margin: 0 10px 0 0;
        font-size: 0.875rem;
      }
    }
  }

  &__textblock {
    font-size: 14px;
    line-height: 1.5em;

    &--alignment {
      &__left {
        text-align: left;
      }

      &__center {
        text-align: center;
      }

      &__right {
        text-align: right;
      }
    }

    &--hr {
      border: none;

      &:before {
        content: "";
        display: block;
        position: absolute;
        right: 0;
        max-width: 100%;
        width: 100%;
        border: 1px solid grey;
      }
    }

    &--tooltip-visible {
      @include tooltip;
      top: 40px;
      left: -1px;
    }

    &--tooltip-hidden {
      @include tooltip;
      opacity: 0;
    }

    &__wrapper {
      position: relative;

      &--overlay {
        top: 0px;
        left: 47%;
        position: absolute;
      }
    }

    &--editor {
      position: relative;
      height: max-content;

      &:global(.public-DraftEditor-content) {
        position: relative;
        top: 20px;
        min-height: 140px;
      }
    }

    &--quote {
      position: relative;
      border-left: 4px solid #e2e9ea;
      color: #888888;
      font-style: italic;
      margin: 16px 0;
      padding: 10px 20px 10px 30px;
    }
  }

  &__toolbar {
    position: relative;
    display: grid;
    grid-template-columns: repeat(48px, auto);
    grid-auto-flow: column;
    cursor: pointer;
    justify-items: center;
    place-self: center;
    height: 48px;
    animation: fadein 1s;
    bottom: -10px;

    &--tooltip {
      margin-left: -8px;

      &__text {
        font-size: 0.7rem;
        visibility: visible;
        width: 57px;
        background-color: $blue-grey-50;
        color: $nearly-black;
        text-align: center;
        border-radius: 3px;
        padding: 5px 0;
        position: absolute;
        z-index: 1;
        bottom: 120%;

        &::after {
          content: "";
          position: absolute;
          top: 100%;
          left: 47%;
          margin-left: -5px;
          border-width: 5px;
          border-style: solid;
          border-color: $blue-grey-50 transparent transparent transparent;
        }
      }
    }

    &--items {
      display: flex;
      align-items: center;
      justify-content: space-between;
      animation: fadein 2s;
      z-index: 500;

      background: $blue-grey-400;
      padding: 1px;
      border: 1px solid $blue-grey-400;
      border-radius: 3px;
    }

    &--instructions {
      flex-grow: 1;
      margin-top: auto;
      margin-bottom: auto;
      overflow: hidden;
      margin-left: 5px;
      font-size: $size-x-small;
      color: $nearly-black;
      place-self: center;
    }

    &--fadein {
      animation: fadein 1s;
    }

    &--rotate {
      animation: rotate 1s;
    }

    &--icon {
      place-self: center;
      cursor: pointer;
      width: 35px;
      height: 35px;
      background-color: $white;
    }

    &--item {
      min-width: 48px;
      min-height: 48px;
      background: $blue-grey-400;

      & i {
        margin: 17px 14px;
        color: $white;
      }

      &:hover {
        background: $blue-grey-700;
        transition: $animate-default;
        border-radius: 3px;
      }
    }

    &--rows {
      padding: 12px;
      color: $white;
      min-width: 50px;
      height: 48px;
      background: $blue-grey-400;

      &:hover {
        background: $blue-grey-700;
        transition: $animate-default;
      }
    }

    &--columns--open {
      padding: 12px;
      color: $white;
      width: 120px;
      height: 48px;
      background: $blue-grey-400;

      &:hover {
        background: $blue-grey-700;
        transition: $animate-default;

        .editor-view__toolbar--item-dropdown {
          background: $blue-grey-700;
        }
      }

      & span::after {
        margin-left: 10px;
        font-family: Helvetica, Arial, Verdana, Tahoma, sans-serif,
          "Font Awesome 5 Free";
        font-weight: 900;
        content: "\f077";
      }
    }

    &--columns--closed {
      padding: 12px;
      color: $white;
      width: 120px;
      height: 48px;
      background: $blue-grey-400;

      &:hover {
        background: $blue-grey-700;
        transition: $animate-default;

        .editor-view__toolbar--item-dropdown {
          background: $blue-grey-700;
        }
      }

      & span::after {
        font-family: Helvetica, Arial, Verdana, Tahoma, sans-serif,
          "Font Awesome 5 Free";
        margin-left: 10px;
        font-weight: 900;
        content: "\f078";
      }
    }

    &--dropdown {
      padding: 12px;
      color: $white;
      width: 12px;
      height: 12px;
      background: $blue-grey-400;

      &:hover {
        background: $blue-grey-700;
        transition: $animate-default;
      }
    }

    &--separator {
      background-color: white;
      border-left: 0.5px solid white;
      margin-top: 6px !important;
      margin-bottom: 4px !important;
      padding-top: 2px !important;
      padding-bottom: 2px !important;
      padding-left: 0px !important;
      padding-right: 0px !important;
    }
  }

  &__inlinetoolbar {
    display: grid;
    grid-template-columns: repeat(48px, auto);
    grid-auto-flow: column;
    cursor: pointer;
    justify-items: center;
    place-self: center;
    height: 48px;
    min-width: 525px;
    z-index: 599;

    &--items {
      display: flex;
      align-items: center;
      justify-content: space-between;
      transition: $animate-default;
      border: 1px solid $blue-grey-100;
    }

    &--instructions {
      overflow: hidden;
      margin-left: 5px;
      font-size: $size-x-small;
      color: $nearly-black;
      place-self: center;
    }

    &--fadein {
      animation: fadein 0s;
    }

    &--rotate {
      animation: rotate 1s;
    }

    &--icon {
      place-self: center;
      cursor: pointer;
      width: 35px;
      height: 35px;
      background-color: $blue-grey-400;
    }

    &--item {
      min-width: 48px;
      min-height: 48px;
      background: $white;

      & i {
        margin: 17px 14px;
        color: $blue-grey-400;
      }

      &__active {
        border-radius: 3px;
        background: $grey-100;
      }

      &:hover {
        background: $grey-50;
        border-radius: 3px;
        transition: $animate-default;
      }
    }

    &--more {
      margin-top: 2px;
    }

    &--rows {
      padding: 12px;
      color: $white;
      min-width: 50px;
      height: 48px;
      background: $blue-grey-400;

      &:hover {
        background: $blue-grey-700;
        transition: $animate-default;
      }
    }

    &--columns--open {
      padding: 12px;
      color: $blue-grey-400;
      min-width: 60px;
      max-width: 150px;
      height: 48px;
      background: $white;

      &:hover {
        background: $grey-50;

        .editor-view__inlinetoolbar--item-dropdown {
          background: $grey-50;
        }
      }

      & span::after {
        margin-left: 10px;
        font-family: Helvetica, Arial, Verdana, Tahoma, sans-serif,
          "Font Awesome 5 Free";
        font-weight: 900;
        content: "\f077";
      }
    }

    &--columns--closed {
      padding: 12px;
      color: $blue-grey-400;
      min-width: 60px;
      max-width: 120px;
      height: 48px;
      background: $white;

      &:hover {
        background: $grey-50;

        .editor-view__inlinetoolbar--item-dropdown {
          background: $grey-50;
        }
      }

      & span::after {
        font-family: Helvetica, Arial, Verdana, Tahoma, sans-serif,
          "Font Awesome 5 Free";
        margin-left: 10px;
        font-weight: 900;
        content: "\f078";
      }
    }

    &--dropdown {
      padding: 12px;
      color: $white;
      width: 12px;
      height: 12px;
      background: $blue-grey-400;

      &:hover {
        background: $blue-grey-700;
      }
    }

    &--separator {
      background-color: white;
      border-left: 0.5px solid white;
      margin-top: 6px !important;
      margin-bottom: 4px !important;
      padding-top: 2px !important;
      padding-bottom: 2px !important;
      padding-left: 0px !important;
      padding-right: 0px !important;
    }

    &--submenu {
      color: $blue-grey-400;
      background: $white;
      border-radius: 0 0 5px 5px;
      width: 100px;
      position: relative;
      top: 10px;
      z-index: 400;

      &--item {
        cursor: pointer;

        &:hover {
          background: $grey-50;
          transition: $animate-default;
        }
      }

      &--text {
        max-width: 150px;
        padding: 5px;
        cursor: pointer;
      }

      & i {
        margin: 17px 14px;
      }

      &__actions {
        color: $blue-grey-400;
        background: $white;
        border-radius: 0 0 5px 5px;
        position: relative;
        top: 10px;

        &--item {
          cursor: pointer;
          &:hover {
            background: $grey-50;
          }
        }

        &--text {
          padding: 5px 5px 5px 10px;
          cursor: pointer;
        }

        & i {
          margin: 17px 14px;
        }
      }
    }
  }

  .editor-view__submenu {
    color: $white;
    background: $blue-grey-400;
    border-radius: 0 0 5px 5px;
    width: 100px;
    position: relative;
    top: 10px;

    &--item {
      cursor: pointer;
      &:hover {
        background: $blue-grey-700;
        transition: $animate-default;
      }
    }

    &--text {
      padding: 5px 5px 5px 10px;
      cursor: pointer;
    }
  }

  @keyframes fadein {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }

  @keyframes rotate {
    from {
      transform: rotate(0deg);
    }
    to {
      transform: rotate(90deg);
    }
  }
}
