.smartblock-btn {
  background-color: transparent;
  border: none;
  margin-right: 5px;
  padding: 5px;
  border-radius: 3px;
  appearance: none;
  -webkit-appearance: none;
  font-size: 20px;
  cursor: pointer;
  text-align: center;
  border: 1px solid transparent;

  svg {
    fill: currentColor;
    vertical-align: middle;
  }
  &:last-child {
    margin-right: 0;
  }
  &:not([disabled]):hover {
    color: #005CEE;
  }

  &[disabled]:hover {
    cursor: not-allowed;
  }
  &.is-black {
    background-color: #333333 !important;
    color: #FFF;
  }
  &.is-disabled {
    opacity: .4;
  }
  &.is-active {
    color: #005CEE;
    opacity: 1;
    background-color: #F2F2F4;

    &:focus {
      outline: 0;
      color: #005CEE;
      background-color: #F2F2F4;
    }
  }
  &:not(.is-active) {
    color: #777;

    &:focus {
      outline: 0;
      color: #777;
      background: #fff;
    }
  }
}

@keyframes smartblock-backbtn-appear {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.smartblock-backbtn {
  background: #f2f2f4;
  width: 44px;
  height: 44px;
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 10;
  color: #014cc5;
  appearance: none;
  border: none;
  cursor: pointer;
  box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
  animation: smartblock-backbtn-appear 0.3s;
  svg {
    fill: currentColor;
  }
}

@keyframes smartblock-edit-menu-fadein {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.smartblock-edit-menu {
  display: flex;
  position: absolute;
  right: 0;
  z-index: 10;
  max-width: 280px;
  animation: smartblock-edit-menu-fadein 0.3s;
  border-radius: 5px;
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
  padding: 4px;
  background-color: #f2f2f4;
}

.smartblock-edit-btn {
  margin: 3px;
  width: 36px;
  height: 36px;
  &.is-black {
    background-color: #444 !important;
    color: #FFF;
    &:hover {
      background-color: #111111 !important;
      color: #FFF!important;
    }
  }
  background-color: transparent;
  color: #666;

  &:hover {
    color: #111;
  }
  &:last-child {
    margin-right: 2px;
  }
}

.smartblock-cell-btn {
  .icon {
    font-size: 30px;
  }
}

@keyframes smartblock-inline-menu-appear {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.smartblock-inline-menu {
  position: absolute;
  z-index: 12;
  animation: smartblock-inline-menu-appear 0.3s;
  margin-top: 8px;
  border-radius: 5px;
  background-color: #fff;
  color: #fff;
  box-shadow: 0 3px 40px 8px rgba(116, 116, 116, 0.2);
}

.smartblock-inline-menu-arrow {
  position: absolute;
  top: -12px;
  content: '';
  display: block;
  border-style: solid;
  border-width: 0 12px 12px 12px;
  border-color: transparent transparent #ffffff transparent;
}

.smartblock-inline-menu-inner {
  padding: 5px;
  display: flex;
  align-items: baseline;
}

@keyframes smartblock-menu-appear {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.smartblock-menu {
  position: absolute;
  z-index: 11;
  animation: smartblock-menu-appear 0.3s;
  border-radius: 5px;
  box-shadow: 0 3px 40px 8px rgba(116, 116, 116, 0.2);
  padding: 5px 0;
  color: #767676;
  background-color: #fff;
  &:before {
    position: absolute;
    left: 20px;
    top: -12px;
    content: '';
    display: block;
    border-style: solid;
    border-width: 0 12px 12px 12px;
    border-color: transparent transparent #ffffff transparent;
  }
}

.smartblock-menu-top {
  padding: 0 5px 0 5px;
}

.smartblock-custom-menu {
  border-top: 1px solid #ccc;
  margin: 5px 0 0 0;
  padding: 5px 5px 0 5px;
}

.smartblock-container {
  &.is-full {
    max-width: none;
  }
  max-width: 780px;
  margin: 0 auto;
  padding: 10px 0 80px 0;
}

.smartblock-input-area {
  width: 100%;
  overflow-y: auto;
}

.smartblock-inner {
  position: relative;
}

.smartblock-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 101;
  background: rgba(0, 0, 0, 0.2);
}

.smartblock-popup-inner {
  flex-basis: 380px;
  background: #fff;
  border-radius: 3px;
  box-shadow: 0 3px 10px 4px rgba(116, 116, 116, 0.2);
  padding: 15px;
  box-sizing: border-box;
  input {
    display: block;
    flex: 1;
    width: 100%;
    padding: 0 5px;
    font-size: 16px;
    line-height: 30px;
    box-sizing: border-box;
    border-radius: 3px 0 0 3px;
    border: 1px solid #eee;
  }

  input:focus {
    outline: 0;
    border: 1px solid #137af3;
    box-shadow: 0 0 0 2px rgba(19, 122, 243, 0.4),
      inset 0 1px 1px rgba(0, 0, 0, 0.1);
  }
}

.smartblock-popup-text {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 16px;
}

.smartblock-popup-btn {
  width: 38px;
  height: 38px;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  border-radius: 0 3px 3px 0;
  border: 1px solid transparent;
  background-color: #014cc5;

  &:focus {
    outline: 0;
    border: 1px solid #137af3;
    box-shadow: 0 0 0 2px rgba(19, 122, 243, 0.4),
      inset 0 1px 1px rgba(0, 0, 0, 0.1);
  }
}

.smartblock-popup-field {
  display: flex;
}

.smartblock-popup-view-btn {
  background-color: #fff;
  border: none;
  color: #adadad;
  margin-left: 5px;
  vertical-align: middle;
}

.smartblock-tooltip-wrap {
  position: absolute;
  display: inline-block;
  z-index: 1000;
  background-color: #fff;
}

.smartblock-tooltip-wrap-arrow {
  position: absolute;
  top: -12px;
  content: '';
  display: block;
  border-style: solid;
  border-width: 0 12px 12px 12px;
  border-color: transparent transparent #ffffff transparent;
}

.smartblock-tooltip {
  color: #777;
  font-size: 16px;
  box-shadow: 0 3px 40px 8px rgba(116, 116, 116, 0.2);
  border-radius: 3px;
  width: 320px;
  line-height: 46px;
  display: block;
}

.smartblock-tooltip-inner {
  display: flex;
  height: 46px;
  border-radius: 3px;
  overflow: hidden;
}

.smartblock-tooltip-input {
  border: none;
  display: block;
  padding: 0 10px;
  font-size: 16px;
  flex: 1;
  &:focus {
    outline: none;
  }
}

.smartblock-tooltip-btn {
  border: none;
  background-color: #014cc5;
  width: 46px;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

.smartblock-container .ProseMirror {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Hiragino Kaku Gothic Pro", "ヒラギノ角ゴシック", "メイリオ", Meiryo, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  padding: 10px 5px;
  background: #fff;
}

.smartblock-container .ProseMirror:focus {
  outline: none;
}

.smartblock-container .ProseMirror .tableWrapper {
  overflow-x: auto;
}

.smartblock-container .ProseMirror table {
  border-collapse: collapse;
  table-layout: fixed;
  width: 100%;
  overflow: hidden;
}

.smartblock-container .ProseMirror td,
.smartblock-container .ProseMirror th {
  vertical-align: top;
  box-sizing: border-box;
  position: relative;
}

.smartblock-container .ProseMirror .column-resize-handle {
  position: absolute;
  right: -2px;
  top: 0;
  bottom: 0;
  width: 4px;
  z-index: 20;
  background-color: #adf;
  pointer-events: none;
}

.smartblock-container .ProseMirror.resize-cursor {
  cursor: ew-resize;
  cursor: col-resize;
}

/* Give selected cells a blue overlay */
.smartblock-container .ProseMirror .selectedCell:after {
  z-index: 2;
  position: absolute;
  content: "";
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  background: rgba(200, 200, 255, 0.4);
  pointer-events: none;
}

.smartblock-container .ProseMirror-gapcursor {
  display: none;
  pointer-events: none;
  position: absolute;
}

.smartblock-container .ProseMirror-gapcursor:after {
  content: "";
  display: block;
  position: absolute;
  top: -2px;
  width: 20px;
  border-top: 1px solid black;
  animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
}

@keyframes ProseMirror-cursor-blink {
  to {
    visibility: hidden;
  }
}

.smartblock-container .ProseMirror-focused .ProseMirror-gapcursor {
  display: block;
}


@media screen and (min-width: 768px) {
  .smartblock-container .ProseMirror {
    padding: 10px;
  }
}

.smartblock-container .ProseMirror figure {
  text-align: center;
  padding: 10px 5px;
  margin: 0;

  &.empty-node figcaption:before {
    content: attr(data-placeholder);
  }

  figcaption {
    font-size: 0;
  }

  figcaption.caption {
    font-size: 14px;
  }

  &.empty-node figcaption.not-active:before {
    content: ""
  }
}

.smartblock-container .ProseMirror .empty-node::before,
.smartblock-container .ProseMirror .empty-editor::before{
  float: left;
  color: #aaa;
  pointer-events: none;
  height: 0;
  font-style: italic;
}

.smartblock-container .ProseMirror figcaption {
  color: #333;
  font-size: 12px;
}

.smartblock-container .ProseMirror img {
  max-width: 100%;
}

.smartblock-container .ProseMirror a {
  color: #014CC5;
}

.smartblock-container .ProseMirror hr {
  padding: 2px 10px;
  border: none;
  margin: 1em 0;
}

.smartblock-container .ProseMirror hr:after {
  content: "";
  display: block;
  height: 1px;
  background-color: silver;
  line-height: 2px;
}

.smartblock-container .ProseMirror *:first-child {
  margin-top: 0;
}

.smartblock-container .ProseMirror p {
  margin: 0 0 30px 0;
  padding: 5px;
  line-height: 1.6;
  font-size: 1rem;
  border-radius: 3px;
  transition: background-color .3s;
  box-sizing: border-box;
}

.smartblock-container .ProseMirror table p {
  margin: 0;
  line-height: 1;
}

@media screen and (min-width: 768px) {
.smartblock-container   .ProseMirror p {
    padding: 5px 10px;
  }
}

.smartblock-container .ProseMirror h1 {
  margin: 0 0 30px 0;
  padding: 0 5px;
  font-size: 1.875rem;
  line-height: 1.3;
}

@media screen and (min-width: 768px) {
.smartblock-container   .ProseMirror h1 {
    padding: 0 10px;
    font-size: 2.125rem;
  }
}


.smartblock-container .ProseMirror h2,
.smartblock-container .ProseMirror h3 {
  margin: 20px 0 10px 0;
  padding: 5px;
  line-height: 1.4;
  border-radius: 3px;
  transition: background-color .3s;
  box-sizing: border-box;
}

.smartblock-container .ProseMirror h2 {
  font-size: 1.625rem;
}

.smartblock-container .ProseMirror h3 {
  font-size: 1.375rem;
}

@media screen and (min-width: 768px) {

.smartblock-container   .ProseMirror h2,
.smartblock-container   .ProseMirror h3 {
    padding: 5px 10px;
  }
}


.smartblock-container .ProseMirror ul,
.smartblock-container .ProseMirror ol {
  margin: 0 0 30px 0;
  padding: 5px 5px 5px 30px;
  font-size: 1rem;
  line-height: 1.4;
  box-sizing: border-box;
}

.smartblock-container .ProseMirror li>p {
  margin: 0;
  padding: 0;
  min-height: auto;
}

.smartblock-container .ProseMirror li ul,
.smartblock-container .ProseMirror li ol {
  margin: 0;
}

.smartblock-container .ProseMirror blockquote {
  position: relative;
  margin: 0 0 30px 0;
  padding: 10px 5px 10px 25px;
  font-size: .875rem;
  line-height: 1.5;
  box-sizing: border-box;
}

.smartblock-container .ProseMirror blockquote:before {
  content: "";
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 10px;
  border-left: 5px solid #D3D3D3;
}

@media screen and (min-width: 768px) {
.smartblock-container   .ProseMirror blockquote {
    padding: 10px 10px 10px 30px;
  }
}

.smartblock-container .ProseMirror th,
.smartblock-container .ProseMirror td {
  border: 1px solid #eee;
  padding: 2px 5px;
}

.smartblock-container .ProseMirror sup,
.smartblock-container .ProseMirror sub {
  line-height: 0;
}

.smartblock-container .ProseMirror .selected {
  background-color: #F2F2F4;
  border-radius: 3px;
}

.smartblock-container .ProseMirrorHideSelection .selected {
  background-color: transparent;
}

.smartblock-container .ProseMirror .ProseMirror-widget {
  color: #ADADAD;
}

.smartblock-container .ProseMirror td,
.smartblock-container .ProseMirror th {
  border-color: #767676;
}

.smartblock-container .ProseMirror table {
  margin-bottom: 15px;
  border-color: #767676;
}

.smartblock-container .ProseMirror table p.empty-node:first-child::before {
  display: none;
}

.smartblock-container .ProseMirror h1.empty-node::before {
  content: attr(data-placeholder);
  font-style: normal;
}

.smartblock-container .ProseMirror p.empty-editor:first-child::before {
  content: attr(data-placeholder) !important;
  font-style: normal;
}

.smartblock-container .ProseMirror ::selection {
  color: #014CC5;
  background: #D1DDF0;
  border-right: 1px solid #014CC5;
  border-left: 1px solid #014CC5;
  caret-color: red;
}

.smartblock-container .ProseMirror figure {
  pointer-events: none;
  color: transparent;
}

.smartblock-container .ProseMirror .caption {
  color: #909090;
  display: block;
  text-align: center;
}

.smartblock-container .ProseMirror .media {
  padding: 10px;
  margin: 0;
  display: block;
}

.smartblock-container .ProseMirror .media.selected {
  position: relative;
  background-color: #F2F2F4;
}

.smartblock-container .ProseMirror .media img.small {
  width: 320px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.smartblock-container .ProseMirror .media img {
  max-width: 100%;
  height: auto;
  cursor: default;
}

.smartblock-container .ProseMirror .media .caption {
  color: #333;
  margin-top: 0;
  margin-bottom: 5px;
}

.smartblock-container .ProseMirror .youtube-frame-wrap {
  margin-bottom: 30px;
  padding: 10px 40px;
}

.smartblock-container .ProseMirror .embed-wrap {
  margin: 0 5px 30px 5px;
  position: relative;
  z-index: 10;
  padding: 5px;
}

.smartblock-container .ProseMirror .embed {
  position: relative;
  display: block;
  padding: 20px;
  color: #666;
  font-size: 14px;
  background: #FFF;
  border: 1px solid rgba(201, 201, 204, 0.48);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .1);

  &:link,
  &:hover,
  &:visited {
    color: #666;
    text-decoration: none;
  }
}

.smartblock-container .ProseMirror .youtube-frame {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%;

  iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
  }
}

.smartblock-container .ProseMirror pre,
.smartblock-container .ProseMirror pre.selected {
  background-color: #333;
  padding: 10px;
  border-radius: 5px;
  color: #FFF;
}

/* a11y-dark theme */
/* Based on the Tomorrow Night Eighties theme: https://github.com/isagalaev/highlight.js/blob/master/src/styles/tomorrow-night-eighties.css */
/* @author: ericwbailey */

.smartblock-container .ProseMirror {

  /* Comment */
  .hljs-comment,
  .hljs-quote {
    color: #d4d0ab;
  }

  /* Red */
  .hljs-variable,
  .hljs-template-variable,
  .hljs-tag,
  .hljs-name,
  .hljs-selector-id,
  .hljs-selector-class,
  .hljs-regexp,
  .hljs-deletion {
    color: #ffa07a;
  }

  /* Orange */
  .hljs-number,
  .hljs-built_in,
  .hljs-builtin-name,
  .hljs-literal,
  .hljs-type,
  .hljs-params,
  .hljs-meta,
  .hljs-link {
    color: #f5ab35;
  }

  /* Yellow */
  .hljs-attribute {
    color: #ffd700;
  }

  /* Green */
  .hljs-string,
  .hljs-symbol,
  .hljs-bullet,
  .hljs-addition {
    color: #abe338;
  }

  /* Blue */
  .hljs-title,
  .hljs-section {
    color: #00e0e0;
  }

  /* Purple */
  .hljs-keyword,
  .hljs-selector-tag {
    color: #dcc6e0;
  }

  .hljs {
    display: block;
    overflow-x: auto;
    background: #2b2b2b;
    color: #f8f8f2;
    padding: 0.5em;
  }

  .hljs-emphasis {
    font-style: italic;
  }

  .hljs-strong {
    font-weight: bold;
  }

  @media screen and (-ms-high-contrast: active) {

    .hljs-addition,
    .hljs-attribute,
    .hljs-built_in,
    .hljs-builtin-name,
    .hljs-bullet,
    .hljs-comment,
    .hljs-link,
    .hljs-literal,
    .hljs-meta,
    .hljs-number,
    .hljs-params,
    .hljs-string,
    .hljs-symbol,
    .hljs-type,
    .hljs-quote {
      color: highlight;
    }

    .hljs-keyword,
    .hljs-selector-tag {
      font-weight: bold;
    }
  }
}
