/**
 * SnapWeb shell polish for FluentCommunity and FluentCart.
 */

body.snapweb-has-fluentcommunity-wrapper {
	--snapweb-shell-radius: 8px;
	--snapweb-shell-border: var(--fcom-border-color, rgba(15, 23, 42, 0.14));
	--snapweb-shell-surface: var(--fcom-card-bg, var(--fcom-primary-bg, #ffffff));
	--snapweb-shell-surface-soft: var(--fcom-secondary-bg, #f5f6f7);
	--snapweb-shell-text: var(--fcom-primary-text, #0f172a);
	--snapweb-shell-muted: var(--fcom-secondary-text, #64748b);
	--snapweb-shell-button-bg: var(--fcom-button-bg, #243241);
	--snapweb-shell-button-text: var(--fcom-button-color, #ffffff);
	--snapweb-shell-button-hover: var(--fcom-button-hover-bg, #1b2734);
	min-height: 100vh;
}

html.dark body.snapweb-has-fluentcommunity-wrapper,
body.snapweb-has-fluentcommunity-wrapper.dark,
body.snapweb-has-fluentcommunity-wrapper[data-color-mode="dark"] {
	--snapweb-shell-border: var(--fcom-border-color, rgba(226, 232, 240, 0.16));
	--snapweb-shell-surface: var(--fcom-card-bg, var(--fcom-primary-bg, #1f242b));
	--snapweb-shell-surface-soft: var(--fcom-secondary-bg, #171b21);
	--snapweb-shell-text: var(--fcom-primary-text, #f8fafc);
	--snapweb-shell-muted: var(--fcom-secondary-text, #cbd5e1);
	--snapweb-shell-button-bg: var(--fcom-accent-color, #ff5a2e);
	--snapweb-shell-button-text: #ffffff;
	--snapweb-shell-button-hover: var(--fcom-accent-hover-color, #f04d22);
	background: #111418;
	color: var(--snapweb-shell-text);
}

body.snapweb-has-fluentcommunity-wrapper .snapweb-fcom-content {
	color: var(--snapweb-shell-text);
	background: transparent;
}

body.snapweb-has-fluentcommunity-wrapper :where(.site-header, .site-footer) {
	display: none;
}

body.snapweb-has-fluentcommunity-wrapper .snapweb-fcom-content :where(p, li, span, label, small, figcaption),
body.snapweb-has-fluentcommunity-wrapper .snapweb-fcom-content :where(.fct-product-meta, .fct-product-pricing, .fct-product-description, .fct-product-variation-item-price) {
	color: inherit;
}

body.snapweb-has-fluentcommunity-wrapper .snapweb-fcom-content :where(.has-text-color, .has-inline-color) {
	color: inherit;
}

body.snapweb-has-fluentcommunity-wrapper .snapweb-fcom-content :where(input, select, textarea, .el-input__wrapper) {
	border-color: var(--snapweb-shell-border);
	border-radius: var(--snapweb-shell-radius);
	background: var(--snapweb-shell-surface);
	color: var(--snapweb-shell-text);
}

body.snapweb-has-fluentcommunity-wrapper .snapweb-fcom-content :where(button, .button, .wp-element-button, .fluent-cart-direct-checkout-button, .fluent-cart-add-to-cart-button, .fct-button, .fct_product_submit_button) {
	border-radius: var(--snapweb-shell-radius);
}

body.snapweb-has-fluentcommunity-wrapper .snapweb-fcom-content :where(.fluent-cart-direct-checkout-button, .wp-element-button.is-style-fill, .fct-button-primary, .fct_product_submit_button) {
	background: var(--snapweb-shell-button-bg);
	border-color: var(--snapweb-shell-button-bg);
	color: var(--snapweb-shell-button-text);
}

body.snapweb-has-fluentcommunity-wrapper .snapweb-fcom-content :where(.fluent-cart-direct-checkout-button, .wp-element-button.is-style-fill, .fct-button-primary, .fct_product_submit_button):hover {
	background: var(--snapweb-shell-button-hover);
	border-color: var(--snapweb-shell-button-hover);
	color: var(--snapweb-shell-button-text);
}

body.snapweb-has-fluentcommunity-wrapper .snapweb-fcom-content :where(.fct-product-card, .fct-product-variation-item, .fct-single-product-info, .fct-product-gallery, .fct-product-summary, .fct-single-product, .fct-product-wrapper) {
	border-color: var(--snapweb-shell-border);
	border-radius: var(--snapweb-shell-radius);
	background: var(--snapweb-shell-surface);
	color: var(--snapweb-shell-text);
}

body.snapweb-has-fluentcommunity-wrapper .snapweb-fcom-content :where(.fct-product-variation-item-title, .fct-product-title, h1, h2, h3, h4) {
	color: var(--snapweb-shell-text);
}

body.snapweb-has-fluentcommunity-wrapper .snapweb-fcom-content :where(.fct-product-variation-item-subtitle, .fct-product-regular-price, .fct-product-sale-price, .fct-product-description, .fct-product-meta) {
	color: var(--snapweb-shell-muted);
}

body.snapweb-has-fluentcommunity-wrapper .snapweb-fcom-content :where(.fct-product-gallery, .fct-product-image, .fct-product-card-image, .fct-product-thumbnail, .fct-product-placeholder) {
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--snapweb-shell-surface-soft);
	overflow: hidden;
}

body.snapweb-has-fluentcommunity-wrapper .fcom_wp_content_body,
body.snapweb-has-fluentcommunity-wrapper .snapweb-fcom-content {
	min-width: 0;
	width: 100%;
}

body.snapweb-has-fluentcommunity-wrapper .snapweb-fcom-content img {
	max-width: 100%;
	height: auto;
	object-fit: contain;
}

body.snapweb-has-fluentcommunity-wrapper .snapweb-fcom-content :where(.fct-product-gallery, .fct-product-image, .fct-product-card-image, .fct-product-thumbnail, .fct-product-placeholder) img,
body.snapweb-has-fluentcommunity-wrapper .snapweb-fcom-content :where(.wp-block-post-featured-image, .wp-block-image) img {
	max-height: min(72vh, 720px);
	width: auto;
	object-fit: contain;
}

body.snapweb-has-fluentcommunity-wrapper .snapweb-fcom-content :where(figure, picture) {
	max-width: 100%;
	overflow: hidden;
}

body.snapweb-has-fluentcommunity-wrapper .snapweb-fcom-content :where(footer) {
	display: none;
}

body.snapweb-ai-generated-page {
	--snapweb-ai-canvas-max: none;
}

body.snapweb-ai-generated-page :where(.site-title-area) {
	display: none;
}

body.snapweb-ai-generated-page :where(.site-content, .snapweb-ai-canvas) {
	margin-top: 0;
	margin-bottom: 0;
	padding-top: 0;
	padding-bottom: 0;
	width: 100%;
	max-width: none;
	overflow-x: clip;
}

body.snapweb-ai-generated-page :where(.site-content > .wp-block-post-content, .snapweb-ai-canvas > .wp-block-post-content, .entry-content) {
	margin-block-start: 0;
	width: 100%;
	max-width: none;
}

body.snapweb-ai-generated-page :where(.wp-site-blocks, .site-content, .wp-block-post-content) > * {
	margin-block-start: 0;
}

body.snapweb-ai-generated-page .wp-block-post-content > :where(.alignfull, .alignwide, section, .wp-block-group) {
	max-width: none;
}

body.snapweb-ai-generated-page .wp-block-post-content > :first-child {
	margin-top: 0;
}

body.snapweb-ai-generated-page .wp-block-post-content > :last-child {
	margin-bottom: 0;
}

body.snapweb-ai-generated-page :where(.gsbp-section, [class*="gsbp-"]) {
	box-sizing: border-box;
}
