/* Public rendering for I-002 image presentation attributes. */
.gce-image-size-thumbnail img { width: 50%; max-width: 100%; height: auto; }
.gce-image-size-medium img { width: 75%; max-width: 100%; height: auto; }
.gce-image-size-large img { width: 90%; max-width: 100%; height: auto; }
.gce-image-size-full img { width: 100%; max-width: 100%; height: auto; }
.gce-image-align-left { text-align: left; }
.gce-image-align-center { text-align: center; }
.gce-image-align-right { text-align: right; }
.gce-image-align-center img { margin-left: auto; margin-right: auto; }
.gce-image-align-right img { margin-left: auto; margin-right: 0; }
.gce-image-align-left img { margin-left: 0; margin-right: auto; }

/* Shared by the HP builder and public headings. Inactive headings keep theme styles. */
:is(.gce-heading, #gce-root .gce-canvas .gce-rich).gce-heading {
    box-sizing: border-box;
    max-width: 100%;
    overflow-wrap: anywhere;
    color: inherit;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: var(--gce-heading-pad, .55em) .7em;
}
:is(.gce-heading, #gce-root .gce-canvas .gce-rich).gce-heading::before,
:is(.gce-heading, #gce-root .gce-canvas .gce-rich).gce-heading::after { content: none; }
.gce-heading.gce-heading-weight--thin { --gce-heading-line: 1px; --gce-heading-left: 3px; }
.gce-heading.gce-heading-weight--thick { --gce-heading-line: 3px; --gce-heading-left: 7px; }
.gce-heading.gce-heading-space--narrow { --gce-heading-pad: .3em; }
.gce-heading.gce-heading-space--wide { --gce-heading-pad: .9em; }
:is(.gce-heading, #gce-root .gce-canvas .gce-rich).gce-heading--underline {
    padding-inline: 0;
    text-decoration-line: underline;
    text-decoration-color: var(--gce-heading-color, #894361);
    text-decoration-thickness: var(--gce-heading-line, 2px);
    text-underline-offset: .22em;
}
:is(.gce-heading, #gce-root .gce-canvas .gce-rich).gce-heading--left,
:is(.gce-heading, #gce-root .gce-canvas .gce-rich).gce-heading--left-bottom {
    border-left: var(--gce-heading-left, 5px) solid var(--gce-heading-color, #894361);
}
:is(.gce-heading, #gce-root .gce-canvas .gce-rich).gce-heading--left-bottom {
    border-bottom: var(--gce-heading-line, 2px) solid var(--gce-heading-color, #894361);
}
:is(.gce-heading, #gce-root .gce-canvas .gce-rich).gce-heading--frame {
    border: var(--gce-heading-line, 2px) solid var(--gce-heading-color, #894361);
}
:is(.gce-heading, #gce-root .gce-canvas .gce-rich).gce-heading--band { background-color: #f5eaf0; }

/* Only builder-decorated LP content gets editor-like spacing and typography. */
#ctwlpt-wrap .gce-lp-content { box-sizing: border-box; max-width: 880px; margin-inline: auto; padding-inline: 20px; }
#ctwlpt-wrap .gce-lp-content > h2.wp-block-heading { font-size: 26px; line-height: 1.4; }
#ctwlpt-wrap .gce-lp-content > h3.wp-block-heading { font-size: 22px; line-height: 1.4; }
#ctwlpt-wrap .gce-lp-content > h4.wp-block-heading { font-size: 19px; line-height: 1.4; }
#ctwlpt-wrap .gce-lp-content > p.wp-block-paragraph { margin: 0; font-size: 16px; line-height: 1.7; min-height: 1.7em; }
#ctwlpt-wrap .gce-lp-content > p.wp-block-paragraph br { display: inline; }
@media (max-width: 600px) { #ctwlpt-wrap .gce-lp-content { padding-inline: 8px; } }

/* Shared layout only for explicitly managed content and the editor canvas. */
.gce-managed-content, #ctwlpt-wrap .gce-lp-content.gce-managed-content {
    --gce-content-gutter: 32px;
    box-sizing: border-box;
    max-width: 880px;
    margin-inline: auto;
    padding-inline: var(--gce-content-gutter);
}
/* Explicit full-width blocks may use the gutter, within the theme container. */
.gce-managed-content > .alignfull {
    width: calc(100% + 2 * var(--gce-content-gutter));
    max-width: none;
    margin-inline: calc(-1 * var(--gce-content-gutter));
}
@media (max-width: 600px) {
    .gce-managed-content, #ctwlpt-wrap .gce-lp-content.gce-managed-content { --gce-content-gutter: 20px; }
}

/* Explicit heading boundaries only; suppress the neighbouring default margin. */
:is(h1,h2,h3,h4,h5,h6).gce-gap-top { margin-block-start: var(--gce-gap-top) !important; }
:is(h1,h2,h3,h4,h5,h6).gce-gap-bottom { margin-block-end: var(--gce-gap-bottom) !important; }
*:has(+ :is(h1,h2,h3,h4,h5,h6).gce-gap-top):not(.gce-gap-bottom) { margin-block-end: 0 !important; }
:is(h1,h2,h3,h4,h5,h6).gce-gap-bottom + :not(.gce-gap-top) { margin-block-start: 0 !important; }

/* Two explicit heading boundaries use the larger value, including flex layouts. */
:is(h1,h2,h3,h4,h5,h6).gce-gap-bottom:has(+ :is(h1,h2,h3,h4,h5,h6).gce-gap-top) { margin-block-end: 0 !important; }
:is(h1,h2,h3,h4,h5,h6).gce-gap-bottom-0 + :is(h1,h2,h3,h4,h5,h6).gce-gap-top { margin-block-start: max(0px, var(--gce-gap-top)) !important; }
:is(h1,h2,h3,h4,h5,h6).gce-gap-bottom-8 + :is(h1,h2,h3,h4,h5,h6).gce-gap-top { margin-block-start: max(8px, var(--gce-gap-top)) !important; }
:is(h1,h2,h3,h4,h5,h6).gce-gap-bottom-16 + :is(h1,h2,h3,h4,h5,h6).gce-gap-top { margin-block-start: max(16px, var(--gce-gap-top)) !important; }
:is(h1,h2,h3,h4,h5,h6).gce-gap-bottom-24 + :is(h1,h2,h3,h4,h5,h6).gce-gap-top { margin-block-start: max(24px, var(--gce-gap-top)) !important; }
:is(h1,h2,h3,h4,h5,h6).gce-gap-bottom-32 + :is(h1,h2,h3,h4,h5,h6).gce-gap-top { margin-block-start: max(32px, var(--gce-gap-top)) !important; }
:is(h1,h2,h3,h4,h5,h6).gce-gap-bottom-48 + :is(h1,h2,h3,h4,h5,h6).gce-gap-top { margin-block-start: max(48px, var(--gce-gap-top)) !important; }
:is(h1,h2,h3,h4,h5,h6).gce-gap-bottom-64 + :is(h1,h2,h3,h4,h5,h6).gce-gap-top { margin-block-start: max(64px, var(--gce-gap-top)) !important; }
