/*
 * EP Announcement Bar
 * Eternal Promises Church palette: charcoal #222b2d, blue-green #1db9d6.
 * Override the custom properties in the theme if the palette changes.
 */
.epab {
	--epab-charcoal: #222b2d;
	--epab-bluegreen: #1db9d6;
	--epab-urgent: #a4161a;
	--epab-font-size: 15px;
	--epab-max-width: 1200px;
	--epab-z: 9990;
}

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

/* ---- Position ------------------------------------------------------------ */

.epab {
	position: relative;
	z-index: var(--epab-z);
	box-sizing: border-box;
	width: 100%;
	font-size: var(--epab-font-size);
	line-height: 1.35;
	-webkit-font-smoothing: antialiased;
}

/* Bottom: fixed to the bottom of the screen, always visible. */
.epab--bottom {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.18);
	padding-bottom: env(safe-area-inset-bottom, 0); /* iPhone home bar */
}

/* The page gets matching bottom padding so the bar never covers the footer. */
html.epab-has-bottom body {
	padding-bottom: var(--epab-height, 56px) !important;
}

/* Salient's back-to-top button sits above the bar instead of under it. */
html.epab-has-bottom #to-top {
	bottom: calc(var(--epab-height, 56px) + 17px) !important;
}

/* ---- Layout: one compact line (about 56px; 80px max) ---------------------- */

.epab__inner {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.875rem 1.25rem;
	box-sizing: border-box;
	max-width: var(--epab-max-width);
	min-height: 52px;
	max-height: 80px;
	margin: 0 auto;
	padding: 8px 16px;
	overflow: hidden;
}

.epab__icon {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: #fff;
	color: var(--epab-urgent);
	font-size: 14px;
	font-weight: 800;
	line-height: 1;
}

.epab__message {
	flex: 0 1 auto;
	min-width: 0;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.epab__link {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 6px;
	padding: 7px 14px;
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
	transition: filter 0.15s ease;
}

.epab__link:hover {
	filter: brightness(1.08);
}

.epab__close {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	margin-left: auto;
	cursor: pointer;
	font-size: 22px;
	line-height: 1;
	opacity: 0.8;
}

.epab__close:hover {
	opacity: 1;
}

/* The message centers; the close button stays at the far right. */
.epab__inner > .epab__close {
	position: absolute;
	right: 12px;
}

.epab__inner {
	position: relative;
	padding-right: 52px;
	padding-left: 52px;
}

/* ---- Colors --------------------------------------------------------------- */

.epab--charcoal {
	background: var(--epab-charcoal);
	color: #fff;
}

.epab--charcoal .epab__link {
	background: var(--epab-bluegreen);
	color: var(--epab-charcoal);
}

.epab--bluegreen {
	background: var(--epab-bluegreen);
	color: var(--epab-charcoal);
}

.epab--bluegreen .epab__link {
	background: var(--epab-charcoal);
	color: #fff;
}

.epab--urgent {
	background: var(--epab-urgent);
	color: #fff;
	font-weight: 600;
}

.epab--urgent .epab__link {
	background: #fff;
	color: var(--epab-urgent);
}

.epab__link:focus-visible,
.epab__close:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* ---- Phones ---------------------------------------------------------------- */

@media (max-width: 640px) {
	.epab {
		--epab-font-size: 14px;
	}
	.epab__inner {
		justify-content: flex-start;
		gap: 10px;
		padding: 8px 48px 8px 14px;
	}
	.epab__link {
		padding: 6px 10px;
	}
	.epab__arrow {
		display: none;
	}
	.epab__inner > .epab__close {
		right: 6px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.epab__link {
		transition: none;
	}
}

@media print {
	.epab {
		display: none !important;
	}
	html.epab-has-bottom body {
		padding-bottom: 0 !important;
	}
}

/* ---------------------------------------------------------------------------
 * Theme shield: Salient and similar themes style every p, a, and button
 * globally (big padding, uppercase, borders). The ID selector wins.
 * ------------------------------------------------------------------------ */

#epab,
#epab *,
.epab-admin-preview .epab,
.epab-admin-preview .epab * {
	box-sizing: border-box;
	font-family: inherit;
	letter-spacing: normal !important;
	text-transform: none !important;
	text-shadow: none !important;
}

#epab .epab__message,
.epab-admin-preview .epab__message {
	margin: 0 !important;
	padding: 0 !important;
	color: inherit !important;
	font-size: var(--epab-font-size) !important;
	line-height: 1.35 !important;
	font-weight: inherit;
	text-align: center;
}

#epab .epab__link,
.epab-admin-preview .epab__link {
	margin: 0 !important;
	padding: 7px 14px !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	font-size: 14px !important;
	line-height: 1.2 !important;
	text-decoration: none !important;
}

#epab.epab--charcoal .epab__link { background: var(--epab-bluegreen) !important; color: var(--epab-charcoal) !important; }
#epab.epab--bluegreen .epab__link { background: var(--epab-charcoal) !important; color: #fff !important; }
#epab.epab--urgent .epab__link { background: #fff !important; color: var(--epab-urgent) !important; }

#epab .epab__close,
.epab-admin-preview .epab__close {
	width: 32px !important;
	height: 32px !important;
	min-width: 0 !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	color: inherit !important;
	font-size: 22px !important;
	line-height: 1 !important;
}

@media (max-width: 640px) {
	#epab .epab__message {
		text-align: left;
	}
	#epab .epab__link {
		padding: 6px 10px !important;
		font-size: 13px !important;
	}
}
