/*
 * Notice bars above the site header (taichema-notices).
 * Colours and type come from the theme's presets; the fallbacks keep the
 * bar right when another theme is active.
 * Slim, plain text, no decoration: the only icon is the close button.
 */
.tno-bar {
	--tno-bg: var(--wp--preset--color--navy, #212e56);
	--tno-fg: var(--wp--preset--color--white, #fff);
	--tno-ring: var(--wp--preset--color--accent-ring, #a9c2ec);

	background: var(--tno-bg);
	color: var(--tno-fg);
	font-size: var(--wp--preset--font-size--sm, 0.875rem);
	line-height: 1.45;
}

.tno-bar--warning {
	--tno-bg: var(--wp--preset--color--sale-bg, #ffe6da);
	--tno-fg: var(--wp--preset--color--ink, #1b2748);
	--tno-ring: var(--wp--preset--color--focus, #2f6fd6);

	border-bottom: 1px solid color-mix(in srgb, var(--wp--preset--color--sale, #a8320a) 22%, transparent);
}

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

.tno-bar__inner {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	box-sizing: border-box;
	width: 100%;
	max-width: calc(var(--ts-container, 1240px) + 2 * var(--ts-gutter, 16px));
	margin-inline: auto;
	padding: 8px var(--ts-gutter, 16px);
}

.tno-bar__text {
	flex: 1 1 auto;
	margin: 0;
	min-width: 0;
	overflow-wrap: anywhere;
}

.tno-bar__link {
	margin-inline-start: 4px;
	color: inherit;
	font-weight: 650;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.tno-bar__link:hover {
	text-decoration-thickness: 2px;
}

/* 44px to hit, but it adds no height to a one-line bar. */
.tno-bar__close {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 44px;
	height: 44px;
	margin: -12px -12px -12px 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: inherit;
	cursor: pointer;
}

.tno-bar__close[hidden] {
	display: none;
}

.tno-bar__close:hover {
	background: color-mix(in srgb, currentcolor 14%, transparent);
}

.tno-bar a:focus-visible,
.tno-bar__close:focus-visible {
	outline: 3px solid var(--tno-ring);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: no-preference) {

	.tno-bar__close {
		transition: background-color 0.15s ease-out;
	}
}
