/*
 * BB.news site bar (v0.21.0): the navy sticky bar, the red Latest strip and the section tabs under
 * 1024 px. Loaded on every page that prints the bar: the homepage templates (with homepage.css on
 * top) and, when the "New site bar" setting is on or the visitor holds the preview key, every other
 * page (inc/site-bar.php). Every rule sits under body.bb-bar, so a page without the bar never
 * sees it. The rules moved here from homepage.css in 0.21.0 unchanged; the variables repeat the
 * homepage ones so each file stands on its own.
 *
 * On pages that are not ours the bar sits in its own .bbh.bbh-site wrapper right after <body>;
 * the .bbh-site rules give that wrapper the same type reset the homepage wrapper has.
 */

body.bb-bar {
	--bbh-navy: #0d1b2a;
	--bbh-gold: #c8860a;
	--bbh-red: #d93025;
	--bbh-ink: #1d2733;
	--bbh-body: #3a4a5c;
	--bbh-rule: #e8e4dc;
	--bbh-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* the homepage templates cut the theme header from the page; every other page keeps the block
   in its markup and hides it here */
body.bb-bar .td-header-template-wrap {
	display: none;
}
/* the theme wrapper hides overflow, which makes it a scroll box and stops position: sticky;
   clip cuts the same overflow without that (browsers without clip keep hidden: no sticky bar) */
body.bb-bar #td-outer-wrap {
	overflow: clip;
}

/* ---------- the bar's own wrapper on pages that are not ours ---------- */
/* display: contents: the wrapper draws no box of its own, so the bar's sticky containing block is
   the body (inside a box of its own height the bar would scroll away with the wrapper); the type
   rules still inherit to the bar */
body.bb-bar .bbh-site {
	display: contents;
	color: var(--bbh-body);
	font: 16px/1.55 var(--bbh-sans);
	font-variant-numeric: lining-nums;
	-webkit-font-smoothing: antialiased;
}
body.bb-bar .bbh-site *,
body.bb-bar .bbh-site *::before,
body.bb-bar .bbh-site *::after {
	box-sizing: border-box;
}
body.bb-bar .bbh-site a {
	color: inherit;
	text-decoration: none;
}
body.bb-bar .bbh-site a:focus-visible,
body.bb-bar .bbh-site summary:focus-visible,
body.bb-bar .bbh-site input:focus-visible {
	outline: 2px solid var(--bbh-gold);
	outline-offset: 3px;
}
body.bb-bar .bbh-site ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
body.bb-bar .bbh-site li {
	margin: 0; /* the theme indents every li */
}
body.bb-bar .bbh-site .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ---------- bar: sticky, navy ---------- */
body.bb-bar .bbh-bar {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 50;
	background: var(--bbh-navy);
	color: #fff;
}
body.bb-bar .bbh-bar-in {
	max-width: 1200px;
	height: 64px;
	margin: 0 auto;
	padding: 0 24px;
	display: flex;
	align-items: center;
	gap: 32px;
}
body.bb-bar .bbh-logo {
	flex: none;
}
body.bb-bar .bbh .bbh-logo img {
	display: block;
	height: 34px;
	width: auto;
	max-width: none;
}
body.bb-bar .bbh-nav {
	display: flex;
	gap: 26px;
	font: 500 14px/1 var(--bbh-sans);
	letter-spacing: 0.01em;
}
body.bb-bar .bbh-nav a {
	display: block;
	padding: 22px 0 19px;
	border-bottom: 3px solid transparent;
	color: #dfe5ec;
}
body.bb-bar .bbh-nav a:hover {
	color: #fff;
	border-bottom-color: var(--bbh-gold);
}
body.bb-bar .bbh-search {
	margin-left: auto;
}
body.bb-bar .bbh-bar summary {
	list-style: none;
	cursor: pointer;
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: 1px solid #33475e;
	color: #dfe5ec;
}
body.bb-bar .bbh-bar summary::-webkit-details-marker {
	display: none;
}
body.bb-bar .bbh-bar summary:hover,
body.bb-bar .bbh-bar details[open] > summary {
	color: #fff;
	border-color: var(--bbh-gold);
}
body.bb-bar .bbh-search form {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	padding: 12px max(24px, calc((100% - 1152px) / 2)) 16px;
	background: var(--bbh-navy);
	border-top: 1px solid #22364c;
}
body.bb-bar .bbh-search input {
	display: block;
	width: 100%;
	max-width: 640px;
	margin: 0 0 0 auto;
	height: 44px;
	padding: 0 14px;
	border: 1px solid #33475e;
	border-radius: 4px;
	background: #fff;
	color: var(--bbh-ink);
	font: 16px/1 var(--bbh-sans);
}
body.bb-bar .bbh-burger {
	display: none;
}
body.bb-bar .bbh-tabs {
	display: none;
}

