.l-post-content {
  padding-bottom: 15px;

  @include respond-to("medium") {
    max-width: 820px;
    min-height: 400px;
    margin: 0 auto;

    @include respond-to("medium") {
      padding-bottom: 30px;
    }
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    color: var(--titles-color);
    line-height: 1.3;
    font-weight: 700;
    padding-top: 5px;
    margin: 0 0 30px;

    @include respond-to("medium") {
      padding-top: 10px;
      margin-bottom: 40px;
    }
  }

  h1 {
    font-size: 2.125rem;

    @include respond-to("medium") {
      font-size: 2.625rem;
    }
  }

  h2 {
    font-size: 1.75rem;

    @include respond-to("medium") {
      font-size: 2.25rem;
    }
  }

  h3 {
    font-size: 1.375rem;

    @include respond-to("medium") {
      font-size: 1.75rem;
    }
  }

  h4 {
    font-size: 1rem;

    @include respond-to("medium") {
      font-size: 1.375rem;
    }
  }

  h5 {
    font-size: 0.938rem;

    @include respond-to("medium") {
      font-size: 1.125rem;
    }
  }

  h6 {
    font-size: 0.813rem;

    @include respond-to("medium") {
      font-size: 1rem;
    }
  }

  p {
    letter-spacing: 0.2px;
    line-height: 1.5;
    font-size: 1.125rem;
    margin-bottom: 25px;

    @include respond-to("medium") {
      letter-spacing: 0.3px;
      line-height: 1.6;
      font-size: 1.25rem;
      margin-bottom: 30px;
    }

    img {
      margin-bottom: 0 !important;
    }
  }

  b,
  strong {
    font-weight: 600;
  }

  em {
    font-style: italic;
  }

  a {
    color: var(--primary-foreground-color);
    text-decoration: underline;
    @include transition(color linear 0.2s);

    &:hover {
      color: var(--link-color);
    }
  }

  ul,
  ol {
    letter-spacing: 0.2px;
    line-height: 1.5;
    font-size: 1.125rem;
    padding-left: 20px;
    margin: 0 0 20px 0;

    @include respond-to("medium") {
      letter-spacing: 0.3px;
      line-height: 1.6;
      font-size: 1.25rem;
      padding-left: 40px;
      margin-bottom: 30px;
    }
  }

  li {
    margin-bottom: 20px;
  }

  img,
  .kg-image {
    display: block;
    max-width: 100%;
    margin: 0 auto 35px;

    @include respond-to("medium") {
      margin-bottom: 40px;
    }
  }

  iframe {
    display: block;
    margin: 0 auto;
    max-width: 100%;
  }

  .fluid-width-video-wrapper {
    margin: 0 auto 35px;

    @include respond-to("medium") {
      margin-bottom: 40px;
    }
  }

  figure,
  &.kg-image-card {
    padding: 20px 0 40px;
    margin: 0 -#{$mobile-space};

    @include respond-to("medium") {
      padding: 20px 0 50px;
      margin: 0;
    }

    &.kg-embed-card {
      display: flex;
      flex-direction: column;
      align-items: center;
      min-width: 100%;
      margin: 0 auto;

      iframe {
        margin: 0 auto;
      }
    }

    &.kg-width-full,
    &.kg-width-wide {
      img {
        width: 100%;
        height: auto;
      }
    }

    &.kg-width-wide {
      @include respond-to("extra-large") {
        margin: 0 -70px;
      }
    }

    &.kg-width-full {
      @include respond-to("medium") {
        width: 100vw;
        margin-left: 50%;
        @include transform(translateX(-50%));
      }
    }

    img,
    .kg-image {
      display: block;
      width: auto;
      max-width: 100%;
      height: auto;
      margin: 0 auto;
    }

    figcaption {
      text-align: center;
      letter-spacing: 0.1px;
      line-height: 1.3;
      font-size: 0.75rem;
      padding: 10px $mobile-space 0 $mobile-space;

      @include respond-to("medium") {
        font-size: 0.875rem;
        padding: 15px 0 0 0;
      }
    }

    .fluid-width-video-container {
      flex-grow: 1;
      width: 100%;
    }

    .fluid-width-video-wrapper {
      margin: 0 auto !important;
    }

    .kg-gallery-container {
      display: flex;
      flex-direction: column;
      width: 100%;
    }

    .kg-gallery-row {
      display: flex;
      flex-direction: row;
      justify-content: center;
    }

    .kg-gallery-image img {
      display: block;
      margin: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .kg-gallery-row:not(:first-of-type) {
      margin: 0.75em 0 0 0;
    }

    .kg-gallery-image:not(:first-of-type) {
      margin: 0 0 0 0.75em;
    }
  }

  hr {
    position: relative;
    margin: 30px 0;
    border: 0;
    border-top: 1px solid var(--secondary-subtle-color);

    @include respond-to("medium") {
      margin: 50px 0;
    }

    &:after {
      content: "";
      position: absolute;
      top: 50%;
      left: 50%;
      width: 10px;
      height: 10px;
      border-radius: 50%;
      background-color: var(--secondary-subtle-color);
      @include bs(0 0 0 10px var(--background-color));
      @include transform(translate(-50%, -50%));

      @include respond-to("medium") {
        width: 12px;
        height: 12px;
        @include bs(0 0 0 20px var(--background-color));
      }
    }
  }

  blockquote {
    position: relative;
    letter-spacing: 0.2px;
    line-height: 1.5;
    font-size: 1.125rem;
    font-style: italic;
    font-family: Georgia, "Times New Roman", Times, serif;
    padding: 0 40px;
    margin: 0 0 25px;

    @include respond-to("medium") {
      letter-spacing: 0.3px;
      line-height: 1.6;
      font-size: 1.25rem;
      padding: 0 60px;
      margin-bottom: 30px;
    }

    &.kg-blockquote-alt {
      color: var(--primary-subtle-color);
      line-height: 1.2;
      font-family: inherit;
      font-style: normal;
      font-weight: 700;
      font-size: 2rem;
      padding-top: 20px;
      padding-bottom: 20px;

      @include respond-to("medium") {
        font-size: 2.625rem;
        padding-top: 40px;
        padding-bottom: 40px;
      }

      &:before {
        display: none;
      }
    }

    &:before {
      content: '"';
      position: absolute;
      top: 0;
      left: 0;
      color: var(--primary-foreground-color);
      line-height: 1;
      font-size: 2.625rem;

      @include respond-to("medium") {
        font-size: 4rem;
      }
    }

    p:last-child {
      margin-bottom: 0;
    }
  }

  table {
    color: var(--titles-color);
    font-size: 0.875rem;
    width: calc(100% + 40px);
    margin: 0 -#{$mobile-space} 25px;

    @include respond-to("medium") {
      font-size: 1rem;
      width: 100%;
      margin: 0 0 30px;
    }

    thead {
      border-bottom: 1px solid var(--table-head-border-bottom);

      td {
        font-weight: 600;
      }
    }

    tbody {
      tr:nth-child(even) {
        background-color: var(--background-color);
      }
      tr:nth-child(odd) {
        background-color: var(--table-background-color-odd);
      }
    }

    td {
      text-align: center;
      padding: 10px;

      @include respond-to("medium") {
        padding: 20px;
      }
    }
  }

  code {
    display: inline-block;
    color: var(--link-color);
    font-size: 0.9rem;
    font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
    padding: 0 5px;
    border-radius: 5px;
    background-color: var(--secondary-subtle-color);
  }

  pre {
    line-height: 1.4;
    font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
    margin: 0 0 25px;
    overflow-x: auto;
    border-radius: 5px;
    background-color: var(--secondary-subtle-color);
    white-space: pre;
    word-spacing: normal;
    word-break: normal;
    word-wrap: normal;
    line-height: 1.5;
    -moz-tab-size: 2;
    -o-tab-size: 2;
    tab-size: 2;
    -webkit-hyphens: none;
    -moz-hyphens: none;
    -ms-hyphens: none;
    hyphens: none;

    @include respond-to("medium") {
      margin-bottom: 30px;
    }

    > code {
      display: block;
      padding: 10px;
      white-space: pre;
      word-spacing: normal;
      word-break: normal;
      word-wrap: normal;
      line-height: 1.5;
      -moz-tab-size: 2;
      -o-tab-size: 2;
      tab-size: 2;
      -webkit-hyphens: none;
      -moz-hyphens: none;
      -ms-hyphens: none;
      hyphens: none;

      @include respond-to("medium") {
        padding: 20px;
      }
    }

    &.line-numbers > code {
      padding: 0;
    }
  }

  form {
    margin-bottom: 25px;

    @include respond-to("medium") {
      margin-bottom: 30px;
    }
  }

  label {
    display: block;
    font-size: 1.125rem;
    margin-bottom: 12px;
  }

  input:not([type="radio"]):not([type="checkbox"]):not(.kg-video-card input):not(.kg-audio-card input),
  textarea,
  select {
    margin-bottom: 20px;
    @extend .m-input;
  }

  textarea {
    height: 100px;
    resize: none;
  }

  select {
    position: relative;
    padding-right: 40px !important;
    background-repeat: no-repeat;
    background-position: calc(100% - 15px) center;
    background-size: 15px 8px;
    background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI5IiBoZWlnaHQ9IjUiIHZpZXdCb3g9IjAgMCA5IDUiPgogICAgPHBhdGggZmlsbD0iIzU2NWU2MCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNOC4zMi41N2EuMjQ3LjI0NyAwIDAgMSAwIC4zNkw0LjY4IDQuNTdhLjI0Ny4yNDcgMCAwIDEtLjM2IDBMLjY4LjkzYS4yNDcuMjQ3IDAgMCAxIDAtLjM2bC4zOS0uMzlhLjI0Ny4yNDcgMCAwIDEgLjM2IDBMNC41IDMuMjUgNy41Ny4xOGEuMjQ3LjI0NyAwIDAgMSAuMzYgMGwuMzkuMzl6Ii8+Cjwvc3ZnPgo=");
  }

  button:not(.m-icon-button):not(.kg-video-card button):not(.kg-audio-card button):not(.kg-toggle-card button) {
    @extend .m-button;

    &:not(.primary) {
      @extend .outlined;
    }
  }

  .kg-bookmark-card {
    width: 100%;
    padding: 0 !important;
    margin: 30px auto !important;
    background: var(--background-color);

    @include respond-to("medium") {
      margin: 40px auto !important;
    }

    &:hover {
      .kg-bookmark-container {
        opacity: 0.8;
        color: var(--primary-foreground-color);
      }
    }
  }

  .kg-card + .kg-bookmark-card {
    margin-top: 0;
  }

  .kg-bookmark-container {
    display: flex;
    color: var(--primary-foreground-color);
    text-decoration: none !important;
    min-height: 148px;
    box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 4px,
      rgba(0, 0, 0, 0.1) 0px 0px 0px 1px;
    border-radius: 3px;
    @include transition(opacity linear 0.2s);
  }

  .kg-bookmark-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 20px;
  }

  .kg-bookmark-title {
    font-size: 1.125rem;
    line-height: 1.3;
    font-weight: 600;
  }

  .kg-bookmark-description {
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.4;
    margin-top: 12px;
    overflow-y: hidden;
  }

  .kg-bookmark-thumbnail {
    position: relative;
    min-width: 30%;
    max-height: 100%;
    overflow: hidden;
  }

  .kg-bookmark-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    border-radius: 0 3px 3px 0;
  }

  .kg-bookmark-metadata {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--titles-color);
    margin-top: 14px;
  }

  .kg-bookmark-icon {
    width: 22px !important;
    height: 22px !important;
    margin-right: 8px !important;
  }

  .kg-bookmark-author:after {
    content: "•";
    margin: 0 6px;
  }

  .kg-bookmark-publisher {
    color: inherit;
  }

  @media (max-width: 500px) {
    .kg-bookmark-container {
      flex-direction: column;
    }

    .kg-bookmark-thumbnail {
      order: 1;
      width: 100%;
      min-height: 160px;
    }

    .kg-bookmark-thumbnail img {
      border-radius: 3px 3px 0 0;
    }

    .kg-bookmark-content {
      order: 2;
    }
  }

  .kg-nft-card {
    .kg-nft-card-container {
      border-radius: 20px;
      background-color: var(--background-color);
    }

    .kg-ntf-image-container {
      border-radius: 20px 20px 0 0;
      overflow: hidden;
    }

    .kg-nft-metadata {
      border-radius: 0 0 20px 20px;
    }

    .kg-nft-header {
      margin-bottom: 10px;

      img {
        display: inline-block;
        width: 100px;
        max-width: 100px;
        margin: 0;
        filter: #{"invert(var(--kg-card-img-invert-color))"};
      }
    }

    .kg-nft-title {
      color: var(--secondary-foreground-color);
      padding-top: 0;
    }

    kg-nft-description,
    .kg-nft-creator {
      color: var(--primary-foreground-color);

      span {
        color: var(--secondary-foreground-color);
      }
    }
  }

  .kg-button-card {
    padding: 30px 0;
    margin-bottom: 25px;

    a.kg-btn {
      color: $white !important;
      font-family: inherit !important;
      height: auto;
      background-color: var(--primary-subtle-color) !important;
      @include bs(0 2px 4px var(--button-shadow-color-normal));
      @extend .m-button;

      &:hover {
        opacity: 1;
        @include transform(translateY(-2px));
        @include bs(0 4px 8px var(--button-shadow-color-hover));
      }
    }
  }

  .kg-callout-card {
    margin-bottom: 25px;

    @include respond-to("medium") {
      margin-bottom: 30px;
    }

    .kg-callout-emoji {
      padding-right: 24px;
    }

    .kg-callout-text {
      font-size: 1.0625rem;

      @include respond-to("medium") {
        font-size: 1.125rem;
      }
    }
  }

  .kg-header-card {
    width: 100vw;
    margin-top: 30px;
    margin-bottom: 30px;
    margin-left: 50%;
    @include transform(translateX(-50%));

    @include respond-to("medium") {
      margin-top: 40px;
      margin-bottom: 40px;
    }

    &.kg-style-light {
      .kg-header-card-header,
      .kg-header-card-subheader {
        color: $titles;
      }

      .kg-header-card-button {
        color: $white !important;
        background-color: var(--primary-subtle-color) !important;
      }
    }

    .kg-header-card-button {
      color: $titles !important;
      font-family: inherit;
      height: auto !important;
      background-color: $white !important;
      @extend .m-button;

      &:hover {
        opacity: 1;
        @include transform(translateY(-2px));
        @include bs(0 4px 8px var(--button-shadow-color-hover));
      }
    }
  }

  .kg-toggle-card {
    margin-bottom: 20px;

    .kg-toggle-heading-text {
      padding-top: 0;
    }

    .kg-toggle-card-icon {
      display: flex !important;
      align-items: center;
      justify-content: center;
      border: 0 !important;
      padding: 0;
      cursor: pointer;
    }
  }

  .kg-product-card {
    margin-bottom: 30px;

    @include respond-to("medium") {
      margin-bottom: 40px;
    }

    .kg-product-card-image {
      height: auto;
      margin-bottom: 0;
      border-radius: 5px;
    }

    .kg-product-card-title {
      padding-top: 0;
      font-family: inherit;
    }

    .kg-product-card-description {
      p {
        font-family: inherit;
      }
    }

    .kg-product-card-button {
      color: $white !important;
      font-family: inherit !important;
      height: auto;
      background-color: var(--primary-subtle-color) !important;
      @extend .m-button;
    }
  }

  .kg-file-card {
    margin-bottom: 30px;

    @include respond-to("medium") {
      margin-bottom: 40px;
    }
  }

  .kg-audio-card {
    margin-bottom: 30px;

    @include respond-to("medium") {
      margin-bottom: 40px;
    }

    img {
      margin: 8px;
    }

    .kg-audio-play-icon,
    .kg-audio-pause-icon,
    .kg-audio-unmute-icon,
    .kg-audio-mute-icon {
      svg {
        fill: var(--secondary-foreground-color);
      }
    }

    .kg-audio-playback-rate {
      color: var(--secondary-foreground-color);
    }

    .kg-audio-seek-slider,
    .kg-audio-volume-slider {
      &:before {
        background-color: var(--secondary-foreground-color);
      }
    }
  }
}

.rtl {
  .l-post-content {
    ul,
    ol {
      padding-left: 0;
      padding-right: 20px;

      @include respond-to("medium") {
        padding-left: 0;
        padding-right: 40px;
      }
    }

    code {
      direction: ltr;
    }

    blockquote {
      &:before {
        left: auto;
        right: 0;
      }
    }

    .kg-bookmark-icon {
      margin-right: 0 !important;
      margin-left: 8px !important;
    }

    figure.kg-width-full {
      @include respond-to("medium") {
        margin-left: 0;
        margin-right: 50%;

        @include transform(translateX(50%));
      }
    }

    .kg-callout-card {
      .kg-callout-emoji {
        padding-right: auto;
        padding-left: 24px;
      }
    }

    .kg-toggle-card {
      .kg-toggle-card-icon {
        margin-left: 0;
        margin-right: 16px;
      }
    }

    .kg-product-card {
      .kg-product-card-rating {
        padding-left: 0;
        padding-right: 16px;
      }
    }
  }
}
