/*
 * Biopharm article style: blog posts (Knowledge Library, News).
 * Shared by the single post page (.single-post .entry-content) and the block editor
 * canvas (.editor-styles-wrapper), so the editor shows the published look.
 * Matches the article style of the old biopharmshop.com.
 */

/* ---------- Page chrome (front end only) ---------- */

/* Porto shows the featured image as a cropped wide banner; the cover image is already the first image in the content. */
.single-post .post-image.single { display: none; }

/* Post title under the breadcrumb (header type 6 hides it by default). */
.single-post .page-top .row > div { display: flex; flex-direction: column-reverse; }
.single-post .page-top .pt-right.d-none { display: block !important; width: 100%; }
.single-post .page-top .page-title,
.editor-styles-wrapper .editor-post-title {
	display: block !important;
	max-width: 880px;
	margin: 30px auto 4px;
	color: #0154a5;
	font-size: 32px;
	font-weight: 700;
	line-height: 1.35;
	text-align: center;
	text-transform: none;
	letter-spacing: 0;
}

/* ---------- Editor canvas ---------- */

.editor-styles-wrapper {
	--wp--style--global--content-size: 880px;
	font-family: "DB Helvethaica X", "Noto Sans Thai", sans-serif;
	background: #fff;
}
.editor-styles-wrapper .is-root-container > * { max-width: 880px; margin-left: auto !important; margin-right: auto !important; }
.editor-styles-wrapper :is(h1, h2, h3, h4, h5, h6) { font-family: inherit; }

/* ---------- Article content (front end + editor) ----------
 * Content rules set only top/bottom margins: left/right stay with the layout
 * (centered 880px column), so every block lines up on the same left edge.
 */

.single-post .entry-content { max-width: 880px; margin: 0 auto; }
:is(.single-post .entry-content, .editor-styles-wrapper) { font-size: 17px; line-height: 1.8; color: #444; }
:is(.single-post .entry-content, .editor-styles-wrapper) p { margin-top: 0; margin-bottom: 16px; }

:is(.single-post .entry-content, .editor-styles-wrapper) :is(h1, h2) {
	margin-top: 8px;
	margin-bottom: 16px;
	color: #0154a5;
	font-size: 26px;
	font-weight: 700;
	line-height: 1.4;
	scroll-margin-top: 120px;
}
:is(.single-post .entry-content, .editor-styles-wrapper) h3 {
	margin-top: 24px;
	margin-bottom: 10px;
	color: #0154a5;
	font-size: 21px;
	font-weight: 600;
	line-height: 1.4;
	scroll-margin-top: 120px;
}
:is(.single-post .entry-content, .editor-styles-wrapper) :is(h1, h2, h3, h4) strong { font-weight: inherit; }
:is(.single-post .entry-content, .editor-styles-wrapper) h4 {
	margin-top: 20px;
	margin-bottom: 8px;
	color: #0154a5;
	font-size: 18px;
	font-weight: 600;
	line-height: 1.4;
}

/* Separator: full-width hairline (the block default is a short 100px bar). */
:is(.single-post .entry-content, .editor-styles-wrapper) hr,
:is(.single-post .entry-content, .editor-styles-wrapper) hr.wp-block-separator {
	width: 100%;
	max-width: none;
	margin-top: 32px;
	margin-bottom: 32px;
	border: 0;
	border-top: 1px solid #e3e8ee;
	background: none;
	opacity: 1;
}
.editor-styles-wrapper .is-root-container > hr.wp-block-separator { max-width: 880px; }
/* A bold paragraph right after a separator is a section label ("Key Takeaway", "สารบัญบทความ"). */
:is(.single-post .entry-content, .editor-styles-wrapper) hr + p > strong:first-child { color: #0154a5; font-size: 20px; }

:is(.single-post .entry-content, .editor-styles-wrapper) figure.wp-block-image { margin-top: 8px; margin-bottom: 18px; }
:is(.single-post .entry-content, .editor-styles-wrapper) img { display: block; height: auto; margin: 8px auto 18px; border-radius: 8px; }
:is(.single-post .entry-content, .editor-styles-wrapper) figure.wp-block-image img { margin: 0 auto; }

:is(.single-post .entry-content, .editor-styles-wrapper) :is(ul, ol) { margin-top: 0; margin-bottom: 18px; padding-left: 22px; }
:is(.single-post .entry-content, .editor-styles-wrapper) li { margin-bottom: 6px; }
:is(.single-post .entry-content, .editor-styles-wrapper) li strong { color: #0154a5; }

/* Table of contents links (#section1, #section2, ...). */
:is(.single-post .entry-content, .editor-styles-wrapper) a[href^="#section"] { color: #555; }
:is(.single-post .entry-content, .editor-styles-wrapper) a[href^="#section"]:hover { color: #0154a5; }

/* Buttons (e.g. "เลือกซื้อสินค้า" in promotion posts) use the brand blue. */
:is(.single-post .entry-content, .editor-styles-wrapper) .wp-block-button__link { background: #0154a5; color: #fff; border-radius: 6px; padding: 12px 28px; text-decoration: none; }
.single-post .entry-content .wp-block-button__link:hover { background: #013f7c; color: #fff; }

:is(.single-post .entry-content, .editor-styles-wrapper) table { width: 100%; margin-top: 10px; margin-bottom: 20px; border-collapse: collapse; }
:is(.single-post .entry-content, .editor-styles-wrapper) :is(th, td) { padding: 10px 12px; border: 1px solid #e3e8ee; }
:is(.single-post .entry-content, .editor-styles-wrapper) th { background: #f3f7fb; color: #0154a5; }

@media (max-width: 767px) {
	.single-post .page-top .page-title { margin-top: 18px; font-size: 24px; }
	.single-post .entry-content { font-size: 16px; }
	.single-post .entry-content h2 { font-size: 22px; }
	.single-post .entry-content h3 { font-size: 19px; }
}
