/*
Theme Name: Mindbrewer
Theme URI: https://mindbrewer.com
Author: Mindbrewer
Description: A quiet, fast, text-first theme for a solo game developer's blog. Every post on one page grouped by year, devlogs grouped by project with automatic entry numbers, a projects showcase page, light and dark modes, and no web fonts or JavaScript.
Version: 1.0.0
Requires at least: 6.2
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mindbrewer
Tags: blog, one-column, custom-colors, custom-logo, custom-menu, editor-style, threaded-comments, translation-ready, wide-blocks
*/

/* ------------------------------------------------------------------
   Tokens
   ------------------------------------------------------------------ */
:root {
	--bg: #fbf8f2;
	--surface: #f3eee5;
	--text: #1f1c18;
	--muted: #6f685d;
	--rule: #e4ddd1;
	--accent: #b4441b;

	--font-serif: "Iowan Old Style", "Charter", "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
	--font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;
	--font-body: var(--font-serif);

	--measure: 40rem;
	--gutter: clamp(1rem, 4vw, 2rem);
	--radius: 6px;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #161513;
		--surface: #201e1b;
		--text: #e8e2d6;
		--muted: #9b9386;
		--rule: #2e2b27;
		--accent: #f0a35e;
	}
}

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

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font-body);
	font-size: clamp(1.0625rem, 0.4vw + 1rem, 1.1875rem);
	line-height: 1.65;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}

a {
	color: var(--accent);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

a:hover {
	text-decoration-thickness: 2px;
}

:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 3px;
	border-radius: 2px;
}

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

hr {
	border: 0;
	border-top: 1px solid var(--rule);
	margin: 2.5rem 0;
}

::selection {
	background: var(--accent);
	color: var(--bg);
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

.skip-link {
	position: absolute;
	left: -999px;
	top: 0.5rem;
	z-index: 10;
	background: var(--text);
	color: var(--bg);
	padding: 0.5rem 0.75rem;
	font-family: var(--font-sans);
	font-size: 0.875rem;
}

.skip-link:focus {
	left: 0.5rem;
}

/* ------------------------------------------------------------------
   Layout
   ------------------------------------------------------------------ */
.wrap {
	max-width: calc(var(--measure) + var(--gutter) * 2);
	margin: 0 auto;
	padding: 0 var(--gutter);
}

.site-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem 1.5rem;
	padding: 2.25rem 0 3.5rem;
	font-family: var(--font-mono);
	font-size: 0.875rem;
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 0.7rem;
	color: var(--text);
	text-decoration: none;
	font-weight: 600;
	letter-spacing: 0.01em;
}

.brand .logo {
	width: 40px;
	height: 40px;
	object-fit: contain;
	border-radius: 9px;
	flex: none;
}

.brand:hover .brand-name {
	text-decoration: underline;
	text-underline-offset: 0.25em;
}

.site-nav .menu {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.25rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.site-nav a {
	color: var(--muted);
	text-decoration: none;
}

.site-nav a:hover,
.site-nav .current-menu-item > a,
.site-nav .current_page_item > a,
.site-nav [aria-current] {
	color: var(--text);
}

.site-nav .current-menu-item > a,
.site-nav .current_page_item > a {
	text-decoration: underline;
	text-decoration-color: var(--accent);
	text-underline-offset: 0.35em;
}

.site-main {
	min-height: 50vh;
}

.site-footer {
	margin-top: 5rem;
	padding: 2rem 0 3rem;
	border-top: 1px solid var(--rule);
	font-family: var(--font-mono);
	font-size: 0.8125rem;
	color: var(--muted);
}

.footer-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.25rem;
	list-style: none;
	margin: 0 0 0.75rem;
	padding: 0;
}

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

.site-footer a:hover {
	color: var(--text);
}

.colophon {
	margin: 0;
}

/* ------------------------------------------------------------------
   Shared bits
   ------------------------------------------------------------------ */
.eyebrow,
.section-label,
.year-label,
.project-eyebrow,
.meta {
	font-family: var(--font-mono);
	font-size: 0.8125rem;
	font-weight: 400;
	letter-spacing: 0.02em;
	color: var(--muted);
}

.eyebrow {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin: 0 0 0.5rem;
	text-transform: uppercase;
}

.page-header {
	margin-bottom: 2.5rem;
}

.page-title,
.entry-title {
	font-family: var(--font-sans);
	font-weight: 700;
	font-size: clamp(1.75rem, 3.5vw + 0.8rem, 2.5rem);
	line-height: 1.15;
	letter-spacing: -0.02em;
	margin: 0;
	text-wrap: balance;
}

.lede {
	font-size: 1.2em;
	color: var(--muted);
	margin: 0.75rem 0 0;
	text-wrap: pretty;
}

