/*
 * Interactive timeline, [fd_embed name=timeline] (Tóth and Bresler case pages).
 * Loaded only on pages that carry it (functions.php section 8).
 */

.fd-t {
	--t-blue: #2c6fca;
	--t-red: #b8322a;
	--t-accent: var(--fd-burgundy, #9b1947);
	--t-ink: #1d1d1b;
	--t-muted: #5f5f5a;
	--t-line: #d4d4cc;
	--t-grid: #e6e6e0;
	--t-label: 36%;
	position: relative;
	/* wider than the half-width text column, centred on it */
	width: min(1140px, 92vw);
	margin: 2em 0 1.6em calc(50% - min(570px, 46vw));
	font-family: var(--fd-font-body, "Open Sans", sans-serif);
	font-size: 14px;
	line-height: 1.45;
	color: var(--t-ink);
}
.fd-t p,
.fd-t ul,
.fd-t li {
	max-width: none;
}

.fd-t-title {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
	line-height: 1.3;
}
.fd-t-sub {
	margin: 4px 0 12px;
	font-size: 13px;
	color: var(--t-muted);
}
.fd-t-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.fd-t-chip {
	position: relative;
	margin: 0;
	padding: 4px 13px 4px 30px;
	font: inherit;
	font-size: 13px;
	color: inherit;
	background: #fff;
	border: 1.5px solid var(--t-line);
	border-radius: 0;
	cursor: pointer;
}
.fd-t-chip::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 12px;
	width: 9px;
	height: 9px;
	background: var(--t-blue);
	transform: translateY(-50%) rotate(45deg);
}
.fd-t-chip--b::before {
	background: var(--t-red);
	border-radius: 50%;
}
.fd-t-chip[aria-pressed="false"] {
	color: var(--t-muted);
	background: #f1f1ed;
	text-decoration: line-through;
}
.fd-t-chip[aria-pressed="false"]::before {
	background: #b9b9b2;
}
.fd-t-chip:focus-visible,
.fd-t-btn:focus-visible,
.fd-t-close:focus-visible,
.fd-t-rel button:focus-visible,
.fd-t-map:focus-visible,
.fd-t-panel:focus-visible {
	/* !important: the parent theme has *:focus { outline: none !important } */
	outline: 2px solid var(--t-accent) !important;
	outline-offset: 2px;
}
/* without JavaScript the filter does nothing and the details are already shown */
.fd-t:not(.fd-t--js) .fd-t-filter,
.fd-t:not(.fd-t--js) .fd-t-hint {
	display: none;
}
.fd-t-hint {
	margin: 10px 0 8px;
	font-size: 13px;
	color: var(--t-muted);
}

.fd-t-chart {
	position: relative;
}
.fd-t-lines {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 0;
	overflow: visible;
	pointer-events: none;
}
.fd-t-lines path {
	fill: none;
	stroke: #b4b4ab;
	stroke-width: 1.4;
	stroke-dasharray: 5 4;
}
.fd-t-lines path.is-dim {
	stroke: #e4e4de;
}
.fd-t-lines path.is-hot {
	stroke: var(--t-accent);
	stroke-width: 2.2;
	stroke-dasharray: none;
}
.fd-t-lines text {
	font-family: var(--fd-font-body, "Open Sans", sans-serif);
	font-size: 12.5px;
	fill: #5f5f5a;
}
.fd-t-lines text.is-dim {
	fill: #b4b4ab;
}
.fd-t-lines text.is-hot {
	fill: var(--t-accent);
	font-weight: 600;
}

.fd-t-axis {
	display: grid;
	grid-template-columns: var(--t-label) 1fr;
	height: 30px;
}
.fd-t-years {
	position: relative;
	border-bottom: 1.5px solid var(--t-line);
}
.fd-t-years span {
	position: absolute;
	bottom: 6px;
	font-size: 13px;
	color: var(--t-muted);
	transform: translateX(-50%);
}

