/**
 * The news bar: thirty designs from Tom's catalogue (`news-bar-designs.html`,
 * divb-hq#239, docs/SPEC-news-bar.md). One sheet for all of them, loaded only where a bar
 * renders and in the editor for the picker tiles.
 *
 * Taken as drawn: structure, heights, colours, the 520px container query, the collapse
 * and every reduced-motion guard. Different on purpose:
 *
 * - every class carries the `mf-nb` prefix (a bare `.chip` is another plugin's on this site);
 * - no font is loaded: Fraunces becomes the theme's heading family, Inter its body family,
 *   IBM Plex Mono the system monospace stack (SPEC §3.8);
 * - the area spans the page, but what is in it (text, chip, ×) sits within the theme's wide
 *   size (Tom, 2026-10-05). `--mf-nb-edge` is that inset: the theme's root padding, or half of
 *   what the page has beyond the wide size, whichever is larger. A design that sets its own
 *   horizontal padding adds it rather than replacing it.
 */

.mf-news-bar {
	--mf-nb-ink: #1a1a2e;
	--mf-nb-blue: #1d4f99;
	--mf-nb-orange: #e35205;
	--mf-nb-deep: #c24504;
	--mf-nb-tint: #e8eff9;
	--mf-nb-grey: #f2f4f8;
	--mf-nb-line: #d5d9e2;
	--mf-nb-violet: #8a2be2;
	--mf-nb-lime: #c6ff3f;
	--mf-nb-cyan: #00e5ff;
	--mf-nb-magenta: #ff2d78;
	--mf-nb-serif: var(--wp--preset--font-family--heading, georgia, serif);
	--mf-nb-sans: var(--wp--preset--font-family--body, system-ui, sans-serif);
	--mf-nb-mono: ui-monospace, sfmono-regular, menlo, consolas, monospace;

	container-type: inline-size;
	display: grid;
	grid-template-rows: 1fr;
	transition: grid-template-rows 0.22s ease;
}

.mf-news-bar.is-closed {
	grid-template-rows: 0fr;
	visibility: hidden;
	transition: grid-template-rows 0.22s ease, visibility 0s 0.22s;
}

.mf-news-bar__clip {
	overflow: hidden;
	min-height: 0;
}

/* ---------- The bar ---------- */

.mf-nb {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	margin: 0;

	/* A `%` here resolves against the bar's container, which spans the page. */
	--mf-nb-wide: calc((100% - var(--wp--style--global--wide-size, 1280px)) / 2);
	--mf-nb-edge: max(var(--wp--style--root--padding-left, 16px), var(--mf-nb-wide));
	--mf-nb-edge-r: max(var(--wp--style--root--padding-right, 16px), var(--mf-nb-wide));

	padding: 0 var(--mf-nb-edge-r) 0 var(--mf-nb-edge);
	font: 400 14px/1.35 var(--mf-nb-sans);
	color: var(--mf-nb-ink);
	background: #fff;
}

.mf-nb .mf-nb__a {
	flex: 1;
	min-width: 0;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 0;
	color: inherit;
	text-decoration: none;
}

.mf-nb .mf-nb__a:hover .mf-nb__t {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.mf-nb .mf-nb__a:focus-visible,
.mf-nb .mf-nb__x:focus-visible,
.mf-nb .mf-nb__cta:focus-visible {
	outline: 2px solid currentcolor;
	outline-offset: -3px;
	border-radius: 4px;
}

.mf-nb .mf-nb__t {
	flex: 0 1 auto;
	font-weight: 600;
}

.mf-nb .mf-nb__ex {
	flex: 1 1 0;
	min-width: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mf-nb .mf-nb__x {
	flex: none;
	width: 32px;
	height: 32px;
	display: grid;
	place-items: center;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	cursor: pointer;
	position: relative;
	z-index: 1;
}

.mf-nb .mf-nb__x[hidden] {
	display: none;
}

.mf-nb .mf-nb__x:hover {
	background: color-mix(in srgb, currentcolor 16%, transparent);
}

@container (max-width: 520px) {

	.mf-nb .mf-nb__ex {
		display: none;
	}

	.mf-nb .mf-nb__t {
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		overflow: hidden;
	}
}

/* ---------- Quiet ---------- */

.mf-nb--v01 {
	border-bottom: 1px solid var(--mf-nb-line);
}

.mf-nb .mf-nb__dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--mf-nb-orange);
	flex: none;
}

