/*
 * WUWT Timeline 0.3.3
 * Mobile first: the base rules are the vertical layout. From 768px up the timeline becomes a horizontal
 * scroller (unless the shortcode says layout="vertical"). Lightbox styles are at the bottom.
 * Year chips keep the original outlined-pill style (accent #4a6fa5). The year bar is a light framed
 * card with a WUWT red rule. Story cards keep the 0.1.2 editorial treatment.
 */

.wuwt-tl {
	--wuwt-brand: #8b0000;
	--wuwt-brand-deep: #5c0000;
	--wuwt-ink: #16110f;
	--wuwt-accent: #4a6fa5;
	--wuwt-line: #8b0000;
	--wuwt-text: #16110f;
	--wuwt-muted: #5c534e;
	--wuwt-card: #fff;
	--wuwt-border: #e4ddd6;
	--wuwt-radius: 6px;
	--wuwt-gap: 44px;
	--wuwt-items: 3;
	--wuwt-n: var(--wuwt-items);
	box-sizing: border-box;
	width: 100%;
	max-width: var(--wuwt-max, 1200px);
	margin: 1.25rem auto 2.75rem;
	padding: 0 14px;
	color: var(--wuwt-text);
	font-size: 1rem;
	line-height: 1.55;
	text-align: left;
}

.wuwt-tl *,
.wuwt-tl *::before,
.wuwt-tl *::after {
	box-sizing: inherit;
}

.wuwt-tl__sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ---- Year bar: light framed track, original chip style, sticky ------------------------------- */

.wuwt-tl__bar-sentinel {
	height: 1px;
	margin: 0;
	pointer-events: none;
}

.wuwt-tl__bar {
	position: sticky;
	top: 0;
	z-index: 50;
	margin: 0 0 1.75rem;
	border: 1px solid var(--wuwt-border);
	border-top: 3px solid var(--wuwt-brand);
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(22, 17, 15, .05), 0 8px 24px rgba(22, 17, 15, .08);
	color: var(--wuwt-text);
}

.wuwt-tl__bar.is-stuck {
	box-shadow: 0 1px 2px rgba(22, 17, 15, .06), 0 12px 28px rgba(22, 17, 15, .14);
}

body.admin-bar .wuwt-tl__bar {
	top: 32px;
}

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

.wuwt-tl__bar-inner {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 72px;
	padding: 12px 14px;
}

.wuwt-tl__years {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	align-items: center;
}

.wuwt-tl__years::before,
.wuwt-tl__years::after {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	width: 28px;
	z-index: 1;
	pointer-events: none;
	opacity: 0;
	transition: opacity .2s ease;
}

