@use "../../styles/variables";

$bullet-size: 0.7em;
$line-width: 0.2em;

:root {
	--ob-linked-list-bullet-size: 0.7em;
	--ob-linked-list-line-width: 0.2em;
}

.ObLinkedList-root {
	list-style-type: none;
	margin-left: 0;
	padding-left: 0;
}

.ObLinkedList-item {
	display: flex;
	align-items: center;
	flex-direction: row;
}

.ObLinkedList-leftColumn {
	flex: 1 1 4em;
	font-size: 0.75em;
	padding: 0 1em;
	text-align: center;
}

.ObLinkedList-rightColumn {
	flex: 1 1 100%;
	padding: 1em 1em 1em 1.5em;
}

.ObLinkedList-line {
	display: flex;
	align-self: stretch;
	flex: 0 0 $line-width;
	background: white;
	position: relative;
}

.ObLinkedList-bullet {
	background: white;

	border: 1px solid rgba(50, 50, 50, 0.25);
	border-radius: 0.55em;
	height: $bullet-size;
	width: $bullet-size;

	position: absolute;
	left: 0;
	top: 50%;

	transform: translate(
		calc(-1 * (var(--ob-linked-list-bullet-size) / 2) + (var(--ob-linked-list-line-width) / 2)),
		-50%
	);
}

.ObLinkedList-card {
	display: block;
	background: white;
	border: 1px solid;
	border-color: variables.$color-border-top variables.$color-border-side variables.$color-border-bottom;
	border-radius: 0.1875em;
	color: inherit;
	cursor: pointer;
	flex: 100% 1 1;
	position: relative;
}

.ObLinkedList-card::before {
	border-bottom: 0.5em solid transparent;
	border-right: 1em solid white;
	border-top: 0.5em solid transparent;
	content: " ";
	filter: drop-shadow(-1px 0px 1px rgba(50, 50, 50, 0.2));
	height: 1em;
	left: -1em;
	margin-top: -0.5em;
	position: absolute;
	top: 50%;
	width: 1em;
}

.ObLinkedList-card:hover {
	background-color: variables.$block-color-bg-hover !important;
	color: inherit;
	text-decoration: inherit;
}

.ObLinkedList-card:hover::before {
	border-right-color: variables.$block-color-bg-hover !important;
}