.mf-nb--v02 {
	background: var(--mf-nb-blue);
	color: #fff;
}

.mf-nb--v02 .mf-nb__chip {
	border: 1px solid rgba(255, 255, 255, 0.75);
	border-radius: 999px;
	padding: 1px 9px;
	font-size: 12px;
	font-weight: 600;
	flex: none;
}

.mf-nb--v03 {
	background: var(--mf-nb-tint);
	border-left: 4px solid var(--mf-nb-blue);

	/* The edge sits at the page's edge; the text stays on the content's line. */
	padding-left: calc(var(--mf-nb-edge) - 4px);
}

.mf-nb--v04 {
	background: var(--mf-nb-ink);
	color: #fff;
}

.mf-nb .mf-nb__sq {
	width: 8px;
	height: 8px;
	background: var(--mf-nb-orange);
	flex: none;
}

.mf-nb--v04 .mf-nb__t {
	text-decoration: underline;
	text-decoration-color: var(--mf-nb-orange);
	text-decoration-thickness: 2px;
	text-underline-offset: 4px;
}

.mf-nb--v05 {
	border-bottom: 2px solid var(--mf-nb-orange);
	min-height: 50px;
}

.mf-nb--v05 .mf-nb__t {
	font: 600 16px/1.3 var(--mf-nb-serif);
}

.mf-nb--v06 {
	background: var(--mf-nb-tint);

	/* The ×'s width again on the left, so the sentence is centred on the content. */
	padding-left: calc(var(--mf-nb-edge) + 32px);
}

.mf-nb--v06 .mf-nb__a {
	justify-content: center;
	text-align: center;
}

.mf-nb--v06 .mf-nb__t {
	font-weight: 500;
}

/* ---------- Brand ---------- */

.mf-nb--v07 {
	background: var(--mf-nb-deep);
	color: #fff;
	font-weight: 700;
}

.mf-nb--v07 .mf-nb__chip {
	background: #fff;
	color: var(--mf-nb-deep);
	border-radius: 2px;
	padding: 1px 8px;
	font-size: 12px;
	flex: none;
}

.mf-nb--v08 {
	background: var(--mf-nb-tint);
}

.mf-nb--v08 .mf-nb__a {
	padding: 0;
	gap: 14px;
	align-self: stretch;
}

.mf-nb--v08 .mf-nb__lab {
	align-self: stretch;
	display: flex;
	align-items: center;
	padding: 0 16px;
	background: var(--mf-nb-deep);
	color: #fff;
	font-weight: 700;
	flex: none;
}

.mf-nb--v08 .mf-nb__t,
.mf-nb--v08 .mf-nb__ex {
	padding: 10px 0;
}

.mf-nb--v09 {
	background: linear-gradient(90deg, var(--mf-nb-blue), var(--mf-nb-violet));
	color: #fff;
}

.mf-nb--v09 .mf-nb__chip {
	background: rgba(255, 255, 255, 0.2);
	border-radius: 999px;
	padding: 1px 9px;
	font-size: 12px;
	font-weight: 700;
	flex: none;
}

.mf-nb--v10 {
	border-bottom: 1px solid var(--mf-nb-line);
}

.mf-nb--v10 .mf-nb__fl {
	align-self: center;
	background: var(--mf-nb-deep);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	padding: 5px 22px 5px 14px;
	clip-path: polygon(0 0, 100% 0, 88% 50%, 100% 100%, 0 100%);
	flex: none;
}

.mf-nb--v10 .mf-nb__a {
	gap: 14px;
}

