/*
Theme Name: Newill
Description: A personal publishing theme for newill.dev.
Version: 1.2.0
Requires at least: 6.0
Requires PHP: 7.4
Author: Matthew Newill
Text Domain: newill-dev
*/

@font-face {
	font-family: "Inter";
	src: url("fonts/inter-latin.woff2") format("woff2");
	font-style: normal;
	font-weight: 400 750;
	font-display: swap;
}

:root {
	color-scheme: light;
	--paper: #fffdfb;
	--ink: #23242b;
	--muted: #615b59;
	--accent: #a13b26;
	--border: #eaded9;
	--card: #f8f3ef;
	--field: #fff;
	--gutter: clamp(1.125rem, 4vw, 2rem);
}

@media (prefers-color-scheme: dark) {
	:root {
		color-scheme: dark;
		--paper: #1e1b1a;
		--ink: #faf1ec;
		--muted: #d2bfb6;
		--accent: #ffae95;
		--border: #4e3d36;
		--card: #2a2421;
		--field: #221e1d;
	}
}

*, *::before, *::after {
	box-sizing: border-box;
}

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font: 1.125rem/1.55 "Inter", system-ui, sans-serif;
	overflow-wrap: anywhere;
}

h1, h2, h3, h4 {
	line-height: 1.14;
}

a {
	color: var(--accent);
	text-underline-offset: .16em;
}

a:hover {
	text-decoration-thickness: .12em;
}

:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 4px;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.screen-reader-text:focus {
	z-index: 100000;
	top: 1rem;
	left: 1rem;
	width: auto;
	height: auto;
	padding: .65rem 1rem;
	margin: 0;
	clip-path: none;
	background: var(--paper);
	color: var(--ink);
}

.shell {
	width: min(100% - var(--gutter) * 2, 50rem);
	margin-inline: auto;
}

.site-header {
	padding: clamp(2.5rem, 6vw, 4.25rem) 0 clamp(2.25rem, 4.5vw, 3rem);
	background: linear-gradient(155deg, #b54a31, #93331f);
	color: #fff;
	text-align: center;
}

.site-name {
	display: inline-block;
	color: inherit;
	font-size: clamp(2.65rem, 7vw, 4.75rem);
	font-weight: 700;
	line-height: 1;
	letter-spacing: -.035em;
	text-decoration: none;
}

.site-intro {
	max-width: 32rem;
	margin: .85rem auto 1.5rem;
	color: #fff4ef;
	font-size: clamp(1.05rem, 2.4vw, 1.25rem);
	line-height: 1.4;
}

.site-nav {
	display: inline-block;
	max-width: 100%;
	padding: .24rem;
	border-radius: .65rem;
	background: #fff8f3;
	color: #842f20;
}

.site-nav ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: .2rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-nav a {
	display: block;
	padding: .35rem .85rem;
	border-radius: .43rem;
	color: inherit;
	font-size: 1rem;
	font-weight: 650;
	text-decoration: none;
}

.site-nav a:hover,
.site-nav .current-menu-item > a,
.site-nav .current_page_item > a {
	background: #f5ddd4;
}

.wp-singular .site-header {
	padding-block: 1.75rem 1.5rem;
}

.wp-singular .site-name {
	font-size: clamp(2rem, 5vw, 2.75rem);
}

.wp-singular .site-intro {
	display: none;
}

.wp-singular .site-nav {
	display: table;
	margin: .85rem auto 0;
}

.post-index, .reading {
	padding-top: clamp(2rem, 5vw, 3.5rem);
}

.index-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1.35rem;
}

.index-header h1, .reading h1 {
	margin: 0;
	font-weight: 700;
	letter-spacing: -.03em;
}

.index-header h1 {
	font-size: clamp(1.75rem, 4vw, 2.35rem);
}

.search-form {
	display: flex;
	align-items: stretch;
	flex-wrap: wrap;
	gap: .4rem;
	max-width: 100%;
}

.search-form label {
	flex: 1 1 8rem;
}

input, button, textarea {
	font: inherit;
}

