/*
 * All styling for the announcement bar lives here. Every rule is scoped
 * under .openit-announcement-bar and resets its own box model / button
 * appearance so nothing here depends on the active theme's style.css.
 * Source Sans 3 is already self-hosted via @font-face in the astra-child
 * theme's style.css, which is enqueued site-wide, so no extra font
 * loading is needed here.
 */

.openit-announcement-bar,
.openit-announcement-bar *,
.openit-announcement-bar *::before,
.openit-announcement-bar *::after {
	box-sizing: border-box;
}

.openit-announcement-bar {
	background: #D63E4F;
	width: 100%;
	height: 70px;
	position: relative;
	z-index: 1;
	font-family: "Source Sans 3", "Source Sans Pro", sans-serif;
	text-transform: uppercase;
}

.openit-announcement-inner {
	display: flex;
	align-items: center;
	gap: 16px;
	height: 100%;
	padding: 12px 24px;
}

.openit-announcement-close {
	flex: 0 0 auto;
	appearance: none;
	-webkit-appearance: none;
	margin: 0;
	background: transparent;
	border: none;
	border-radius: 0;
	color: #fff;
	font-family: inherit;
	font-size: 1.6rem !important;
	line-height: 1;
	cursor: pointer;
	padding: 4px;
}

button.openit-announcement-close {
	background-color: unset !important;
}

.openit-announcement-content {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 24px;
	overflow: hidden;
}

.openit-announcement-marquee {
	flex: 0 1 auto;
	min-width: 0;
	display: flex;
	align-items: center;
}

.openit-announcement-text {
	display: inline-block;
	color: #FFFFFF;
	font-size: 1rem;
	line-height: 1rem;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
}

a.openit-announcement-text:hover {
	color: #FFF !important;
}

.openit-announcement-cta {
	flex: 0 1 auto;
	display: inline-block;
	background: #FFFFFF;
	color: #CD172D;
	font-size: 1rem;
	line-height: 1rem;
	font-weight: 600;
	padding: 8px 16px;
	border-radius: 8px;
	text-decoration: none;
	white-space: nowrap;
	max-width: 50%;
	overflow: hidden;
	text-overflow: ellipsis;
}

.openit-announcement-cta:hover {
	background: #FAFAFA;
}

/* Mobile: fixed 70px height stays, long text scrolls via marquee instead of wrapping/clipping. */
@media (max-width: 600px) {
	.openit-announcement-inner {
		padding: 12px 16px;
	}

	.openit-announcement-bar.openit-marquee-active .openit-announcement-content {
		justify-content: flex-start;
	}

	.openit-announcement-bar.openit-marquee-active .openit-announcement-marquee {
		flex: 0 0 auto;
		width: max-content;
		animation: openit-marquee-scroll var(--openit-marquee-duration, 12s) linear infinite;
	}

	.openit-announcement-bar.openit-marquee-active .openit-announcement-text {
		overflow: visible;
		text-overflow: initial;
		margin-right: 32px;
	}

	/* Long scrolling text and a static CTA don't fit the same row on mobile. */
	.openit-announcement-bar.openit-marquee-active .openit-announcement-cta {
		display: none;
	}
}

@keyframes openit-marquee-scroll {
	from {
		transform: translateX(0);
	}

	to {
		transform: translateX(-50%);
	}
}