.mf-nb--v11 {
	background: var(--mf-nb-ink);
	color: #fff;
	box-shadow: inset 0 3px 0 var(--mf-nb-blue), inset 0 6px 0 var(--mf-nb-orange);
	padding-top: 6px;
}

.mf-nb--v12 {
	background: var(--mf-nb-tint);
}

.mf-nb--v12 .mf-nb__cta {
	background: var(--mf-nb-blue);
	color: #fff;
	border-radius: 999px;
	padding: 4px 14px;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	flex: none;
}

.mf-nb--v12 .mf-nb__cta:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ---------- Editorial ---------- */

.mf-nb--v13 {
	border-bottom: 2px solid var(--mf-nb-ink);
	min-height: 54px;
}

.mf-nb--v13 .mf-nb__t {
	font: 800 20px/1.2 var(--mf-nb-serif);
	letter-spacing: -0.01em;
}

.mf-nb--v14 {
	border-top: 1px solid var(--mf-nb-ink);
	border-bottom: 3px double var(--mf-nb-ink);
}

.mf-nb--v14 .mf-nb__lead {
	font: italic 500 15px/1.3 var(--mf-nb-serif);
	color: var(--mf-nb-deep);
	flex: none;
}

.mf-nb--v14 .mf-nb__t {
	font: 500 16px/1.3 var(--mf-nb-serif);
}

.mf-nb--v15 {
	background: var(--mf-nb-grey);
}

.mf-nb--v15 .mf-nb__ex {
	font: italic 500 12.5px/1.3 var(--mf-nb-serif);
}

.mf-nb--v16 {
	border-bottom: 1px solid var(--mf-nb-line);
}

.mf-nb--v16 .mf-nb__lead {
	font-weight: 800;
	color: var(--mf-nb-violet);
	flex: none;
}

.mf-nb--v16 .mf-nb__t {
	font: italic 500 16px/1.3 var(--mf-nb-serif);
}

.mf-nb--v17 {
	border-bottom: 1px solid var(--mf-nb-line);
	padding-block: 6px;
}

.mf-nb--v17 .mf-nb__date {
	display: grid;
	place-items: center;
	width: 46px;
	padding: 4px 0;
	border-radius: 4px;
	background: var(--mf-nb-blue);
	color: #fff;
	line-height: 1;
	flex: none;
}

.mf-nb--v17 .mf-nb__date b {
	font: 700 20px/1 var(--mf-nb-serif);
}

.mf-nb--v17 .mf-nb__date i {
	font-style: normal;
	font-size: 11px;
	font-weight: 600;
	margin-top: 2px;
}

.mf-nb--v18 {
	border-bottom: 1px solid var(--mf-nb-line);
}

.mf-nb .mf-nb__q {
	font: 700 38px/0.6 var(--mf-nb-serif);
	color: var(--mf-nb-orange);
	margin-top: 16px;
	flex: none;
}

.mf-nb--v18 .mf-nb__t {
	font: italic 500 17px/1.3 var(--mf-nb-serif);
}

/* ---------- Technical ---------- */

.mf-nb--v19 {
	background: var(--mf-nb-ink);
	color: #fff;
	font: 400 13px/1.4 var(--mf-nb-mono);
}

.mf-nb--v19 .mf-nb__pr {
	color: var(--mf-nb-lime);
	flex: none;
}

.mf-nb .mf-nb__cur {
	width: 8px;
	height: 15px;
	background: var(--mf-nb-lime);
	flex: none;
	animation: mf-nb-blink 1.1s steps(1) infinite;
}

.mf-nb--v19 .mf-nb__t,
.mf-nb--v21 .mf-nb__t,
.mf-nb--v22 .mf-nb__t,
.mf-nb--v23 .mf-nb__t {
	font-weight: 400;
}

@keyframes mf-nb-blink {

	50% {
		opacity: 0;
	}
}

.mf-nb--v20 {
	border-bottom: 1px solid var(--mf-nb-line);
}

