/* =============================================================
   CHE — Announcement bar  ·  [che_announcement_bar]
   Fixed to the top of the window. The page moves down by the
   bar's height, which js/announcement-bar.js keeps exact if the
   words wrap.

   Selectors start from #che-bar so they outrank the Hello theme
   and the Elementor kit, which restyle every button and link.
   ============================================================= */

:root {
	--che-bar-h: 52px;
}

body:has(#che-bar:not([hidden])) {
	padding-top: var(--che-bar-h);
}

html:has(#che-bar:not([hidden])) {
	scroll-padding-top: var(--che-bar-h);
}

/* The bar is fixed, so its own Elementor section has nothing to hold open. */
.elementor-section:has(#che-bar),
.elementor-column:has(#che-bar),
.elementor-widget-wrap:has(#che-bar),
.elementor-widget:has(#che-bar),
.e-con:has(#che-bar) {
	min-height: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	padding: 0 !important;
}

#che-bar {
	--che-bar-bg: #33502c;
	--che-bar-accent: #8cb164;

	position: fixed;
	top: 0;
	right: 0;
	left: 0;
	z-index: 900; /* below the mobile menu (1000), popups and the cookie banner */
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-height: var(--che-bar-h);
	padding: 8px 56px;
	background: var(--che-bar-bg);
	color: #fff;
	font-family: "Montserrat", sans-serif;
	box-shadow: 0 2px 12px rgba(30, 45, 25, .22);
}

#che-bar[hidden] {
	display: none;
}

#che-bar *,
#che-bar *::before,
#che-bar *::after {
	box-sizing: border-box;
}

body.admin-bar #che-bar {
	top: 32px;
}

/* ---------- message ---------- */

#che-bar .che-bar__inner {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	width: 100%;
	max-width: 1350px;
}

#che-bar .che-bar__pulse {
	position: relative;
	flex: none;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--che-bar-accent);
}

#che-bar .che-bar__pulse::after {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	border-radius: 50%;
	background: var(--che-bar-accent);
	animation: che-bar-pulse 2s ease-out infinite;
}

@keyframes che-bar-pulse {
	from {
		opacity: .7;
		transform: scale(1);
	}

	to {
		opacity: 0;
		transform: scale(2.8);
	}
}

#che-bar .che-bar__msg {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}

#che-bar .che-bar__title {
	min-width: 0;
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.25;
}

#che-bar .che-bar__detail {
	display: flex;
	flex: none;
	align-items: center;
	gap: 16px;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.25;
	white-space: nowrap;
}

#che-bar .che-bar__text-short {
	display: none;
}

#che-bar .che-bar__count {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 30px;
	padding: 0 13px 0 5px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .14);
	font-size: 13px;
	font-weight: 600;
}

#che-bar .che-bar__count[hidden] {
	display: none;
}

#che-bar .che-bar__count b {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 30px;
	height: 22px;
	padding: 0 7px;
	border-radius: 999px;
	background: #fff;
	color: var(--che-bar-bg);
	font-size: 13px;
	font-weight: 800;
	line-height: 1;
}

/* ---------- button ---------- */

#che-bar .che-bar__cta,
#che-bar .che-bar__cta:hover,
#che-bar .che-bar__cta:focus,
#che-bar .che-bar__cta:active,
#che-bar .che-bar__cta:visited {
	color: var(--che-bar-bg);
	text-decoration: none;
}

#che-bar .che-bar__cta {
	display: inline-flex;
	flex: none;
	align-items: center;
	gap: 8px;
	height: 36px;
	padding: 0 16px 0 18px;
	border-radius: 999px;
	background: #fff;
	font-family: inherit;
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
	white-space: nowrap;
}

/* The whole bar is the link; the close button sits above this. */
#che-bar .che-bar__cta::after {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
}

#che-bar .che-bar__cta:focus-visible {
	outline: 3px solid var(--che-bar-accent);
	outline-offset: 2px;
}

#che-bar .che-bar__arrow {
	display: block;
	flex: none;
	transition: transform .2s ease;
}

@media (hover: hover) {
	#che-bar:hover .che-bar__arrow {
		transform: translateX(3px);
	}
}

/* ---------- close ---------- */

#che-bar .che-bar__close,
#che-bar .che-bar__close:hover,
#che-bar .che-bar__close:focus,
#che-bar .che-bar__close:active {
	color: #fff;
	text-decoration: none;
	box-shadow: none;
}

#che-bar .che-bar__close {
	position: absolute;
	top: 50%;
	right: 12px;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	margin: -16px 0 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	font-size: 0;
	line-height: 0;
	cursor: pointer;
	transition: background-color .15s ease;
}

#che-bar .che-bar__close:hover {
	background: rgba(255, 255, 255, .16);
}

#che-bar .che-bar__close:focus {
	background: transparent;
}

#che-bar .che-bar__close:focus-visible {
	outline: 3px solid var(--che-bar-accent);
	outline-offset: 0;
}

#che-bar .che-bar__close svg {
	display: block;
}

/* ---------- tablet ---------- */

@media (max-width: 1024px) {
	#che-bar {
		padding: 8px 48px 8px 16px;
	}

	#che-bar .che-bar__text {
		display: none;
	}

	#che-bar .che-bar__text-short {
		display: inline;
	}
}

@media (max-width: 782px) {
	body.admin-bar #che-bar {
		top: 46px;
	}
}

/* ---------- phone ---------- */

@media (max-width: 767px) {
	:root {
		--che-bar-h: 58px;
	}

	#che-bar {
		padding: 7px 42px 7px 14px;
	}

	#che-bar .che-bar__inner {
		justify-content: space-between;
		gap: 10px;
	}

	#che-bar .che-bar__pulse {
		display: none;
	}

	#che-bar .che-bar__msg {
		display: block;
		flex: 1 1 auto;
	}

	#che-bar .che-bar__title {
		display: block;
		font-size: 14px;
		white-space: normal;
	}

	#che-bar .che-bar__detail {
		flex-wrap: wrap;
		flex: 0 1 auto;
		gap: 0;
		margin-top: 3px;
		font-size: 12px;
		white-space: normal;
	}

	/* The countdown drops its pill and reads as part of the line. */
	#che-bar .che-bar__count {
		gap: 3px;
		height: auto;
		padding: 0;
		background: none;
		font-size: 12px;
		font-weight: 700;
	}

	#che-bar .che-bar__count::before {
		content: "·";
		margin: 0 5px;
		font-weight: 500;
	}

	#che-bar .che-bar__count b {
		min-width: 0;
		height: auto;
		padding: 0;
		background: none;
		color: inherit;
		font-size: 12px;
		font-weight: 800;
	}

	#che-bar .che-bar__cta {
		height: 34px;
		padding: 0 14px;
		font-size: 13px;
	}

	#che-bar .che-bar__arrow {
		display: none;
	}

	#che-bar .che-bar__close {
		right: 5px;
	}
}

/* The smallest phones drop the date so the bar stays two lines tall. */
@media (max-width: 359px) {
	#che-bar .che-bar__title {
		font-size: 13px;
	}

	#che-bar .che-bar__text-short {
		display: none;
	}

	#che-bar .che-bar__count::before {
		display: none;
	}

	#che-bar .che-bar__cta {
		padding: 0 12px;
	}
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
	#che-bar .che-bar__pulse::after {
		animation: none;
		opacity: 0;
	}

	#che-bar .che-bar__arrow,
	#che-bar .che-bar__close {
		transition: none;
	}
}
