:root {
    --editor-richtext-padding-vertical: 1rem;
    --editor-border-radius: 0.25rem;

    --editor-accent-color-rgb: 34, 70, 136;
    --editor-margin-x: 15%;

    --editor-warning-color-rgb: 255, 0, 0;
    --editor-warning-color-opacity: 5;  /* 100 max / 0 min */

    --editor-info-color-rgb: 0, 21, 114;
    --editor-info-color-opacity: 5;     /* 100 max / 0 min */

    --editor-success-color-rgb: 0, 139, 26;
    --editor-success-color-opacity: 5;  /* 100 max / 0 min */

    --editor-button-text: #f3f3f3;
    --editor-button-bg: 47, 0, 92;
    --editor-button-bg-opacity: 80;     /* 100 max / 0 min */
    --editor-button-text-hover: #f3f3f3;
    --editor-button-bg-hover: 47, 0, 92;
    --editor-button-bg-hover-opacity: 100;     /* 100 max / 0 min */
}
*, *:before, *:after {
    box-sizing: border-box;
}
.wagtail-editorjs-richtext.wagtail-editorjs-richtext > * {
    /* margin: 0.75rem 0; */
    margin-top: 0;
    margin-bottom: 0;
    padding-top: calc(var(--editor-richtext-padding-vertical) / 2);
    padding-bottom: calc(var(--editor-richtext-padding-vertical) / 2);
}
.wagtail-editorjs-richtext.wagtail-editorjs-richtext h1,
.wagtail-editorjs-richtext.wagtail-editorjs-richtext h2,
.wagtail-editorjs-richtext.wagtail-editorjs-richtext h3,
.wagtail-editorjs-richtext.wagtail-editorjs-richtext h4,
.wagtail-editorjs-richtext.wagtail-editorjs-richtext h5,
.wagtail-editorjs-richtext.wagtail-editorjs-richtext h6 {
    margin: 0 0;
    padding: 0;
}
.wagtail-editorjs-richtext.wagtail-editorjs-richtext h1 {
    font-size: 2.5rem;
}
.wagtail-editorjs-richtext.wagtail-editorjs-richtext h2 {
    font-size: 2.25rem;
}
.wagtail-editorjs-richtext.wagtail-editorjs-richtext h3 {
    font-size: 2rem;
}
.wagtail-editorjs-richtext.wagtail-editorjs-richtext h4 {
    font-size: 1.5rem;
}
.wagtail-editorjs-richtext.wagtail-editorjs-richtext h5 {
    font-size: 1.25rem;
}
.wagtail-editorjs-richtext.wagtail-editorjs-richtext h6 {
    font-size: 1rem;
    margin: 0.1rem 0;
    padding: 0;
}
.wagtail-editorjs-richtext p {
    font-size: 1rem;
    margin: 0;
    padding: 0;
}
.wagtail-editorjs-richtext.wagtail-editorjs-richtext > :not(.stretched):is(.bg-stretched) {
    padding-left: calc(var(--editor-margin-x) / 5);
    padding-right: calc(var(--editor-margin-x) / 5);
}

.wagtail-editorjs-color-tuned {
    color: var(--text-color, inherit) !important;
    background-color: var(--background-color, inherit) !important;
}
.wagtail-editorjs-color-tuned * {
    color: var(--text-color, inherit) !important;
}

