/* v1.0.188: compact inline-image rhythm and seven safe text colors. */

.bk-editor-color-palette{
  display:inline-flex;
  align-items:center;
  gap:5px;
  min-height:32px;
  padding:3px 6px;
  margin-inline-start:2px;
  border:1px solid #c7dce2;
  border-radius:10px;
  background:#fff;
  direction:rtl;
}
.bk-editor-color-label{
  color:#334155!important;
  -webkit-text-fill-color:#334155!important;
  font-size:.7rem;
  font-weight:850;
  white-space:nowrap;
}
.bsu-toolbar .bk-editor-color-swatch,
.be-toolbar .bk-editor-color-swatch,
.bam-toolbar .bk-editor-color-swatch{
  width:21px!important;
  height:21px!important;
  min-width:21px!important;
  min-height:21px!important;
  flex:0 0 21px!important;
  padding:0!important;
  margin:0!important;
  border:2px solid #fff!important;
  border-radius:50%!important;
  background:var(--bk-editor-swatch)!important;
  box-shadow:0 0 0 1px rgba(15,23,42,.28)!important;
  cursor:pointer!important;
  appearance:none;
  -webkit-appearance:none;
}
.bsu-toolbar .bk-editor-color-swatch:hover,
.be-toolbar .bk-editor-color-swatch:hover,
.bam-toolbar .bk-editor-color-swatch:hover,
.bsu-toolbar .bk-editor-color-swatch:focus-visible,
.be-toolbar .bk-editor-color-swatch:focus-visible,
.bam-toolbar .bk-editor-color-swatch:focus-visible{
  transform:scale(1.12);
  box-shadow:0 0 0 2px #0e7490!important;
  outline:0;
}

/* Keep paragraphs and inline images visually connected in all three editors. */
.bsu-editor p,.be-editor p,.bam-editor p{
  margin:0 0 8px!important;
}
.bsu-editor figure,.be-editor figure,.bam-editor figure{
  display:block;
  width:100%;
  margin:6px 0!important;
}
.bsu-editor img,.be-editor img,.bam-editor img{
  margin:6px 0!important;
}
.bsu-editor figure>img,.be-editor figure>img,.bam-editor figure>img{
  margin:0!important;
}
.bsu-editor p+figure,.be-editor p+figure,.bam-editor p+figure,
.bsu-editor figure+p,.be-editor figure+p,.bam-editor figure+p,
.bsu-editor figure+figure,.be-editor figure+figure,.bam-editor figure+figure{
  margin-top:5px!important;
}

/* Seven controlled colors: safe in the editor and in the published article. */
.bsu-editor [data-bk-color="black"],.be-editor [data-bk-color="black"],.bam-editor [data-bk-color="black"],.bk-article-content [data-bk-color="black"]{color:#111827!important;-webkit-text-fill-color:#111827!important}
.bsu-editor [data-bk-color="red"],.be-editor [data-bk-color="red"],.bam-editor [data-bk-color="red"],.bk-article-content [data-bk-color="red"]{color:#dc2626!important;-webkit-text-fill-color:#dc2626!important}
.bsu-editor [data-bk-color="orange"],.be-editor [data-bk-color="orange"],.bam-editor [data-bk-color="orange"],.bk-article-content [data-bk-color="orange"]{color:#ea580c!important;-webkit-text-fill-color:#ea580c!important}
.bsu-editor [data-bk-color="yellow"],.be-editor [data-bk-color="yellow"],.bam-editor [data-bk-color="yellow"],.bk-article-content [data-bk-color="yellow"]{color:#a16207!important;-webkit-text-fill-color:#a16207!important}
.bsu-editor [data-bk-color="green"],.be-editor [data-bk-color="green"],.bam-editor [data-bk-color="green"],.bk-article-content [data-bk-color="green"]{color:#15803d!important;-webkit-text-fill-color:#15803d!important}
.bsu-editor [data-bk-color="blue"],.be-editor [data-bk-color="blue"],.bam-editor [data-bk-color="blue"],.bk-article-content [data-bk-color="blue"]{color:#2563eb!important;-webkit-text-fill-color:#2563eb!important}
.bsu-editor [data-bk-color="purple"],.be-editor [data-bk-color="purple"],.bam-editor [data-bk-color="purple"],.bk-article-content [data-bk-color="purple"]{color:#7e22ce!important;-webkit-text-fill-color:#7e22ce!important}

/* Compact published-article image spacing without cropping the image. */
.bk-article-content p{
  margin-bottom:8px!important;
}
.bk-article-content figure{
  margin:6px 0!important;
}
.bk-article-content img{
  margin:6px 0!important;
}
.bk-article-content figure>img{
  margin:0!important;
}
.bk-article-content p+figure,
.bk-article-content figure+p,
.bk-article-content figure+figure,
.bk-article-content p+img,
.bk-article-content img+p,
.bk-article-content img+img{
  margin-top:5px!important;
}
.bk-article-content figcaption{
  margin-top:4px!important;
  margin-bottom:2px!important;
}

@media(max-width:680px){
  .bk-editor-color-palette{
    gap:4px;
    padding:3px 5px;
  }
  .bsu-toolbar .bk-editor-color-swatch,
  .be-toolbar .bk-editor-color-swatch,
  .bam-toolbar .bk-editor-color-swatch{
    width:20px!important;
    height:20px!important;
    min-width:20px!important;
    min-height:20px!important;
    flex-basis:20px!important;
  }
  .bsu-editor p,.be-editor p,.bam-editor p,
  .bk-article-content p{
    margin-bottom:7px!important;
  }
  .bsu-editor figure,.be-editor figure,.bam-editor figure,
  .bk-article-content figure,
  .bsu-editor img,.be-editor img,.bam-editor img,
  .bk-article-content img{
    margin-top:5px!important;
    margin-bottom:5px!important;
  }
  .bsu-editor figure>img,.be-editor figure>img,.bam-editor figure>img,
  .bk-article-content figure>img{
    margin:0!important;
  }
}

/* v1.0.193: inline article images have no vertical margin. */
.bsu-editor figure,
.be-editor figure,
.bam-editor figure,
.bsu-editor img,
.be-editor img,
.bam-editor img,
.bk-article-content figure,
.bk-article-content img {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.bsu-editor p + figure,
.be-editor p + figure,
.bam-editor p + figure,
.bsu-editor figure + p,
.be-editor figure + p,
.bam-editor figure + p,
.bsu-editor figure + figure,
.be-editor figure + figure,
.bam-editor figure + figure,
.bk-article-content p + figure,
.bk-article-content figure + p,
.bk-article-content figure + figure,
.bk-article-content p + img,
.bk-article-content img + p,
.bk-article-content img + img {
  margin-top: 0 !important;
}

/* v1.0.194: override the stronger reading-rhythm figure rule. */
body.bk-single-content-light .bk-content-card .bk-article-content figure,
body.bk-single-content-light .bk-content-card .bk-article-content img {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  margin-block: 0 !important;
}

/* Remove the paragraph gap immediately before an inline image wrapper too. */
body.bk-single-content-light .bk-content-card .bk-article-content p:has(+ figure),
body.bk-single-content-light .bk-content-card .bk-article-content p:has(+ img) {
  margin-bottom: 0 !important;
}

body.bk-single-content-light .bk-content-card .bk-article-content figure + p,
body.bk-single-content-light .bk-content-card .bk-article-content img + p,
body.bk-single-content-light .bk-content-card .bk-article-content figure + figure,
body.bk-single-content-light .bk-content-card .bk-article-content img + img {
  margin-top: 0 !important;
}
