/* Defaults have zero specificity so WordPress per-block color classes win. */
:where(.bdb-section,.bdb-heading,.bdb-button) {
    color: var(--bdb-text, #382d32);
    font-family: var(--bdb-font, inherit);
    box-sizing: border-box;
}
.bdb-section {
    padding: clamp(24px, 5vw, 64px) clamp(16px, 4vw, 40px);
}
.bdb-section.is-style-soft:not(.has-background) { background: var(--bdb-surface); }
.bdb-section.is-style-frame { border: 1px solid var(--bdb-primary); }
.bdb-section > .bdb-section__inner { width: 100%; max-width: 1120px; margin-inline: auto; }
.bdb-heading { line-height: 1.5; font-weight: 600; font-size: 28px; }
.bdb-heading.bdb-heading.is-style-line { padding-bottom: .5em; border-bottom: 1px solid var(--bdb-primary); }
.bdb-heading.bdb-heading.is-style-center { text-align: center; padding-bottom: .7em; }
.bdb-heading.bdb-heading.is-style-center::after {
    content: ''; display: block; position: static; width: 2em; height: 2px;
    margin: .6em auto 0; background: var(--bdb-primary); border: 0;
}
:where(.bdb-button) { color: #fff; background-color: var(--bdb-primary); }
.bdb-button { display: inline-block; border-radius: 4px; padding: 0; max-width: 100%; }
.bdb-button > .bdb-button__link {
    display: inline-block; padding: .85em 1.8em; color: inherit; background: transparent;
    border: 1px solid transparent; border-radius: inherit; text-decoration: none;
    font: inherit; line-height: 1.5; overflow-wrap: anywhere; box-sizing: border-box;
}
.bdb-button.is-style-outline:not(.has-background) { background: transparent; }
.bdb-button.is-style-outline:not(.has-text-color) { color: var(--bdb-primary); }
.bdb-button.is-style-outline > .bdb-button__link { border-color: currentColor; }
.bdb-button > a.bdb-button__link:hover { color: inherit; }
.bdb-button > a.bdb-button__link:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.bdb-heading.bdb-heading:not(.has-text-color),.bdb-section:not(.has-text-color) { color: var(--bdb-text); }
.bdb-heading.bdb-heading:not([style*="font-family"]),.bdb-section:not([style*="font-family"]),.bdb-button:not([style*="font-family"]) { font-family: var(--bdb-font, inherit); }

/* Fullwide section: all selectors stay within Ballet Design blocks. */
.bdb-section.bdb-section--fullwide {
    position: relative;
    isolation: isolate;
    padding-block: var(--bdb-padding-desktop, 60px);
    padding-inline: clamp(16px, 4vw, 40px);
}
.bdb-section--fullwide:not(.has-background) { background-color: var(--bdb-surface, #faf3f5); }
.bdb-section--fullwide > .bdb-section__inner { position: relative; z-index: 1; }
.bdb-section--fullwide > .bdb-section__inner[data-bdb-width="article"] { max-width: var(--wp--style--global--content-size, 800px); }
.bdb-section--fullwide > .bdb-section__inner[data-bdb-width="wide"] { max-width: var(--wp--style--global--wide-size, 1120px); }
.bdb-section--fullwide > .bdb-section__inner[data-bdb-width="full"] { max-width: none; }
.bdb-section--fullwide > .bdb-section__inner > :first-child:not(.bdb-heading) { margin-block-start: 0; }
.bdb-section--fullwide > .bdb-section__inner > :last-child:not(.bdb-heading) { margin-block-end: 0; }
.bdb-section__background { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; border-radius: inherit; }
.bdb-section__image,.bdb-section__overlay { position: absolute; inset: 0; }
.bdb-section__image { background-repeat: no-repeat; background-size: cover; }
.bdb-section__overlay:not(.has-background) { background-color: var(--bdb-overlay-color, transparent); }
.bdb-section--fullwide[data-bdb-effect="parallax"] > .bdb-section__background > .bdb-section__image {
    inset-block: -80px;
    transform: translate3d(0, var(--bdb-parallax-offset, 0px), 0);
}
.bdb-section__divider {
    position: absolute; left: 0; width: 100%; max-width: none; z-index: 2;
    display: block; pointer-events: none; fill: var(--bdb-divider-color, #fff);
}
.bdb-section__divider--top { top: -1px; }
.bdb-section__divider--bottom { bottom: -1px; transform: rotate(180deg); }
.bdb-section__divider--top.bdb-section__divider--reverse { transform: scaleX(-1); }
.bdb-section__divider--bottom.bdb-section__divider--reverse { transform: rotate(180deg) scaleX(-1); }
@media (min-width: 783px) and (prefers-reduced-motion: no-preference) {
    .bdb-section--fullwide[data-bdb-effect="fixed"] > .bdb-section__background > .bdb-section__image { background-attachment: fixed; }
}
@media (max-width: 782px) {
    .bdb-section.bdb-section--fullwide { padding-block: var(--bdb-padding-mobile, 40px); }
}
@media (prefers-reduced-motion: reduce) {
    .bdb-section--fullwide[data-bdb-effect="parallax"] > .bdb-section__background > .bdb-section__image { transform: none; inset: 0; }
}
/* The editor previews a static background so selection and typing stay stable. */
.editor-styles-wrapper .bdb-section__image { background-attachment: scroll !important; transform: none !important; }

/* Existing saved SVGs remain in the HTML for block validation compatibility.
   Boundary shapes now clip the section, revealing the actual backdrop. */
.bdb-section--fullwide > svg.bdb-section__divider { display: none; }

/* Paired headings: layout and decoration can be selected independently. */
.bdb-heading.bdb-heading--paired {
    display: flex;
    flex-direction: column;
    gap: .65rem;
    position: relative;
    box-sizing: border-box;
    min-width: 0;
    margin-block: 2rem;
    line-height: 1.5;
    font-size: 1rem;
}
.bdb-heading.bdb-heading--paired[data-bdb-heading-space="narrow"] { margin-block: 1rem; }
.bdb-heading.bdb-heading--paired[data-bdb-heading-space="tight"] { margin-block: .5rem; }
.bdb-heading.bdb-heading--paired[data-bdb-heading-space="wide"] { margin-block: 3rem; }
.bdb-heading.bdb-heading--paired[data-bdb-heading-space="none"] { margin-block: 0; }
.bdb-heading--paired > .bdb-heading__main {
    margin: 0;
    min-width: 0;
    font-family: inherit;
    font-size: var(--bdb-main-size, 28px);
    font-weight: 600;
    line-height: 1.35;
    color: inherit;
    overflow-wrap: anywhere;
}
.bdb-heading--paired > .bdb-heading__sub {
    margin: 0;
    min-width: 0;
    font-family: inherit;
    font-size: var(--bdb-sub-size, 1.25rem);
    font-weight: 400;
    line-height: 1.8;
    color: inherit;
    overflow-wrap: anywhere;
}
.bdb-heading.bdb-heading--inline,.bdb-heading.bdb-heading--inline-reverse {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 1.25rem;
    justify-content: var(--bdb-heading-justify, flex-start);
}
.bdb-heading.bdb-heading--paired.is-style-line { padding-block-end: 1rem; border-bottom: 1px solid var(--bdb-primary); }
.bdb-heading.bdb-heading--paired.is-style-center {
    text-align: center;
    --bdb-heading-justify: center;
    padding-block-end: 1.6rem;
}
.bdb-heading.bdb-heading--paired.is-style-center::after {
    content: ''; position: absolute; bottom: 0; left: calc(50% - 1.75rem);
    width: 3.5rem; height: 2px; margin: 0; background: var(--bdb-primary);
}
.bdb-heading.bdb-heading--paired.is-style-double-line { padding-block: 1.25rem; border-block: 3px double var(--bdb-primary); }
.bdb-heading.bdb-heading--paired.is-style-side-line { padding-inline-start: 1.25rem; border-inline-start: 3px solid var(--bdb-primary); }
.bdb-heading.bdb-heading--paired.is-style-frame { padding: clamp(1.25rem, 3vw, 2rem); border: 1px solid var(--bdb-primary); }
.bdb-heading.bdb-heading--paired.is-style-soft-card { padding: clamp(1.25rem, 3vw, 2rem); border-radius: 8px; }
.bdb-heading.bdb-heading--paired.is-style-soft-card:not(.has-background) { background: var(--bdb-surface); }
.bdb-heading.bdb-heading--paired.is-style-ribbon { padding: 1.25rem 1.5rem; border-inline-start: 6px solid var(--bdb-primary); }
.bdb-heading.bdb-heading--paired.is-style-ribbon:not(.has-background) { background: var(--bdb-surface); }
.bdb-heading.bdb-heading--paired.is-style-ornament { text-align: center; --bdb-heading-justify: center; padding-block-end: 2rem; }
.bdb-heading.bdb-heading--paired.is-style-ornament::after {
    content: ''; position: absolute; bottom: .25rem; left: calc(50% - 5px);
    width: 10px; height: 10px; border: 1px solid var(--bdb-primary); transform: rotate(45deg);
}
.bdb-heading--paired.is-style-editorial > .bdb-heading__main { font-weight: 400; }
.bdb-heading--paired.is-style-editorial > .bdb-heading__sub { padding-inline-start: .9rem; border-inline-start: 1px solid var(--bdb-primary); }
.bdb-heading--paired.is-style-pill > .bdb-heading__sub { align-self: flex-start; padding: .25em 1em; border: 1px solid var(--bdb-primary); border-radius: 999px; }
@media (max-width: 600px) {
    .bdb-heading.bdb-heading--inline,.bdb-heading.bdb-heading--inline-reverse { flex-direction: column; align-items: stretch; }
}

/* Button designs share the same saved link markup and honor per-block colors. */
.bdb-button { position: relative; vertical-align: middle; }
.bdb-button > .bdb-button__link { position: relative; max-width: 100%; text-align: center; }
.bdb-button[data-bdb-size="small"] > .bdb-button__link { padding: .65em 1.4em; font-size: .875rem; }
.bdb-button[data-bdb-size="large"] > .bdb-button__link { padding: 1em 2em; font-size: 1.125rem; }
.bdb-button[data-bdb-width="full"] { display: block; width: 100%; }
.bdb-button[data-bdb-width="full"] > .bdb-button__link { display: block; width: 100%; }
.bdb-button.aligncenter { display: table; margin-inline: auto; }
.bdb-button:is(.is-style-fill,.is-style-outline),.bdb-button:not([class*="is-style-"]){border-radius:var(--bdb-button-radius,4px)}
.bdb-button.is-style-pill { border-radius: 999px; }
.bdb-button.is-style-soft:not(.has-background) { background: var(--bdb-surface); }
.bdb-button.is-style-soft:not(.has-text-color),
.bdb-button.is-style-double-line:not(.has-text-color),
.bdb-button.is-style-underline:not(.has-text-color),
.bdb-button.is-style-frame:not(.has-text-color),
.bdb-button.is-style-corner:not(.has-text-color),
.bdb-button.is-style-glass:not(.has-text-color) { color: var(--bdb-primary); }
.bdb-button.is-style-gradient:not(.has-background) { background: linear-gradient(125deg, var(--bdb-primary), #623d50); }
.bdb-button.is-style-shadow { box-shadow: 0 4px 0 color-mix(in srgb, var(--bdb-primary), #000 25%), 0 8px 18px #00000012; }
.bdb-button.is-style-double-line { border: 3px double currentColor; }
.bdb-button.is-style-double-line:not(.has-background),
.bdb-button.is-style-underline:not(.has-background),
.bdb-button.is-style-frame:not(.has-background),
.bdb-button.is-style-corner:not(.has-background) { background: transparent; }
.bdb-button.is-style-underline { border-radius: 0; }
.bdb-button.is-style-underline > .bdb-button__link { padding-inline: .25em; border-bottom: 1px solid currentColor; border-radius: 0; }
.bdb-button.is-style-frame { border: 1px solid currentColor; border-radius: 0; }
.bdb-button.is-style-frame::after {
    content: ''; position: absolute; inset: 5px -5px -5px 5px; border: 1px solid currentColor;
    opacity: .4; pointer-events: none;
}
.bdb-button.is-style-corner { border-radius: 0; }
.bdb-button.is-style-corner::before,.bdb-button.is-style-corner::after {
    content: ''; position: absolute; width: 14px; height: 14px; pointer-events: none; border-color: currentColor;
}
.bdb-button.is-style-corner::before { top: 0; left: 0; border-top: 1px solid; border-left: 1px solid; }
.bdb-button.is-style-corner::after { bottom: 0; right: 0; border-bottom: 1px solid; border-right: 1px solid; }
.bdb-button.is-style-glass { border: 1px solid color-mix(in srgb, var(--bdb-primary), transparent 55%); backdrop-filter: blur(10px); }
.bdb-button.is-style-glass:not(.has-background) { background: color-mix(in srgb, var(--bdb-surface), transparent 20%); }
.bdb-button:is(.is-style-arrow,[data-bdb-icon],[data-bdb-hover="arrow"]) > .bdb-button__link::after {
    content: ''; display: inline-block; width: 1em; height: 1em; margin-inline-start: 1em;
    vertical-align: -.12em; background: currentColor;
    clip-path: polygon(0 44%, 75% 44%, 49% 17%, 58% 8%, 100% 50%, 58% 92%, 49% 83%, 75% 56%, 0 56%);
}
.bdb-button[data-bdb-icon="chevron"] > .bdb-button__link::after { clip-path: polygon(30% 5%, 75% 50%, 30% 95%, 20% 85%, 55% 50%, 20% 15%); }
.bdb-button[data-bdb-icon="external"] > .bdb-button__link::after { clip-path: polygon(55% 0,100% 0,100% 45%,85% 45%,85% 25%,45% 65%,35% 55%,75% 15%,55% 15%,55% 0,25% 25%,25% 85%,85% 85%,85% 60%,100% 60%,100% 100%,10% 100%,10% 25%); }
.bdb-button > a.bdb-button__link:focus-visible { outline: 2px solid var(--bdb-primary); outline-offset: 5px; }

/* Phosphor spans keep the label's stored HTML separate from decorative icons. */
.bdb-button > .bdb-button__link { display: inline-flex; align-items: center; justify-content: center; gap: var(--bdb-button-icon-gap, 12px); }
.bdb-button[data-bdb-width="full"] > .bdb-button__link { display: flex; }
.bdb-button > .bdb-button__link > .bdb-button__text { min-width: 0; overflow-wrap: anywhere; }
.bdb-button > .bdb-button__link > .bdb-button__icon { font-size: var(--bdb-button-icon-size, 1.1em); }
/* Explicit Phosphor choices replace the old generated trailing arrow. */
.bdb-button[data-bdb-phosphor] > .bdb-button__link::after { content: none; display: none; }
.bdb-button[data-bdb-hover="arrow"] > .bdb-button__link > .bdb-button__icon--after { transition: transform var(--bdb-motion-duration, 650ms); }
.bdb-button[data-bdb-hover="arrow"]:is(:hover,:focus-within) > .bdb-button__link > .bdb-button__icon--after { transform: translateX(5px); }
@media (prefers-reduced-motion: reduce) {
    .bdb-button[data-bdb-hover="arrow"] > .bdb-button__link > .bdb-button__icon--after { transition: none !important; transform: none !important; }
}

/* A custom background must not add theme-provided box padding around a button. */
.bdb-button.bdb-button { padding: 0; }
.bdb-heading.bdb-heading--paired.has-background { padding: clamp(1.25rem, 3vw, 2rem); }

/* Keep soft masks within empty edge space, independent of theme markup. */
.bdb-section--fullwide { --bdb-current-section-padding: var(--bdb-padding-desktop, 60px); }
.bdb-section.bdb-section--fullwide[style*="--bdb-soft-top-height"] { padding-block-start: max(var(--bdb-current-section-padding), var(--bdb-soft-top-height)); }
.bdb-section.bdb-section--fullwide[style*="--bdb-soft-bottom-height"] { padding-block-end: max(var(--bdb-current-section-padding), var(--bdb-soft-bottom-height)); }
@media (max-width: 782px) {
    .bdb-section--fullwide { --bdb-current-section-padding: var(--bdb-padding-mobile, 40px); }
}

/* A transparent gradient stop reveals the underlying page, not the default surface. */
.bdb-section.bdb-section--gradient,
.bdb-section.bdb-section--gradient > .bdb-section__background > .bdb-section__overlay{background-color:transparent!important}

/* Remove the default block gap only where two Ballet sections meet. Explicit margins still win. */
.bdb-section.bdb-section:has(+ .bdb-section){margin-block-end:0}
.bdb-section.bdb-section + .bdb-section.bdb-section{margin-block-start:0}
/* Gutenberg may wrap aligned blocks in separate .wp-block containers. */
.editor-styles-wrapper .wp-block:has(> .bdb-section):has(+ .wp-block > .bdb-section){margin-block-end:0}
.editor-styles-wrapper .wp-block:has(> .bdb-section) + .wp-block:has(> .bdb-section){margin-block-start:0}

/* Heading ornaments use the same scoped styling in the editor and on the site.
   Retired styles above remain solely for previously saved pages. */
.bdb-heading.bdb-heading--paired.is-style-vertical-line {
    text-align: center; --bdb-heading-justify: center; padding-block-end: 3rem;
}
.bdb-heading.bdb-heading--paired.is-style-vertical-line::before {
    content: ''; position: absolute; inset-block-end: 0; left: calc(50% - .5px);
    width: 1px; height: 2rem; background: var(--bdb-primary);
}
.bdb-heading.bdb-heading--paired:is(.is-style-icon-leading,.is-style-icon-top)::before {
    content: var(--bdb-heading-icon, none); position: absolute;
    display: flex; align-items: center; justify-content: center;
    width: var(--bdb-heading-icon-size,32px); height: var(--bdb-heading-icon-size,32px);
    font-family: var(--bdb-heading-icon-family,"BDB Phosphor")!important;
    font-size: var(--bdb-heading-icon-size,32px); font-weight: normal; font-style: normal;
    line-height: 1; color: var(--bdb-heading-icon-color,var(--bdb-primary));
    speak: never; -webkit-font-smoothing: antialiased; pointer-events: none;
}
.bdb-heading.bdb-heading--paired.is-style-icon-leading { padding-inline-start: calc(var(--bdb-heading-icon-size,32px) + 1rem); }
.bdb-heading.bdb-heading--paired.is-style-icon-leading::before { inset-inline-start: 0; top: 0; }
.bdb-heading.bdb-heading--paired.is-style-icon-top {
    text-align: center; --bdb-heading-justify: center;
    padding-block-start: calc(var(--bdb-heading-icon-size,32px) + 1rem);
}
.bdb-heading.bdb-heading--paired.is-style-icon-top::before {
    top: 0; left: calc(50% - var(--bdb-heading-icon-size,32px)/2);
}

/* Decorative subtitle behind the main title; saved text markup stays unchanged. */
.bdb-heading.bdb-heading--paired:is(.is-style-backdrop-center,.is-style-backdrop-high,.is-style-backdrop-right,.is-style-backdrop-left) {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    justify-items: var(--bdb-heading-backdrop-justify, center);
    isolation: isolate;
    min-height: clamp(110px, 12vw, 160px);
    padding-block: 1rem;
    padding-inline: clamp(16px, 3vw, 32px);
    text-align: center;
}
.bdb-heading.bdb-heading--paired:is(.is-style-backdrop-center,.is-style-backdrop-high,.is-style-backdrop-right,.is-style-backdrop-left) > :is(.bdb-heading__main,.bdb-heading__sub) {
    grid-column: 1;
    grid-row: 1;
    width: fit-content;
    max-width: 100%;
    text-align: inherit;
}
.bdb-heading.bdb-heading--paired:is(.is-style-backdrop-center,.is-style-backdrop-high,.is-style-backdrop-right,.is-style-backdrop-left) > .bdb-heading__main {
    position: relative;
    z-index: 1;
}
.bdb-heading.bdb-heading--paired:is(.is-style-backdrop-center,.is-style-backdrop-high,.is-style-backdrop-right,.is-style-backdrop-left) > .bdb-heading__sub {
    position: relative;
    z-index: 0;
    font-size: var(--bdb-sub-size, clamp(60px, 6.7vw, 96px));
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 400;
    line-height: 1.15;
    color: var(--bdb-primary, #d9a6b7);
    opacity: .22;
}
.bdb-heading.bdb-heading--paired.is-style-backdrop-high > .bdb-heading__sub { transform: translateY(-.35em); }
.bdb-heading.bdb-heading--paired.is-style-backdrop-right > .bdb-heading__sub {
    transform: translate(clamp(10px, 2vw, 24px), .12em);
}
.bdb-heading.bdb-heading--paired.is-style-backdrop-left > .bdb-heading__sub {
    transform: translate(calc(-1 * clamp(10px, 2vw, 24px)), .12em);
}
@media (max-width: 600px) {
    .bdb-heading.bdb-heading--paired:is(.is-style-backdrop-center,.is-style-backdrop-high,.is-style-backdrop-right,.is-style-backdrop-left) {
        min-height: 94px;
        padding-block: .75rem;
    }
    .bdb-heading.bdb-heading--paired:is(.is-style-backdrop-center,.is-style-backdrop-high,.is-style-backdrop-right,.is-style-backdrop-left) > .bdb-heading__sub {
        font-size: var(--bdb-sub-size, clamp(52px, 13vw, 76px));
    }
}