@media (min-width: 576px) {
    .wagtail-editorjs-richtext.wagtail-editorjs-richtext > :not(.stretched, .bg-stretched) {
        margin-left: calc(var(--editor-margin-x) / 5);
        margin-right: calc(var(--editor-margin-x) / 5);
    }
    .wagtail-editorjs-richtext.wagtail-editorjs-richtext > :not(.stretched):is(.bg-stretched) {
        padding-left: calc(var(--editor-margin-x) / 5);
        padding-right: calc(var(--editor-margin-x) / 5);
    }
}
@media (min-width: 768px) {
    .wagtail-editorjs-richtext.wagtail-editorjs-richtext > :not(.stretched, .bg-stretched) {
        margin-left: calc(var(--editor-margin-x) / 4);
        margin-right: calc(var(--editor-margin-x) / 4);
    }
    .wagtail-editorjs-richtext.wagtail-editorjs-richtext > :not(.stretched):is(.bg-stretched) {
        padding-left: calc(var(--editor-margin-x) / 4);
        padding-right: calc(var(--editor-margin-x) / 4);
    }
}
@media (min-width: 992px) {
    .wagtail-editorjs-richtext.wagtail-editorjs-richtext > :not(.stretched, .bg-stretched) {
        margin-left: calc(var(--editor-margin-x) / 3);
        margin-right: calc(var(--editor-margin-x) / 3);
    }
    .wagtail-editorjs-richtext.wagtail-editorjs-richtext > :not(.stretched):is(.bg-stretched) {
        padding-left: calc(var(--editor-margin-x) / 3);
        padding-right: calc(var(--editor-margin-x) / 3);
    }
}
@media (min-width: 1200px) {
    .wagtail-editorjs-richtext.wagtail-editorjs-richtext > :not(.stretched, .bg-stretched) {
        margin-left: calc(var(--editor-margin-x) / 2);
        margin-right: calc(var(--editor-margin-x) / 2);
    }
    .wagtail-editorjs-richtext.wagtail-editorjs-richtext > :not(.stretched):is(.bg-stretched) {
        padding-left: calc(var(--editor-margin-x) / 2);
        padding-right: calc(var(--editor-margin-x) / 2);
    }
}
@media (min-width: 1400px) {
    .wagtail-editorjs-richtext.wagtail-editorjs-richtext > :not(.stretched, .bg-stretched) {
        margin-left: var(--editor-margin-x);
        margin-right: var(--editor-margin-x);
    }
    .wagtail-editorjs-richtext.wagtail-editorjs-richtext > :not(.stretched):is(.bg-stretched) {
        padding-left: var(--editor-margin-x);
        padding-right: var(--editor-margin-x);
    }
}
.wagtail-editorjs-richtext > *:has(figure, img) {
    padding-top: 0;
    padding-bottom: 0;
}
.wagtail-editorjs-richtext figure {
    margin: 0;
    display: flex;
    flex-direction: column;
}
.wagtail-editorjs-richtext .with-background > img {
    padding: 0.5rem;
}
.wagtail-editorjs-richtext .with-background > figure {
    padding-top: 0.5em;
    background-color: var(--figure-bg);
}
.wagtail-editorjs-richtext :not(.stretched) > figure img {
    width: 60%;
    height: auto;
}
.wagtail-editorjs-richtext figure figcaption {
    padding: 0.5rem 0;
    font-size: 0.8rem;
    text-align: center;
    color: #f3f3f3;
    background-color: rgba(var(--editor-accent-color-rgb), 0.4);
}
.wagtail-editorjs-richtext .with-background > img,
.wagtail-editorjs-richtext .with-background:not(figure) > img {
    padding: 1rem;
}
.wagtail-editorjs-richtext > img,
.wagtail-editorjs-richtext :not(figure) > img {
    padding-top: 0;
    padding-bottom: 0;
    max-height: 500px;
    overflow: hidden;
}
.wagtail-editorjs-richtext img {
    height: auto;
}
.wagtail-editorjs-richtext img {
    width: 60%;
}
.wagtail-editorjs-richtext .stretched figure,
.wagtail-editorjs-richtext .stretched figure img,
.wagtail-editorjs-richtext .stretched img {
    width: 100%;
    max-height: 500px;
    overflow: hidden;
    object-fit: cover;
}

.wagtail-editorjs-richtext .align-content-left {
    text-align: left;
}
.wagtail-editorjs-richtext .align-content-center {
    text-align: center;
}
.wagtail-editorjs-richtext .align-content-right {
    text-align: right;
}

.wagtail-editorjs-richtext .align-content-left figure,
.wagtail-editorjs-richtext .align-content-left img {
    display: block;
    margin-left: 0;
    margin-right: auto;
}

.wagtail-editorjs-richtext .align-content-right figure,
.wagtail-editorjs-richtext .align-content-right img {
    margin-left: auto;
    margin-right: 0;

}

