/* Newsflash Scrolling Banner — front end */

.nfsb,
.nfsb *,
.nfsb *::before,
.nfsb *::after {
	box-sizing: border-box;
}

.nfsb {
	--nfsb-bg: #c8102e;
	--nfsb-text: #fff;
	--nfsb-badge-bg: #fff;
	--nfsb-badge-text: #c8102e;
	--nfsb-h: 40px;
	--nfsb-fs: 15px;

	position: relative;
	z-index: 99980;
	width: 100%;
	overflow: hidden;
	background: var(--nfsb-bg);
	color: var(--nfsb-text);
	font-size: var(--nfsb-fs);
	line-height: 1.2;
}
.nfsb--bold { font-weight: 700; }

/* Hidden only when scripts can run, so it can be moved into place without a flash. */
@media (scripting: enabled) {
	.nfsb--pending { display: none; }
}

/* Fixed positions */
.nfsb--pos-fixed_top,
.nfsb--pos-fixed_bottom {
	position: fixed;
	left: 0;
	right: 0;
	width: auto;
	z-index: 99991;
}
.nfsb--pos-fixed_top { top: 0; }
.nfsb--pos-fixed_bottom { bottom: 0; }
.admin-bar .nfsb--pos-fixed_top { top: 32px; }
@media (max-width: 782px) {
	.admin-bar .nfsb--pos-fixed_top { top: 46px; }
}
body.nfsb-pad-top { padding-top: var(--nfsb-pad, 0px); }
body.nfsb-pad-bottom { padding-bottom: var(--nfsb-pad, 0px); }

/* ---------------------------------------------------------------- Layout */

.nfsb__inner {
	display: flex;
	align-items: center;
	gap: 12px;
	height: var(--nfsb-h);
	padding: 0 clamp(10px, 2.5vw, 22px);
}

.nfsb .nfsb__badge {
	flex: none;
	padding: 0.3em 0.8em;
	border-radius: 999px;
	background: var(--nfsb-badge-bg);
	color: var(--nfsb-badge-text);
	font-size: 0.8em;
	font-weight: 700;
	letter-spacing: 0.07em;
	line-height: 1.2;
	text-transform: uppercase;
	white-space: nowrap;
}

.nfsb__track {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
	height: 100%;
	overflow: hidden;
	-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 22px, #000 calc(100% - 22px), transparent 100%);
	mask-image: linear-gradient(90deg, transparent 0, #000 22px, #000 calc(100% - 22px), transparent 100%);
}

/* Without JavaScript: first message only, static */
.nfsb__msg {
	display: flex;
	align-items: center;
	height: 100%;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}
.nfsb__msg:not(:first-child) { display: none; }

/* With JavaScript: messages are scrolled one by one */
.nfsb.is-js .nfsb__msg {
	display: flex;
	position: absolute;
	top: 0;
	left: 0;
	overflow: visible;
	visibility: hidden;
	will-change: transform;
}

/* Reduced motion: messages fade in place instead of scrolling */
.nfsb.is-static .nfsb__msg {
	opacity: 0;
	transition: opacity 0.5s ease;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
}
.nfsb.is-static .nfsb__msg.is-shown { opacity: 1; }

.nfsb .nfsb__msg a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
}
.nfsb .nfsb__msg a:hover { text-decoration-thickness: 2px; }

/* Buttons */
.nfsb .nfsb__btn {
	flex: none;
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	box-shadow: none;
	color: inherit;
	font-size: 15px;
	line-height: 1;
	opacity: 0.85;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	transition: background-color 0.2s ease, opacity 0.2s ease;
}
.nfsb .nfsb__btn:hover,
.nfsb .nfsb__btn:focus-visible {
	background: rgba(255, 255, 255, 0.2);
	color: inherit;
	opacity: 1;
}
.nfsb .nfsb__btn:focus-visible,
.nfsb a:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}
.nfsb .nfsb__ico-play { display: none; }
.nfsb .nfsb__pause.is-paused .nfsb__ico-pause { display: none; }
.nfsb .nfsb__pause.is-paused .nfsb__ico-play { display: block; }

/* Hide buttons when there is nothing to pause */
.nfsb:not(.is-js) .nfsb__pause { display: none; }

/* Screen-reader copy of the messages */
.nfsb .nfsb__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
	list-style: none;
}

@media (max-width: 640px) {
	.nfsb { font-size: calc(var(--nfsb-fs) * 0.93); }
	.nfsb__inner { gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
	.nfsb .nfsb__btn { transition: none; }
}