.archive-description {
	color: var(--muted);
	margin-top: 0.75rem;
}

.archive-description p {
	margin: 0;
}

.sep {
	opacity: 0.6;
}

.status {
	display: inline-block;
	padding: 0.1em 0.55em;
	border: 1px solid currentColor;
	border-radius: 999px;
	font-family: var(--font-mono);
	font-size: 0.6875rem;
	line-height: 1.5;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--muted);
}

.status-development,
.status-prototype {
	color: var(--accent);
}

.status-released {
	color: #2f7d4f;
}

@media (prefers-color-scheme: dark) {
	.status-released {
		color: #7fcf9b;
	}
}

/* ------------------------------------------------------------------
   Home intro
   ------------------------------------------------------------------ */
.intro {
	font-size: 1.3em;
	line-height: 1.45;
	margin-bottom: 3rem;
	text-wrap: pretty;
}

.intro p {
	margin: 0 0 0.75rem;
}

.intro p:last-child {
	margin-bottom: 0;
}

/* ------------------------------------------------------------------
   Post lists
   ------------------------------------------------------------------ */
.year {
	margin-bottom: 2.75rem;
}

.year-label,
.section-label {
	margin: 0 0 0.75rem;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid var(--rule);
}

.section-label {
	margin-top: 3rem;
	text-transform: uppercase;
}

.post-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.post-row {
	display: grid;
	grid-template-columns: 4.25rem 1fr;
	gap: 1rem;
	align-items: baseline;
	padding: 0.4rem 0;
}

.row-date,
.row-num {
	font-family: var(--font-mono);
	font-size: 0.8125rem;
	color: var(--muted);
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.row-num {
	color: var(--accent);
}

.row-title {
	color: var(--text);
	text-decoration: none;
	font-size: 1.05em;
	line-height: 1.4;
}

.row-title:hover {
	color: var(--accent);
	text-decoration: underline;
}

.row-tag {
	display: inline-block;
	margin-left: 0.4rem;
	font-family: var(--font-mono);
	font-size: 0.6875rem;
	letter-spacing: 0.03em;
	color: var(--accent);
	vertical-align: 0.15em;
	white-space: nowrap;
}

.row-tag::before {
	content: "▸ ";
	opacity: 0.7;
}

.row-sub {
	display: block;
	font-family: var(--font-mono);
	font-size: 0.75rem;
	color: var(--muted);
}

.pagination,
.navigation.pagination {
	margin-top: 2.5rem;
	font-family: var(--font-mono);
	font-size: 0.875rem;
}

.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1rem;
}

.pagination .current {
	color: var(--muted);
}

/* ------------------------------------------------------------------
   Single post
   ------------------------------------------------------------------ */
.entry-header {
	margin-bottom: 2rem;
}

.entry-header .meta {
	margin: 0.75rem 0 0;
}

.meta a {
	color: var(--accent);
	text-decoration: none;
}

.meta a:hover {
	text-decoration: underline;
}

.entry-hero {
	margin: 0 0 2.25rem;
}

.entry-hero img {
	display: block;
	width: 100%;
	border-radius: var(--radius);
}

.entry-footer {
	margin-top: 3rem;
}

.tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	list-style: none;
	margin: 0 0 2rem;
	padding: 0;
	font-family: var(--font-mono);
	font-size: 0.8125rem;
}

.tags a {
	color: var(--muted);
	text-decoration: none;
}

.tags a::before {
	content: "#";
	opacity: 0.6;
}

.tags a:hover {
	color: var(--accent);
}

.post-nav {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1.5rem;
	margin-top: 3rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--rule);
}

.post-nav a {
	color: var(--text);
	text-decoration: none;
	line-height: 1.4;
}

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

.post-nav span {
	display: block;
	font-family: var(--font-mono);
	font-size: 0.75rem;
	color: var(--muted);
	margin-bottom: 0.25rem;
}

.post-nav .next {
	grid-column: 2;
	text-align: right;
}

/* ------------------------------------------------------------------
   Prose (post and page content)
   ------------------------------------------------------------------ */
.prose > * {
	margin-top: 0;
	margin-bottom: 1.25em;
}

.prose > :last-child {
	margin-bottom: 0;
}

.prose h2,
.prose h3,
.prose h4 {
	font-family: var(--font-sans);
	line-height: 1.25;
	letter-spacing: -0.01em;
	margin-top: 2.25em;
	margin-bottom: 0.6em;
	text-wrap: balance;
}

.prose h2 {
	font-size: 1.45em;
}

.prose h3 {
	font-size: 1.2em;
}

.prose h4 {
	font-size: 1em;
}

.prose ul,
.prose ol {
	padding-left: 1.35em;
}

.prose li + li {
	margin-top: 0.3em;
}