.mf-nb--v20 .mf-nb__ver {
	font: 600 12px/1 var(--mf-nb-mono);
	background: var(--mf-nb-tint);
	color: var(--mf-nb-blue);
	border: 1px solid var(--mf-nb-blue);
	border-radius: 4px;
	padding: 4px 8px;
	flex: none;
}

.mf-nb--v21 {
	background: var(--mf-nb-ink);
	color: #fff;
	font: 400 13px/1.4 var(--mf-nb-mono);
}

.mf-nb--v21 .mf-nb__a {
	padding: 0;
	gap: 0;
	background: rgba(198, 255, 63, 0.12);
	align-self: stretch;
}

.mf-nb--v21 .mf-nb__g {
	align-self: stretch;
	display: flex;
	align-items: center;
	padding: 0 14px;
	background: var(--mf-nb-lime);
	color: var(--mf-nb-ink);
	font-weight: 600;
	flex: none;
	margin-right: 12px;
}

.mf-nb--v21 .mf-nb__t,
.mf-nb--v21 .mf-nb__ex {
	padding: 10px 0;
}

.mf-nb--v21 .mf-nb__ex {
	padding-left: 12px;
}

.mf-nb--v22 {
	background: var(--mf-nb-blue);
	color: #fff;
	font: 400 12px/1.3 var(--mf-nb-mono);
	min-height: 34px;
}

.mf-nb--v22 .mf-nb__a {
	padding: 0;
	gap: 0;
	align-self: stretch;
}

.mf-nb--v22 .mf-nb__seg {
	align-self: stretch;
	display: flex;
	align-items: center;
	padding: 0 12px;
	border-right: 1px solid rgba(255, 255, 255, 0.4);
	flex: none;
}

.mf-nb--v22 .mf-nb__seg--a {
	background: var(--mf-nb-deep);
	font-weight: 600;
}

.mf-nb--v22 .mf-nb__t {
	padding: 6px 12px;
}

.mf-nb--v23 {
	background: var(--mf-nb-ink);
	color: #fff;
	font: 400 13px/1.4 var(--mf-nb-mono);
}

.mf-nb--v23 .mf-nb__ts {
	color: #9fb3d1;
	flex: none;
}

.mf-nb--v23 .mf-nb__lvl {
	background: var(--mf-nb-cyan);
	color: var(--mf-nb-ink);
	padding: 0 7px;
	border-radius: 3px;
	font-weight: 600;
	flex: none;
}

.mf-nb--v24 {
	background: var(--mf-nb-grey);
	font: 400 13px/1.4 var(--mf-nb-mono);
}

.mf-nb--v24 .mf-nb__cm {
	color: #5b6275;
}

.mf-nb--v24 .mf-nb__t {
	font-weight: 600;
}

/* ---------- Loud ---------- */

.mf-nb--v25 {
	background: var(--mf-nb-ink);
	color: #fff;
}

.mf-nb--v25 .mf-nb__chip {
	background: var(--mf-nb-magenta);
	color: var(--mf-nb-ink);
	font-weight: 700;
	border-radius: 3px;
	padding: 1px 9px;
	font-size: 12px;
	flex: none;
}

.mf-nb--v25 .mf-nb__t {
	text-decoration: underline;
	text-decoration-color: var(--mf-nb-cyan);
	text-decoration-thickness: 2px;
	text-underline-offset: 4px;
}

.mf-nb--v25 .mf-nb__ex {
	color: var(--mf-nb-cyan);
}

.mf-nb--v26 {
	border-bottom: 1px solid var(--mf-nb-line);
}

.mf-nb--v26 .mf-nb__t {
	background: linear-gradient(transparent 52%, var(--mf-nb-lime) 52%);
	padding: 0 5px;
	font-weight: 700;
	border-radius: 2px;
}

.mf-nb--v27 {
	background: var(--mf-nb-lime);
}

.mf-nb--v27 .mf-nb__a {
	overflow: hidden;
}

