/* 記事本文タイポグラフィ（.entry-content / エディタープレビュー共通） */
.entry-content,
.editor-styles-wrapper {
	font-size: 16px;
	line-height: 1.15;
	font-weight: 400;
	color: inherit;
}

/* ブロック間の余白リセット（見出し・リストは個別指定） */
.entry-content > *,
.editor-styles-wrapper > * {
	margin-top: 0;
	margin-bottom: 0;
}

/* 見出し（Tailwind preflight・インライン書式より優先） */
.entry-content h1,
.entry-content h1.wp-block-heading,
.entry-content .wp-block-heading.has-h-1-font-size,
.editor-styles-wrapper h1,
.editor-styles-wrapper h1.wp-block-heading,
.editor-styles-wrapper .wp-block-heading.has-h-1-font-size {
	font-size: 40px !important;
	line-height: 1.15;
	font-weight: 700 !important;
	font-style: normal;
	margin-top: 15px;
	margin-bottom: 0.3em;
	text-decoration: none;
}

.entry-content h2,
.entry-content h2.wp-block-heading,
.entry-content .wp-block-heading.has-h-2-font-size,
.editor-styles-wrapper h2,
.editor-styles-wrapper h2.wp-block-heading,
.editor-styles-wrapper .wp-block-heading.has-h-2-font-size {
	font-size: 25px !important;
	line-height: 1.15;
	font-weight: 700 !important;
	font-style: normal;
	margin-top: 5px;
	margin-bottom: 0;
	text-decoration: none;
}

/* H2 サブタイトル行（1回改行・<br> 直下の em など） */
.entry-content h2 em,
.entry-content h2 i,
.editor-styles-wrapper h2 em,
.editor-styles-wrapper h2 i {
	font-size: 16px !important;
	font-weight: 400 !important;
	font-style: italic;
}

/* 見出し2：改行2回（別ブロック）＝1行分の間隔。1回改行（<br>）は余白なし */
.entry-content h2 + h2,
.entry-content h2.wp-block-heading + h2.wp-block-heading,
.editor-styles-wrapper h2 + h2,
.editor-styles-wrapper h2.wp-block-heading + h2.wp-block-heading,
.entry-content h2.travel-in-japan-break-before,
.entry-content h2.wp-block-heading.travel-in-japan-break-before,
.editor-styles-wrapper h2.travel-in-japan-break-before,
.editor-styles-wrapper h2.wp-block-heading.travel-in-japan-break-before,
.entry-content :is(ul, ol, p, figure, .wp-block-image) + h2,
.entry-content :is(ul, ol, p, figure, .wp-block-image) + h2.wp-block-heading,
.editor-styles-wrapper :is(ul, ol, p, figure, .wp-block-image) + h2,
.editor-styles-wrapper :is(ul, ol, p, figure, .wp-block-image) + h2.wp-block-heading {
	margin-top: 1.15em !important;
}

.entry-content h2 br,
.editor-styles-wrapper h2 br {
	line-height: inherit;
}

.entry-content h3,
.entry-content h3.wp-block-heading,
.entry-content .wp-block-heading.has-h-3-font-size,
.editor-styles-wrapper h3,
.editor-styles-wrapper h3.wp-block-heading,
.editor-styles-wrapper .wp-block-heading.has-h-3-font-size {
	font-size: 16px !important;
	line-height: 1.15;
	font-weight: 700 !important;
	font-style: normal;
	margin-top: 5px;
	margin-bottom: 2px;
	text-decoration: none;
}

.entry-content h3 br,
.editor-styles-wrapper h3 br {
	line-height: inherit;
}

.entry-content h4,
.entry-content h4.wp-block-heading,
.entry-content .wp-block-heading.has-h-4-font-size,
.editor-styles-wrapper h4,
.editor-styles-wrapper h4.wp-block-heading,
.editor-styles-wrapper .wp-block-heading.has-h-4-font-size {
	font-size: 16px !important;
	line-height: 1.15;
	font-weight: 400 !important;
	font-style: italic;
	margin-top: 0;
	margin-bottom: 10px;
	text-decoration: none;
}

/* 2回改行（空行）の直後：異なるブロック種別間も1行分の余白（H3・H4は固定余白のため除外） */
.entry-content :not(h3):not(h4).travel-in-japan-break-before,
.editor-styles-wrapper :not(h3):not(h4).travel-in-japan-break-before {
	margin-top: 1.15em !important;
}

/* 画像・メディアの前（空行）：直前のテキストブロックに下余白 */
.entry-content .travel-in-japan-break-after,
.editor-styles-wrapper .travel-in-japan-break-after {
	margin-bottom: 1.15em !important;
}

/* リスト直後の画像（className を付けられないブロック用） */
.entry-content :is(ul, ol) + :is(figure, .wp-block-image),
.editor-styles-wrapper :is(ul, ol) + :is(figure, .wp-block-image) {
	margin-top: 1.15em !important;
}

/* 2回改行後の画像（figure の class のみ・ブロック attrs には付けない） */
.entry-content :is(figure, .wp-block-image).travel-in-japan-break-before,
.editor-styles-wrapper :is(figure, .wp-block-image).travel-in-japan-break-before,
.entry-content :is(h1, h2, h3) + :is(figure, .wp-block-image),
.entry-content :is(h1, h2, h3).wp-block-heading + :is(figure, .wp-block-image),
.editor-styles-wrapper :is(h1, h2, h3) + :is(figure, .wp-block-image),
.editor-styles-wrapper :is(h1, h2, h3).wp-block-heading + :is(figure, .wp-block-image) {
	margin-top: 1.15em !important;
}

