/* page layout */
html {
	max-width: 55em;
	margin-left: auto;
}
body {
	position: relative;
	margin-right: auto;
	padding: 5em 1em 0 5em;
	max-width: 38em;

	font-family: bask, baskerville, serif;
	line-height: 1.5;
}
@media (max-width: 580px) {
	body {
		padding: 2em 1em 0 1em;
	}
}

/* Typography */
body {
	font-variant-ligatures: common-ligatures;
	font-kerning: normal;
}
h1 {
	font-size: 2em;
	letter-spacing: 0.1em;
	font-feature-settings: "smcp";
}
h2 {
	font-size: 1.2em;
}
p {
	margin-bottom: 1em;
}
body > p:first-of-type::first-letter,
article > p:first-of-type::first-letter {
	initial-letter: 2;
	font-weight: bold;
	font-size: 2em;
	line-height: 1em;
}
body > p:first-of-type::first-line,
article > p:first-of-type::first-line
{
	font-feature-settings: "smcp";
}
abbr {
	border-bottom: dotted 1px black;
}
code:not([data-lang]) {
	background: lightgray;
	border: solid gray 1px;
	white-space: pre-wrap;
	wrap-inside: avoid;
	vertical-align: middle;
	padding: 1px 0.5ch;
}
.fixme {
	color: red;
	background: yellow;
	text-transform: uppercase;
	border: dashed orange;
}
.note {
	font-style: italic;
}

blockquote::before {
	content: "“";
	font-size: 3em;
	position: absolute;
	top: 0;
	left: -1ch;
}
blockquote {
	position:relative;
	font-size: 0.85em;
	margin-left: 3em;
	margin-right: 0;
}

/* link styling */
a {
	color: black;
}
a:visited {
	color: grey;
}
h1 a,
a[rel=bookmark] {
	text-decoration: none;
}
h1 a:hover,
a[rel=bookmark]:hover {
	text-decoration: underline;
}
a[rel=bookmark]::before {
	float: left;
	margin-left: -1em;
	content: "§";
}
a[rel=bookmark]:not(:hover)::before {
	color: lightgrey;
}

/* list styles */
ul,
dl {
	list-style: none;
	padding: 0;
	line-height: 2;
	position: relative;
	margin-top: 1em;
}
ul > li,
dt {
	padding-left: 2em;
}
dt::before,
ul > li::before {
	position:absolute;
	left: 0;
	height: 20px;
	width: 20px;
	content: "";
	border: 3px solid gray;
	border-bottom: 6px solid gray;
	border-top: 1px solid gray;
	border-radius: 16px;
	background: lightgrey;
	-webkit-transform: translateY(3px) scale(0.3);
	transform: translateY(3px) scale(0.3); /* drawing at larger scale and then scaling down to work around chrome doing ugly things with borders less than 1px */
}
dt:hover::before, 
ul > li:hover::before {
	background: white;
	border-color: lightgrey;
	-webkit-transform: translateY(1px) scale(0.4);
	transform: translateY(1px) scale(0.6);
}

/* Footer layout */
footer {
	font-size: smaller;
	margin: 2em 0 2em;
}
footer a::before {
	display: inline-block;
	content: "";
	width: 16px;
	height: 16px;
	line-height: 0;
	margin-right: 0.5ch;
	vertical-align: middle;
	background-size: contain;
}
#subscribe {
	margin: 1em 0;
	text-align: center;
}
#subscribe a::before {
	background-image: url("/assets/feed-icon.svg");
}
#contact-list #twitter a::before {
	background-image: url("/assets/twitter-icon.svg");
}
#contact-list #email a::before {
	background-image: url("/assets/mail-icon.svg");
}
#contact-list #github a::before {
	background-image: url("/assets/github-icon.svg");
}
#contact-list {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	text-align: center; /*fallback if flexbox isn't supported. Has no effect if it is.*/
}
#contact-list li {
	display: inline-block; /*fallback if flexbox isn't supported. Has no effect if it is.*/
	margin: 1em auto;
	white-space: nowrap;
	flex: 1 0 0;
	text-align: center;
	padding: 0 1em;
}
@supports not (min-width:auto) {
	/* Chrome supports flexbox but not min-width: auto.
	 * Bail out to the fallback */
	#contact-list {
		display: block;
	}
}
#contact-list li::before {
	content: none;
}
footer [rel=license] {
	text-align: center;
	display: block;
}

/* Blog layout */
article header {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
}
article header h2 {
	margin-left: 1em;
	margin-right: 0.5em;
	flex: 1;
	text-wrap: balance;
}
article header time {
	color: grey;
	margin-right: 1em;
	font-size: 0.7em;
	wrap-inside: avoid;
}
article {
	border-top: solid lightgrey 1px;
	padding: 0 1em 2em;
}
article:last-of-type {
	border-bottom: solid lightgrey 1px;
}

/* Navigation */
#nav {
	font-size: smaller;
	position: absolute;
	top: 0;
	right: 1em;
}

#pagination {
	margin: 1em 0;
	text-align: center;
}
#pagination a {
	display: block;
}
#pagination::after {
	content: " ";
	display: block;
	visibility: hidden;
	clear: both;
}
#pagination [rel=next] {
	float: left;
}
#pagination [rel=next]::before {
	content: "←";
	text-decoration: underline white;
}
#pagination [rel=prev] {
	float: right;
}
#pagination [rel=prev]:after {
	content: "→";
	text-decoration: underline white;
}

/* Animations and transitions */
::before, ::after {
	transition-property: padding, margin, border, margin, background, transform, -webkit-transform;
	transition-duration: 0.3s;
}

/* Fonts */
@font-face {
	font-family: bask;
	src: url(/assets/LibreBaskerville-Regular.otf);
}
@font-face {
	font-family: bask;
	src: url(/assets/LibreBaskerville-Bold.otf);
	font-weight: bold;
}
@font-face {
	font-family: bask;
	src: url(/assets/LibreBaskerville-Italic.otf);
	font-style: italic;
}