.fd-t-row {
	position: relative;
	z-index: 1;
}
.fd-t-row.is-off {
	display: none;
}
.fd-t-btn {
	display: grid;
	grid-template-columns: var(--t-label) 1fr;
	align-items: stretch;
	box-sizing: border-box;
	width: 100%;
	min-height: 46px;
	margin: 0;
	padding: 0;
	font: inherit;
	text-align: left;
	color: inherit;
	background: none;
	border: 0;
	border-radius: 0;
	cursor: pointer;
}
.fd-t-btn:hover {
	background: rgba(0, 0, 0, 0.03);
}
.fd-t-name {
	align-self: center;
	padding: 4px 14px 4px 6px;
	font-size: 15px;
	line-height: 1.3;
}
.fd-t-track {
	position: relative;
	/* year grid lines, one per year (--t-cols years on the axis; Tóth: 2021–2027) */
	background-image: linear-gradient(to right, var(--t-grid) 1px, transparent 1px);
	background-size: calc(100% / var(--t-cols, 6)) 100%;
	border-right: 1px solid var(--t-grid);
}
.fd-t-track::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 0;
	width: var(--x);
	border-top: 1px solid #ecece6;
}
.fd-t-dot {
	position: absolute;
	top: 50%;
	left: var(--x);
	z-index: 1;
	width: 13px;
	height: 13px;
	background: var(--t-blue);
	border-radius: 2px;
	transform: translate(-50%, -50%) rotate(45deg);
}
.fd-t-row--b .fd-t-dot {
	background: var(--t-red);
	border-radius: 50%; /* bankruptcies: circle, foundings: diamond (not colour alone) */
}
@media (forced-colors: active) {
	.fd-t-dot,
	.fd-t-chip::before {
		box-sizing: border-box;
		border: 2px solid CanvasText;
	}
}
.fd-t-date {
	position: absolute;
	top: 50%;
	left: calc(var(--x) + 15px);
	padding: 0 4px;
	font-size: 13.5px;
	background: #fff; /* lines run behind the dates */
	white-space: nowrap;
	color: var(--t-muted);
	transform: translateY(-50%);
}
.fd-t-row--flip .fd-t-date {
	left: auto;
	right: calc(100% - var(--x) + 15px);
}
/* the kind is spoken and shown in the panel; on wide screens the colour carries it */
.fd-t-kind {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* Company rows (Bresler page): a bar from the register entry to today, striped red
   from insolvency proceedings or liquidation on; each dot sits at its own --x. */
.fd-t-label {
	align-self: center;
	padding: 4px 14px 4px 6px;
}
.fd-t-label .fd-t-name {
	display: block;
	padding: 0;
}
.fd-t-row--bar .fd-t-date,
.fd-t-row--bar.is-sel .fd-t-date {
	position: static;
	display: block;
	padding: 0;
	font-size: 12.5px;
	white-space: normal;
	background: none;
	transform: none;
}
.fd-t-row--bar .fd-t-track::before {
	display: none;
}
.fd-t-seg {
	position: absolute;
	top: 50%;
	height: 12px;
	background: #5a5a60;
	transform: translateY(-50%);
}
.fd-t-seg--liq {
	background: repeating-linear-gradient(135deg, var(--t-red) 0 5px, #d9716a 5px 10px);
}
.fd-t-row--bar .fd-t-dot {
	box-shadow: 0 0 0 2px #fff;
}
.fd-t-dot--b {
	background: var(--t-red);
	border-radius: 50%;
}
.fd-t-dot--p {
	box-sizing: border-box;
	width: 11px;
	height: 11px;
	background: #fff;
	border: 2.5px solid #2f2f33;
	border-radius: 50%;
}
.fd-t--sel .fd-t-row:not(.is-sel):not(.is-rel) .fd-t-seg {
	opacity: 0.3;
}
.fd-t--sel .fd-t-row:not(.is-sel):not(.is-rel) .fd-t-dot--p {
	background: #fff;
	border-color: #c4c4bd;
}
.fd-t-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 18px;
	margin: 0 0 12px;
	padding: 0;
	list-style: none;
	font-size: 13px;
	color: var(--t-muted);
}
.fd-t-legend li {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
}
.fd-t-legend li::before {
	content: "";
	box-sizing: border-box;
	width: 22px;
	height: 10px;
	background: #5a5a60;
}
.fd-t-legend .fd-t-lg-liq::before {
	background: repeating-linear-gradient(135deg, var(--t-red) 0 5px, #d9716a 5px 10px);
}
.fd-t-legend .fd-t-lg-p::before {
	width: 11px;
	height: 11px;
	background: #fff;
	border: 2.5px solid #2f2f33;
	border-radius: 50%;
}

/* selection */
.fd-t-row.is-sel .fd-t-btn {
	background: rgba(155, 25, 71, 0.075); /* translucent: the lines behind stay visible */
}
.fd-t-row.is-sel .fd-t-date {
	background: #f7eef2;
}
.fd-t-row.is-sel .fd-t-dot,
.fd-t-row.is-rel .fd-t-dot {
	box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--t-accent);
}
.fd-t-row.is-sel .fd-t-name {
	font-weight: 600;
}
.fd-t--sel .fd-t-row:not(.is-sel):not(.is-rel) .fd-t-name,
.fd-t--sel .fd-t-row:not(.is-sel):not(.is-rel) .fd-t-date {
	color: #6f6f69;
}
.fd-t--sel .fd-t-row:not(.is-sel):not(.is-rel) .fd-t-dot {
	background: #c4c4bd;
}

/* details: inline without JavaScript, in the panel with it */
.fd-t-detail {
	margin: 0 0 12px var(--t-label);
	font-size: 13px;
}
.fd-t--js .fd-t-row .fd-t-detail {
	display: none;
}
.fd-t-detail ul {
	margin: 0;
	padding: 0 0 0 18px;
}
.fd-t-detail li {
	margin: 0 0 5px;
}
.fd-t-src {
	margin: 8px 0 0;
	font-size: 12.5px;
	color: var(--t-muted);
}

.fd-t-panel {
	position: relative;
	z-index: 2;
	margin: 6px 0 12px;
	padding: 16px 20px 18px;
	background: #fff;
	border: 1.5px solid var(--t-accent);
	border-radius: 0;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
}
.fd-t-panel[hidden] {
	display: none;
}
.fd-t-panel:focus {
	outline: none;
}
.fd-t-panel-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
}
.fd-t-panel-title {
	margin: 0;
	font-size: 16.5px;
	font-weight: 600;
	line-height: 1.3;
}
.fd-t-close {
	flex: none;
	margin: 0;
	padding: 2px 10px;
	font: inherit;
	font-size: 12.5px;
	color: var(--t-muted);
	background: none;
	border: 1px solid var(--t-line);
	border-radius: 0;
	cursor: pointer;
}
.fd-t-panel-meta {
	margin: 2px 0 0;
	font-size: 13px;
	color: var(--t-muted);
}
.fd-t-panel .fd-t-detail {
	margin: 10px 0 0;
	font-size: 14px;
}
.fd-t-panel-sub {
	margin: 14px 0 6px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--t-muted);
}
.fd-t-rel {
	display: grid;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.fd-t-rel li {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 2px 10px;
	margin: 0;
	padding: 0;
}
.fd-t-rel button {
	margin: 0;
	padding: 0;
	font: inherit;
	font-weight: 600;
	text-align: left;
	color: var(--t-accent);
	background: none;
	border: 0;
	border-bottom: 1px solid currentColor;
	cursor: pointer;
}
.fd-t-rel span {
	font-size: 13px;
	color: var(--t-muted);
}
.fd-t-map {
	margin: 14px 0 0;
	padding: 5px 14px;
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	color: var(--t-accent);
	background: #fff;
	border: 1.5px solid var(--t-accent);
	border-radius: 0;
	cursor: pointer;
}

/* Phones: a dated list without the axis and lines; the panel opens under the tapped event. */
@media (max-width: 759px) {
	.fd-t-axis,
	.fd-t-lines {
		display: none;
	}
	.fd-t-btn {
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		gap: 2px;
		padding: 10px 6px;
		border-bottom: 1px solid #ececE6;
		border-radius: 0;
	}
	.fd-t-name {
		align-self: auto;
		padding: 0;
		font-weight: 600;
	}
	.fd-t-track {
		position: static;
		display: flex;
		align-items: center;
		gap: 12px;
		background: none;
		border: 0;
	}
	.fd-t-track::before {
		display: none;
	}
	.fd-t-dot {
		position: static;
		flex: none;
		width: 10px;
		height: 10px;
		margin-left: 5px;
		transform: rotate(45deg);
	}
	.fd-t-date,
	.fd-t-row--flip .fd-t-date {
		position: static;
		padding: 0;
		background: none;
		transform: none;
	}
	.fd-t-kind {
		position: static;
		width: auto;
		height: auto;
		overflow: visible;
		clip: auto;
		font-size: 12.5px;
		color: var(--t-muted);
	}
	.fd-t-detail {
		margin-left: 0;
	}
	.fd-t-panel {
		margin: 8px 0;
	}
	/* company rows: name and period only, the bars need the axis */
	.fd-t-label {
		align-self: auto;
		padding: 0;
	}
	.fd-t-label .fd-t-name {
		font-weight: 600;
	}
	.fd-t-row--bar .fd-t-track,
	.fd-t-legend {
		display: none;
	}
}