.mf-nb--v27 .mf-nb__mq {
	display: flex;
	width: max-content;
	animation: mf-nb-marquee 26s linear infinite;
}

.mf-nb--v27 .mf-nb__g1 {
	display: flex;
	align-items: center;
	white-space: nowrap;
}

.mf-nb--v27 .mf-nb__g1 span {
	padding-right: 44px;
	font-weight: 600;
}

.mf-nb--v27 .mf-nb__g1 span::after {
	content: "//";
	margin-left: 44px;
	font-family: var(--mf-nb-mono);
	color: var(--mf-nb-deep);
	font-weight: 600;
}

.mf-nb--v27:hover .mf-nb__mq,
.mf-nb--v27:focus-within .mf-nb__mq {
	animation-play-state: paused;
}

@keyframes mf-nb-marquee {

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

.mf-nb--v28 {
	margin: 12px auto;
	width: fit-content;
	max-width: calc(100% - 24px);
	border-radius: 999px;
	background: var(--mf-nb-ink);
	color: #fff;
	padding: 0 6px 0 18px;
	box-shadow: 0 3px 10px rgba(26, 26, 46, 0.28);
}

.mf-nb--v28 .mf-nb__a {
	flex: 0 1 auto;
}

.mf-nb .mf-nb__pulse {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--mf-nb-orange);
	flex: none;
	box-shadow: 0 0 0 0 rgba(227, 82, 5, 0.7);
	animation: mf-nb-pulse 2.4s ease-out 3;
}

@keyframes mf-nb-pulse {

	70% {
		box-shadow: 0 0 0 9px rgba(227, 82, 5, 0);
	}

	100% {
		box-shadow: 0 0 0 0 rgba(227, 82, 5, 0);
	}
}

.mf-nb--v29 {
	background: var(--mf-nb-tint);
	padding: 16px var(--mf-nb-edge-r) 12px var(--mf-nb-edge);
	align-items: flex-start;
}

.mf-nb--v29 .mf-nb__a {
	flex: 0 1 auto;
	background: #fff;
	border: 2px solid var(--mf-nb-ink);
	border-radius: 14px;
	padding: 8px 14px;
	box-shadow: 3px 3px 0 var(--mf-nb-ink);
	margin-left: 18px;
	position: relative;
}

.mf-nb--v29 .mf-nb__a::before {
	content: "";
	position: absolute;
	top: -10px;
	left: 22px;
	width: 16px;
	height: 16px;
	background: #fff;
	border-left: 2px solid var(--mf-nb-ink);
	border-top: 2px solid var(--mf-nb-ink);
	transform: rotate(45deg);
}

.mf-nb--v29 .mf-nb__x {
	margin-left: auto;
}

.mf-nb--v30 {
	background: #fff;
	border-top: 3px solid var(--mf-nb-ink);
	border-bottom: 3px solid var(--mf-nb-ink);

	/* At least clear of the striped ends, which stay at the page's edges. */
	padding: 0 max(40px, var(--mf-nb-edge-r)) 0 max(44px, var(--mf-nb-edge));
	min-height: 48px;
}

.mf-nb--v30::before,
.mf-nb--v30::after {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	width: 32px;
	background: repeating-linear-gradient(-45deg, #1a1a2e 0 10px, #e35205 10px 20px);
}

.mf-nb--v30::before {
	left: 0;
}

.mf-nb--v30::after {
	right: 0;
}

.mf-nb--v30 .mf-nb__t {
	font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {

	.mf-news-bar,
	.mf-news-bar.is-closed {
		transition: none;
	}

	.mf-nb .mf-nb__cur,
	.mf-nb .mf-nb__pulse {
		animation: none;
	}

	.mf-nb--v27 .mf-nb__mq {
		animation: none;
		width: auto;
	}

	.mf-nb--v27 .mf-nb__g1:last-child {
		display: none;
	}

	.mf-nb--v27 .mf-nb__g1 {
		overflow: hidden;
	}
}