.wagtail-editorjs-richtext .align-content-center figure,
.wagtail-editorjs-richtext .align-content-center img {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.wagtail-editorjs-richtext table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    margin: 0.5rem 0;
}
.wagtail-editorjs-richtext table th,
.wagtail-editorjs-richtext table td {
    padding: 0.5rem;
    border: 1px solid rgba(var(--editor-accent-color-rgb), 0.1);
}
.wagtail-editorjs-richtext table th {
    background-color: rgba(var(--editor-accent-color-rgb), 0.1);
}
.wagtail-editorjs-richtext table tr:nth-child(even) {
    background-color: rgba(var(--editor-accent-color-rgb), 0.01);
}
.wagtail-editorjs-richtext table tr:nth-child(odd) {
    background-color: rgba(var(--editor-accent-color-rgb), 0.03);
}


.wagtail-editorjs-richtext .warning {
    padding: 1rem 1.5rem;
    margin: 0.5rem 0;
    font-size: 0.9rem;
    background-color: rgba(var(--editor-warning-color-rgb), calc(var(--editor-warning-color-opacity) / 100));
    border: 1px solid rgba(var(--editor-warning-color-rgb), calc(var(--editor-warning-color-opacity) / 10));
    color: rgb(var(--editor-warning-color-rgb));
    border-radius: var(--editor-border-radius);
}

.wagtail-editorjs-richtext .warning h2 {
    margin: 0;
    margin-bottom: 0.2rem;
    padding: 0;
    font-size: 1.2rem;
}

.wagtail-editorjs-richtext .warning p {
    margin: 0;
    padding: 0;
}

/* .cdx-text-variant--details .ce-block__content, */
/* .cdx-text-variant--citation .ce-block__content, */

.wagtail-editorjs-richtext hr {
    margin: 2rem 0;
    border: 0;
    border-top: 1px solid rgba(var(--editor-accent-color-rgb), 0.1);

}

.wagtail-editorjs-richtext .inline-code {
    padding: 0.25rem;
    margin: 0.5rem 0.25rem;
    background-color: rgba(var(--editor-accent-color-rgb), 0.1);
    border-radius: var(--editor-border-radius);
    font-family: monospace;
    font-size: 0.9rem;
}

.wagtail-editorjs-richtext code.code {
    padding: 0.25rem;
    margin: 0.5rem 0;
    display: flex;
    background-color: rgba(var(--editor-accent-color-rgb), 0.1);
    border-radius: var(--editor-border-radius);
    font-family: monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
}


/* Attaches */
.wagtail-editorjs-richtext .attaches {
    padding: 0.5rem 1rem;
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(var(--editor-accent-color-rgb), 0.1);
    border-radius: var(--editor-border-radius);
    position: relative;
}
.wagtail-editorjs-richtext .attaches .attaches-title {
    margin: 0;
    padding: 0;
    font-size: 1.2rem;
    font-weight: bold;
}
.wagtail-editorjs-richtext .attaches .attaches-size {
    font-size: 0.8rem;
    color: rgba(var(--editor-accent-color-rgb), 0.5);
}
.wagtail-editorjs-richtext .attaches .attaches-link {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    margin: 0;
    border: 2px solid rgba(var(--editor-accent-color-rgb), 0.1);
    border-radius: var(--editor-border-radius);
    text-decoration: none;
    color: inherit;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}
.wagtail-editorjs-richtext .attaches .attaches-link svg {
    vertical-align: middle;
    width: 1.3em;
    height: 1.3em;
}



/* Checklist Feature */
.wagtail-editorjs-richtext .checklist li {
    list-style-type: none;
    position: relative;
    padding-left: 1.5em;
}
.wagtail-editorjs-richtext .checklist li:before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 1em;
    height: 1em;
    border: 1px solid rgba(var(--editor-accent-color-rgb), 0.1);
    border-radius: var(--editor-border-radius);
    background-color: rgba(var(--editor-accent-color-rgb), 0.1);
}
.wagtail-editorjs-richtext .checklist li.checked:before {
    content: "✔";
    display: flex;
    justify-content: center;
    align-items: center;
    color: rgba(var(--editor-success-color-rgb), 1);
    background-color: rgba(var(--editor-success-color-rgb), calc(var(--editor-success-color-opacity) / 100));
    border: 1px solid rgba(var(--editor-success-color-rgb), calc(var(--editor-success-color-opacity) / 10));
}


