body .editor-styles-wrapper {
    font-family: var(--cabb-font-body) !important;
    font-size: 18px;
    color: var(--cabb-editor-text-color, #202020);
}

body .h1, body .h2, body .h3, body .h4, body .h5, body .h6,
body h1, body h2, body h3, body h4, body h5, body h6 {
    font-weight: 600;
}

/* theme.json root padding — keep content blocks aligned with 670px column */
.editor-styles-wrapper :is(.is-root-container, .wp-block-post-content, .block-editor-block-list__layout.is-root-container).has-global-padding {
    padding: 0 !important;
}

/* Editor root blocks: use margins like frontend, not theme.json block-gap (1.5rem) */
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container,
.editor-styles-wrapper .is-root-container {
    --wp--style--block-gap: 0;
    gap: 0 !important;
}

.editor-styles-wrapper .block-editor-block-list__layout.is-root-container.is-layout-flow > * + *,
.editor-styles-wrapper .is-root-container.is-layout-flow > * + * {
    margin-block-start: 0 !important;
}

.editor-styles-wrapper .block-editor-block-list__layout.is-root-container > figure.wp-block-image,
.editor-styles-wrapper .is-root-container > figure.wp-block-image {
    margin-top: 0 !important;
    margin-bottom: 1.5em !important;
}

.editor-styles-wrapper .is-root-container > p:not(.alignwide):not(.alignfull),
.editor-styles-wrapper .is-root-container > ul.wp-block-list:not(.alignwide):not(.alignfull),
.editor-styles-wrapper .is-root-container > ol.wp-block-list:not(.alignwide):not(.alignfull) {
    font-size: 18px;
    margin-bottom: 1.5em;
}

.editor-styles-wrapper .is-root-container > h1.wp-block-heading,
.editor-styles-wrapper .is-root-container > h2.wp-block-heading,
.editor-styles-wrapper .is-root-container > h3.wp-block-heading,
.editor-styles-wrapper .is-root-container > h4.wp-block-heading,
.editor-styles-wrapper .is-root-container > h5.wp-block-heading,
.editor-styles-wrapper .is-root-container > h6.wp-block-heading,
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container > h1.wp-block-heading,
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container > h2.wp-block-heading,
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container > h3.wp-block-heading,
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container > h4.wp-block-heading,
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container > h5.wp-block-heading,
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container > h6.wp-block-heading {
    font-family: var(--cabb-font-heading) !important;
    color: inherit;
}

/* Singular articles: heading margins (match body.single-post rules on GolfStar etc.) */
body.single-post main > h1.wp-block-heading,
body.single-post main > h2.wp-block-heading,
body.single-post main > h3.wp-block-heading,
body.single-post main > h4.wp-block-heading,
body.single-post main > h5.wp-block-heading,
body.single main > h1.wp-block-heading,
body.single main > h2.wp-block-heading,
body.single main > h3.wp-block-heading,
body.single main > h4.wp-block-heading,
body.single main > h5.wp-block-heading {
    font-weight: 600;
    margin: 0.5em auto;
}

/* Empty paragraphs add phantom spacing in editor and on frontend */
body.single-post main > p:empty,
body.single main > p:empty,
.editor-styles-wrapper .is-root-container > p:empty,
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container > p:empty {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
}

/* Content heading scale — same on all sites, frontend + editor (overrides theme.json rem sizes) */
.editor-styles-wrapper :is(h1, h2, h3, h4, h5, h6).wp-block-heading,
.editor-styles-wrapper .is-root-container > :is(h1, h2, h3, h4, h5, h6).wp-block-heading,
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container > :is(h1, h2, h3, h4, h5, h6).wp-block-heading,
main > :is(h1, h2, h3, h4, h5, h6).wp-block-heading,
.is-root-container > :is(h1, h2, h3, h4, h5, h6).wp-block-heading {
    font-family: var(--cabb-font-heading) !important;
}

.editor-styles-wrapper h1.wp-block-heading,
.editor-styles-wrapper .is-root-container > h1.wp-block-heading,
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container > h1.wp-block-heading,
main > h1.wp-block-heading,
.is-root-container > h1.wp-block-heading,
h1.wp-block-heading {
    font-size: 40px !important;
    line-height: 1.2 !important;
    font-weight: 700 !important;
}

.editor-styles-wrapper h2.wp-block-heading,
.editor-styles-wrapper .is-root-container > h2.wp-block-heading,
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container > h2.wp-block-heading,
main > h2.wp-block-heading,
.is-root-container > h2.wp-block-heading,
h2.wp-block-heading {
    font-size: 32px !important;
    line-height: 1.25 !important;
    font-weight: 600 !important;
}

.editor-styles-wrapper h3.wp-block-heading,
.editor-styles-wrapper .is-root-container > h3.wp-block-heading,
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container > h3.wp-block-heading,
main > h3.wp-block-heading,
.is-root-container > h3.wp-block-heading,
h3.wp-block-heading {
    font-size: 26px !important;
    line-height: 1.23 !important;
    font-weight: 600 !important;
}

.editor-styles-wrapper h4.wp-block-heading,
.editor-styles-wrapper .is-root-container > h4.wp-block-heading,
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container > h4.wp-block-heading,
main > h4.wp-block-heading,
.is-root-container > h4.wp-block-heading,
h4.wp-block-heading {
    font-size: 24px !important;
    line-height: 1.33 !important;
    font-weight: 600 !important;
}

.editor-styles-wrapper h5.wp-block-heading,
.editor-styles-wrapper .is-root-container > h5.wp-block-heading,
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container > h5.wp-block-heading,
main > h5.wp-block-heading,
.is-root-container > h5.wp-block-heading,
h5.wp-block-heading {
    font-size: 20px !important;
    line-height: 1.4 !important;
    font-weight: 600 !important;
}

.editor-styles-wrapper h6.wp-block-heading,
.editor-styles-wrapper .is-root-container > h6.wp-block-heading,
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container > h6.wp-block-heading,
main > h6.wp-block-heading,
.is-root-container > h6.wp-block-heading,
h6.wp-block-heading {
    font-size: 18px !important;
    line-height: 1.44 !important;
    font-weight: 600 !important;
}

main > *:not(.cabb-block):last-child {
    padding-bottom: 64px;
}

main > p:not(.alignwide):not(.alignfull),
main > h1.wp-block-heading:not(.alignwide):not(.alignfull),
main > h2.wp-block-heading:not(.alignwide):not(.alignfull),
main > h3.wp-block-heading:not(.alignwide):not(.alignfull),
main > h4.wp-block-heading:not(.alignwide):not(.alignfull),
main > h5.wp-block-heading:not(.alignwide):not(.alignfull),
main > h6.wp-block-heading:not(.alignwide):not(.alignfull),
main > .wp-block-paragraph:not(.alignwide):not(.alignfull),
main > ul.wp-block-list:not(.alignwide):not(.alignfull),
main > ol.wp-block-list:not(.alignwide):not(.alignfull),
main > .wp-block-heading:not(.alignwide):not(.alignfull) {
    max-width: var(--wp--custom--cabb-text-content-size, 670px);
    padding: 0 0;
    box-sizing: border-box;
    margin-inline: auto;
}

@media (max-width: 800px) {
    body.single main > p:not(.alignwide):not(.alignfull),
    body.single main > h1.wp-block-heading:not(.alignwide):not(.alignfull),
    body.single main > h2.wp-block-heading:not(.alignwide):not(.alignfull),
    body.single main > h3.wp-block-heading:not(.alignwide):not(.alignfull),
    body.single main > h4.wp-block-heading:not(.alignwide):not(.alignfull),
    body.single main > h5.wp-block-heading:not(.alignwide):not(.alignfull),
    body.single main > h6.wp-block-heading:not(.alignwide):not(.alignfull),
    body.single main > .wp-block-paragraph:not(.alignwide):not(.alignfull),
    body.single main > ul.wp-block-list:not(.alignwide):not(.alignfull),
    body.single main > ol.wp-block-list:not(.alignwide):not(.alignfull),
    body.single main > .wp-block-heading:not(.alignwide):not(.alignfull),
    .editor-styles-wrapper .is-root-container > p:not(.alignwide):not(.alignfull),
    .editor-styles-wrapper .is-root-container > ul.wp-block-list:not(.alignwide):not(.alignfull),
    .editor-styles-wrapper .is-root-container > ol.wp-block-list:not(.alignwide):not(.alignfull),
    .editor-styles-wrapper .is-root-container > :is(h1, h2, h3, h4, h5, h6).wp-block-heading:not(.alignwide):not(.alignfull) {
        padding-inline: var(--content-padding-x, 20px) !important;
    }
}

.is-root-container > .wp-block-heading:not(.alignwide):not(.alignfull),
.is-root-container > p:not(.alignwide):not(.alignfull),
.is-root-container > ul.wp-block-list:not(.alignwide):not(.alignfull),
.is-root-container > ol.wp-block-list:not(.alignwide):not(.alignfull),
main > .wp-block-heading:not(.alignwide):not(.alignfull),
main > p:not(.alignwide):not(.alignfull),
main > ul.wp-block-list:not(.alignwide):not(.alignfull),
main > ol.wp-block-list:not(.alignwide):not(.alignfull) {
    max-width: var(--wp--custom--cabb-text-content-size, 670px) !important;
    margin-inline: auto !important;
}

/* Keep list markers inside the content column (outside markers spill left on mobile) */
.is-root-container > ul.wp-block-list:not(.alignwide):not(.alignfull),
.is-root-container > ol.wp-block-list:not(.alignwide):not(.alignfull),
main > ul.wp-block-list:not(.alignwide):not(.alignfull),
main > ol.wp-block-list:not(.alignwide):not(.alignfull) {
    list-style-position: inside;
    padding-inline-start: 0 !important;
    padding-left: 0 !important;
}

/* Editor: Gutenberg RichText is block-level inside li — keep bullet + text on one line */
.editor-styles-wrapper :is(ul, ol).wp-block-list > :is(li, .wp-block-list-item) > :is(.rich-text, .block-editor-rich-text__editable, [contenteditable="true"]) {
    display: inline;
}

.editor-styles-wrapper :is(ul, ol).wp-block-list :is(li, .wp-block-list-item) {
    padding-bottom: 4px;
}

.is-layout-flex figure.wp-block-image:not(.alignwide):not(.alignfull), .is-layout-flow figure.wp-block-image:not(.alignwide):not(.alignfull), 
.is-layout-flex .wp-block-quote:not(.alignwide):not(.alignfull), .is-layout-flow .wp-block-quote:not(.alignwide):not(.alignfull)
{
    max-width: 100% !important;
    width: 100% !important;
}

main > figure.wp-block-image:not(.alignwide):not(.alignfull),
.is-root-container > figure.wp-block-image:not(.alignwide):not(.alignfull),
main > .wp-block-quote:not(.alignwide):not(.alignfull),
.is-root-container > .wp-block-quote:not(.alignwide):not(.alignfull) {
    max-width: 100% !important;
    width: var(--wp--custom--cabb-text-content-size, 670px) !important;
}

/* Singular templates: wide-width images 900px max, fill viewport when narrower (like alignfull) */
body.single-post main > figure.wp-block-image.alignwide:not(.alignfull):not(.alignleft):not(.alignright),
body.single main > figure.wp-block-image.alignwide:not(.alignfull):not(.alignleft):not(.alignright) {
    max-width: 900px !important;
    width: 100% !important;
    margin-inline: auto !important;
}

.is-content-restricted figure.wp-block-image,
.is-content-restricted .wp-block-quote,
.is-content-restricted h1.wp-block-heading, .is-content-restricted h2.wp-block-heading, .is-content-restricted h3.wp-block-heading, .is-content-restricted h4.wp-block-heading, .is-content-restricted h5.wp-block-heading, .is-content-restricted h6.wp-block-heading {
    max-width: 100% !important;
    width: 100% !important;
}

figure.wp-block-image.alignwide {
    max-width: var(--wp--custom--cabb-block-content-wide-size, var(--wp--style--global--wide-size)) !important;
    width: 100% !important;
    margin-inline: auto !important;
}

/* Editor: singular article wide images use 900px via --cabb-editor-alignwide-max (set in block_editor_settings_all) */
.editor-styles-wrapper figure.wp-block-image.alignwide:not(.alignfull):not(.alignleft):not(.alignright) {
    max-width: var(--cabb-editor-alignwide-max, var(--wp--custom--cabb-block-content-wide-size, var(--wp--style--global--wide-size))) !important;
}

.wp-block-quote.alignwide,
h1.wp-block-heading.alignwide, h2.wp-block-heading.alignwide, h3.wp-block-heading.alignwide, h4.wp-block-heading.alignwide, h5.wp-block-heading.alignwide, h6.wp-block-heading.alignwide {
    max-width: 100% !important;
    width: var(--wp--custom--cabb-block-content-wide-size, var(--wp--style--global--wide-size)) !important;
    margin-inline: auto !important;
}

figure.wp-block-image.alignfull,
.wp-block-quote.alignfull,
h1.wp-block-heading.alignfull, h2.wp-block-heading.alignfull, h3.wp-block-heading.alignfull, h4.wp-block-heading.alignfull, h5.wp-block-heading.alignfull, h6.wp-block-heading.alignfull {
    max-width: 100% !important;
    width: 100% !important;
}

h1:where(.wp-block-heading).has-background, h2:where(.wp-block-heading).has-background, h3:where(.wp-block-heading).has-background, h4:where(.wp-block-heading).has-background, h5:where(.wp-block-heading).has-background, h6:where(.wp-block-heading).has-background {
    padding: 1.75rem 1.25rem;
}

p.has-background {
    padding: 1rem 1.25rem;
}

.is-style-narrow-text {
    width: auto !important;
    display: inline-block !important;
}

main > figure.wp-block-image.is-resized {
    width: unset;
    max-width: unset !important;
}

figure.wp-block-image.alignleft {
    margin-left: 0;
}

figure.wp-block-image.alignright {
    margin-right: 0;
}

main > :is(h1, h2, h3, h4, h5, h6).wp-block-heading {
    font-family: var(--cabb-font-heading);
    margin-bottom: 1em;
}

main > figure.wp-block-image {
    font-family: var(--cabb-font-heading);
    margin-bottom: 1.5em;
}

main > p {
    font-size: 18px;
    margin-bottom: 1.5em;
}

main > p > em {
    font-size: 24px;
}

body.single-course main > figure.wp-block-image:first-child,
body.single-course main > .wp-block-image:first-child {
    max-width: var(--wp--style--global--content-size, var(--wp--custom--cabb-block-content-size, 760px)) !important;
    width: var(--wp--style--global--content-size, var(--wp--custom--cabb-block-content-size, 760px)) !important;
    margin-inline: auto !important;
    padding-top: 50px;
    box-sizing: border-box;
}

main > figure.wp-block-image img {
    max-width: 100% !important;
}

/* Image captions: 670px column, heading font, 14px, same color as paragraphs */
main > figure.wp-block-image > figcaption,
main > figure.wp-block-image > .wp-element-caption,
.is-root-container > figure.wp-block-image > figcaption,
.is-root-container > figure.wp-block-image > .wp-element-caption,
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container > figure.wp-block-image > figcaption,
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container > figure.wp-block-image > .wp-element-caption,
.editor-styles-wrapper .is-root-container > figure.wp-block-image > figcaption,
.editor-styles-wrapper .is-root-container > figure.wp-block-image > .wp-element-caption,
.editor-styles-wrapper figure.wp-block-image > figcaption,
.editor-styles-wrapper figure.wp-block-image > .wp-element-caption {
    max-width: var(--wp--custom--cabb-text-content-size, 670px) !important;
    width: 100% !important;
    margin-inline: auto !important;
    box-sizing: border-box;
    font-family: var(--cabb-font-heading) !important;
    font-size: 14px !important;
    line-height: 1.58;
    font-weight: 400;
    font-style: normal !important;
    text-align: left !important;
    color: inherit !important;
    margin-top: 0.5em !important;
    margin-bottom: 0 !important;
}

.editor-styles-wrapper figure.wp-block-image > figcaption,
.editor-styles-wrapper figure.wp-block-image > .wp-element-caption,
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container > figure.wp-block-image > figcaption,
.editor-styles-wrapper .block-editor-block-list__layout.is-root-container > figure.wp-block-image > .wp-element-caption,
.editor-styles-wrapper .is-root-container > figure.wp-block-image > figcaption,
.editor-styles-wrapper .is-root-container > figure.wp-block-image > .wp-element-caption {
    color: var(--cabb-editor-text-color, inherit) !important;
}

h1.wp-block-heading {
    text-transform: uppercase;
    margin: 0;
    padding: 0;
}

h1.wp-block-heading:not([class*="has-text-align-"]) {
    text-align: center;
}

h1.wp-block-heading.has-text-align-left {
    text-align: left;
}

h1.wp-block-heading.has-text-align-center {
    text-align: center;
}

h1.wp-block-heading.has-text-align-right {
    text-align: right;
}

h1.wp-block-heading.has-text-align-justify {
    text-align: justify;
}

.wp-block-quote {
    max-width: 680px !important;
    width: calc(100% - 80px);
    padding: 30px 40px !important;
    margin-bottom: 1.5em;
    border: none !important;
    font-weight: 500;
    color: #222;
}

.wp-block-quote p {
    font-size: 20px;
    line-height: 1.4;
    font-style: italic;
}

.wp-block-quote cite {
    font-size: 18px;
    line-height: 1.44;
}
