/*
 * sKnow / Blockman integration layer.
 * Blockman feature selectors are retained for content compatibility while
 * sKnow remains the authority for the site shell, typography and colours.
 */
:root {
	--bm-color-main: var(--brass, #a8823c);
	--bm-color-link: var(--brass-deep, #8a6a2c);
	--bm-color-text: var(--ink, #16181d);
	--bm-color-bg: var(--paper, #f5f3ee);
	--bm-color-border: var(--line, rgba(22, 24, 29, .14));
	--bm-content-size: 760px;
	--bm-content-width: 760px;
	--bm-radius: 0px;
}

/* Prevent imported content styles from redefining sKnow's outer layout. */
body,
.site,
.site-content,
.content-area,
.site-main {
	font-family: var(--font-body);
	color: var(--ink);
}

.entry-content .bm-post-list,
.entry-content .bm-tabs,
.entry-content .bm-table-wrap,
.entry-content .blockman-toc,
.entry-content .bm-capbox,
.entry-content .bm-button-wrap {
	max-width: 100%;
}

/*
 * Blockman centres every direct child of .entry-content. Core blocks such as
 * quote, pullquote, gallery, table and embed later use margin shorthand, which
 * cancels only the horizontal auto margins and leaves the max-width in place.
 * The result is a narrower block pinned to the left. Reassert one consistent
 * content alignment for every ordinary direct child, regardless of block type.
 */
.entry-content > :where(
	:not(.alignwide):not(.alignfull):not(.alignleft):not(.alignright):
	not(.bm-effect--wide):not(.bm-effect--screen)
) {
	margin-left: auto !important;
	margin-right: auto !important;
}

/* Wide/full blocks fill sKnow's article column without Blockman's negative
 * padding compensation. True viewport-width effects remain opt-in through the
 * dedicated Blockman screen effect class. */
.entry-content > .alignwide,
.entry-content > .alignfull {
	width: 100%;
	max-width: 100%;
	margin-left: 0 !important;
	margin-right: 0 !important;
}

/* Preserve WordPress' floated image/block alignment semantics. */
.entry-content > .alignleft {
	margin-left: 0 !important;
}

.entry-content > .alignright {
	margin-right: 0 !important;
}

/* Nested galleries must size from their own row, not from article alignment. */
.entry-content .wp-block-gallery > .wp-block-image,
.entry-content .blocks-gallery-grid > .blocks-gallery-item {
	margin-left: 0;
	margin-right: 0;
}

.blockman-toc,
.bm-table-wrap,
.bm-profile-widget,
.bm-banner-widget,
.bm-related,
.bm-author-box {
	border-color: var(--line);
	background: var(--white);
}

.blockman-toc a,
.bm-post-list a,
.bm-related a,
.bm-author-box a {
	color: inherit;
}

.blockman-toc a:hover,
.bm-post-list a:hover,
.bm-related a:hover,
.bm-author-box a:hover {
	color: var(--brass);
}

/* Vertical table headings remain opt-in and scroll safely on small screens. */
.entry-content .bm-table-scroll,
.entry-content .wp-block-table {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

@media (max-width: 767px) {
	.entry-content .bm-post-list,
	.entry-content .bm-tabs,
	.entry-content .bm-table-wrap {
		width: 100%;
	}
}
