/*
 * Post body styling — applies to both block content and legacy classic-editor
 * HTML (core/freeform). 65% of posts are classic, so raw <p>/<h2>/<img>/<ul>/
 * <table> inside the content need explicit rhythm and responsive media here
 * (theme.json blockGap only spaces real blocks, not raw classic markup).
 *
 * Scope: the Post Content block wrapper (front: .wp-block-post-content:not(:where(.lp-ninejp)) /
 * .entry-content:not(:where(.lp-ninejp)), editor: .editor-styles-wrapper).
 */

.wp-block-post-content:not(:where(.lp-ninejp)),
.entry-content:not(:where(.lp-ninejp)) {
	font-family: var(--wp--preset--font-family--body, "Noto Sans JP", sans-serif);
	line-height: 1.75;
	color: var(--wp--preset--color--contrast, #111);
	word-break: break-word;
	overflow-wrap: anywhere;
}

/* Responsive media in legacy content */
.wp-block-post-content:not(:where(.lp-ninejp)) :where(img, iframe, video, embed, object),
.entry-content:not(:where(.lp-ninejp)) :where(img, iframe, video, embed, object) {
	max-width: 100%;
	height: auto;
}

/* Vertical rhythm for raw classic markup */
.wp-block-post-content:not(:where(.lp-ninejp)) :where(p, ul, ol, blockquote, figure, table, pre),
.entry-content:not(:where(.lp-ninejp)) :where(p, ul, ol, blockquote, figure, table, pre) {
	margin: 1.5em 0 0;
}
/* classic body rhythm: top-margin spacing — 35px above each paragraph (incl. the
   first), looser 1.88 leading; figures get 40px top/bottom */
.wp-block-post-content:not(:where(.lp-ninejp)) p, .entry-content:not(:where(.lp-ninejp)) p { line-height: 1.88; margin: 35px 0 0; }
.wp-block-post-content:not(:where(.lp-ninejp)) figure, .entry-content:not(:where(.lp-ninejp)) figure { margin: 40px 0; }
/* keep the first paragraph's top margin (WP's flow layout resets first-child) so
   the body text sits 35px below the body's padding, like the classic */
.wp-block-post-content:not(:where(.lp-ninejp)) > p:first-child, .entry-content:not(:where(.lp-ninejp)) > p:first-child { margin-top: 35px; }

/* article headings reproduce the classic .article-container designs (h2 = bottom
   rule, h3 = left rule, h4 = filled bar). font-size is !important so the editor's
   has-*-font-size presets (output with !important) can't shrink them — the classic
   fixed these sizes regardless of any font-size class on the heading. */
.wp-block-post-content:not(:where(.lp-ninejp)) h2, .entry-content:not(:where(.lp-ninejp)) h2 {
	margin: 60px 0 0; padding: 0 0 10px 10px;
	font-size: 26px !important; font-weight: 500; line-height: 1.46;
	border-bottom: 2px solid var(--wp--preset--color--contrast);
}
.wp-block-post-content:not(:where(.lp-ninejp)) h3, .entry-content:not(:where(.lp-ninejp)) h3 {
	margin: 60px 0 0; padding-left: 20px;
	font-size: 23px !important; font-weight: 500; line-height: 1.65;
	border-left: 2px solid #d9d9d9;
}
.wp-block-post-content:not(:where(.lp-ninejp)) h4, .entry-content:not(:where(.lp-ninejp)) h4 {
	margin: 65px 0 0; padding: 8px 20px;
	font-size: 20px !important; font-weight: 500;
	background: var(--wp--preset--color--surface);
}
.wp-block-post-content:not(:where(.lp-ninejp)) h5, .entry-content:not(:where(.lp-ninejp)) h5 {
	margin: 2em 0 0.6em; font-size: 16px; font-weight: 500; line-height: 1.4;
}

/* Lists */
.wp-block-post-content:not(:where(.lp-ninejp)) :where(ul, ol),
.entry-content:not(:where(.lp-ninejp)) :where(ul, ol) { padding-left: 1.4em; }
.wp-block-post-content:not(:where(.lp-ninejp)) li, .entry-content:not(:where(.lp-ninejp)) li { margin: 0.3em 0; }

/* Links: inherit text color, underline on hover (matches classic theme) */
.wp-block-post-content:not(:where(.lp-ninejp)) a,
.entry-content:not(:where(.lp-ninejp)) a { color: var(--wp--preset--color--contrast, #111); text-decoration: underline; }

/* Captions */
.wp-block-post-content:not(:where(.lp-ninejp)) :where(figcaption, .wp-caption-text),
.entry-content:not(:where(.lp-ninejp)) :where(figcaption, .wp-caption-text) {
	font-size: 13px;
	color: #555;
	text-align: center;
	margin-top: 0;
	line-height: 1.5;
}

/* Tables */
.wp-block-post-content:not(:where(.lp-ninejp)) table, .entry-content:not(:where(.lp-ninejp)) table { width: 100%; border-collapse: collapse; }
.wp-block-post-content:not(:where(.lp-ninejp)) :where(th, td), .entry-content:not(:where(.lp-ninejp)) :where(th, td) {
	border: 1px solid var(--wp--preset--color--border, #ddd);
	padding: 0.5em 0.75em;
	text-align: left;
}

/* Blockquote */
.wp-block-post-content:not(:where(.lp-ninejp)) blockquote, .entry-content:not(:where(.lp-ninejp)) blockquote {
	border-left: 3px solid var(--wp--preset--color--border, #ddd);
	padding-left: 1em;
	color: var(--wp--preset--color--muted, #878787);
}
