// HEADINGS
h1,
h2,
h3,
h4,
h5,
h6 {
	text-wrap: balance;
	margin: 2rem 0 1rem;
	font-weight: lighter;
	line-height: 1.25;
	font-family: var(--font-antique);
	letter-spacing: -0.05em;
}

h1 {
	font-size: 2.5rem;
}

h2 {
	font-size: 2rem;
}

h3 {
	font-size: 1.5rem;
}

small {
	color: var(--fg-muted-5);
	font-size: 0.875em;
}

abbr[title] {
	cursor: help;
	text-decoration: underline;
	text-decoration-style: dotted;
	text-decoration-thickness: max(1px, 0.0625em);
}

figcaption {
	color: var(--fg-muted-4);
	font-size: 0.875em;
	text-align: center;
}

blockquote {
	margin: 0;
	border-radius: 0.25rem;
	border-inline-start: 0.25rem solid var(--primary-color);
	padding: 0 0.75rem;
	color: var(--fg-muted-5);
}

mark,
del,
ins,
samp,
q {
	box-shadow: var(--edge-highlight);
	border-radius: var(--rounded-corner-small);
	padding: 0.125rem 0.375rem;
}

mark {
	background-color: var(--primary-color-alpha);
	color: var(--primary-color);
}

del {
	background-color: var(--red-bg);
	color: var(--red-fg);
	text-decoration: line-through;
	text-decoration-thickness: max(1px, 0.0625em);
}

ins {
	background-color: var(--green-bg);
	color: var(--green-fg);
	text-decoration: underline;
	text-decoration-thickness: max(1px, 0.0625em);
}

samp {
	background-color: var(--fg-muted-1);
	color: var(--fg-muted-5);
	font-size: 0.875em;
}

q {
	background-color: var(--fg-muted-1);
	color: var(--fg-muted-5);
	font-style: italic;
}

u {
	text-decoration: underline;
	text-decoration-style: wavy;
	text-decoration-color: var(--red-fg);
	text-decoration-thickness: max(1px, 0.0625em);
}

progress {
	-webkit-appearance: none;
	appearance: none;
	box-shadow: var(--edge-highlight);
	border: none;
	border-radius: 999px;
	background-color: var(--fg-muted-1);
	width: 100%;
	height: 0.5rem;
	color: var(--primary-color);

	&:indeterminate {
		background-color: var(--fg-muted-1);
	}

	&:indeterminate::-moz-progress-bar {
		background-color: transparent;
	}

	&::-webkit-progress-bar {
		background-color: transparent;
	}

	&::-moz-progress-bar {
		border-radius: 999px;
		background-color: var(--primary-color);
	}

	&::-webkit-progress-value {
		border-radius: 999px;
		background-color: var(--primary-color);
	}
}

kbd {
	display: inline-block;
	transition: var(--transition);
	cursor: pointer;
	box-shadow: inset 0 -0.125rem 0 var(--fg-muted-2), 0 -0.0625rem 0 var(--fg-muted-3);
	border-radius: var(--rounded-corner-small);
	background-color: var(--fg-muted-2);
	padding: 0.25rem 0.375rem;
	font-size: 0.875em;
	line-height: 1;

	// Small nice thingy, keys can be pressed!
	&:active {
		transform: translateY(0.125rem);
		box-shadow: inset 0 0.0625rem 0 var(--fg-muted-2);
		background-color: var(--fg-muted-3);
	}
}

a {
	color: var(--primary-color);
	font-weight: bold;
	text-decoration-thickness: max(1px, 0.0625em);

	&:hover {
		text-decoration-style: wavy;
	}
}

hr {
	margin: 2rem auto;
	border: none;
	border-top: 0.1875rem double var(--fg-muted-2);
	overflow: visible;
	color: var(--fg-muted-4);
	font-size: 1.5rem;
	text-align: center;

	&::after {
		position: relative;
		top: -1.5rem;
		background: var(--bg-color), var(--primary-color);
		padding: 0 0.25rem;
		content: "☙❧";

		// An ugly hack to fix mirroring in rtl
		:root[dir*="rtl"] & {
			content: "❧☙";
		}
	}
}

dt {
	font-weight: bold;
}

dd {
	margin-bottom: 1rem;
}

aside {
	float: right;
	margin-inline-start: 1rem;
	box-shadow: var(--edge-highlight);
	border-radius: var(--rounded-corner);
	background-color: var(--primary-color-alpha);
	padding: 1rem;
	width: 30%;

	:root[dir*="rtl"] & {
		float: left;
	}

	@media only screen and (max-width: 720px) {
		float: none;
		margin-inline-start: 0;
		width: 100%;
	}
}

details {
	box-shadow: var(--edge-highlight);
	border-radius: var(--rounded-corner);
	background-color: var(--fg-muted-1);
	padding: 1rem;

	summary {
		cursor: pointer;
		line-height: 1.25;
	}
}
