.ckeditor-content {
  /* Image */

  figure.image {
    display: block;
    margin: 1em auto;
    max-width: 100%;
    text-align: center;
  }

  figure.image img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    aspect-ratio: attr(width) / attr(height);
    object-fit: contain;
    margin: 0 auto;
  }

  .image-style-align-left {
    float: left;
    margin-right: 1em;
    clear: both;
  }

  .image-style-align-right {
    float: right;
    margin-left: 1em;
    clear: both;
  }

  .image-style-align-center {
    display: block;
    margin: 1em auto;
    clear: both;
  }

  /* Table */
  figure.table {
    width: 100%;
    max-width: 100%;
    margin: 1em auto;
    display: block;

    table {
      margin: auto;
      border-collapse: collapse;
      border-spacing: 0;
      width: 100%;
      height: auto;
      border: 1px solid #ccc;

      td,
      th {
        min-width: 2em;
        padding: 8px;
        border: 1px solid #ccc;
        text-align: left;
      }

      th {
        font-weight: bold;
        background: hsla(0, 0%, 0%, 5%);
      }

      colgroup col {
        width: auto;
      }

      &.ck-table-resized {
        width: 100%;
        max-width: 100%;
        table-layout: auto;

        colgroup {
          display: table-column-group;
        }
      }
    }

    &[dir='rtl'] th {
      text-align: right;
    }

    &[dir='ltr'] th {
      text-align: left;
    }

    .ck-table-bogus-paragraph {
      display: inline-block;
      width: 100%;
    }

    .ck-table-column-resizer {
      position: absolute;
      width: 5px;
      cursor: col-resize;
      background-color: rgba(0, 0, 0, 0.2);
    }
  }

  @media print {
    figure.table table {
      height: initial;
    }
  }

  /* Code Block */
  pre {
    position: relative;
    padding: 1em !important;
    color: hsl(0, 0%, 20.8%);
    background: hsla(0, 0%, 78%, 0.3);
    border: 1px solid hsl(0, 0%, 77%) !important;
    border-radius: 2px;
    text-align: left;
    direction: ltr;
    tab-size: 4;
    white-space: pre-wrap;
    font-style: normal;
    min-width: 200px;

    code {
      background: unset;
      padding: 0;
      border-radius: 0;

      &[class^='language-']::after {
        position: absolute;
        top: -1px;
        right: 10px;
        background: hsl(240, 4%, 25%);
        font-size: 10px;
        line-height: 16px;
        padding: 2px 6px;
        color: hsl(0, 0%, 100%);
        white-space: nowrap;
        border-radius: 4px;
      }

      &.language-cpp::after {
        content: 'C++';
      }
      &.language-c::after {
        content: 'C';
      }
      &.language-java::after {
        content: 'Java';
      }
      &.language-javascript::after {
        content: 'JavaScript';
      }
      &.language-typescript::after {
        content: 'TypeScript';
      }
      &.language-python::after {
        content: 'Python';
      }
      &.language-php::after {
        content: 'PHP';
      }
      &.language-html::after {
        content: 'HTML';
      }
      &.language-css::after {
        content: 'CSS';
      }
      &.language-sql::after {
        content: 'SQL';
      }
      &.language-json::after {
        content: 'JSON';
      }
      &.language-plaintext::after {
        content: 'Plain Text';
      }
    }
  }

  /*Link */
  a {
    color: #046ccc;
    &:hover {
      opacity: 0.8;
    }
  }

  /* List */
  ul,
  ol {
    padding-inline-start: 40px;
  }

  .ck-content ol {
    list-style-type: decimal;

    & ol {
      list-style-type: lower-latin;

      & ol {
        list-style-type: lower-roman;

        & ol {
          list-style-type: upper-latin;

          & ol {
            list-style-type: upper-roman;
          }
        }
      }
    }
  }

  .ck-content ul {
    list-style-type: disc;

    & ul {
      list-style-type: circle;

      & ul {
        list-style-type: square;

        & ul {
          list-style-type: square;
        }
      }
    }
  }
}
