/*
 * Blog-only styling for swiftforgeleads.com — loaded by inc/blog-layout.php, so it
 * affects /blog/ pages only and never the homepage, privacy policy or terms.
 *
 * Two jobs:
 *  1. Put the blog content in a white "box" on the site's grey page background,
 *     the way boxed blog layouts read, instead of text floating on the page.
 *  2. Point the drop-in's own CSS variables at the site's brand colours, so the
 *     blog is not the stock blue (#2f5bea) inside that box.
 *
 * The box is applied to .cms-blog / .cms-post (the elements the CRM renders INSIDE
 * <main>) and deliberately NOT to #main — the theme has
 * ".sf-fullbleed #main.site-main { padding: 0 !important }", which would win.
 */

:root {
	--cms-accent: var(--sf-accent, #80a9af);
	--cms-text:   var(--sf-ink, #11151b);
	--cms-line:   var(--sf-border, #e4e6ea);
	--cms-muted:  var(--sf-muted, #55555e);
	--cms-radius: 14px;

	--sf-blog-box-pad:    44px;
	--sf-blog-box-gap:    44px;
	--sf-blog-box-radius: 16px;
}

/* ---- the box ---------------------------------------------------------- */

.cms-blog,
.cms-post,
.cms-notfound {
	background: var(--sf-white, #fff);
	border: 1px solid var(--sf-border, #e4e6ea);
	border-radius: var(--sf-blog-box-radius);
	box-shadow: 0 1px 3px rgba(17, 21, 27, .06), 0 8px 24px rgba(17, 21, 27, .04);
	padding: var(--sf-blog-box-pad);
	margin: var(--sf-blog-box-gap) auto;
	box-sizing: border-box;
}

/* list page: the grid's own width, plus the box padding */
.cms-blog {
	max-width: calc(var(--cms-width, 1080px) + var(--sf-blog-box-pad) * 2);
	width: 100%;
}

/* post page: keep the ~720px reading measure INSIDE the padding */
.cms-post {
	max-width: calc(var(--cms-read, 720px) + var(--sf-blog-box-pad) * 2);
	width: 100%;
}

/* first/last child margins would push the box open */
.cms-blog > :first-child,
.cms-post > :first-child { margin-top: 0; }
.cms-blog > :last-child,
.cms-post > :last-child  { margin-bottom: 0; }

/* ---- small screens ---------------------------------------------------- */

@media (max-width: 768px) {
	:root {
		--sf-blog-box-pad:    22px;
		--sf-blog-box-gap:    18px;
		--sf-blog-box-radius: 12px;
	}
	/* edge-to-edge-ish on phones: the box keeps a small gutter, not 22px of white */
	.cms-blog,
	.cms-post,
	.cms-notfound {
		margin-left: 12px;
		margin-right: 12px;
	}
}
