/*
 * SleepBaby.org 2.5.7 homepage interaction hardening.
 *
 * This late, cache-safe layer preserves the 2.5.6 visual reset while making
 * the two horizontal navigation systems and small editorial links complete,
 * touch-safe controls at every supported narrow width.
 */

body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-home-masthead__logo {
	min-width: 44px !important;
	min-height: 48px !important;
	align-items: center;
	justify-content: center;
}

body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor :is(
	.sb-home-reasons__list,
	.sb-home-reasons__source-note
) a[href] {
	display: inline-flex !important;
	min-width: 44px;
	min-height: 44px !important;
	align-items: center;
	justify-content: center;
	margin-inline: -4px;
	padding-inline: 4px !important;
	border-radius: 6px;
	vertical-align: middle;
}

/*
 * At tablet size and below, the masthead becomes two complete rows. This
 * prevents the three primary destinations from being squeezed behind the
 * logo while retaining the same information hierarchy and labels.
 */
@media (max-width: 768px) {
	body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-home-masthead,
	body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-home-masthead.is-compact {
		width: calc(100% - 16px) !important;
		min-height: 0 !important;
		grid-template-columns: minmax(0, 1fr) !important;
		gap: 6px !important;
		margin: 8px auto 10px !important;
		padding: 8px !important;
		overflow: visible !important;
		border-radius: 14px !important;
	}

	body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-home-masthead__logo {
		width: min(210px, calc(100% - 24px)) !important;
		min-height: 48px !important;
		justify-self: center !important;
	}

	body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-home-masthead__logo img,
	body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-home-masthead.is-compact .sb-home-masthead__logo img {
		width: min(188px, 100%) !important;
		max-height: 44px !important;
		object-fit: contain;
	}

	body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-home-masthead__nav {
		display: grid !important;
		width: 100%;
		min-width: 0;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 4px !important;
	}

	body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-home-masthead__nav a {
		width: 100%;
		min-width: 0 !important;
		min-height: 48px !important;
		padding: 7px 6px !important;
		font-size: clamp(13.5px, 3.8vw, 15px) !important;
		line-height: 1.12 !important;
		text-align: center;
		white-space: normal;
	}

	/*
	 * The chapter rail keeps horizontal momentum scrolling, but no longer
	 * masks or clips the edge of a control. The persistent scrollbar and full
	 * first/last padding make the interaction explicit without adding copy.
	 */
	body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-home-chapters {
		display: grid !important;
		position: sticky;
		top: 4px;
		width: calc(100% - 16px) !important;
		grid-template-columns: minmax(0, 1fr);
		gap: 6px !important;
		margin: 0 auto 14px !important;
		padding: 6px !important;
		overflow: visible !important;
		border-radius: 13px !important;
	}

	body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-home-chapters__label {
		width: 100%;
		min-height: 44px !important;
		justify-content: center;
		padding-inline: 12px !important;
		font-size: 12px !important;
		letter-spacing: .065em !important;
	}

	body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-home-chapters ul {
		display: flex !important;
		width: 100%;
		min-width: 0;
		max-width: 100%;
		flex-wrap: nowrap !important;
		gap: 5px !important;
		margin: 0 !important;
		padding: 0 2px 8px !important;
		overflow-x: auto !important;
		overflow-y: hidden !important;
		overscroll-behavior-inline: contain;
		scroll-padding-inline: 2px;
		scroll-snap-type: inline proximity;
		scrollbar-color: #725d7d #eee8f0;
		scrollbar-gutter: auto;
		scrollbar-width: auto;
		touch-action: pan-x;
		-webkit-mask-image: none !important;
		mask-image: none !important;
		-webkit-overflow-scrolling: touch;
	}

	body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-home-chapters ul::-webkit-scrollbar {
		height: 9px;
	}

	body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-home-chapters ul::-webkit-scrollbar-track {
		border-radius: 999px;
		background: #eee8f0;
	}

	body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-home-chapters ul::-webkit-scrollbar-thumb {
		border: 2px solid #eee8f0;
		border-radius: 999px;
		background: #725d7d;
	}

	body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-home-chapters li {
		width: auto !important;
		min-width: 0 !important;
		max-width: none !important;
		flex: 0 0 calc((100% - 10px) / 3) !important;
		scroll-snap-align: start;
	}

	body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-home-chapters a {
		width: 100%;
		min-height: 52px !important;
		padding: 8px 6px !important;
		font-size: 14px !important;
		line-height: 1.12 !important;
		text-align: center;
		white-space: normal;
	}
}

@media (max-width: 320px) {
	body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-home-masthead__nav a {
		padding-inline: 4px !important;
		font-size: 13.5px !important;
	}

	body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-home-chapters li {
		flex-basis: calc((100% - 5px) / 2) !important;
	}
}

@media (forced-colors: active) {
	body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor :is(
		.sb-home-masthead__nav a,
		.sb-home-chapters a,
		.sb-home-reasons__list a,
		.sb-home-reasons__source-note a
	) {
		border: 1px solid ButtonText !important;
	}
}

