/**
 * Editor iframe (canvas and BlockPreview). Loaded as a real <link> so
 * WordPress does not rewrite selectors the way add_editor_style() does.
 *
 * Site Editor previews inherit the admin dark colour-scheme; without an
 * explicit light canvas they paint as solid black thumbnails.
 *
 * Keep this file small. Never pull Bootstrap / vendor packs into iframes.
 */

html {
	color-scheme: light only !important;
	background-color: #ffffff !important;
}

html,
html.block-editor-block-preview__content-iframe,
html.block-editor-iframe__html {
	color-scheme: light only !important;
	background-color: #ffffff !important;
}

body,
body.block-editor-iframe__body,
body.editor-styles-wrapper,
html.block-editor-block-preview__content-iframe body,
html.block-editor-iframe__html body {
	color-scheme: light only !important;
	background-color: var(--wp--preset--color--base, #ffffff) !important;
	color: var(--wp--preset--color--contrast-2, #3d3d3d);
	font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

h1, h2, h3, h4, h5, h6,
.wp-block-heading,
.wp-block-site-title,
.wp-block-post-title {
	font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	color: var(--wp--preset--color--contrast, #1a1a1a);
}

/* Pattern / template thumbnails: collapse sticky chrome and avoid min-height blowouts. */
html.block-editor-block-preview__content-iframe,
html.block-editor-block-preview__content-iframe body {
	min-height: 0 !important;
	height: auto !important;
	background-color: #ffffff !important;
	color-scheme: light only !important;
}

html.block-editor-block-preview__content-iframe .is-position-sticky,
html.block-editor-block-preview__content-iframe header.wp-block-template-part,
html.block-editor-block-preview__content-iframe .wp-site-blocks > header {
	position: relative !important;
	top: auto !important;
	inset: auto !important;
}

/* Force readable text if a dark admin cascade leaks colour tokens. */
html.block-editor-block-preview__content-iframe .editor-styles-wrapper,
html.block-editor-block-preview__content-iframe .block-editor-block-list__layout {
	background-color: #ffffff !important;
	color: #1a1a1a;
}
