/* SPARK blog detail: layout for blog posts written with the "sb-" HTML structure (references/blog-html-structure.md),
   matching the designer's blog detail page (references/blogs/blog detail). Loaded on single posts only (spark-blog.php).
   Posts without <div class="sb-blog"> keep the plain article layout of the blog template. */

/* The template's article column is 860px; an sb-blog breaks out to the full page width. */
.single-post { overflow-x: hidden; }
.spark-article:has(.sb-blog) { padding-top: 0 !important; padding-bottom: 0 !important; }
.sb-blog { position: relative; left: 50%; width: 100vw; margin-left: -50vw; font-family: "Poppins", sans-serif; font-size: 15px; line-height: 1.75; color: #3D3D3D; }
/* Side space as in the design (about 8% of the width), content never wider than 1600px. */
.sb-blog > section { padding: 80px max(20px, 8.33vw, calc((100vw - 1600px) / 2)); }
.sb-blog > section + section:not(.sb-bg):not(.sb-band):not(.sb-cta) { padding-top: 20px; }
.sb-blog .sb-bg, .sb-blog .sb-band { background: #F7F7FA; }
.sb-blog p { margin: 0 0 16px; }
.sb-blog p:last-child { margin-bottom: 0; }
.spark-article .sb-blog h2 { margin: 0 0 18px; font-family: "Montserrat", sans-serif; font-size: 32px; line-height: 1.25; font-weight: 700; color: #18155D; }
.spark-article .sb-blog a:not(.sb-btn) { color: #6865FF; }
.spark-article .sb-blog h2 a:not(.sb-btn), .spark-article .sb-blog h3 a:not(.sb-btn) { color: inherit; font: inherit; text-decoration: none; }

/* Image + text, side by side. Text first in the markup; .sb-split--reverse puts the image on the left. */
.sb-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(40px, 4.5vw, 80px); align-items: center; }
.sb-split--reverse > .sb-media { order: -1; }
.sb-media { margin: 0; }
.spark-article .sb-blog .sb-media img { display: block; width: 100%; height: auto; border-radius: 20px !important; }
.spark-article .sb-blog .sb-media--fill img { aspect-ratio: 4 / 3; object-fit: cover; object-position: center 70%; }
/* Whole image, never cropped, on a blurred copy of itself (as in the design): style="--sb-bg:url(blurred.webp)" */
.sb-media--contain { aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 20px; background: #DCE6F2 var(--sb-bg, none) center / cover no-repeat; }
.spark-article .sb-blog .sb-media--contain img { width: auto; height: 100%; max-width: 100%; object-fit: contain; border-radius: 0 !important; }
.sb-lead { font-family: "Montserrat", sans-serif; font-size: 26px !important; line-height: 1.3 !important; font-weight: 700; color: #18155D; }

/* Centred text on a grey band. */
.sb-band { text-align: center; }
/* Specific enough to beat the h2/p margin rules above, so the 900px block sits in the middle of the band. */
.spark-article .sb-blog .sb-band > * { max-width: 900px; margin-left: auto; margin-right: auto; }

/* Longer text without an image (lists, numbered points): left-aligned, readable width. Add sb-bg for grey. */
.sb-plain > * { max-width: 960px; }
.spark-article .sb-blog .sb-plain h3, .spark-article .sb-blog .sb-split h3 { margin: 24px 0 8px; font-family: "Montserrat", sans-serif; font-size: 20px; font-weight: 700; color: #18155D; }

/* Event photos in a row. */
.sb-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 380px)); justify-content: center; gap: 24px; }
.sb-gallery .sb-media img { height: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

/* Video (YouTube) as the media of a split. */
.sb-video { aspect-ratio: 16 / 9; border-radius: 20px; overflow: hidden; background: #000; }
.sb-video iframe { display: block; width: 100%; height: 100%; border: 0; }

/* Lists. */
.spark-article .sb-blog ul { margin: 0 0 18px; padding-left: 20px; }
.spark-article .sb-blog ul.sb-checks { list-style: none; padding-left: 0; }
.sb-checks li { position: relative; padding-left: 32px; margin-bottom: 10px; }
.sb-checks li::before { content: ""; position: absolute; left: 0; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #6865FF url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 12px no-repeat; }

/* Navy quote box (used as the "media" side of a split, or alone). */
.sb-thanks { background: linear-gradient(135deg, #18155D 0%, #2B2584 100%); color: #fff; border-radius: 20px; padding: 48px 44px; text-align: center; font-style: italic; }
.spark-article .sb-blog .sb-thanks h3 { margin: 0 0 18px; font-family: "Montserrat", sans-serif; font-size: 28px; line-height: 1.25; font-weight: 700; font-style: italic; color: #fff; }
.sb-thanks p { color: #E4E3FF; }

/* Navy call to action band: heading left, text and button right. */
.sb-cta { display: grid; grid-template-columns: 1.15fr 1fr; gap: 48px; align-items: center; background: linear-gradient(110deg, #18155D 0%, #221D78 100%); color: #E4E3FF; }
.spark-article .sb-blog .sb-cta h2 { margin: 0; color: #fff; font-size: 36px; }
.sb-cta p { margin-bottom: 18px; }
.sb-btn { display: inline-block; padding: 14px 26px; border: 1px solid #fff; border-radius: 8px; background: #fff; color: #18155D !important; font: 600 15px/1.2 "Poppins", sans-serif; text-decoration: none !important; transition: background .2s, color .2s; }
.sb-btn:hover, .sb-btn:focus { background: transparent; color: #fff !important; }
/* A post with its own CTA band hides the template's generic one so two navy bands don't stack. */
body:has(.sb-cta) .elementor-element-b2fd76d { display: none; }

@media (max-width: 1024px) {
	.sb-blog > section { padding: 60px 24px; }
	.sb-split, .sb-cta { gap: 36px; }
	.spark-article .sb-blog h2 { font-size: 28px; }
}
@media (max-width: 767px) {
	/* Blog hero (template): long titles were cut off at 40px in the 460px hero. */
	.elementor-5170 .elementor-element.elementor-element-b8fd2fa { --min-height: 0px !important; --overflow: visible !important; --padding-top: 48px !important; --padding-bottom: 48px !important; }
	.elementor-5170 .elementor-element.elementor-element-b5fd21d .elementor-heading-title { font-size: 28px !important; line-height: 1.2 !important; }
	.sb-blog > section { padding: 48px 20px; }
	.sb-split, .sb-cta { grid-template-columns: 1fr; }
	.sb-split > .sb-media { order: -1; } /* image first, then the text */
	.sb-lead { font-size: 22px !important; }
	.spark-article .sb-blog h2, .spark-article .sb-blog .sb-cta h2 { font-size: 24px; }
	.sb-thanks { padding: 32px 24px; }
	.spark-article .sb-blog .sb-thanks h3 { font-size: 22px; }
}
