/* Gutenberg video: родной размер. Фронт и редактор разведены — в iframe у figure нет класса align*. */

.text-content figure.wp-block-video:not(.alignwide):not(.alignfull) video,
.editor-styles-wrapper figure.wp-block-video video,
body:not(.wp-admin):not(.block-editor-iframe__body) figure.wp-block-video:not(.alignwide):not(.alignfull) video {
	display: block;
	width: auto;
	max-width: 100%;
	height: auto;
}

/* Сайт, «Нет»: левый край колонки, без float. */
.text-content figure.wp-block-video:not([class*="align"]),
body:not(.wp-admin):not(.block-editor-iframe__body) figure.wp-block-video:not([class*="align"]) {
	float: none;
	clear: both;
	display: block;
	width: fit-content;
	max-width: 100%;
	margin-left: 0;
	margin-right: auto;
	text-align: left;
}

/* Сайт, «По центру». */
.text-content figure.wp-block-video.aligncenter,
body:not(.wp-admin):not(.block-editor-iframe__body) figure.wp-block-video.aligncenter {
	float: none;
	clear: both;
	display: block;
	width: fit-content;
	max-width: 100%;
	margin-left: auto;
	margin-right: auto;
}

.text-content figure.wp-block-video.alignwide video,
.text-content figure.wp-block-video.alignfull video,
body:not(.wp-admin):not(.block-editor-iframe__body) figure.wp-block-video.alignwide video,
body:not(.wp-admin):not(.block-editor-iframe__body) figure.wp-block-video.alignfull video {
	width: 100%;
}

/* Редактор: «Нет» — та же колонка, что у абзаца; видео слева внутри неё. */
.editor-styles-wrapper .wp-block[data-type="core/video"]:not([data-align]),
.editor-styles-wrapper .block-editor-block-list__block[data-type="core/video"]:not([data-align]) {
	box-sizing: border-box;
	width: 100%;
	max-width: var(--wp--style--global--content-size, 840px) !important;
	margin-left: auto !important;
	margin-right: auto !important;
}

.editor-styles-wrapper figure.wp-block-video video {
	display: block;
	width: auto;
	max-width: 100%;
	height: auto;
}

.editor-styles-wrapper .wp-block[data-type="core/video"]:not([data-align]) figure.wp-block-video,
.editor-styles-wrapper .block-editor-block-list__block[data-type="core/video"]:not([data-align]) > video {
	display: block;
	float: none;
	width: fit-content;
	max-width: 100%;
	margin-left: 0;
	margin-right: auto;
}

.editor-styles-wrapper [data-align="center"] figure.wp-block-video {
	float: none !important;
	width: fit-content;
	max-width: 100%;
	margin-left: auto !important;
	margin-right: auto !important;
}

.editor-styles-wrapper [data-align="center"][data-type="core/video"],
.editor-styles-wrapper [data-align="center"]:has(> figure.wp-block-video) {
	float: none !important;
	height: auto !important;
	max-width: var(--wp--style--global--content-size, 840px);
	width: 100%;
	margin-left: auto !important;
	margin-right: auto !important;
}

.editor-styles-wrapper [data-align="left"] figure.wp-block-video,
.editor-styles-wrapper [data-align="right"] figure.wp-block-video {
	margin-left: unset;
	margin-right: unset;
	width: fit-content;
	max-width: 100%;
}