/*
 * Assisted article arrivals receive a deliberate first-screen handoff rather
 * than the compact cold-traffic card. The query/session journey gate is set
 * in conversion-v257.js; direct homepage traffic keeps the proven v2.5.6
 * hero and home_hero_guided_scroll treatment unchanged.
 */
body.sb-home-precovid-2019.sleepbaby-homepage.sb-cro-assisted-continuity-active #tve_editor [data-css="tve-u-169e7153da2"] {
	grid-template-columns: minmax(0, 1fr) !important;
	align-items: start !important;
	gap: clamp(22px, 3vw, 34px) !important;
}

body.sb-home-precovid-2019.sleepbaby-homepage.sb-cro-assisted-continuity-active #tve_editor h1[data-css="tve-u-15ddcf2d07a"] {
	max-width: 16ch !important;
}

body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck,
body.sb-home-precovid-2019.sleepbaby-homepage.sb-cro-variant--april #tve_editor .sb-assisted-continuity-deck {
	display: grid !important;
	position: relative;
	width: 100% !important;
	max-width: none !important;
	grid-column: 1 / -1;
	grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
	grid-template-areas:
		"eyebrow eyebrow"
		"title actions"
		"copy actions"
		"path path"
		"proof proof";
	align-items: center;
	justify-self: stretch !important;
	gap: 14px clamp(24px, 4vw, 54px) !important;
	margin: 0 !important;
	padding: clamp(24px, 4vw, 46px) !important;
	overflow: hidden;
	border: 1px solid rgba(255, 255, 255, .78) !important;
	border-radius: clamp(22px, 3vw, 34px) !important;
	background:
		radial-gradient(circle at 97% 8%, rgba(198, 244, 225, .70), transparent 17rem),
		radial-gradient(circle at 3% 100%, rgba(238, 206, 242, .62), transparent 19rem),
		linear-gradient(135deg, #fffdfa 0%, #faf4fc 52%, #f0fbf7 100%) !important;
	background-color: #fffdfa !important;
	box-shadow: 0 28px 68px rgba(12, 7, 24, .32), inset 0 1px rgba(255, 255, 255, .98) !important;
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
}

body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck::before {
	position: absolute;
	top: 0;
	right: 0;
	left: 0;
	height: 6px;
	background: linear-gradient(90deg, #8d64a2, #76c5a4 54%, #e39caf);
	content: "";
}

body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck .sb-cro-hero-module__eyebrow {
	grid-area: eyebrow;
	margin: 0 !important;
	color: #5a3169 !important;
	-webkit-text-fill-color: #5a3169 !important;
	font-size: clamp(14px, 1.6vw, 17px) !important;
	letter-spacing: .1em !important;
}

body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck__title {
	grid-area: title;
	margin: 0 !important;
	color: #2f163a !important;
	-webkit-text-fill-color: #2f163a !important;
	font-family: "Times New Roman", Times, serif !important;
	font-size: clamp(34px, 3.7vw, 52px) !important;
	font-weight: 700 !important;
	line-height: .98 !important;
	letter-spacing: -.035em !important;
	text-align: left !important;
}

body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck__copy {
	grid-area: copy;
	max-width: 48ch;
	margin: 0 !important;
	color: #382a3e !important;
	-webkit-text-fill-color: #382a3e !important;
	font-family: "Times New Roman", Times, serif !important;
	font-size: clamp(18px, 2vw, 22px) !important;
	line-height: 1.4 !important;
	text-align: left !important;
}

body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck__path {
	display: grid !important;
	grid-area: path;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 8px;
	margin: 2px 0 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck__path li {
	display: flex !important;
	min-width: 0;
	min-height: 56px;
	align-items: center;
	gap: 8px;
	margin: 0 !important;
	padding: 8px 10px !important;
	border: 1px solid #cdbfd2;
	border-radius: 13px;
	color: #392541 !important;
	-webkit-text-fill-color: #392541 !important;
	background: rgba(255, 253, 250, .88);
	font-size: clamp(14px, 1.5vw, 17px) !important;
	font-weight: 700 !important;
	line-height: 1.12 !important;
}

body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck__path li span {
	display: inline-flex;
	width: 28px;
	height: 28px;
	flex: 0 0 28px;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	color: #2f163a !important;
	-webkit-text-fill-color: #2f163a !important;
	background: #d9f3e7;
	font-size: 15px !important;
	font-weight: 700 !important;
}

body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck__actions {
	display: grid;
	grid-area: actions;
	width: 100%;
	gap: 10px;
	padding: clamp(14px, 2.4vw, 24px);
	border: 1px solid #d1c3d7;
	border-radius: 20px;
	background: rgba(255, 253, 250, .88);
	box-shadow: 0 16px 34px rgba(61, 36, 72, .12);
}

body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck__actions .sb-cro-cta,
body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck__actions .sb-cro-hero-module__guided {
	width: 100% !important;
	min-height: 58px !important;
	margin: 0 !important;
	border-radius: 15px !important;
}

body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck__actions a.sb-cro-cta,
body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck__actions a.sb-cro-cta:visited,
body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck__actions a.sb-cro-cta:hover,
body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck__actions a.sb-cro-cta:active,
body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck__actions a.sb-cro-cta:focus-visible,
body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck__actions a.sb-cro-cta :is(span, strong, em) {
	color: #2f163a !important;
	-webkit-text-fill-color: #2f163a !important;
	opacity: 1 !important;
}

body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck__actions a.sb-cro-cta,
body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck__actions a.sb-cro-cta:visited,
body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck__actions a.sb-cro-cta:hover,
body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck__actions a.sb-cro-cta:active,
body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck__actions a.sb-cro-cta:focus-visible {
	border-color: #4e9273 !important;
	background: linear-gradient(135deg, #c8f5df, #aee9ca) !important;
	background-color: #c8f5df !important;
	box-shadow: 0 13px 26px rgba(56, 118, 88, .20), inset 0 1px rgba(255, 255, 255, .92) !important;
	font-size: clamp(19px, 2vw, 22px) !important;
}

/* The v2.4.7 contrast lock is deliberately stateful and highly specific.
 * Match that cascade here so both assisted labels stay deep plum on mint in
 * every normal interaction state; the later forced-colors rule still maps
 * these same descendants to LinkText. */
body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck.sb-cro-hero-module .sb-assisted-continuity-deck__actions a.sb-cro-cta:is(:link, :visited, :hover, :focus-visible, :active, [aria-disabled="true"], .is-disabled) :is(span, strong, em, b, i) {
	color: #2f163a !important;
	-webkit-text-fill-color: #2f163a !important;
	opacity: 1 !important;
	text-shadow: none !important;
}

body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck .sb-cro-hero-module__proof {
	grid-area: proof;
	margin-top: 6px !important;
}

@media (max-width: 768px) {
	body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck,
	body.sb-home-precovid-2019.sleepbaby-homepage.sb-cro-variant--april #tve_editor .sb-assisted-continuity-deck {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas:
			"eyebrow"
			"title"
			"copy"
			"path"
			"actions"
			"proof";
		gap: 13px !important;
	}

	body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck__actions {
		padding: 12px;
	}
}

@media (max-width: 520px) {
	body.sb-home-precovid-2019.sleepbaby-homepage.sb-cro-assisted-continuity-active #tve_editor [data-css="tve-u-169e7153da2"] {
		width: calc(100% - 12px) !important;
		padding: 28px 14px !important;
		border-radius: 22px !important;
	}

	body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck,
	body.sb-home-precovid-2019.sleepbaby-homepage.sb-cro-variant--april #tve_editor .sb-assisted-continuity-deck {
		padding: 22px 15px !important;
		border-radius: 19px !important;
	}

	body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck__path {
		grid-template-columns: minmax(0, 1fr);
	}

	body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck__path li {
		min-height: 48px;
	}
}

