/**
 * Sunday Live Banner
 * Riverwood Church design system: Raisin #141A1D, Riverwood Blue #83A8BC,
 * Driftwood #F4F1ED, live red #BC0000. Montserrat is already loaded globally.
 */

:root {
	/* Updated at runtime by JS to the bar's real measured height. */
	--slb-height: 46px;
}

/*
 * Keep the fixed bar off the footer (which is a <section>, not a <footer>).
 * High specificity + !important because at least one Breakdance page stylesheet
 * sets a `padding` shorthand on body and would otherwise erase the clearance.
 */
html body.slb-has-banner {
	padding-bottom: calc( var( --slb-height, 46px ) + env( safe-area-inset-bottom, 0px ) ) !important;
}

.slb {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 9000; /* above page content, below Breakdance popups/modals (10000+) */
	background: #141a1d;
	border-top: 1px solid #83a8bc;
	padding-bottom: env( safe-area-inset-bottom, 0px );
	box-shadow: 0 -10px 30px -22px rgba( 20, 26, 29, 0.75 );
	font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	-webkit-font-smoothing: antialiased;
}

/* Live state: the hairline turns red. */
.slb[data-slb-state="live"] {
	border-top-color: #bc0000;
}

.slb__link,
.slb__link:visited {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 6px 12px;
	min-height: 46px;
	padding: 9px 18px;
	text-align: center;
	text-decoration: none;
	color: #f4f1ed;
	transition: background-color 300ms ease;
}

.slb__link[hidden] {
	display: none !important;
}

.slb__link:hover,
.slb__link:focus-visible {
	background-color: rgba( 131, 168, 188, 0.12 );
	text-decoration: none;
	color: #ffffff;
}

.slb__link:focus-visible {
	outline: 2px solid #83a8bc;
	outline-offset: -3px;
}

.slb__text {
	font-size: 13px;
	font-weight: 400;
	line-height: 1.3;
	letter-spacing: 0.01em;
	color: #f4f1ed;
}

.slb__cta {
	position: relative;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #83a8bc;
}

.slb__link--live .slb__cta {
	color: #ffffff;
}

/* Thin separator between message and CTA (desktop only — it wraps on phones). */
.slb__cta::before {
	content: "";
	position: absolute;
	left: -7px;
	top: 50%;
	width: 1px;
	height: 12px;
	margin-top: -6px;
	background: rgba( 244, 241, 237, 0.28 );
}

.slb__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	color: #83a8bc;
}

.slb__icon--play svg {
	display: block;
}

/* Live "recording" dot. */
.slb__icon--dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: #bc0000;
	box-shadow: 0 0 0 0 rgba( 188, 0, 0, 0.6 );
	animation: slb-pulse 2s ease-out infinite;
}

@keyframes slb-pulse {
	0%   { box-shadow: 0 0 0 0 rgba( 188, 0, 0, 0.55 ); }
	70%  { box-shadow: 0 0 0 9px rgba( 188, 0, 0, 0 ); }
	100% { box-shadow: 0 0 0 0 rgba( 188, 0, 0, 0 ); }
}

/* Red "LIVE NOW" chip — white on #BC0000 clears AA. */
.slb__badge {
	display: inline-block;
	padding: 3px 9px 2px;
	border-radius: 100px;
	background: #bc0000;
	color: #ffffff;
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	white-space: nowrap;
}

/* ------------------------------------------- header nav "Online Gathering" */

/*
 * Outside the live window the link is left completely alone — it inherits the
 * header's own menu styling. Inside it, the label swaps and the text turns red.
 *
 * #BC0000 on the header's #F3EFE9 background is 5.8:1 (AA for normal text), and
 * 6.4:1 on the white mobile menu.
 *
 * !important is needed to out-rank Breakdance's generated header rules, which
 * set the link colour (and its hover colour) at a higher specificity from
 * uploads/breakdance/css/post-15879.css.
 */
.slb-nav__label[hidden] {
	display: none !important;
}

.slb-nav-link[data-slb-state="live"],
.slb-nav-link[data-slb-state="live"]:hover,
.slb-nav-link[data-slb-state="live"]:focus,
.breakdance-menu-item:hover > .slb-nav-link[data-slb-state="live"],
.breakdance-menu-item:hover .slb-nav-link[data-slb-state="live"] {
	color: #bc0000 !important;
}

/* ---------------------------------------------------------------- phones */
@media ( max-width: 600px ) {
	:root {
		--slb-height: 56px;
	}

	.slb__link {
		gap: 3px 10px;
		padding: 8px 14px;
		flex-direction: column;
	}

	.slb__icon {
		display: none;
	}

	.slb__link--live .slb__icon--dot {
		display: inline-flex;
	}

	.slb__text {
		font-size: 12px;
	}

	.slb__cta {
		font-size: 10px;
		letter-spacing: 0.1em;
	}

	.slb__cta::before {
		display: none;
	}

	/* Put the live dot inline with the badge rather than on its own row. */
	.slb__link--live {
		flex-direction: row;
		flex-wrap: wrap;
	}
}

/* ------------------------------------------------------ a11y and print */
@media ( prefers-reduced-motion: reduce ) {
	.slb__icon--dot {
		animation: none;
	}

	.slb__link {
		transition: none;
	}
}

@media print {
	.slb {
		display: none !important;
	}

	html body.slb-has-banner {
		padding-bottom: 0 !important;
	}
}
