/**
 * クラシック本文：ショートコード・表を画面上で中央寄せ
 * （段落の text-align では効かないブロック子向け）
 */
.tool-classic-center {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	text-align:center;
}

.tool-classic-center > * {
	max-width: 100%;
}

.tool-classic-center > p {
	width: 100%;
	margin-left: auto;
	margin-right: auto;
	text-align: center;
}

.tool-classic-center table {
	margin-left: auto;
	margin-right: auto;
	border-collapse: collapse;
}

/*
 * TinyMCE（クラシック・ビジュアル）iframe 内プレビュー
 * - body は .mce-content-body。単体セレクタより詳細度を上げないと中央寄せが負ける。
 * - p に display:flex 等を当てると WebKit／TinyMEC でキャレットが見えなくなる事例があるため、
 *  中央寄せは text-align のみとする。
 * - 本文色が白になり背景と同化する事例への保険（フロント .page-content と干渉しないよう .mce-content-body のみ）
 */
.mce-content-body .tool-classic-center,
.wp-block-freeform .tool-classic-center {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	color: #1a1a1a;
	opacity: 1 !important;
	visibility: visible !important;
	transform: none !important;
}

.mce-content-body .tool-classic-center > *,
.wp-block-freeform .tool-classic-center > * {
	max-width: 100%;
}

.mce-content-body .tool-classic-center > p,
.wp-block-freeform .tool-classic-center > p {
	width: 100%;
	margin-left: auto;
	margin-right: auto;
	text-align: center !important;
	box-sizing: border-box;
	color: inherit;
	caret-color: #1a1a1a;
}

.mce-content-body .tool-classic-center > p:not([class]):empty,
.wp-block-freeform .tool-classic-center > p:not([class]):empty,
.mce-content-body .tool-classic-center > p:not([class]):has(> br:only-child),
.wp-block-freeform .tool-classic-center > p:not([class]):has(> br:only-child) {
	min-height: 1.5em;
	text-align: center !important;
}
