/**
 * Announcement bar styles.
 *
 * Every rule is scoped to the .mtb-bar element so themes and other plugins stay untouched.
 */

.mtb-bar {
	background: var( --mtb-bg, #0f172a );
	color: var( --mtb-color, #ffffff );
	box-sizing: border-box;
	width: 100%;
	font-size: 15px;
	line-height: 1.6;
	z-index: 99990;
}

.mtb-bar--fixed {
	position: fixed;
	top: var( --mtb-top, 0px );
	inset-inline: 0;
}

.mtb-bar[hidden] {
	display: none;
}

.mtb-bar__inner {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	max-width: var( --mtb-max-width, 1200px );
	margin: 0 auto;
	padding: 10px 20px;
}

.mtb-bar__content {
	flex: 1 1 auto;
	min-width: 0;
}

.mtb-bar__content > :first-child {
	margin-top: 0;
}

.mtb-bar__content > :last-child {
	margin-bottom: 0;
}

.mtb-bar__content a {
	color: inherit;
	text-decoration: underline;
}

.mtb-bar__timer {
	direction: ltr;
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
}

/* Text alternative of the countdown, exposed to assistive technology only. */
.mtb-bar .mtb-sr {
	border: 0;
	clip-path: inset( 50% );
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

.mtb-unit {
	background: var( --mtb-timer-bg, #1e293b );
	color: var( --mtb-timer-color, #ffffff );
	border-radius: 8px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-width: 46px;
	padding: 4px 8px;
}

.mtb-unit__value {
	font-size: 17px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	line-height: 1.2;
}

.mtb-unit__label {
	font-size: 10px;
	line-height: 1.4;
	opacity: 0.75;
}

/* Compact layout: digits only, separated by colons. */
.mtb-bar--compact .mtb-bar__timer {
	background: var( --mtb-timer-bg, #1e293b );
	color: var( --mtb-timer-color, #ffffff );
	border-radius: 8px;
	gap: 0;
	padding: 4px 10px;
}

.mtb-bar--compact .mtb-unit {
	background: none;
	border-radius: 0;
	flex-direction: row;
	min-width: 0;
	padding: 0;
}

.mtb-bar--compact .mtb-unit__label {
	display: none;
}

.mtb-bar--compact .mtb-unit + .mtb-unit::before {
	content: ":";
	opacity: 0.6;
	padding: 0 3px;
}

.mtb-bar--no-days .mtb-unit--days {
	display: none;
}

.mtb-bar__close {
	background: none;
	border: 0;
	color: inherit;
	cursor: pointer;
	flex: 0 0 auto;
	font-size: 20px;
	line-height: 1;
	opacity: 0.7;
	padding: 4px 6px;
}

.mtb-bar__close:hover,
.mtb-bar__close:focus {
	opacity: 1;
}

/* Keeps the fixed bar clear of the WordPress toolbar. */
body.admin-bar .mtb-bar--fixed {
	--mtb-top: 32px;
}

html.mtb-has-fixed body {
	padding-top: var( --mtb-offset, 0px );
}

@media screen and ( max-width: 782px ) {
	body.admin-bar .mtb-bar--fixed {
		--mtb-top: 46px;
	}
}

@media screen and ( max-width: 600px ) {
	.mtb-bar {
		font-size: 13px;
	}

	.mtb-bar__inner {
		flex-wrap: wrap;
		gap: 8px;
		justify-content: center;
		padding: 8px 12px;
		text-align: center;
	}

	.mtb-bar__content {
		flex: 1 1 100%;
	}

	.mtb-unit {
		min-width: 40px;
	}

	.mtb-unit__value {
		font-size: 15px;
	}
}