@media (prefers-reduced-motion: reduce) {
	body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck,
	body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck * {
		scroll-behavior: auto !important;
		transition-duration: .01ms !important;
		animation: none !important;
	}
}

@media (forced-colors: active) {
	body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck,
	body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck__actions,
	body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck__path li {
		border: 1px solid CanvasText !important;
		background: Canvas !important;
		box-shadow: none !important;
	}

	body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck,
	body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck .sb-cro-hero-module__eyebrow,
	body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck .sb-assisted-continuity-deck__title,
	body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck .sb-assisted-continuity-deck__copy,
	body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck .sb-assisted-continuity-deck__path,
	body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck .sb-assisted-continuity-deck__path li,
	body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck .sb-assisted-continuity-deck__path li span,
	body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck .sb-cro-hero-module__proof,
	body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck .sb-cro-hero-module__proof li {
		color: CanvasText !important;
		-webkit-text-fill-color: CanvasText !important;
	}

	body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck__actions a.sb-cro-cta,
	body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck__actions a.sb-cro-cta :is(span, strong, em),
	body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck__actions a.sb-cro-hero-module__guided,
	body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck__actions a.sb-cro-hero-module__guided :is(span, strong, em) {
		color: LinkText !important;
		-webkit-text-fill-color: LinkText !important;
		border-color: LinkText !important;
		forced-color-adjust: auto !important;
	}

	/* Match the older release's stateful CTA specificity so its normal-mode
	 * white WebKit fill cannot survive Chromium's dark forced-colors palette. */
	body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck.sb-cro-hero-module .sb-assisted-continuity-deck__actions a.sb-cro-cta:is(:link, :visited, :hover, :focus-visible, :active, [aria-disabled="true"], .is-disabled),
	body.sb-home-precovid-2019.sleepbaby-homepage #tve_editor .sb-assisted-continuity-deck.sb-cro-hero-module .sb-assisted-continuity-deck__actions a.sb-cro-cta:is(:link, :visited, :hover, :focus-visible, :active, [aria-disabled="true"], .is-disabled) :is(span, strong, em, b, i) {
		color: LinkText !important;
		-webkit-text-fill-color: LinkText !important;
		border-color: LinkText !important;
		forced-color-adjust: auto !important;
	}
}
