/*
 * SleepBaby Article Render Guard 1.0.15
 *
 * Final, article-scoped compatibility layer for component-schema drift.
 * This file changes presentation only. It does not change article markup,
 * destinations, affiliate attributes, disclosures, tracking, or visibility.
 */

/*
 * The theme owns ordinary prose links with an !important plum foreground.
 * Native components own their own surface color, so contextual links inside a
 * component must inherit that local foreground in every interaction state.
 * Button-like links are excluded and receive their own atomic paint contract.
 */
body.sleepbaby-affiliate-editorial.sleepbaby-affiliate-editorial-v3106.sb-affiliate-page--article.sb-affiliate-page--article .entry-content :is(
	[data-sb-native-component],
	[data-sb-component],
	[data-sb-article-flow-surface],
	[data-sb-background-owned],
	.sbds-video,
	.sbds-video-card,
	.sb-video-card,
	.sleepbaby-video,
	.sleepbaby-video-card,
	.sleepbaby-article-video,
	.sb-amazon-module,
	.sb-amazon-module-luxury,
	.sb-amazon-luxury,
	.sbds-affiliate-module,
	[id^="sb-amazon-"],
	:is(section, aside, figure):has(iframe[src*="youtube.com"], iframe[src*="youtube-nocookie.com"])
) a:not([data-sb-contrast-role="amazon-button"]):not(.sabb-box__button):not(.sbds-affiliate-module__button):not(.sleepbaby-workshop-cta__button):not(.sb-article-cta__button):not(.wp-block-button__link):not(.wp-element-button):not(.button):not([role="button"]):not([rel~="sponsored"]):not([href*="sleepbaby-20"]):not([href^="#sb-source-"]):is(
	:link,
	:visited,
	:hover,
	:focus,
	:focus-visible,
	:active
) {
	color: inherit !important;
	-webkit-text-fill-color: currentColor !important;
	text-decoration-color: currentColor !important;
	text-underline-offset: 0.16em !important;
	text-shadow: none !important;
	opacity: 1 !important;
}

/*
 * Source jumps are small light citation chips, even when their parent card is
 * dark. Give the chip its own complete color pair instead of inheriting the
 * parent foreground. This keeps numbered references readable without changing
 * their destinations or the source/disclosure system.
 */
body.sleepbaby-affiliate-editorial.sleepbaby-affiliate-editorial-v3106.sb-affiliate-page--article.sb-affiliate-page--article .entry-content :is(
	[data-sb-native-component],
	[data-sb-component],
	[data-sb-article-flow-surface],
	[data-sb-background-owned],
	.sbds-video,
	.sbds-video-card,
	.sb-video-card,
	.sleepbaby-video,
	.sleepbaby-video-card,
	.sleepbaby-article-video
) a[href^="#sb-source-"]:is(
	:link,
	:visited,
	:hover,
	:focus,
	:focus-visible,
	:active
) {
	color: #2f2140 !important;
	-webkit-text-fill-color: #2f2140 !important;
	background: #f1e8f5 !important;
	background-image: none !important;
	text-decoration-color: currentColor !important;
	text-shadow: none !important;
	opacity: 1 !important;
}

body.sleepbaby-affiliate-editorial.sleepbaby-affiliate-editorial-v3106.sb-affiliate-page--article.sb-affiliate-page--article .entry-content :is(
	[data-sb-native-component],
	[data-sb-component],
	[data-sb-article-flow-surface],
	[data-sb-background-owned],
	.sbds-video,
	.sbds-video-card,
	.sb-video-card,
	.sleepbaby-video,
	.sleepbaby-video-card,
	.sleepbaby-article-video,
	.sb-amazon-module,
	.sb-amazon-module-luxury,
	.sb-amazon-luxury,
	.sbds-affiliate-module,
	[id^="sb-amazon-"],
	:is(section, aside, figure):has(iframe[src*="youtube.com"], iframe[src*="youtube-nocookie.com"])
) a:not([data-sb-contrast-role="amazon-button"]):not(.sabb-box__button):not(.sbds-affiliate-module__button):not(.sleepbaby-workshop-cta__button):not(.sb-article-cta__button):not(.wp-block-button__link):not(.wp-element-button):not(.button):not([role="button"]):not([rel~="sponsored"]):not([href*="sleepbaby-20"]):not([href^="#sb-source-"]):is(
	:link,
	:visited,
	:hover,
	:focus,
	:focus-visible,
	:active
) :is(span, strong, em, b, i, small) {
	color: inherit !important;
	-webkit-text-fill-color: currentColor !important;
	text-shadow: none !important;
	opacity: 1 !important;
}