/* ---------- Latest strip: the newest headlines on one red line under the bar ---------- */
body.bb-bar .bbh-strip {
	background: var(--bbh-red);
	color: #fff;
}
body.bb-bar .bbh-strip-in {
	display: flex;
	align-items: center;
	gap: 14px;
	max-width: 1200px;
	height: 36px;
	margin: 0 auto;
	padding: 0 24px;
}
body.bb-bar .bbh .bbh-strip-label {
	flex: none;
	margin: 0;
	padding-right: 14px;
	border-right: 1px solid rgba(255, 255, 255, 0.5);
	font: 700 13px/1 var(--bbh-sans);
}
body.bb-bar .bbh-strip-view {
	flex: 1;
	min-width: 0;
	overflow-x: auto;
	scrollbar-width: none;
}
body.bb-bar .bbh-strip-view::-webkit-scrollbar {
	display: none;
}
body.bb-bar .bbh .bbh-strip-track {
	display: flex;
	width: max-content;
}
body.bb-bar .bbh .bbh-strip-track li {
	margin-right: 18px;
	padding-right: 18px;
	border-right: 1px solid rgba(255, 255, 255, 0.5);
	white-space: nowrap;
	font: 600 13px/36px var(--bbh-sans);
}
body.bb-bar .bbh-strip-track time {
	margin-left: 6px;
	font-weight: 400;
}
body.bb-bar .bbh .bbh-strip a:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}
body.bb-bar .bbh .bbh-strip a:focus-visible,
body.bb-bar .bbh .bbh-strip-pause:focus-visible {
	outline: 2px solid #fff;
	outline-offset: -2px;
}
body.bb-bar .bbh-strip-move {
	display: flex;
	width: max-content;
	animation: bbh-crawl linear infinite;
}
@keyframes bbh-crawl {
	to {
		transform: translateX(-50%);
	}
}
body.bb-bar .bbh-strip.is-moving .bbh-strip-view {
	overflow: hidden;
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 18px);
	mask-image: linear-gradient(90deg, transparent, #000 18px);
}
body.bb-bar .bbh-strip:hover .bbh-strip-move,
body.bb-bar .bbh-strip.is-paused .bbh-strip-move {
	animation-play-state: paused;
}
body.bb-bar .bbh-strip.is-moving.is-still .bbh-strip-view {
	overflow-x: auto;
}
body.bb-bar .bbh-strip.is-still .bbh-strip-move {
	animation: none;
}
body.bb-bar .bbh-strip-pause {
	flex: none;
	display: grid;
	place-items: center;
	width: 26px;
	height: 26px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.6);
	border-radius: 50%;
	background: transparent;
	color: #fff;
	cursor: pointer;
}
body.bb-bar .bbh-strip-pause[hidden] {
	display: none;
}
body.bb-bar .bbh-strip-pause span {
	width: 8px;
	height: 9px;
	border-left: 3px solid currentColor;
	border-right: 3px solid currentColor;
}
body.bb-bar .bbh-strip-pause[aria-pressed="true"] span {
	width: 0;
	height: 0;
	margin-left: 2px;
	border-style: solid;
	border-width: 5px 0 5px 8px;
	border-color: transparent transparent transparent currentColor;
}

