.link-overlay {
	--link-overlay-columns: 2;
	--link-overlay-gap: var(--gap-md);
	--link-overlay-padding: var(--padding-xs);
	--link-overlay-radius: var(--radius-2xl);

	--hover-shadow-y: var(--hover-overlay-shadow-x);
	--hover-shadow-x: var(--hover-overlay-shadow-x);

	display: grid;
	grid-template-columns: repeat(var(--link-overlay-columns), minmax(0, 1fr));
	gap: var(--link-overlay-gap);
	list-style: none;
	margin: 0;
	padding: 0;
}

@media (min-width: 768px) {
	.link-overlay {
		--link-overlay-gap: var(--gap-xl);
		--link-overlay-columns: 3;
	}
}

@media (min-width: 1280px) {
	.link-overlay {
		--link-overlay-columns: 4;
	}
}

.link-overlay-item {
	background-color: var(--element-bg);
	border: var(--element-border);
	border-radius: var(--link-overlay-radius);
	color: var(--element-text);
	padding: var(--link-overlay-padding);
	text-underline-offset: var(--size-1);
	font-size: var(--font-size-heading-sm);
	line-height: var(--lh-max-loose);
	font-weight: var(--font-weight-bold);
	min-height: calc(3lh + 2 * var(--link-overlay-padding));
	height: 100%;
	width: 100%;
	display: flex;
	align-items: flex-start;
	position: relative;
	transition: var(--button-transition);
	cursor: pointer;

	text-decoration: var(--text-decoration);
	text-decoration-style: var(--text-decoration-style);
	text-decoration-skip-ink: var(--text-decoration-skip-ink);
	text-decoration-thickness: var(--text-decoration-thickness);
	text-underline-offset: var(--text-underline-offset);
}

.link-overlay-item::after {
	content: "";
	position: absolute;
	top: var(--hover-shadow-y);
	left: var(--hover-shadow-x);
	right: calc(-1 * var(--hover-shadow-x));
	bottom: calc(-1 * var(--hover-shadow-y));
	border-radius: inherit;
	background-color: transparent;
	pointer-events: none;
	transition: var(--button-transition);
	z-index: -1;

	@media (forced-colors: active) {
		content: none;
	}
}

.link-overlay-item span {
	text-align: left;
	hyphens: auto;
	word-break: break-word;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	overflow: hidden;
}

.link-overlay-item:hover {
	text-decoration: none;
}

.link-overlay-item:hover::after {
	background-color: var(--shadow-neutral);
}

.link-overlay-item:focus-visible {
	box-shadow: none;
	outline: 4px solid var(--border-neutral);
	outline-offset: 0;
	text-decoration: none;
}

.element-dialog {
	background: none;
}
