/* Shared structural reset; appearance is supplied by tokens and block styles. */
:where(.wp-site-blocks, .editor-styles-wrapper) {
	box-sizing: border-box;
}

/* Preserve the live site's viewport painting and permanent scrollbar gutter. */
html:has(.wp-site-blocks) {
	overflow-y: scroll;
	background-color: var(--wp--preset--color--contrast);
}

:where(body, .editor-styles-wrapper) {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	-webkit-tap-highlight-color: transparent;
}

:where(.wp-site-blocks, .editor-styles-wrapper) *,
:where(.wp-site-blocks, .editor-styles-wrapper) *::before,
:where(.wp-site-blocks, .editor-styles-wrapper) *::after {
	box-sizing: inherit;
}

:where(.wp-site-blocks, .editor-styles-wrapper) :where(h1, h2, h3, h4, h5, h6, p, figure, ul, ol, blockquote) {
	margin: 0;
	padding: 0;
}

:where(.wp-site-blocks, .editor-styles-wrapper) :where(img) {
	max-width: 100%;
	height: auto;
	vertical-align: bottom;
}

:where(.wp-site-blocks, .editor-styles-wrapper) .wp-block-image > a {
	display: block;
}

:where(.wp-site-blocks, .editor-styles-wrapper) .wp-block-group {
	margin-block-start: 0;
}

:where(.wp-site-blocks, .editor-styles-wrapper) .is-style-vv-main-inside {
	position: relative;
	min-height: 1px;
}

:where(.wp-site-blocks, .editor-styles-wrapper) .wp-block-embed {
	margin: 0;
}

:where(.wp-site-blocks, .editor-styles-wrapper) strong {
	font-weight: 600;
}

:where(.wp-site-blocks, .editor-styles-wrapper) :focus-visible {
	outline: 2px solid currentcolor;
	outline-offset: 3px;
}

/* Preserve authored overlays without sacrificing normal editor block positioning. */
.editor-styles-wrapper :is(.wp-block-group, .wp-block-validvalue-external-embed):where([class*="is-style-vv-"]) {
	position: var(--validvalue-block-position, relative);
}

.editor-styles-wrapper .wp-block[data-align="full"] {
	width: 100%;
	max-width: none;
}

/* Geometry comes from registered variations without losing to core image CSS. */
:is(.wp-site-blocks, .editor-styles-wrapper) .wp-block-image:where([class*="is-style-vv-"], .is-style-chrome-logo) img {
	width: var(--validvalue-image-width, auto);
	height: var(--validvalue-image-height, auto);
	min-width: var(--validvalue-image-min-width, 0);
	min-height: var(--validvalue-image-min-height, 0);
	max-width: var(--validvalue-image-max-width, 100%);
	max-height: var(--validvalue-image-max-height, none);
	object-fit: var(--validvalue-image-object-fit, fill);
	object-position: var(--validvalue-image-object-position, 50% 50%);
}

/* Core injects height:auto into unchanged editor images, overriding the source crop. */
.editor-styles-wrapper .wp-block-image:where([class*="is-style-vv-"], .is-style-chrome-logo) img[style*="height: auto"] {
	height: var(--validvalue-image-height, auto) !important;
}

/* Decorative empty groups must not become layout-picker panels or flex wrappers. */
.editor-styles-wrapper .wp-block-group:where([class*="is-style-vv-"]) > div:has(> .wp-block-group__placeholder[class*="is-style-vv-"]) {
	display: contents;
}

.editor-styles-wrapper .wp-block-group__placeholder:where([class*="is-style-vv-"]) {
	width: 100%;
	min-width: 0;
}

.editor-styles-wrapper .wp-block-group__placeholder:where([class*="is-style-vv-"]) > .components-placeholder {
	display: none;
}

.editor-styles-wrapper .wp-block-group:where([class*="is-style-vv-"]) > .block-list-appender:only-child {
	position: absolute;
	inset: 0;
}

.editor-styles-wrapper [data-validvalue-caret-break] {
	display: none;
}

/* Core table defaults outrank partial styles; these values remain theme-owned. */
:is(.wp-site-blocks, .editor-styles-wrapper) .wp-block-table table {
	width: var(--validvalue-table-width, auto);
	border-collapse: var(--validvalue-table-border-collapse);
	border-spacing: var(--validvalue-table-border-spacing);
}

:is(.wp-site-blocks, .editor-styles-wrapper) .wp-block-table :is(td, th) {
	border: var(--validvalue-table-cell-border);
	padding: var(--validvalue-table-cell-padding);
}

@media (prefers-reduced-motion: reduce) {
	:where(.wp-site-blocks, .editor-styles-wrapper) * {
		scroll-behavior: auto !important;
		transition: none !important;
		animation: none !important;
	}
}