/*
 * Compatibility for the current dark native families. The generic link rule
 * above remains safe on light components because it inherits their dark local
 * foreground; only families that are explicitly dark receive light copy.
 */
body.sleepbaby-affiliate-editorial.sleepbaby-affiliate-editorial-v3106.sb-affiliate-page--article.sb-affiliate-page--article .entry-content :is(
	[data-sb-native-component*="video" i],
	[data-sb-native-component="article-specific-amazon-recommendation"],
	[data-sb-native-component="emergency-boundary"]
) {
	color: #fffefb !important;
	-webkit-text-fill-color: #fffefb !important;
}

body.sleepbaby-affiliate-editorial.sleepbaby-affiliate-editorial-v3106.sb-affiliate-page--article.sb-affiliate-page--article .entry-content :is(
	[data-sb-native-component*="video" i],
	[data-sb-native-component="article-specific-amazon-recommendation"],
	[data-sb-native-component="emergency-boundary"]
) :is(h2, h3, h4, h5, p, li, strong, em, small, span, figcaption, blockquote) {
	color: inherit !important;
	-webkit-text-fill-color: currentColor !important;
}

/*
 * Legacy authored Hatch/product cards sometimes reused plugin-owned
 * .sabb-box without the plugin's required .sabb-box__content structure. The
 * real plugin module nests its copy, so direct-child scope repairs only the
 * legacy authored shape and leaves the canonical SABB component untouched.
 */
body.sleepbaby-affiliate-editorial.sleepbaby-affiliate-editorial-v3106.sb-affiliate-page--article.sb-affiliate-page--article .entry-content .sabb-box > :is(h2, h3, h4, h5, p, ul, ol, blockquote, figcaption) {
	color: #eee8f7 !important;
	-webkit-text-fill-color: #eee8f7 !important;
}

body.sleepbaby-affiliate-editorial.sleepbaby-affiliate-editorial-v3106.sb-affiliate-page--article.sb-affiliate-page--article .entry-content .sabb-box > :is(h2, h3, h4, h5, p, ul, ol, blockquote, figcaption) :is(strong, em, b, i, small, span) {
	color: inherit !important;
	-webkit-text-fill-color: currentColor !important;
}

body.sleepbaby-affiliate-editorial.sleepbaby-affiliate-editorial-v3106.sb-affiliate-page--article.sb-affiliate-page--article .entry-content .sabb-box > .sabb-eyebrow {
	color: #f2cf84 !important;
	-webkit-text-fill-color: #f2cf84 !important;
}

body.sleepbaby-affiliate-editorial.sleepbaby-affiliate-editorial-v3106.sb-affiliate-page--article.sb-affiliate-page--article .entry-content .sabb-box > .sabb-disclosure {
	color: #d8d0e4 !important;
	-webkit-text-fill-color: #d8d0e4 !important;
}

body.sleepbaby-affiliate-editorial.sleepbaby-affiliate-editorial-v3106.sb-affiliate-page--article.sb-affiliate-page--article .entry-content .sabb-box > :is(p, ul, ol, blockquote, figcaption) a:not([rel~="sponsored"]):not([href*="sleepbaby-20"]):is(
	:link,
	:visited,
	:hover,
	:focus,
	:focus-visible,
	:active
) {
	color: #ffe2a3 !important;
	-webkit-text-fill-color: #ffe2a3 !important;
	text-decoration-color: currentColor !important;
}

/*
 * Fallback product CTA contract. SABB's canonical button and SBUA's direct
 * grid cards already own complete, verified palettes and are excluded. Every
 * other sponsored/tagged article link receives one inseparable foreground /
 * background pair across unvisited, visited, hover, focus, and active states.
 */
