/* cspell:ignore oldstyle-nums */
body {
	line-height: var(--body-line-height);
	font-weight: var(--body-font-weight);
	font-variant-numeric: oldstyle-nums;
}

::marker {
	font-variant-numeric: oldstyle-nums;
}

main ul:not(.toc) {
	list-style-type: square;

	ul {
		li::marker {
			content: '– ';
			font-weight: bold;
		}
	}

	li::marker {
		color: var(--yellow);
	}
}

li:not(:last-of-type) {
	margin-bottom: 0.75rem;
	position: relative;

	@media (min-width: 66rem) {
		margin-bottom: 0;
	}
}

a {
	color: inherit;
	text-decoration: underline;
	text-decoration-color: var(--blue-dark);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.115em;
	transition: color 0.15s, text-decoration-color 0.1s;

	.dark & {
		text-decoration-color: var(--blue-light);
	}

	&:hover,
	&:focus {
		color: var(--blue-light);
		text-decoration-color: var(--blue-light);
	}
}

h1,
.h1,
h2,
.h2,
h3,
.h3,
h4,
.h4,
h5,
.h5,
h6,
.h6 {
	font-family: var(--heading-font);
	font-weight: bold;
	color: var(--heading-color);
	line-height: 1.2;
	position: relative;
	margin-bottom: var(--quarter-note);
	margin-top: var(--whole-note);
	padding: 0;

	a {
		color: inherit;
	}
}

h1,
.h1 {
	font-size: 2rem;
	position: relative;
	margin-top: var(--quarter-note);
	font-weight: normal;

	@media (min-width: 42rem) {
		font-size: 2.6rem;
	}
}

h2,
.h2 {
	font-size: 1.6rem;
	font-weight: bold;
	margin: var(--whole-note) 0 var(--quarter-note);
	z-index: 2;

	@media (min-width: 42rem) {
		font-size: 2rem;
		margin-top: var(--tied-whole-note);
	}

	&::before {
		content: '';
		width: var(--whole-note);
		height: 0.125em;
		background: currentColor;
		display: block;
		margin: 0 0 var(--eighth-note);
	}
}

h2 + h3 {
	margin-top: var(--half-note);
}

h3,
.h3 {
	font-size: 1.3rem;
	margin-top: var(--dotted-half-note);

	@media (min-width: 42rem) {
		font-size: 1.5rem;
	}
}

h4,
.h4 {
	font-size: 1rem;
	text-transform: uppercase;
}

h5,
.h5 {
	font-size: 1.1rem;
}

h6,
.h6 {
	font-size: 1rem;
}

h4,
.h4,
h5,
.h5,
h6,
.h6 {
	margin-top: var(--half-note);
}

.h3,
.h4,
.h5,
.h6 {
	&::before {
		display: none;
	}
}

* {
	-moz-osx-font-smoothing: grayscale;
	-webkit-font-smoothing: antialiased;
}

p {
	margin: 0 0 var(--quarter-note);
}

blockquote {
	font-size: 1.125rem;
	margin: var(--half-note) 0;
	padding: 0 0 0 var(--quarter-note);
	font-style: italic;
	line-height: 1.5;
	position: relative;
	border: 0;
	border-left: 4px solid var(--blue-light);
	white-space: pre-wrap;

	p {
		margin-bottom: 1em;
	}

	> *:last-of-type {
		margin-bottom: 0;
	}
}

ul,
ol {
	padding-left: 1rem;
	margin: var(--quarter-note) 0;

	li {
		padding-left: var(--sixteenth-note);

		p {
			margin-bottom: var(--eighth-note);
		}
	}

	ul,
	ol {
		margin: var(--quarter-note) 0;
	}

	li + li {
		margin-top: var(--eighth-note);
	}
}

.post > ol,
.post > ul {
	li + li {
		margin-top: var(--quarter-note);
	}
}

.post {
	.cover-image {
		margin: 0;
		border: 1px solid var(--neutral-dark);
	}

	.meta + p::first-letter,
	.meta + *:not(p) + p::first-letter,
	.meta + *:not(p) + *:not(p) + p::first-letter,
	hr + p::first-letter {
		font-size: 3.3em;
		float: left;
		line-height: 0.7;
		margin: 0.35rem 0.3rem 0 -0.125rem;
		color: inherit;
		font-weight: bold;
	}

	.meta {
		font-size: 0.8rem;
		line-height: 1.6;
		margin: var(--half-note) 0 var(--whole-note);
		width: max-content;
		padding: 0.5em 0;
		font-family: var(--heading-font);
		border-top: 2px solid var(--neutral-light);

		b {
			text-transform: uppercase;
			font-style: normal;
			font-size: 0.7rem;
		}
	}

	.post-footer {
		margin: var(--whole-note) 0 var(--half-note);

		.h4 {
			margin: 0 0 calc(var(--quarter-note) / 2);

			&::before {
				display: none;
			}
		}
	}

	.post-links {
		margin: var(--half-note) 0;
		font-family: var(--heading-font);

		a {
			margin-left: 1ch;
		}

		&__contact::marker {
			content: '📩';
		}

		&__blog::marker {
			content: '🔙';
		}
	}

	.section-heading-image {
		margin-top: var(--dotted-whole-note);

		& + * {
			margin-top: var(--quarter-note);
		}
	}

	.cp_embed_wrapper {
		width: calc(100% + var(--margin) + var(--margin));
		max-width: unset;
		margin-left: calc(var(--margin) * -1);

		@media (max-width: 92rem) and (min-width: 82rem) {
			margin-left: 0;
		}
	}

	.back-to-top {
		position: relative;
	}

	@media (min-width: 82rem) {
		h1 {
			width: calc(100% + 15vw);
			max-width: unset;
			font-size: calc(1.8rem + 1.5vw);
		}
	}
}

.sidebar {
	margin-inline: auto !important;
}

figure {
	margin: var(--half-note) 0;

	p {
		margin: 0;
	}

	img {
		display: block;
		margin-bottom: 0;
		margin-inline: auto;
	}
}

figcaption {
	font-size: 0.75rem;
	text-align: center;
	margin: 0.5rem 0 0;
	font-style: italic;
	text-wrap: balance;
}

:where(h2, h3, h4, h5, h6) {
	position: relative;

	a[aria-hidden] {
		position: absolute;
		display: block;
		left: -0.75em;
		width: 1em;
		height: 1em;
		line-height: 1;
		text-align: center;

		@media (min-width: 34rem) {
			left: -1em;
		}
	}

	.icon-link {
		position: relative;

		&::before {
			content: '#';
			color: var(--neutral-light);
			font-weight: normal;
			opacity: 0;
		}
	}

	&:hover .icon-link::before {
		opacity: 1;
	}
}

h1,
h2,
h3,
h4,
h5,
h6 {
	text-wrap: balance;
}