.wuwt-tl__years::before {
	left: 0;
	background: linear-gradient(90deg, #fff 0%, rgba(255, 255, 255, 0) 100%);
}

.wuwt-tl__years::after {
	right: 0;
	background: linear-gradient(270deg, #fff 0%, rgba(255, 255, 255, 0) 100%);
}

.wuwt-tl__years.is-overflow-left::before,
.wuwt-tl__years.is-overflow-right::after {
	opacity: 1;
}

.wuwt-tl__years ul {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	margin: 0;
	padding: 4px 6px;
	list-style: none;
	overflow-x: auto;
	scrollbar-width: thin;
	scrollbar-color: var(--wuwt-border) transparent;
	-webkit-overflow-scrolling: touch;
	scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
	.wuwt-tl__years ul,
	.wuwt-tl__scroller {
		scroll-behavior: auto;
	}

	.wuwt-tl__years::before,
	.wuwt-tl__years::after {
		transition: none;
	}
}

.wuwt-tl__years li {
	flex: none;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wuwt-tl .wuwt-tl__years a {
	display: block;
	padding: 9px 16px;
	border: 1px solid #d4d8de;
	border-radius: 999px;
	background: #fff;
	color: var(--wuwt-text);
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	font-variant-numeric: tabular-nums;
	transition: border-color .15s ease, color .15s ease, background .15s ease, box-shadow .15s ease;
}

.wuwt-tl .wuwt-tl__years a:hover {
	border-color: var(--wuwt-accent);
	color: var(--wuwt-accent);
	background: #fff;
}

.wuwt-tl .wuwt-tl__years a[aria-current="true"] {
	background: var(--wuwt-accent);
	border-color: var(--wuwt-accent);
	color: #fff;
	box-shadow: 0 1px 4px rgba(74, 111, 165, .35);
}

.wuwt-tl__btn,
.wuwt-lb__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid var(--wuwt-border, #d9dde2);
	border-radius: 50%;
	background: #fff;
	color: var(--wuwt-text, #1d2327);
	cursor: pointer;
	line-height: 1;
}

.wuwt-tl__bar .wuwt-tl__btn {
	flex: none;
	width: 48px;
	height: 48px;
	border: 1px solid #d4d8de;
	border-radius: 50%;
	background: #fff;
	color: var(--wuwt-text);
	box-shadow: 0 1px 3px rgba(22, 17, 15, .08);
}

.wuwt-tl__bar .wuwt-tl__prev,
.wuwt-tl__bar .wuwt-tl__next {
	border-radius: 50%;
}

.wuwt-tl__bar .wuwt-tl__btn:hover:not(:disabled) {
	border-color: var(--wuwt-accent);
	color: var(--wuwt-accent);
	background: #fff;
}

.wuwt-tl__bar .wuwt-tl__btn:disabled {
	opacity: .35;
	cursor: default;
	box-shadow: none;
}

.wuwt-tl a:focus-visible,
.wuwt-tl button:focus-visible,
.wuwt-tl__scroller:focus-visible,
.wuwt-tl img[data-wuwt-lb]:focus-visible,
.wuwt-tl__card:focus-visible {
	outline: 3px solid var(--wuwt-accent);
	outline-offset: 2px;
}

/* Small screens: smaller arrows and tighter padding so four or five years fit in the bar. */
@media (max-width: 600px) {
	.wuwt-tl {
		padding-right: 6px;
		padding-left: 6px;
	}

	.wuwt-tl__bar {
		margin-bottom: 1.25rem;
	}

	.wuwt-tl__bar-inner {
		gap: 4px;
		min-height: 0;
		padding: 8px 6px;
	}

	.wuwt-tl__bar .wuwt-tl__btn {
		width: 34px;
		height: 34px;
	}

	.wuwt-tl__bar .wuwt-tl__btn svg {
		width: 18px;
		height: 18px;
	}

	.wuwt-tl__years::before,
	.wuwt-tl__years::after {
		width: 18px;
	}

	.wuwt-tl__years ul {
		gap: 4px;
		padding: 3px 2px;
	}

	.wuwt-tl .wuwt-tl__years a {
		padding: 7px 8px;
		font-size: .875rem;
	}
}

/* ---- Vertical layout (base) ------------------------------------------------------------------ */

.wuwt-tl__scroller {
	overflow: visible;
}

.wuwt-tl__track {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 52px;
	margin: 0;
	padding: 8px 0 12px 48px;
	list-style: none;
}

.wuwt-tl__track::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: 11px;
	width: 3px;
	border-radius: 2px;
	background: var(--wuwt-line);
}

.wuwt-tl__item {
	position: relative;
	min-width: 0;
	margin: 0;
	padding: 0;
	list-style: none;
	scroll-margin-top: 88px;
}

.wuwt-tl__yearrow {
	margin: 0;
}

.wuwt-tl__year {
	display: inline-block;
	margin: 0 0 10px;
	padding: 3px 14px;
	border-radius: 8px;
	background: var(--wuwt-accent);
	color: #fff;
	font-size: 1.125rem;
	font-weight: 700;
	letter-spacing: .02em;
	line-height: 1.4;
	scroll-margin-top: 88px;
}

.wuwt-tl__entry {
	position: relative;
}

.wuwt-tl__marker {
	position: absolute;
	top: 22px;
	left: -48px;
	width: 19px;
	height: 19px;
	border: 3px solid var(--wuwt-line);
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 0 0 3px var(--wuwt-card, #fff);
	z-index: 1;
}

/* Horizontal stem from the line to the card (vertical layout). */
.wuwt-tl__card::before {
	content: "";
	position: absolute;
	top: 30px;
	right: 100%;
	width: 22px;
	height: 2px;
	background: var(--wuwt-line);
}

.wuwt-tl__card {
	position: relative;
	padding: 26px 20px 22px;
	border: 1px solid var(--wuwt-border);
	border-top: 3px solid var(--wuwt-brand);
	border-radius: var(--wuwt-radius);
	background: var(--wuwt-card);
	box-shadow: 0 2px 4px rgba(22, 17, 15, .06), 0 14px 32px rgba(22, 17, 15, .1);
}

.wuwt-tl__head {
	margin: 0 0 .85em;
}

/* Top "Copy link": right-aligned above the title, opposite the date badge, so the title stays a clear link. */
.wuwt-tl__head-tools {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	margin: -6px 0 .7em;
}

@media (pointer: coarse) {
	.wuwt-tl__head-tools {
		margin: 0 0 .8em;
	}
}

.wuwt-tl__date {
	display: inline-block;
	position: absolute;
	top: 0;
	left: 16px;
	transform: translateY(-50%);
	padding: 4px 11px 3px;
	border-radius: 2px;
	background: var(--wuwt-brand);
	color: #fff;
	font-size: .72rem;
	font-weight: 700;
	letter-spacing: .08em;
	line-height: 1.3;
	text-transform: uppercase;
	box-shadow: 0 1px 3px rgba(22, 17, 15, .2);
}

.wuwt-tl .wuwt-tl__title {
	margin: .35em 0 0;
	padding: 0;
	color: var(--wuwt-ink);
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.3;
	text-transform: none;
	letter-spacing: normal;
}

.wuwt-tl .wuwt-tl__title a {
	color: inherit;
	text-decoration: none;
}

.wuwt-tl .wuwt-tl__title a:hover {
	color: var(--wuwt-brand);
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* ---- Story link (copy / share) and the card a link points at -------------------------------- */

.wuwt-tl a.wuwt-tl__share {
	display: inline-flex;
	align-items: center;
	gap: .4em;
	padding: 3px 11px 3px 9px;
	border: 1px solid var(--wuwt-border);
	border-radius: 999px;
	background: #fff;
	color: var(--wuwt-muted);
	font-size: .78rem;
	font-weight: 600;
	line-height: 1.4;
	text-decoration: none;
	cursor: pointer;
	transition: color .15s, border-color .15s, background-color .15s;
}

.wuwt-tl a.wuwt-tl__share:hover,
.wuwt-tl a.wuwt-tl__share:focus-visible {
	border-color: var(--wuwt-accent);
	color: var(--wuwt-accent);
}

.wuwt-tl a.wuwt-tl__share.is-done {
	border-color: var(--wuwt-accent);
	background: var(--wuwt-accent);
	color: #fff;
}

@media (pointer: coarse) {
	.wuwt-tl a.wuwt-tl__share {
		min-height: 44px;
		padding: 6px 16px 6px 13px;
		font-size: .88rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wuwt-tl a.wuwt-tl__share {
		transition: none;
	}
}

.wuwt-tl__item.is-target .wuwt-tl__card {
	box-shadow: 0 0 0 3px var(--wuwt-accent), 0 14px 32px rgba(22, 17, 15, .14);
}

/* ---- Story body ------------------------------------------------------------------------------ */

.wuwt-tl__body {
	font-size: .975rem;
	overflow-wrap: anywhere;
}

.wuwt-tl__body > :first-child {
	margin-top: 0;
}

.wuwt-tl__body > :last-child {
	margin-bottom: 0;
}

.wuwt-tl__body p {
	margin: .7em 0;
}

.wuwt-tl__body a {
	color: var(--wuwt-brand);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.wuwt-tl__body img {
	display: block;
	max-width: 100%;
	height: auto;
	margin: .8em auto;
	border-radius: 4px;
}

.wuwt-tl__body img[data-wuwt-lb] {
	cursor: zoom-in;
}

.wuwt-tl__body img[data-wuwt-lb]:hover {
	filter: brightness(.96);
}

.wuwt-tl__body .alignleft,
.wuwt-tl__body .alignright,
.wuwt-tl__body .aligncenter {
	float: none;
	margin-right: auto;
	margin-left: auto;
}

.wuwt-tl__body figure {
	max-width: 100%;
	margin: .8em 0;
}

.wuwt-tl__body figcaption {
	color: var(--wuwt-muted);
	font-size: .8125rem;
	text-align: center;
}

.wuwt-tl__body hr {
	height: 0;
	margin: 1em 0;
	border: 0;
	border-top: 1px solid var(--wuwt-border);
	background: none;
}

.wuwt-tl__body blockquote {
	margin: .8em 0;
	padding: .2em 0 .2em 1em;
	border-left: 3px solid var(--wuwt-brand);
	color: var(--wuwt-muted);
}

.wuwt-tl__body iframe,
.wuwt-tl__body video,
.wuwt-tl__body embed {
	max-width: 100%;
}

.wuwt-tl__body table {
	display: block;
	max-width: 100%;
	overflow-x: auto;
}

.wuwt-tl--empty {
	color: var(--wuwt-muted);
}

/* ---- Horizontal layout (768px and wider, unless layout="vertical") --------------------------- */

@media (max-width: 1023px) {
	.wuwt-tl {
		--wuwt-n: min(var(--wuwt-items), 2);
	}
}

@media (min-width: 768px) {
	.wuwt-tl:not(.wuwt-tl--vertical) .wuwt-tl__bar {
		margin-bottom: 2rem;
	}

	.wuwt-tl:not(.wuwt-tl--vertical) .wuwt-tl__scroller {
		margin: 0 -2px;
		padding: 8px 2px 28px;
		overflow-x: auto;
		overflow-y: hidden;
		overscroll-behavior-x: contain;
		scroll-snap-type: x proximity;
		scroll-behavior: smooth;
		scrollbar-color: var(--wuwt-line) #efecea;
		scrollbar-width: thin;
		cursor: grab;
	}

	.wuwt-tl:not(.wuwt-tl--vertical) .wuwt-tl__scroller a,
	.wuwt-tl:not(.wuwt-tl--vertical) .wuwt-tl__scroller button,
	.wuwt-tl:not(.wuwt-tl--vertical) .wuwt-tl__scroller img[data-wuwt-lb] {
		cursor: pointer;
	}

	.wuwt-tl:not(.wuwt-tl--vertical) .wuwt-tl__scroller.is-dragging {
		scroll-snap-type: none;
		scroll-behavior: auto;
		cursor: grabbing;
		user-select: none;
		-webkit-user-select: none;
	}

	.wuwt-tl:not(.wuwt-tl--vertical) .wuwt-tl__scroller.is-free-scroll {
		scroll-snap-type: none;
		scroll-behavior: auto;
	}

	.wuwt-tl:not(.wuwt-tl--vertical) .wuwt-tl__scroller.is-dragging,
	.wuwt-tl:not(.wuwt-tl--vertical) .wuwt-tl__scroller.is-dragging * {
		cursor: grabbing !important;
		user-select: none;
		-webkit-user-select: none;
	}

	.wuwt-tl:not(.wuwt-tl--vertical) .wuwt-tl__scroller img {
		-webkit-user-drag: none;
	}

	.wuwt-tl:not(.wuwt-tl--vertical) .wuwt-tl__scroller.is-dragging img {
		-webkit-user-drag: none;
	}

	.wuwt-tl:not(.wuwt-tl--vertical) .wuwt-tl__track {
		flex-direction: row;
		align-items: flex-start;
		gap: var(--wuwt-gap);
		padding: 0;
	}

	.wuwt-tl:not(.wuwt-tl--vertical) .wuwt-tl__track::before {
		display: none;
	}

	.wuwt-tl:not(.wuwt-tl--vertical) .wuwt-tl__item {
		flex: 0 0 calc((100% - (var(--wuwt-n) - 1) * var(--wuwt-gap)) / var(--wuwt-n));
		scroll-snap-align: start;
		scroll-margin-top: 0;
	}

	.wuwt-tl:not(.wuwt-tl--vertical) .wuwt-tl__yearrow {
		display: flex;
		align-items: flex-end;
		min-height: 40px;
		padding-bottom: 6px;
	}

	.wuwt-tl:not(.wuwt-tl--vertical) .wuwt-tl__year {
		margin: 0;
		scroll-margin-top: 0;
	}

	/* The line runs through every item's marker row; the dot sits near the card's left edge. */
	.wuwt-tl:not(.wuwt-tl--vertical) .wuwt-tl__marker {
		position: relative;
		top: auto;
		left: auto;
		display: block;
		width: auto;
		height: 32px;
		border: 0;
		border-radius: 0;
		background: none;
		box-shadow: none;
	}

	.wuwt-tl:not(.wuwt-tl--vertical) .wuwt-tl__marker::before {
		content: "";
		position: absolute;
		top: 50%;
		right: calc(var(--wuwt-gap) / -2);
		left: calc(var(--wuwt-gap) / -2);
		height: 3px;
		margin-top: -1.5px;
		background: var(--wuwt-line);
	}

	.wuwt-tl:not(.wuwt-tl--vertical) .wuwt-tl__item:first-child .wuwt-tl__marker::before {
		left: 0;
	}

	.wuwt-tl:not(.wuwt-tl--vertical) .wuwt-tl__item:last-child .wuwt-tl__marker::before {
		right: 0;
	}

	.wuwt-tl:not(.wuwt-tl--vertical) .wuwt-tl__marker::after {
		content: "";
		position: absolute;
		top: 50%;
		left: 22px;
		width: 17px;
		height: 17px;
		margin-top: -8.5px;
		border: 3px solid var(--wuwt-line);
		border-radius: 50%;
		background: #fff;
		box-shadow: 0 0 0 3px #f7f4f1;
		z-index: 1;
	}

	/* Stem from the line down to the card. Even cards sit lower so the row doesn't read as a grid. */
	.wuwt-tl:not(.wuwt-tl--vertical) .wuwt-tl__card {
		margin-top: 18px;
	}

	.wuwt-tl:not(.wuwt-tl--vertical) .wuwt-tl__item:nth-child(even) .wuwt-tl__card {
		margin-top: 42px;
	}

	.wuwt-tl:not(.wuwt-tl--vertical) .wuwt-tl__card::before {
		top: auto;
		right: auto;
		left: 29px;
		width: 2px;
		height: 18px;
		bottom: 100%;
		background: var(--wuwt-line);
	}

	.wuwt-tl:not(.wuwt-tl--vertical) .wuwt-tl__item:nth-child(even) .wuwt-tl__card::before {
		height: 42px;
	}
}

/* ---- Lightbox -------------------------------------------------------------------------------- */

html.wuwt-lb-open {
	overflow: hidden;
}

.wuwt-lb {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(8, 10, 14, .97);
	color: #e8eaed;
	font-family: inherit;
	opacity: 0;
	overscroll-behavior: contain;
	transition: opacity .16s ease;
}

.wuwt-lb[hidden] {
	display: none;
}

.wuwt-lb.is-open {
	opacity: 1;
}

.wuwt-lb__stage {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 56px 72px 0;
	touch-action: pinch-zoom;
	user-select: none;
	-webkit-user-select: none;
}

.wuwt-lb__imgwrap {
	position: relative;
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 0;
}

.wuwt-lb__img {
	display: block;
	width: auto;
	max-width: 100%;
	height: auto;
	max-height: 100%;
	object-fit: contain;
	border-radius: 4px;
	background: #fff;
	box-shadow: 0 8px 40px rgba(0, 0, 0, .5);
	transition: transform .18s ease, opacity .18s ease;
	-webkit-user-drag: none;
}

.wuwt-lb.is-dragging .wuwt-lb__img {
	transition: none;
}

.wuwt-lb.is-loading .wuwt-lb__img {
	opacity: .55;
}

.wuwt-lb.is-loading .wuwt-lb__imgwrap::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 34px;
	height: 34px;
	margin: -17px 0 0 -17px;
	border: 3px solid rgba(255, 255, 255, .25);
	border-top-color: #fff;
	border-radius: 50%;
	animation: wuwt-lb-spin .8s linear infinite;
}

@keyframes wuwt-lb-spin {
	to {
		transform: rotate(360deg);
	}
}

.wuwt-lb__cap {
	flex: 0 0 auto;
	width: 100%;
	max-width: 920px;
	padding: 12px 8px 18px;
	font-size: .9rem;
	line-height: 1.4;
	text-align: center;
}

.wuwt-lb__count {
	display: block;
	color: #aab0b8;
	font-size: .8125rem;
}

.wuwt-lb__title {
	font-weight: 700;
}

.wuwt-lb__src a {
	color: #9ec1ff;
	text-decoration: underline;
}

.wuwt-lb__btn {
	position: absolute;
	z-index: 2;
	border-color: rgba(255, 255, 255, .28);
	background: rgba(255, 255, 255, .12);
	color: #fff;
}

.wuwt-lb__btn:hover {
	background: rgba(255, 255, 255, .26);
}

.wuwt-lb__btn:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}

.wuwt-lb__btn[hidden] {
	display: none;
}

.wuwt-lb__close {
	top: 10px;
	right: 12px;
}

.wuwt-lb__prev,
.wuwt-lb__next {
	top: 50%;
	margin-top: -22px;
}

.wuwt-lb__prev {
	left: 12px;
}

.wuwt-lb__next {
	right: 12px;
}

@media (max-width: 767px) {
	.wuwt-lb__stage {
		padding: 56px 6px 0;
	}

	.wuwt-lb__prev,
	.wuwt-lb__next {
		top: auto;
		bottom: 14px;
		margin-top: 0;
	}

	.wuwt-lb__cap {
		padding-bottom: 70px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wuwt-lb,
	.wuwt-lb__img {
		transition: none;
	}

	.wuwt-lb.is-loading .wuwt-lb__imgwrap::after {
		animation: none;
	}
}

/* wuwt-tl reduced-motion horizontal override */

@media (prefers-reduced-motion: reduce) {
	.wuwt-tl:not(.wuwt-tl--vertical) .wuwt-tl__scroller {
		scroll-behavior: auto;
	}
}
