/* Match the frontend colours inside TinyMCE, including ACF rich-text fields. */
html:has(> body.mce-content-body) {
    --color-neutral-900: #1b1b1b;
    --color-white: #ffffff;
    --color-primary: #ffd500;
    color-scheme: only dark;
    background-color: var(--color-neutral-900);
    color: var(--color-white);
}

body.mce-content-body {
    font-family: "articulat-cf", Arial, sans-serif;
    font-size-adjust: from-font;
    background-color: var(--color-neutral-900);
    color: var(--color-white);
    caret-color: currentColor;
}

body.mce-content-body :where(a) {
    color: var(--color-primary);
}

/* Shared quote appearance for the frontend and classic rich-text editors. */
:is(.content, body.mce-content-body) blockquote {
    margin-block: 24px;
    margin-inline: 0;
    padding: 16px 20px;
    background-color: rgb(255 255 255 / 10%);
    color: inherit;
    font-size: 14px;
    line-height: 1.5;
    font-style: italic;
    overflow-wrap: anywhere;
}

:is(.content, body.mce-content-body) blockquote :is(p, li) {
    font-size: inherit;
    line-height: 1.5;
    font-style: inherit;
}

:is(.content, body.mce-content-body) blockquote p {
    margin-block: 0;
    padding-block: 0;
}

:is(.content, body.mce-content-body) blockquote p + p {
    margin-block-start: 0.75em;
}

/* The theme declares paragraph line-height as important in its base layer. */
@layer base {
    .content blockquote :is(p, li) {
        line-height: 1.5 !important;
    }
}

/* Shared H2-H6 sizes for article content and rich-text editors. */
:is(.content, body.mce-content-body) :is(h2, h3, h4, h5, h6) {
    line-height: 1.5;
    overflow-wrap: anywhere;
}

:is(.content, body.mce-content-body) h2 { font-size: 26px; }
:is(.content, body.mce-content-body) h3 { font-size: 23px; }
:is(.content, body.mce-content-body) h4 { font-size: 21px; }
:is(.content, body.mce-content-body) h5 { font-size: 18px; }
:is(.content, body.mce-content-body) h6 { font-size: 16px; }

@media (min-width: 768px) {
    :is(.content, body.mce-content-body) h2 { font-size: 32px; }
    :is(.content, body.mce-content-body) h3 { font-size: 28px; }
    :is(.content, body.mce-content-body) h4 { font-size: 24px; }
    :is(.content, body.mce-content-body) h5 { font-size: 20px; }
    :is(.content, body.mce-content-body) h6 { font-size: 18px; }
}