.prose blockquote,
.wp-block-quote {
	margin-left: 0;
	margin-right: 0;
	padding-left: 1.25em;
	border-left: 3px solid var(--accent);
	color: var(--muted);
	font-style: italic;
}

.prose blockquote cite,
.wp-block-quote cite {
	display: block;
	margin-top: 0.5em;
	font-style: normal;
	font-family: var(--font-mono);
	font-size: 0.8em;
}

.prose figure {
	margin-left: 0;
	margin-right: 0;
}

.prose img {
	border-radius: var(--radius);
}

.prose figcaption,
.wp-element-caption {
	margin-top: 0.5em;
	font-family: var(--font-mono);
	font-size: 0.8rem;
	color: var(--muted);
	text-align: center;
}

.prose table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9em;
}

.prose th,
.prose td {
	padding: 0.5em 0.75em;
	border-bottom: 1px solid var(--rule);
	text-align: left;
}

.prose hr,
.wp-block-separator {
	border: 0;
	border-top: 1px solid var(--rule);
	margin: 2.5em auto;
}

/* Code: devlogs tend to have plenty of it. */
code,
kbd,
samp,
pre {
	font-family: var(--font-mono);
	font-size: 0.86em;
}

:not(pre) > code {
	background: var(--surface);
	padding: 0.12em 0.35em;
	border-radius: 4px;
}

pre,
.wp-block-code {
	background: var(--surface);
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	padding: 1em 1.15em;
	overflow-x: auto;
	line-height: 1.55;
	tab-size: 4;
}

pre code {
	background: none;
	padding: 0;
	font-size: inherit;
}

kbd {
	padding: 0.1em 0.4em;
	border: 1px solid var(--rule);
	border-bottom-width: 2px;
	border-radius: 4px;
	background: var(--surface);
}

mark {
	background: color-mix(in srgb, var(--accent) 22%, transparent);
	color: inherit;
	padding: 0 0.15em;
}

/* Wide and full blocks: let screenshots and GIFs breathe. */
.prose .alignwide {
	width: min(100vw - var(--gutter) * 2, 56rem);
	max-width: none;
	margin-left: 50%;
	transform: translateX(-50%);
}

.prose .alignfull {
	width: 100vw;
	max-width: none;
	margin-left: 50%;
	transform: translateX(-50%);
}

.prose .alignfull img {
	border-radius: 0;
}

.alignleft {
	float: left;
	margin: 0.3em 1.5em 1em 0;
	max-width: 50%;
}

.alignright {
	float: right;
	margin: 0.3em 0 1em 1.5em;
	max-width: 50%;
}

.aligncenter {
	margin-left: auto;
	margin-right: auto;
	text-align: center;
}

.wp-block-image img {
	height: auto;
}

.wp-block-embed {
	margin-left: 0;
	margin-right: 0;
}

.wp-block-button__link {
	background: var(--accent);
	color: var(--bg);
	border-radius: var(--radius);
	font-family: var(--font-sans);
	font-size: 0.9375rem;
	font-weight: 600;
	text-decoration: none;
	padding: 0.6em 1.1em;
}

.is-style-outline .wp-block-button__link {
	background: transparent;
	color: var(--accent);
	border: 1px solid currentColor;
}

.page-links {
	font-family: var(--font-mono);
	font-size: 0.875rem;
	margin-top: 2rem;
}

/* ------------------------------------------------------------------
   Projects
   ------------------------------------------------------------------ */
.project-list {
	display: grid;
	gap: 2.5rem;
}

.prose + .project-list {
	margin-top: 2.5rem;
}

.project-card {
	display: grid;
	gap: 1rem;
}

.project-cover {
	display: block;
	border-radius: var(--radius);
	overflow: hidden;
	background: var(--surface);
	aspect-ratio: 16 / 9;
}

.project-cover img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.project-cover:hover img {
	transform: scale(1.02);
}

.project-eyebrow {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin: 0 0 0.35rem;
	text-transform: uppercase;
}

.project-eyebrow:empty {
	display: none;
}

.project-title {
	font-family: var(--font-sans);
	font-size: 1.35em;
	line-height: 1.2;
	letter-spacing: -0.01em;
	margin: 0;
}

.project-title a {
	color: var(--text);
	text-decoration: none;
}

.project-title a:hover {
	color: var(--accent);
}

.project-tagline {
	margin: 0.35rem 0 0;
	color: var(--muted);
}

.project-meta {
	margin: 0.6rem 0 0;
	font-family: var(--font-mono);
	font-size: 0.8125rem;
	color: var(--muted);
}

.project-meta a {
	text-decoration: none;
}

.project-meta a:hover,
.project-cta:hover {
	text-decoration: underline;
}

