/*
 * editor-base.css
 * 投稿本文の基本構造をエディターとフロントで共通化する
 */

/* ==========================================================
   基本要素
========================================================== */

:where(
	.editor-styles-wrapper,
	.entry-content,
	.entry-summary
) :where(
	h1,
	h2,
	h3,
	h4,
	h5,
	h6,
	p,
	figure,
	blockquote,
	dl,
	dd
) {
	margin-top: 0;
}


/* ==========================================================
   リスト
========================================================== */

:where(
	.editor-styles-wrapper,
	.entry-content,
	.entry-summary
) :where(ul, ol) {
	margin-top: 0;
	padding-left: 1.5em;
}

:where(
	.editor-styles-wrapper,
	.entry-content,
	.entry-summary
) :where(li > ul, li > ol) {
	margin-bottom: 0;
}


/* ==========================================================
   区切り線
========================================================== */

:where(
	.editor-styles-wrapper,
	.entry-content,
	.entry-summary
) hr {
	height: 1px;
	margin-block: var(--wp--preset--spacing--lg, 2rem);
	border: 0;
}


/* ==========================================================
   コード
========================================================== */

:where(
	.editor-styles-wrapper,
	.entry-content,
	.entry-summary
) pre {
	max-width: 100%;
	margin-bottom: var(--wp--preset--spacing--md, 1.5rem);
	overflow: auto;
}

:where(
	.editor-styles-wrapper,
	.entry-content,
	.entry-summary
) :where(code, kbd, samp) {
	font-family:
		var(
			--wp--preset--font-family--monospace,
			ui-monospace,
			SFMono-Regular,
			Menlo,
			Monaco,
			Consolas,
			"Liberation Mono",
			"Courier New",
			monospace
		);
}


/* ==========================================================
   テーブル
========================================================== */

:where(
	.editor-styles-wrapper,
	.entry-content,
	.entry-summary
) table {
	width: 100%;
	border-collapse: collapse;
}

:where(
	.editor-styles-wrapper,
	.entry-content,
	.entry-summary
) :where(th, td) {
	padding: var(--wp--preset--spacing--xs, 0.5rem);
	border: 1px solid var(--wp--preset--color--line, #dddddd);
	text-align: left;
	vertical-align: top;
}


/* ==========================================================
   リンク
========================================================== */

:where(
	.editor-styles-wrapper,
	.entry-content,
	.entry-summary
) a {
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

:where(
	.editor-styles-wrapper,
	.entry-content,
	.entry-summary
) a:focus-visible {
	outline: 2px solid var(--wp--preset--color--link-blue, #315b8a);
	outline-offset: 3px;
}


/* ==========================================================
   画像・メディア
========================================================== */

:where(
	.editor-styles-wrapper,
	.entry-content,
	.entry-summary
) :where(
	img,
	svg,
	video,
	canvas,
	audio,
	iframe,
	embed,
	object
) {
	max-width: 100%;
}

:where(
	.editor-styles-wrapper,
	.entry-content,
	.entry-summary
) img {
	height: auto;
	vertical-align: middle;
}

:where(
	.editor-styles-wrapper,
	.entry-content,
	.entry-summary
) figure {
	margin-right: 0;
	margin-bottom: var(--wp--preset--spacing--md, 1.5rem);
	margin-left: 0;
}

:where(
	.editor-styles-wrapper,
	.entry-content,
	.entry-summary
) iframe {
	border: 0;
}


/* ==========================================================
   フォーム
========================================================== */

:where(
	.editor-styles-wrapper,
	.entry-content,
	.entry-summary
) :where(button, input, select, textarea) {
	font: inherit;
}

:where(
	.editor-styles-wrapper,
	.entry-content,
	.entry-summary
) :where(
	button,
	input[type="button"],
	input[type="reset"],
	input[type="submit"]
) {
	padding: 0.75em 1.25em;
	border: 1px solid var(--wp--preset--color--line, #dddddd);
	cursor: pointer;
}

:where(
	.editor-styles-wrapper,
	.entry-content,
	.entry-summary
) :where(
	input[type="text"],
	input[type="email"],
	input[type="url"],
	input[type="password"],
	input[type="number"],
	input[type="tel"],
	input[type="date"],
	input[type="time"],
	input[type="datetime-local"],
	select,
	textarea
) {
	width: 100%;
	padding: 0.75em;
	border: 1px solid var(--wp--preset--color--line, #dddddd);
	border-radius: 4px;
	background-color:
		var(--wp--preset--color--background, #ffffff);
	color: var(--wp--preset--color--text-primary, #262626);
}

:where(
	.editor-styles-wrapper,
	.entry-content,
	.entry-summary
) textarea {
	min-height: 8rem;
	resize: vertical;
}

:where(
	.editor-styles-wrapper,
	.entry-content,
	.entry-summary
) :where(button, input, select, textarea):focus-visible {
	outline: 2px solid var(--wp--preset--color--link-blue, #315b8a);
	outline-offset: 2px;
}