*,
*:before,
*:after {
	box-sizing: border-box;
	max-width: 100%;
}

/* Form controls don't inherit type styles by default; make them match the page. */
button,
input,
select,
textarea {
	font-family: inherit;
}

/**
 * The whole site sits in a single centred column of "paper", like the
 * graypaper's page — the dark backdrop shows through at the sides.
 */
.layout {
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: var(--column-width);
	min-height: 100vh;
	margin: 0 auto;
	background-color: var(--paper);
	background-image: url('/images/paper-texture.svg');
	background-attachment: fixed;
	background-size: 300px 300px;
	box-shadow:
		0 4px 6px -1px rgba(9, 9, 11, 0.6),
		0 2px 4px -2px rgba(9, 9, 11, 0.6);
}

main {
	flex: 1 0 auto;
	width: 100%;
	padding: 2rem 1.5rem 3rem;
}

@media (min-width: 48rem) {
	main {
		padding: 3.5rem 3rem 4rem;
	}
}

/* Constrain reading measure to the column's inner width */
main > * {
	max-width: 100%;
}

img {
	width: 100%;
	max-width: 100%;
	height: auto;
}

.post .cover-image {
	margin-bottom: 2rem;
	border: 1px solid var(--rule-soft);
}

/* Post titles echo the graypaper's centred, uppercase, bold-serif headline */
.post h1 {
	font-family: var(--primaryFont);
	font-weight: bold;
	text-align: center;
	text-transform: uppercase;
	font-size: clamp(1.25rem, 1rem + 1.1vw, 1.9rem);
	line-height: 1.3;
	margin-bottom: 0.75rem;
}

.post .meta {
	font-family: var(--displayFont);
	font-size: 0.6875rem;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--ink-muted);
	text-align: center;
	margin-bottom: 3rem;
	padding-bottom: 1.5rem;
	border-bottom: 1px solid var(--rule);
}

.post .meta b {
	font-weight: 500;
	color: var(--ink-faint);
}

/* Post list — a quiet, ruled index in the manner of graypaper.com/news */
.posts-list {
	list-style-type: none;
	padding: 0;
	margin: 2rem 0 0;
}

.posts-list > li {
	margin: 0;
	padding: 1.25rem 0;
	border-bottom: 1px solid var(--rule-soft);
}

.posts-list > li:first-child {
	border-top: 1px solid var(--rule-soft);
}

.posts-list article {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.posts-list .post-date {
	font-family: var(--displayFont);
	font-size: 0.6875rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--ink-faint);
}

.posts-list h2 {
	font-family: var(--primaryFont);
	font-size: 1.0625rem;
	font-weight: normal;
	line-height: 1.4;
	margin: 0;
	letter-spacing: 0;
}

.posts-list h2 a {
	color: var(--accent);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.15em;
	transition: color 0.15s;
}

.posts-list h2 a:hover {
	color: var(--ink-strong);
	text-decoration-thickness: 2px;
}

.posts-list p {
	margin: 0.5rem 0 0;
	font-size: 0.95rem;
	color: var(--ink-muted);
}

.posts-list img {
	display: none;
}

@media (min-width: 40rem) {
	.posts-list article {
		display: grid;
		grid-template-columns: 7.5rem 1fr;
		gap: 0 1.25rem;
		align-items: baseline;
	}

	.posts-list .post-date {
		grid-column: 1;
		grid-row: 1;
	}

	.posts-list .post-body {
		grid-column: 2;
		grid-row: 1;
	}
}

.post-footer {
	margin-top: 4rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--rule);
}

.post-footer h2 {
	font-family: var(--displayFont);
	font-size: 0.6875rem;
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--ink-faint);
	margin: 0 0 0.75rem;
}

.post-footer__categories {
	padding: 0;
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	list-style-type: none;
}

.post-footer li {
	display: inline-block;
	margin: 0;
}

.post-footer a {
	display: inline-block;
	font-family: var(--displayFont);
	font-size: 0.6875rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--ink-muted);
	border: 1px solid var(--rule);
	padding: 0.3rem 0.6rem;
	transition:
		color 0.15s,
		border-color 0.15s;
}

.post-footer a:hover {
	color: var(--accent);
	border-color: var(--accent);
}

.icon-link {
	position: relative;
}

.icon-link::before {
	content: url('/link.svg');
	filter: invert(0.65);
	position: absolute;
	left: -1rem;
	width: 1rem;
	height: 1rem;
	top: 0;
	opacity: 0.25;
	transition: opacity 0.2s;
}

@media (min-width: 48rem) {
	.icon-link::before {
		left: -1.5rem;
	}
}

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