/* ---------- under 1024 px: menu button and section tabs instead of the inline section links ---------- */
@media (max-width: 1023px) {
	body.bb-bar .bbh-nav {
		display: none;
	}
	body.bb-bar .bbh-burger {
		display: block;
	}
	body.bb-bar .bbh-burger summary {
		width: 36px;
		height: 36px;
		border: 0;
	}
	body.bb-bar .bbh-burger summary span,
	body.bb-bar .bbh-burger summary span::before,
	body.bb-bar .bbh-burger summary span::after {
		display: block;
		width: 18px;
		height: 2px;
		background: currentColor;
		border-radius: 1px;
	}
	body.bb-bar .bbh-burger summary span {
		position: relative;
	}
	body.bb-bar .bbh-burger summary span::before,
	body.bb-bar .bbh-burger summary span::after {
		content: "";
		position: absolute;
		left: 0;
	}
	body.bb-bar .bbh-burger summary span::before {
		top: -6px;
	}
	body.bb-bar .bbh-burger summary span::after {
		top: 6px;
	}
	body.bb-bar .bbh .bbh-burger-list {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		padding: 4px 16px 12px;
		background: var(--bbh-navy);
		border-top: 1px solid #22364c;
	}
	body.bb-bar .bbh-burger-list a {
		display: block;
		padding: 14px 0;
		border-bottom: 1px solid #22364c;
		color: #fff;
		font: 500 16px/1.2 var(--bbh-sans);
	}
	body.bb-bar .bbh-logo {
		margin: 0 auto;
	}
	/* no-script fallback: an open search hides the menu list (the bar's script closes one panel
	   when the other opens) */
	body.bb-bar .bbh-bar-in:has(.bbh-search[open]) .bbh-burger-list {
		display: none;
	}
	body.bb-bar .bbh-search {
		margin-left: 0;
	}
	body.bb-bar .bbh-tabs {
		display: flex;
		gap: 8px;
		overflow-x: auto;
		padding: 10px 16px;
		background: #fff;
		border-bottom: 1px solid var(--bbh-rule);
		scrollbar-width: none;
	}
	body.bb-bar .bbh-tabs::-webkit-scrollbar {
		display: none;
	}
	body.bb-bar .bbh-tabs a {
		flex: none;
		padding: 9px 12px;
		border: 1px solid var(--bbh-rule);
		border-radius: 999px;
		background: #fff;
		color: var(--bbh-navy);
		font: 500 13px/1 var(--bbh-sans);
	}
	body.bb-bar .bbh-tabs a[aria-current] {
		background: var(--bbh-navy);
		border-color: var(--bbh-navy);
		color: #fff;
	}
}

/* ---------- phone ---------- */
@media (max-width: 767px) {
	body.bb-bar .bbh-bar-in {
		height: 52px;
		padding: 0 16px;
		gap: 12px;
	}
	body.bb-bar .bbh .bbh-logo img {
		height: 26px;
	}
	body.bb-bar .bbh-search summary {
		width: 34px;
		height: 34px;
	}
	body.bb-bar .bbh-search form {
		padding: 10px 16px 14px;
	}
	body.bb-bar .bbh-strip-in {
		gap: 10px;
		padding: 0 0 0 16px;
	}
	body.bb-bar .bbh .bbh-strip-label {
		padding-right: 10px;
	}
	body.bb-bar .bbh-strip-pause {
		margin-right: 10px;
	}
}

/* reduced motion: the strip stays still (its script does not start it either) */
@media (prefers-reduced-motion: reduce) {
	body.bb-bar .bbh-strip-move {
		animation: none;
	}
}

/* the admin bar stops being fixed under 600 px, so the bar sticks to the top edge there */
@media (max-width: 600px) {
	body.bb-bar .bbh-bar {
		top: 0;
	}
}