/* Text variant tunes */
.wagtail-editorjs-richtext .text-variant-details {
    margin: 1rem 0;
    padding: 0.5rem 1rem;
    border-radius: var(--editor-border-radius);
    border: 1px solid rgba(var(--editor-info-color-rgb), calc(var(--editor-info-color-opacity) / 10));
    background-color: rgba(var(--editor-info-color-rgb), calc(var(--editor-info-color-opacity) / 100));
    color: rgba(var(--editor-info-color-rgb), 1);
    font-size: 0.9rem;
}
.wagtail-editorjs-richtext .text-variant-call-out {
    font-size: 1.1rem;
    margin: 1rem 0;
    padding: 1rem 1.5rem;
    border-radius: var(--editor-border-radius);
    border: 1px solid rgba(var(--editor-warning-color-rgb), calc(var(--editor-warning-color-opacity) / 10));
    box-shadow: 0 0 0 5px rgba(var(--editor-warning-color-rgb), calc(var(--editor-warning-color-opacity) / 50));
}


/* Blockquote feature / text variant tune [citation] */
.wagtail-editorjs-richtext .text-variant-citation {
    margin: 1rem 0;
    padding: 0.5rem;
    border-radius: var(--editor-border-radius);
    border: 1px solid rgba(var(--editor-accent-color-rgb), 0.5);
    position: relative;
}
.wagtail-editorjs-richtext blockquote {
    padding: 0.5rem 1rem;
    margin: 0.5rem 0;
    border-left: 0.25rem solid rgba(var(--editor-accent-color-rgb), 0.1);
    background-color: rgba(var(--editor-accent-color-rgb), 0.05);
    border-radius: var(--editor-border-radius);
    position: relative;
}
.wagtail-editorjs-richtext blockquote footer {
    font-size: 0.8rem;
    color: rgba(var(--editor-accent-color-rgb), 0.5);
}
.wagtail-editorjs-richtext .text-variant-citation:before,
.wagtail-editorjs-richtext blockquote:before {
    content: "“";
    font-size: 2rem;
    color: rgba(var(--editor-accent-color-rgb), 0.5);
    position: absolute;
    top: 0;
    right: 1rem;
}
.wagtail-editorjs-richtext .align-content-right blockquote:before,
.wagtail-editorjs-richtext blockquote.align-content-right:before {
    left: 1rem;
    right: auto;
}


/* Nested list feature */
.wagtail-editorjs-richtext ol.nested-list {
    --d: var(--depth, 0);
    counter-reset: item;
    list-style-type: none;
    padding-left: calc(var(--d) * 1em);
}
.wagtail-editorjs-richtext ol.nested-list li {
    display: block;
    position: relative;
}
.wagtail-editorjs-richtext ol.nested-list li:before {
    content: counters(item, ".") ". ";
    counter-increment: item;
    position: absolute;
    left: 0;
}


/* Image row feature. */
.wagtail-editorjs-richtext .image-row {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    width: 100%;
    gap: 0.5rem;
}
.wagtail-editorjs-richtext .image-row .image-wrapper {
    display: flex;
    flex: 1 0 15%;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(var(--editor-accent-color-rgb), 0.1);
    min-width: 150px;
    min-height: 200px;
    max-height: 200px;
}
.wagtail-editorjs-richtext .image-row .image-wrapper img {
    width: 100%;
    height: 100%;
    min-height: 200px;
    object-fit: cover;
    margin: 0;
}


.wagtail-editorjs-richtext .editor-button {
    width: 100%;
    padding: 0.5rem;
    margin: 0.5rem 0;
    transition: background-color 0.2s, color 0.2s;
    border-radius: var(--editor-border-radius);
    border: 1px solid rgba(var(--editor-button-bg), min(calc(var(--editor-button-bg-opacity) / 10), 1));
    background-color: rgba(var(--editor-button-bg), calc(var(--editor-button-bg-opacity) / 100));
    color: var(--editor-button-text);
}
.wagtail-editorjs-richtext .editor-button:hover {
    background-color: rgba(var(--editor-button-bg-hover), calc(var(--editor-button-bg-hover-opacity) / 100));
    color: var(--editor-button-text-hover);
}

.wagtail-tooltip {
    cursor: help;
    color: rgba(var(--editor-accent-color-rgb), 1);
    text-decoration: dotted underline;
    text-underline-offset: 0.15em;
}