body.sleepbaby-affiliate-editorial.sleepbaby-affiliate-editorial-v3106.sb-affiliate-page--article.sb-affiliate-page--article .entry-content :not(.sbua-grid) > a:is(
	[rel~="sponsored"],
	[href*="sleepbaby-20"],
	[href*="amazon.com"],
	[href*="amzn.to"]
):not(.sabb-box__button):is(
	:link,
	:visited,
	:hover,
	:focus,
	:focus-visible,
	:active
) {
	display: inline-flex !important;
	box-sizing: border-box !important;
	min-height: 50px !important;
	align-items: center !important;
	justify-content: center !important;
	padding: 0.83rem 1.25rem !important;
	border: 2px solid #fffbea !important;
	border-radius: 999px !important;
	color: #171126 !important;
	-webkit-text-fill-color: #171126 !important;
	background: linear-gradient(180deg, #fff4d6 0%, #f2cf84 100%) !important;
	background-image: linear-gradient(180deg, #fff4d6 0%, #f2cf84 100%) !important;
	box-shadow: 0 8px 22px rgba(3, 2, 15, 0.23) !important;
	font-weight: 800 !important;
	line-height: 1.2 !important;
	text-align: center !important;
	text-decoration: none !important;
	text-shadow: none !important;
	mix-blend-mode: normal !important;
	opacity: 1 !important;
}

body.sleepbaby-affiliate-editorial.sleepbaby-affiliate-editorial-v3106.sb-affiliate-page--article.sb-affiliate-page--article .entry-content :not(.sbua-grid) > a:is(
	[rel~="sponsored"],
	[href*="sleepbaby-20"],
	[href*="amazon.com"],
	[href*="amzn.to"]
):not(.sabb-box__button):is(
	:link,
	:visited,
	:hover,
	:focus,
	:focus-visible,
	:active
) :is(span, strong, em, b, i, small) {
	color: #171126 !important;
	-webkit-text-fill-color: #171126 !important;
	text-shadow: none !important;
	opacity: 1 !important;
}

body.sleepbaby-affiliate-editorial.sleepbaby-affiliate-editorial-v3106.sb-affiliate-page--article.sb-affiliate-page--article .entry-content :not(.sbua-grid) > a:is(
	[rel~="sponsored"],
	[href*="sleepbaby-20"],
	[href*="amazon.com"],
	[href*="amzn.to"]
):not(.sabb-box__button):focus-visible {
	outline: 3px solid #ffffff !important;
	outline-offset: 4px !important;
	box-shadow: 0 0 0 7px rgba(127, 111, 203, 0.8) !important;
}

/*
 * The frame class used by the newer video card was absent from the old frame
 * family. Own its 16:9 geometry globally so article-body <style> blocks are no
 * longer required, and extend the same fallback to marked native video cards.
 */
body.sleepbaby-affiliate-editorial.sleepbaby-affiliate-editorial-v3106.sb-affiliate-page--article .entry-content :is(
	.sbds-video-card__frame,
	.sb-video-card__frame,
	.sleepbaby-video-card__frame,
	[data-sb-native-component*="video" i] :is(div, figure):has(> iframe[src*="youtube"]),
	[data-sb-component*="video" i] :is(div, figure):has(> iframe[src*="youtube"])
) {
	position: relative !important;
	display: block !important;
	box-sizing: border-box !important;
	width: 100% !important;
	max-width: none !important;
	height: auto !important;
	min-height: 0 !important;
	aspect-ratio: 16 / 9 !important;
	overflow: hidden !important;
	padding: 0 !important;
}

body.sleepbaby-affiliate-editorial.sleepbaby-affiliate-editorial-v3106.sb-affiliate-page--article .entry-content :is(
	.sbds-video-card__frame,
	.sb-video-card__frame,
	.sleepbaby-video-card__frame,
	[data-sb-native-component*="video" i] :is(div, figure):has(> iframe[src*="youtube"]),
	[data-sb-component*="video" i] :is(div, figure):has(> iframe[src*="youtube"])
) > :is(iframe, video) {
	position: absolute !important;
	inset: 0 !important;
	display: block !important;
	box-sizing: border-box !important;
	width: 100% !important;
	max-width: none !important;
	height: 100% !important;
	min-height: 0 !important;
	margin: 0 !important;
	border: 0 !important;
}

@media (max-width: 680px) {
	body.sleepbaby-affiliate-editorial.sleepbaby-affiliate-editorial-v3106.sb-affiliate-page--article .entry-content :not(.sbua-grid) > a:is(
		[rel~="sponsored"],
		[href*="sleepbaby-20"],
		[href*="amazon.com"],
		[href*="amzn.to"]
	):not(.sabb-box__button) {
		width: 100% !important;
	}
}

@media (forced-colors: active) {
	body.sleepbaby-affiliate-editorial.sleepbaby-affiliate-editorial-v3106.sb-affiliate-page--article .entry-content :not(.sbua-grid) > a:is(
		[rel~="sponsored"],
		[href*="sleepbaby-20"],
		[href*="amazon.com"],
		[href*="amzn.to"]
	):not(.sabb-box__button) {
		border-color: ButtonText !important;
		color: ButtonText !important;
		-webkit-text-fill-color: ButtonText !important;
		background: ButtonFace !important;
		background-image: none !important;
		box-shadow: none !important;
		forced-color-adjust: auto !important;
	}
}

/*
 * Article-owned homepage CTA recovery (1.0.15).
 *
 * The theme deliberately hides retained workshop/acquisition modules with
 * .sleepbaby-workshop-cta { display:none!important }. A governed article's
 * marked final CTA is a different surface. Restore only a direct, marked CTA
 * inside .sbds-article; unmarked legacy acquisition modules remain hidden.
 */
body.sleepbaby-affiliate-editorial.sleepbaby-affiliate-editorial-v3106.sb-affiliate-page--article.sb-affiliate-page--article .entry-content .sbds-article > :is(section, aside, div).sleepbaby-workshop-cta:is(
	[data-sb-component],
	[data-sb-cta-variant],
	[data-cta-variant],
	[data-sbds-final-cta]
) {
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
}

/*
 * The older component layer forces every workshop CTA button to a white-on-
 * teal gradient, overriding the authored cream/plum contract. Reassert the
 * sealed pair atomically in every link state, including nested text nodes.
 * #32183f on #fff3c8 has a 14.13:1 WCAG contrast ratio.
 */
body.sleepbaby-affiliate-editorial.sleepbaby-affiliate-editorial-v3106.sb-affiliate-page--article.sb-affiliate-page--article .entry-content .sbds-article > :is(section, aside, div):is(
	.sleepbaby-workshop-cta:is([data-sb-component], [data-sb-cta-variant], [data-cta-variant], [data-sbds-final-cta]),
	.sbds-final-cta[data-sb-component]
) a.sleepbaby-workshop-cta__button:is(
	:link,
	:visited,
	:hover,
	:focus,
	:focus-visible,
	:active
) {
	border-color: #fff3c8 !important;
	color: #32183f !important;
	-webkit-text-fill-color: #32183f !important;
	background: #fff3c8 !important;
	background-image: none !important;
	filter: none !important;
	mix-blend-mode: normal !important;
	opacity: 1 !important;
	text-shadow: none !important;
}

body.sleepbaby-affiliate-editorial.sleepbaby-affiliate-editorial-v3106.sb-affiliate-page--article.sb-affiliate-page--article .entry-content .sbds-article > :is(section, aside, div):is(
	.sleepbaby-workshop-cta:is([data-sb-component], [data-sb-cta-variant], [data-cta-variant], [data-sbds-final-cta]),
	.sbds-final-cta[data-sb-component]
) a.sleepbaby-workshop-cta__button:is(
	:link,
	:visited,
	:hover,
	:focus,
	:focus-visible,
	:active
) :is(span, strong, em, b, i, small) {
	color: #32183f !important;
	-webkit-text-fill-color: #32183f !important;
	text-shadow: none !important;
	opacity: 1 !important;
}

body.sleepbaby-affiliate-editorial.sleepbaby-affiliate-editorial-v3106.sb-affiliate-page--article.sb-affiliate-page--article .entry-content .sbds-article > :is(section, aside, div):is(
	.sleepbaby-workshop-cta:is([data-sb-component], [data-sb-cta-variant], [data-cta-variant], [data-sbds-final-cta]),
	.sbds-final-cta[data-sb-component]
) a.sleepbaby-workshop-cta__button:focus-visible {
	outline: 3px solid #ffffff !important;
	outline-offset: 4px !important;
}

@media (forced-colors: active) {
	body.sleepbaby-affiliate-editorial.sleepbaby-affiliate-editorial-v3106.sb-affiliate-page--article.sb-affiliate-page--article .entry-content .sbds-article > :is(section, aside, div):is(
		.sleepbaby-workshop-cta:is([data-sb-component], [data-sb-cta-variant], [data-cta-variant], [data-sbds-final-cta]),
		.sbds-final-cta[data-sb-component]
	) a.sleepbaby-workshop-cta__button {
		border-color: ButtonText !important;
		color: ButtonText !important;
		-webkit-text-fill-color: ButtonText !important;
		background: ButtonFace !important;
		background-image: none !important;
		forced-color-adjust: auto !important;
	}
}
