/*
 * Shared LaunchPress Starter Framework.
 * Business starter plugins supply semantic classes and default content;
 * this bridge makes those patterns obey LaunchPress Site Design consistently.
 */

/* Page Layout: starter sections opt in with lp-starter-layout-section. */
body.launchpress-starter-page .lp-page-content--contained > .lp-starter-layout-section {
	box-sizing: border-box;
	width: min(100%, var(--lp-content-width, 760px)) !important;
	max-width: var(--lp-content-width, 760px) !important;
	margin-left: auto !important;
	margin-right: auto !important;
}

body.launchpress-starter-page .lp-page-content--wide > .lp-starter-layout-section {
	box-sizing: border-box;
	width: min(100%, var(--lp-wide-width, 1200px)) !important;
	max-width: var(--lp-wide-width, 1200px) !important;
	margin-left: auto !important;
	margin-right: auto !important;
}

/*
 * Shared Page Layout fallback for front-page templates.
 * Some front-page templates render the Post Content wrapper differently from
 * interior pages. The framework mirrors the Theme's effective layout onto the
 * body, then constrains semantic starter sections directly. This supplements
 * (rather than replaces) the wrapper-based rules above and keeps Theme Default
 * completely untouched.
 */
body.launchpress-starter-page.lp-starter-layout-contained main .lp-starter-layout-section {
	box-sizing: border-box;
	width: min(100%, var(--lp-starter-content-width, 760px)) !important;
	max-width: var(--lp-starter-content-width, 760px) !important;
	margin-left: auto !important;
	margin-right: auto !important;
}

body.launchpress-starter-page.lp-starter-layout-wide main .lp-starter-layout-section {
	box-sizing: border-box;
	width: min(100%, var(--lp-starter-wide-width, 1200px)) !important;
	max-width: var(--lp-starter-wide-width, 1200px) !important;
	margin-left: auto !important;
	margin-right: auto !important;
}

body.launchpress-starter-page.lp-starter-layout-full main .lp-starter-layout-section {
	box-sizing: border-box;
	width: 100% !important;
	max-width: none !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}

/* Custom Typography: global Site Design wins over starter inline defaults. */
body.lp-typography-custom.launchpress-starter-page main :where(h1,h2,h3,h4,h5,h6,.wp-block-heading,.lp-icon-box-heading) {
	font-family: var(--lp-heading-font) !important;
	font-weight: var(--lp-starter-heading-weight) !important;
	color: var(--lp-starter-heading-color) !important;
}

body.lp-typography-custom.launchpress-starter-page main :where(p,li,blockquote,cite,.lp-icon-box-body) {
	font-family: var(--lp-body-font) !important;
	color: var(--lp-starter-body-color) !important;
}

/* Page Titles & Banners owns its title color. Keep starter Typography font/weight,
 * but do not let the shared !important heading color override that dedicated setting. */
body.lp-typography-custom.launchpress-starter-page main .lp-page-title--banner :where(h1,h2,h3,h4,h5,h6,.wp-block-heading,.wp-block-post-title) {
	color: var(--lp-title-color, #17112e) !important;
}

/* Deliberately high-contrast starter surfaces remain readable. */
body.lp-typography-custom.launchpress-starter-page main .lp-starter-contrast :where(h1,h2,h3,h4,h5,h6,.wp-block-heading) {
	color: var(--lp-starter-on-accent) !important;
}
body.lp-typography-custom.launchpress-starter-page main .lp-starter-contrast :where(p,li,blockquote,cite) {
	color: var(--lp-starter-muted-on-accent) !important;
}

/* Custom Buttons: Site Design must win even when a starter saved inline colors. */
body.lp-buttons-custom.launchpress-starter-page main :where(.wp-block-button__link,.wp-element-button) {
	background-color: var(--lp-starter-button-bg) !important;
	color: var(--lp-starter-button-text) !important;
	border-color: var(--lp-starter-button-bg) !important;
	border-radius: var(--lp-starter-button-radius) !important;
	padding: var(--lp-starter-button-py) var(--lp-starter-button-px) !important;
}
body.lp-buttons-custom.launchpress-starter-page main :where(.wp-block-button__link,.wp-element-button):is(:hover,:focus-visible) {
	background-color: var(--lp-starter-button-hover-bg) !important;
	color: var(--lp-starter-button-hover-text) !important;
	border-color: var(--lp-starter-button-hover-bg) !important;
}

/* Custom Colors: semantic starter classes map to one shared palette. */
body.lp-colors-custom.launchpress-starter-page main {
	--lp-starter-alt-surface-mixed: var(--lp-starter-alt-surface);
	--lp-starter-card-mixed: var(--lp-starter-card);
	--lp-starter-border-mixed: var(--lp-starter-border);
}
@supports (color: color-mix(in srgb, #000 50%, #fff)) {
	body.lp-colors-custom.launchpress-starter-page main {
		--lp-starter-alt-surface-mixed: color-mix(in srgb, var(--lp-starter-surface) 88%, var(--lp-starter-accent) 12%);
		--lp-starter-card-mixed: color-mix(in srgb, var(--lp-starter-surface) 96%, var(--lp-starter-accent) 4%);
		--lp-starter-border-mixed: color-mix(in srgb, var(--lp-starter-accent) 30%, transparent);
	}
}
body.lp-colors-custom.launchpress-starter-page main .lp-starter-surface {
	background: var(--lp-starter-surface) !important;
}
body.lp-colors-custom.launchpress-starter-page main .lp-starter-surface-alt {
	background: var(--lp-starter-alt-surface-mixed) !important;
}
body.lp-colors-custom.launchpress-starter-page main .lp-starter-surface-accent {
	background-color: var(--lp-starter-accent) !important;
	--lp-section-bg: var(--lp-starter-accent) !important;
	color: var(--lp-starter-on-accent) !important;
}
body.lp-colors-custom.launchpress-starter-page main .lp-starter-card {
	background: var(--lp-starter-card-mixed) !important;
	border-color: var(--lp-starter-border-mixed) !important;
}
body.lp-colors-custom.launchpress-starter-page main .lp-starter-accent-text {
	color: var(--lp-starter-accent) !important;
}
body.lp-colors-custom.launchpress-starter-page main .lp-starter-contrast :where(h1,h2,h3,h4,h5,h6,p,li,blockquote,cite,.wp-block-heading) {
	color: var(--lp-starter-on-accent) !important;
}
body.lp-colors-custom.launchpress-starter-page main .wp-block-launchpress-icon-box {
	--lp-icon-box-bg: var(--lp-starter-card-mixed) !important;
	--lp-icon-box-border: var(--lp-starter-border-mixed) !important;
	--lp-icon-box-icon-color: var(--lp-starter-accent) !important;
	--lp-icon-box-icon-bg: var(--lp-starter-alt-surface-mixed) !important;
}
body.lp-colors-custom.launchpress-starter-page main .lp-starter-surface-accent.wp-block-cover .wp-block-cover__background {
	background-color: var(--lp-starter-accent) !important;
}
body.lp-colors-custom.launchpress-starter-page main .lp-starter-media-frame img {
	border-color: var(--lp-starter-border-mixed) !important;
}