.search-field, .search-submit, .comment-form input:not([type="checkbox"]), .comment-form textarea,
.post-password-form input {
	padding: .41rem .65rem;
	border: 1px solid var(--border);
	border-radius: .4rem;
	background: var(--field);
	color: var(--ink);
}

.search-field {
	width: 100%;
}

.search-submit, .comment-form input[type="submit"], .post-password-form input[type="submit"] {
	cursor: pointer;
	color: var(--accent);
	font-weight: 650;
}

.post-list {
	display: grid;
	gap: .85rem;
}

.post-summary {
	padding: clamp(1rem, 4vw, 1.35rem) clamp(1rem, 4vw, 1.6rem);
	border: 1px solid var(--border);
	border-radius: .8rem;
	background: var(--card);
}

.post-summary h2 {
	margin: 0;
	font-size: clamp(1.4rem, 4vw, 1.7rem);
	font-weight: 700;
	letter-spacing: -.022em;
}

.post-summary h2 a {
	color: inherit;
	text-decoration: none;
}

.post-summary h2 a:hover {
	color: var(--accent);
	text-decoration: underline;
}

.post-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: .3rem .5rem;
	margin: .35rem 0 0;
	color: var(--muted);
	font-size: .95rem;
}

.post-excerpt {
	margin-top: .55rem;
	color: var(--muted);
}

.post-excerpt p {
	margin: .4rem 0 0;
}

.pagination .nav-links, .comments-pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .75rem;
	margin-top: 1.5rem;
}

.page-numbers.current {
	font-weight: 700;
}

.reading {
	width: min(100% - var(--gutter) * 2, 45rem);
}

.reading h1 {
	font-size: clamp(2.25rem, 6vw, 3.5rem);
}

.reading .entry-header {
	margin-bottom: clamp(1.5rem, 4vw, 2.25rem);
}

.entry-header .post-meta {
	margin-top: .85rem;
}

.entry-content {
	display: flow-root;
	font-size: 1.25rem;
	line-height: 1.65;
}

.entry-content > :first-child {
	margin-top: 0;
}

.entry-content h2, .entry-content h3, .entry-content h4 {
	margin-top: 1.65em;
	margin-bottom: .5em;
}

.entry-content pre, .entry-content .wp-block-table {
	max-width: 100%;
	overflow-x: auto;
}

.entry-content code, .entry-content kbd, .entry-content pre {
	font-family: ui-monospace, Menlo, Consolas, monospace;
	font-size: .86em;
}

.entry-content pre {
	border: 1px solid var(--border);
	border-radius: .55rem;
	padding: 1rem;
	background: var(--card);
	overflow-wrap: normal;
}

.entry-content pre code {
	font-size: inherit;
}

.entry-content blockquote {
	margin-inline: 0;
	border-inline-start: .25rem solid var(--border);
	padding-inline-start: 1.1rem;
}

img, video, iframe, .wp-caption {
	max-width: 100%;
}

img, video {
	height: auto;
}

figure {
	max-width: 100%;
	margin-inline: 0;
}

figcaption, .wp-caption-text {
	color: var(--muted);
	font-size: .88em;
}

.alignleft {
	float: left;
	margin-inline-end: 1rem;
}

.alignright {
	float: right;
	margin-inline-start: 1rem;
}

.aligncenter {
	display: block;
	margin-inline: auto;
}

.post-tags {
	display: flex;
	flex-wrap: wrap;
	gap: .65rem;
	margin-top: 1.5rem;
}

.comments-area {
	margin-top: 2rem;
	padding-top: 1rem;
	border-top: 1px solid var(--border);
}

.comment-list, .comment-list .children {
	padding-inline-start: 1.25rem;
}

.comment-form label:not([for="wp-comment-cookies-consent"]) {
	display: block;
}

.comment-form input, .comment-form textarea {
	max-width: 100%;
}

.site-footer {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	margin-top: 3.5rem;
	padding: 1.1rem 0 2.25rem;
	border-top: 1px solid var(--border);
	font-size: .95rem;
}

.site-footer a:first-child {
	color: var(--muted);
}