.project-cta {
	font-weight: 600;
}

/* "Currently brewing" on the home page and the card under devlog posts. */
.project-card--home,
.project-card--post {
	padding: 1.25rem 1.35rem;
	background: var(--surface);
	border: 1px solid var(--rule);
	border-radius: var(--radius);
}

.project-card--home {
	margin-bottom: 3.25rem;
}

@media (min-width: 40em) {
	.project-card--home:has(.project-cover) {
		grid-template-columns: 13rem 1fr;
		align-items: center;
		gap: 1.35rem;
	}

	.project-list .project-card:has(.project-cover) {
		grid-template-columns: 15rem 1fr;
		align-items: start;
		gap: 1.5rem;
	}
}

.project-facts {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem 2.5rem;
	margin: 2rem 0 0;
	font-size: 0.95em;
}

.project-facts dt {
	font-family: var(--font-mono);
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--muted);
}

.project-facts dd {
	margin: 0.15rem 0 0;
}

.project-header + .entry-hero {
	margin-bottom: 2rem;
}

/* ------------------------------------------------------------------
   Forms, search, comments
   ------------------------------------------------------------------ */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="search"],
textarea {
	width: 100%;
	padding: 0.55em 0.7em;
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	background: var(--bg);
	color: var(--text);
	font: inherit;
	font-family: var(--font-sans);
	font-size: 1rem;
}

input:focus,
textarea:focus {
	outline: 2px solid var(--accent);
	outline-offset: 0;
	border-color: transparent;
}

button,
input[type="submit"] {
	padding: 0.55em 1em;
	border: 0;
	border-radius: var(--radius);
	background: var(--text);
	color: var(--bg);
	font-family: var(--font-sans);
	font-size: 0.9375rem;
	font-weight: 600;
	cursor: pointer;
}

button:hover,
input[type="submit"]:hover {
	background: var(--accent);
}

.search-form {
	display: flex;
	gap: 0.5rem;
	margin-top: 1.25rem;
}

.empty {
	color: var(--muted);
}

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

.comments-title,
.comment-reply-title {
	font-family: var(--font-sans);
	font-size: 1.15em;
	margin: 0 0 1.25rem;
}

.comment-list,
.comment-list .children {
	list-style: none;
	margin: 0;
	padding: 0;
}

.comment-list .children {
	margin-left: 1.25rem;
	padding-left: 1rem;
	border-left: 1px solid var(--rule);
}

.comment-body {
	padding: 1rem 0;
}

.comment-meta {
	font-family: var(--font-mono);
	font-size: 0.8125rem;
	color: var(--muted);
}

.comment-meta a {
	color: inherit;
	text-decoration: none;
}

.comment-author {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.comment-author .fn {
	font-style: normal;
	color: var(--text);
	font-weight: 600;
}

.comment-author .says {
	display: none;
}

.comment-author img {
	border-radius: 50%;
}

.comment-content {
	margin-top: 0.5rem;
}

.comment-content p {
	margin: 0 0 0.75em;
}

.reply {
	font-family: var(--font-mono);
	font-size: 0.8125rem;
}

.comment-respond {
	margin-top: 2rem;
}

.comment-form p {
	margin: 0 0 1rem;
}

.comment-form label {
	display: block;
	margin-bottom: 0.25rem;
	font-family: var(--font-mono);
	font-size: 0.8125rem;
	color: var(--muted);
}

.comment-form .comment-form-cookies-consent {
	display: flex;
	gap: 0.5rem;
	align-items: baseline;
}

.comment-form .comment-form-cookies-consent label {
	display: inline;
}

.comment-notes,
.logged-in-as {
	font-size: 0.875rem;
	color: var(--muted);
}

.bypostauthor > .comment-body .fn::after {
	content: " ✦";
	color: var(--accent);
}

/* ------------------------------------------------------------------
   Small screens
   ------------------------------------------------------------------ */
@media (max-width: 30em) {
	.site-header {
		padding: 1.5rem 0 2.5rem;
	}

	.post-row {
		grid-template-columns: 1fr;
		gap: 0;
		padding: 0.55rem 0;
	}

	.row-date {
		font-size: 0.75rem;
	}

	.row-num {
		font-size: 0.75rem;
	}

	.post-nav {
		grid-template-columns: 1fr;
	}

	.post-nav .next {
		grid-column: 1;
		text-align: left;
	}

	.alignleft,
	.alignright {
		float: none;
		max-width: 100%;
		margin: 0 0 1em;
	}
}

@media (prefers-reduced-motion: reduce) {
	* {
		transition: none !important;
	}
}

@media print {
	.site-header nav,
	.site-footer,
	.post-nav,
	.comments {
		display: none;
	}

	body {
		background: #fff;
		color: #000;
	}
}
