/* Lean Timelines lightbox. */

html.tlb-open { overflow: hidden; }

[data-tlb] { cursor: zoom-in; }
.tlb-video { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; padding: 0; border: 0; background: transparent; cursor: pointer; }
[data-tlb]:focus-visible, .tlb-video:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }

.tlb {
	--tlb-bg: rgba(10, 10, 10, .94);
	--tlb-ui: #fff;
	--tlb-soft: rgba(255, 255, 255, .12);
	position: fixed;
	inset: 0;
	box-sizing: border-box;
	width: 100%;
	max-width: none;
	height: 100%;
	max-height: none;
	margin: 0;
	padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
	border: 0;
	background: var(--tlb-bg);
	color: var(--tlb-ui);
	font-size: 15px;
	line-height: 1.45;
}
.tlb__bar, .tlb__cap { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.tlb[open] { display: flex; flex-direction: column; }
.tlb::backdrop { background: transparent; }
.tlb--light { --tlb-bg: rgba(250, 250, 250, .96); --tlb-ui: #111; --tlb-soft: rgba(0, 0, 0, .08); }
.tlb *, .tlb *::before, .tlb *::after { box-sizing: border-box; }
.tlb :focus-visible { outline: 2px solid var(--tlb-ui); outline-offset: 2px; }

/* Top bar. */
.tlb__bar { display: flex; align-items: center; justify-content: space-between; gap: 1em; order: 0; padding: 6px 8px 6px 16px; }
.tlb__count { font-variant-numeric: tabular-nums; opacity: .85; }
.tlb__tools { display: flex; gap: 2px; margin-left: auto; }
.tlb__btn {
	display: inline-grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	cursor: pointer;
	text-decoration: none;
}
.tlb__btn svg { width: 22px; height: 22px; }
.tlb__btn:hover, .tlb__btn[aria-pressed="true"] { background: var(--tlb-soft); }
.tlb__btn[hidden] { display: none; }
.tlb__btn:disabled { opacity: .3; cursor: default; }

/* Image area. */
.tlb__stage { position: relative; display: flex; flex: 1; align-items: center; justify-content: center; order: 2; min-height: 0; overflow: hidden; touch-action: pan-y pinch-zoom; }
.tlb__fig { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 100%; margin: 0; padding: 8px 64px; }
.tlb__media { display: flex; flex: 1; align-items: center; justify-content: center; width: 100%; min-height: 0; }
.tlb__media img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.tlb__media iframe { border: 0; background: #fff; }
.tlb__media .tlb__video { width: min(100%, 1280px); max-height: 100%; aspect-ratio: 16 / 9; background: #000; }
.tlb__media .tlb__doc { width: min(100%, 1100px); height: 100%; }
.tlb__media .tlb__page { width: min(100%, var(--tlb-fw, 70vw)); height: min(100%, var(--tlb-fh, 90vh)); border-radius: var(--tlb-radius, 0); }

/* Optional frame around images (Easy FancyBox's border). */
.tlb__media > img { border: var(--tlb-frame, 0) solid var(--tlb-frame-color, #fff); border-radius: var(--tlb-radius, 0); background: var(--tlb-frame-color, transparent); }

/* Pop-up content moved in from the page. */
.tlb__inline {
	max-width: min(100%, 800px);
	max-height: 100%;
	overflow: auto;
	padding: 1.5em 1.75em;
	border-radius: var(--tlb-radius, 4px);
	background: var(--tlb-box, #fff);
	color: var(--tlb-box-text, #1a1a1a);
	font-size: 1rem;
	line-height: 1.6;
	text-align: left;
}
.tlb__inline:focus { outline: none; }
.tlb__inline > :first-child { margin-top: 0; }
.tlb__inline > :last-child { margin-bottom: 0; }
.tlb[data-type="inline"] .tlb__media, .tlb[data-type="iframe"] .tlb__media, .tlb[data-type="pdf"] .tlb__media { cursor: default; }
.tlb--thumbs-none .tlb__media img, .tlb.is-single .tlb__media img { max-height: 100%; }
.tlb__cap { max-width: 70ch; padding: 10px 0 2px; text-align: center; }
.tlb__cap[hidden] { display: none; }
.tlb__title:empty, .tlb__text:empty { display: none; }
.tlb__text { opacity: .85; }

.tlb__prev, .tlb__next { position: absolute; top: 50%; z-index: 1; background: var(--tlb-soft); transform: translateY(-50%); }
.tlb__prev { left: 10px; }
.tlb__next { right: 10px; }
.tlb.is-single .tlb__prev, .tlb.is-single .tlb__next, .tlb.is-single .tlb__slideshow { display: none; }

/* Zoomed: the image at its real size, scroll (or drag on touch) to look around. */
.tlb.is-zoomed .tlb__stage { display: block; overflow: auto; touch-action: auto; }
.tlb.is-zoomed .tlb__fig { display: block; width: max-content; height: auto; min-width: 100%; padding: 0; }
.tlb.is-zoomed .tlb__media { display: block; }
.tlb.is-zoomed .tlb__media img { max-width: none; max-height: none; margin: auto; cursor: zoom-out; }
.tlb.is-zoomed .tlb__cap, .tlb.is-zoomed .tlb__prev, .tlb.is-zoomed .tlb__next { display: none; }
.tlb__media img { cursor: zoom-in; }

/* Thumbnails. */
.tlb__thumbs { display: flex; gap: 6px; order: 3; padding: 8px 12px 12px; overflow-x: auto; scrollbar-width: thin; }
.tlb__thumbs:empty { display: none; }
.tlb--thumbs-top .tlb__thumbs { order: 1; padding: 0 12px 8px; }
.tlb__thumbs button { flex: 0 0 auto; width: 60px; height: 60px; padding: 0; border: 2px solid transparent; border-radius: 4px; background: none; cursor: pointer; opacity: .6; }
.tlb__thumbs button:first-child { margin-left: auto; }
.tlb__thumbs button:last-child { margin-right: auto; }
.tlb__thumbs button[aria-current="true"] { border-color: var(--tlb-ui); opacity: 1; }
.tlb__thumbs button:hover { opacity: 1; }
.tlb__thumbs img { display: block; width: 100%; height: 100%; border-radius: 2px; object-fit: cover; }

@media (max-width: 600px) {
	.tlb__fig { padding: 4px 8px; }
	.tlb__prev, .tlb__next { top: auto; bottom: 8px; transform: none; }
	.tlb__thumbs { display: none; }
	.tlb__cap { padding-bottom: 56px; } /* Room for the arrows. */
}