/* 本文段落：改行2回＝1行分の間隔、段落余白なし */
.entry-content p,
.editor-styles-wrapper p {
	margin: 0;
	font-size: 16px;
	line-height: 1.15;
	font-weight: 400;
}

/* 2回改行で作った空行段落（<br> のみ・エディター・フロントで空白行として表示） */
.entry-content p:has(> br:only-child),
.editor-styles-wrapper p:has(> br:only-child) {
	margin: 0 !important;
	min-height: 0;
}

.entry-content p + p:has(> br:only-child),
.editor-styles-wrapper p + p:has(> br:only-child),
.entry-content p:has(> br:only-child) + p,
.editor-styles-wrapper p:has(> br:only-child) + p {
	margin-top: 0 !important;
}

.entry-content p + p,
.entry-content .wp-block-paragraph + .wp-block-paragraph,
.entry-content p.travel-in-japan-break-before,
.entry-content :is(h1, h2, h3) + p,
.entry-content :is(h1, h2, h3).wp-block-heading + p,
.entry-content :is(figure, .wp-block-image) + p,
.editor-styles-wrapper p + p,
.editor-styles-wrapper .wp-block-paragraph + .wp-block-paragraph,
.editor-styles-wrapper p.travel-in-japan-break-before,
.editor-styles-wrapper :is(h1, h2, h3) + p,
.editor-styles-wrapper :is(h1, h2, h3).wp-block-heading + p,
.editor-styles-wrapper :is(figure, .wp-block-image) + p {
	margin-top: 1.15em !important;
}

/* 同一ブロック内の <br> 改行は余白なし（上の p+p ルールの対象外） */

/* 改行1回は余分なスペースなし */
.entry-content br,
.editor-styles-wrapper br {
	line-height: inherit;
}

/* Google Docs インデント（フロント表示のみ。エディターでは span を block 化しない） */
.entry-content p[style*="text-indent"],
.entry-content p[style*="margin-left"],
.entry-content p[style*="padding-left"],
.entry-content span[style*="text-indent"],
.entry-content span[style*="margin-left"],
.entry-content span[style*="padding-left"] {
	display: block;
}

/* 字下げ — エディター・フロント（useBlockProps / render_block の inline style 用） */
.editor-styles-wrapper .wp-block-paragraph[style*="text-indent"],
.editor-styles-wrapper p[style*="text-indent"],
.entry-content .wp-block-paragraph[style*="text-indent"],
.entry-content p[style*="text-indent"] {
	text-indent: 1em;
}

/* エディター内はテキスト選択を確実に有効化 */
.editor-styles-wrapper .block-editor-rich-text__editable,
.editor-styles-wrapper [contenteditable="true"] {
	user-select: text;
	-webkit-user-select: text;
}

/* Tailwind preflight が list-style を消すため、本文リストを復元 */
.entry-content ul,
.entry-content ol,
.entry-content .wp-block-list,
.editor-styles-wrapper ul,
.editor-styles-wrapper ol,
.editor-styles-wrapper .wp-block-list {
	margin-top: 0;
	margin-bottom: 5px;
	padding-left: 1.5rem;
}

.entry-content ul,
.entry-content ul.wp-block-list,
.editor-styles-wrapper ul,
.editor-styles-wrapper ul.wp-block-list {
	list-style-type: disc;
}

.entry-content ul ul,
.entry-content ul ul.wp-block-list,
.editor-styles-wrapper ul ul,
.editor-styles-wrapper ul ul.wp-block-list {
	list-style-type: circle;
}

.entry-content ul ul ul,
.editor-styles-wrapper ul ul ul {
	list-style-type: square;
}

.entry-content ol,
.entry-content ol.wp-block-list,
.editor-styles-wrapper ol,
.editor-styles-wrapper ol.wp-block-list {
	list-style-type: decimal;
}

.entry-content li,
.editor-styles-wrapper li {
	margin: 0.25em 0;
	line-height: 1.15;
}

/* 画像：拡大なし・中央・上下余白なし・キャプション非表示 */
.entry-content .wp-block-image,
.editor-styles-wrapper .wp-block-image {
	margin-top: 0;
	margin-bottom: 0;
	text-align: center;
}

.entry-content .wp-block-image img,
.entry-content img,
.editor-styles-wrapper .wp-block-image img,
.editor-styles-wrapper img {
	display: block;
	width: auto;
	max-width: 100%;
	height: auto;
	margin-left: auto;
	margin-right: auto;
	margin-top: 0;
	margin-bottom: 0;
}

.entry-content .wp-block-image figcaption,
.entry-content figcaption,
.editor-styles-wrapper .wp-block-image figcaption,
.editor-styles-wrapper figcaption {
	display: none;
}

/* 引用・表・ボタンなどは手動設定のため自動余白なし */
.entry-content .wp-block-quote,
.entry-content .wp-block-table,
.entry-content .wp-block-button,
.entry-content blockquote,
.entry-content table,
.editor-styles-wrapper .wp-block-quote,
.editor-styles-wrapper .wp-block-table,
.editor-styles-wrapper .wp-block-button,
.editor-styles-wrapper blockquote,
.editor-styles-wrapper table {
	margin-top: 0;
	margin-bottom: 0;
}
