/*
Theme Name: Zhiyu Qinggao
Theme URI: https://valar.cool/
Author: Zhiyu
Author URI: https://valar.cool/
Description: A quiet, text-first WordPress theme for long-running personal notes, old architecture visits, cultural observations, archives, search, and comments.
Version: 0.1.6
Requires at least: 6.0
Tested up to: 7.0
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: zhiyu-qinggao
Tags: blog, one-column, custom-menu, featured-images, threaded-comments, translation-ready
*/

:root {
	--zq-paper: #faf9f4;
	--zq-surface: #fffdf8;
	--zq-ink: #202020;
	--zq-muted: #686864;
	--zq-soft: #8a867c;
	--zq-line: #dedbd1;
	--zq-accent: #5f5143;
	--zq-accent-soft: #eeeae2;
	--zq-max: 980px;
	--zq-serif: Georgia, "Times New Roman", "Noto Serif SC", "Songti SC", SimSun, serif;
	--zq-sans: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	color: var(--zq-ink);
	background: var(--zq-paper);
	font: 16px/1.88 var(--zq-sans);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

body,
button,
input,
textarea,
select {
	font-family: var(--zq-sans);
}

a {
	color: inherit;
	text-decoration-thickness: .07em;
	text-underline-offset: .18em;
}

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

img,
svg,
video {
	display: block;
	max-width: 100%;
	height: auto;
}

button,
input,
textarea {
	color: inherit;
	font: inherit;
}

blockquote {
	margin: 2em 0;
	padding: .2em 0 .2em 1.2em;
	color: var(--zq-muted);
	border-left: 3px solid var(--zq-line);
}

table {
	width: 100%;
	border-collapse: collapse;
}

th,
td {
	padding: .7em;
	border: 1px solid var(--zq-line);
	text-align: left;
	vertical-align: top;
}

pre,
code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

pre {
	overflow-x: auto;
	padding: 1em;
	background: var(--zq-accent-soft);
}

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

.screen-reader-text:focus {
	top: 8px;
	left: 8px;
	z-index: 100000;
	display: block;
	width: auto;
	height: auto;
	padding: 12px 16px;
	clip: auto;
	color: #fff;
	background: var(--zq-ink);
}

.site {
	min-height: 100vh;
}

.site-header,
.site-main,
.site-footer {
	max-width: var(--zq-max);
	margin: 0 auto;
	padding-right: 24px;
	padding-left: 24px;
}

.site-header {
	padding-top: 30px;
	padding-bottom: 24px;
	border-bottom: 1px solid var(--zq-line);
}

.site-header__inner {
	display: grid;
	grid-template-columns: minmax(230px, .82fr) minmax(380px, 1fr);
	align-items: center;
	gap: 34px;
}

.site-branding {
	display: flex;
	align-items: center;
	gap: 20px;
	min-width: 0;
}

.site-title {
	margin: 0;
	font-family: var(--zq-serif);
	font-size: clamp(32px, 6vw, 48px);
	font-weight: 560;
	line-height: 1.08;
}

.site-title a {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
}

.site-title--logo img {
	width: clamp(62px, 6.7vw, 88px);
	height: auto;
	max-height: 115px;
	object-fit: contain;
}

.site-description {
	max-width: 230px;
	margin: 0;
	color: var(--zq-muted);
	font-size: 14px;
	line-height: 1.5;
}

.site-tools {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 18px;
}

.main-navigation ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 17px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.main-navigation a {
	color: var(--zq-muted);
	font-size: 14px;
	font-weight: 650;
	text-decoration: none;
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a {
	color: var(--zq-ink);
}

.search-form {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 42px;
	align-items: center;
	width: 44px;
	height: 42px;
	border: 1px solid transparent;
	border-radius: 999px;
	background: var(--zq-ink);
	overflow: hidden;
	transition: width .24s ease, background .24s ease, border-color .24s ease, box-shadow .24s ease;
}

.search-form:hover,
.search-form:focus-within {
	width: min(280px, 42vw);
	background: var(--zq-surface);
	border-color: var(--zq-line);
	box-shadow: 0 8px 26px rgba(32, 32, 32, .08);
}

.search-field {
	min-width: 0;
	height: 40px;
	padding: 0 2px 0 14px;
	border: 0;
	background: transparent;
	outline: 0;
	font-size: 13px;
	opacity: 0;
	transition: opacity .18s ease;
}

.search-form:hover .search-field,
.search-form:focus-within .search-field {
	opacity: 1;
}

.search-submit {
	display: grid;
	width: 42px;
	height: 40px;
	place-items: center;
	padding: 0;
	color: #fff;
	background: var(--zq-ink);
	border: 0;
	border-radius: 999px;
	font-size: 22px;
	font-family: var(--zq-serif);
	line-height: 1;
	cursor: pointer;
}

.search-submit svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-width: 2;
}

.site-main {
	padding-top: 44px;
	padding-bottom: 64px;
}

.home-intro {
	margin-bottom: 38px;
	padding-bottom: 28px;
	border-bottom: 1px solid var(--zq-line);
}

.home-intro__eyebrow,
.archive-label,
.entry-meta,
.entry-footer,
.post-card__meta,
.image-caption,
.comment-metadata,
.logged-in-as,
.comment-notes {
	color: var(--zq-muted);
	font-size: 13px;
}

.home-intro__eyebrow,
.archive-label {
	margin: 0 0 10px;
	font-weight: 850;
	letter-spacing: .15em;
	text-transform: uppercase;
}

.page-title {
	max-width: 820px;
	margin: 0;
	font-family: var(--zq-serif);
	font-size: clamp(35px, 5.5vw, 58px);
	font-weight: 540;
	line-height: 1.15;
}

.home-intro__headline {
	max-width: none;
	margin: 0;
	font-family: var(--zq-serif);
	font-size: 42px;
	font-weight: 540;
	line-height: 1.22;
	white-space: nowrap;
}

.home-intro p {
	max-width: 720px;
	margin: 18px 0 0;
	color: var(--zq-muted);
	line-height: 2;
}

.post-list {
	display: grid;
	gap: 0;
}

.post-card {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 168px;
	gap: 24px;
	padding: 30px 0;
	border-bottom: 1px solid var(--zq-line);
}

.post-card:first-child {
	padding-top: 0;
}

.post-card__title {
	margin: 0;
	font-family: var(--zq-serif);
	font-size: clamp(25px, 3vw, 34px);
	font-weight: 540;
	line-height: 1.28;
}

.post-card__title a {
	text-decoration: none;
}

.post-card__excerpt {
	margin: 14px 0 0;
	color: var(--zq-muted);
}

.post-card__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 8px;
	margin: 14px 0 0;
	line-height: 1.7;
}

.post-card__meta--after {
	padding-top: 2px;
}

.post-card__thumb {
	position: relative;
	align-self: start;
	margin: 0;
}

.post-card__thumb img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border: 1px solid var(--zq-line);
	background: var(--zq-accent-soft);
}

.entry-header {
	margin-bottom: 24px;
}

.entry-title {
	max-width: 860px;
	margin: 0;
	font-family: var(--zq-serif);
	font-size: clamp(34px, 5vw, 58px);
	font-weight: 540;
	line-height: 1.16;
}

.entry-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 14px;
}

.entry-thumbnail {
	margin: 0 0 28px;
}

.entry-thumbnail img {
	width: 100%;
	max-height: 72vh;
	object-fit: contain;
	background: var(--zq-accent-soft);
	border: 1px solid var(--zq-line);
}

.entry-content {
	font-family: var(--zq-serif);
	font-size: 18px;
	line-height: 2.05;
}

.entry-content > * {
	max-width: 760px;
}

.entry-content > .alignwide {
	max-width: 100%;
}

.entry-content > .alignfull {
	max-width: none;
	margin-right: calc(50% - 50vw);
	margin-left: calc(50% - 50vw);
}

.entry-content p {
	margin: 0 0 1.4em;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
	margin: 2.1em 0 .75em;
	font-family: var(--zq-serif);
	line-height: 1.35;
}

.entry-content h2 {
	font-size: 30px;
}

.entry-content h3 {
	font-size: 24px;
}

.entry-content figure {
	margin: 2em 0;
}

.entry-content figcaption,
.wp-caption-text {
	margin-top: .65em;
	color: var(--zq-muted);
	font-family: var(--zq-sans);
	font-size: 13px;
	line-height: 1.6;
	text-align: left;
}

.entry-content img {
	border: 1px solid var(--zq-line);
}

.entry-footer {
	display: grid;
	gap: 8px;
	margin-top: 34px;
	padding-top: 20px;
	border-top: 1px solid var(--zq-line);
}

.entry-footer a,
.post-card__meta a {
	color: var(--zq-muted);
}

.nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-start;
	gap: 8px;
	margin-top: 34px;
}

.nav-links a,
.page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 46px;
	min-height: 40px;
	padding: 0 14px;
	border: 1px solid var(--zq-line);
	border-radius: 8px;
	background: var(--zq-surface);
	text-decoration: none;
	line-height: 1;
	transition: background .18s ease, border-color .18s ease, color .18s ease;
}

.page-numbers.current {
	color: #fff;
	background: var(--zq-ink);
	border-color: var(--zq-ink);
}

.nav-links a:hover,
.page-numbers:not(.current):hover {
	border-color: color-mix(in srgb, var(--zq-ink) 32%, var(--zq-line));
}

.post-navigation .nav-links {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}

.post-navigation .nav-links a {
	display: grid;
	align-content: center;
	gap: 4px;
	min-height: 64px;
	padding: 12px 14px;
	border-style: dashed;
	text-align: left;
}

.post-navigation .nav-next {
	text-align: right;
}

.nav-subtitle {
	color: var(--zq-muted);
	font-size: 12px;
}

.nav-title {
	font-family: var(--zq-serif);
	font-size: 16px;
	line-height: 1.4;
}

.page-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 7px;
	margin: 2.2em 0 1.4em;
	font-family: var(--zq-sans);
	font-size: 14px;
}

.page-links__label {
	margin-right: 2px;
	color: var(--zq-muted);
	font-weight: 700;
}

.page-links > a,
.page-links > span:not(.page-links__label) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 34px;
	min-height: 32px;
	padding: 0 10px;
	border: 1px solid var(--zq-line);
	border-radius: 7px;
	background: var(--zq-surface);
	text-decoration: none;
	line-height: 1;
}

.page-links > span:not(.page-links__label) {
	color: #fff;
	background: var(--zq-ink);
	border-color: var(--zq-ink);
}

.page-links > a:hover {
	border-color: color-mix(in srgb, var(--zq-ink) 32%, var(--zq-line));
}

.comments-area {
	margin-top: 48px;
	padding-top: 32px;
	border-top: 1px solid var(--zq-line);
}

.comments-title,
.comment-reply-title {
	margin: 0 0 22px;
	font-family: var(--zq-serif);
	font-size: 28px;
	font-weight: 540;
}

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

.comment-list .children {
	margin: 18px 0 0 28px;
	padding: 0;
	list-style: none;
}

.comment-body {
	padding: 22px 0;
	border-bottom: 1px solid var(--zq-line);
}

.comment-author {
	display: flex;
	align-items: center;
	gap: 10px;
	font-style: normal;
}

.comment-author .avatar {
	width: 38px;
	height: 38px;
	border-radius: 50%;
}

.comment-content {
	margin-top: 12px;
	color: var(--zq-muted);
}

.comment-form {
	display: grid;
	gap: 14px;
	max-width: 680px;
}

.comment-form label {
	display: block;
	margin-bottom: 5px;
	color: var(--zq-muted);
	font-size: 13px;
}

.comment-form input:not([type="checkbox"]),
.comment-form textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--zq-line);
	border-radius: 8px;
	background: var(--zq-surface);
}

.comment-form textarea {
	min-height: 220px;
	resize: vertical;
}

.comment-form input:not([type="checkbox"]):focus,
.comment-form textarea:focus {
	outline: 2px solid color-mix(in srgb, var(--zq-accent) 18%, transparent);
	outline-offset: 2px;
	border-color: color-mix(in srgb, var(--zq-accent) 38%, var(--zq-line));
}

.form-submit .submit,
.comment-form input[type="submit"],
#submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 18px;
	color: #fff !important;
	background: var(--zq-ink);
	border: 1px solid var(--zq-ink);
	border-radius: 8px;
	cursor: pointer;
	font-weight: 700;
	text-decoration: none;
}

.form-submit .submit:hover,
.comment-form input[type="submit"]:hover,
#submit:hover {
	background: var(--zq-accent);
	border-color: var(--zq-accent);
}

.no-results,
.not-found {
	padding: 34px;
	border: 1px solid var(--zq-line);
	background: var(--zq-surface);
}

.site-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 22px;
	padding-top: 30px;
	padding-bottom: 42px;
	color: var(--zq-muted);
	border-top: 1px solid var(--zq-line);
}

.site-info {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 12px;
}

.site-info span + span::before {
	content: "/";
	margin-right: 12px;
	color: var(--zq-line);
}

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

.footer-menu {
	display: flex;
	flex-wrap: wrap;
	gap: 15px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sticky .post-card__title::before {
	content: "置顶";
	display: inline-flex;
	margin-right: .5em;
	padding: .15em .45em;
	color: #fff;
	background: var(--zq-accent);
	font-family: var(--zq-sans);
	font-size: 12px;
	vertical-align: middle;
}

.bypostauthor {
	outline: 0;
}

@media (max-width: 760px) {
	body {
		font-size: 15px;
	}

	.site-header,
	.site-main,
	.site-footer {
		padding-right: 18px;
		padding-left: 18px;
	}

	.site-header__inner,
	.post-card,
	.site-footer {
		grid-template-columns: 1fr;
		justify-items: start;
	}

	.site-branding {
		align-items: flex-end;
	}

	.site-title--logo img {
		width: 62px;
	}

	.site-tools {
		width: 100%;
		align-items: flex-start;
		justify-content: flex-start;
		flex-direction: column;
	}

	.main-navigation ul {
		justify-content: flex-start;
	}

	.home-intro__headline {
		font-size: 24px;
	}

	.search-form {
		width: 100%;
		background: var(--zq-surface);
		border-color: var(--zq-line);
	}

	.search-field {
		opacity: 1;
	}

	.post-card__thumb {
		order: -1;
		width: 100%;
	}

	.post-card__thumb img {
		aspect-ratio: 16 / 10;
	}

	.entry-content {
		font-size: 17px;
	}

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

	.post-navigation .nav-next {
		text-align: left;
	}

	.comment-list .children {
		margin-left: 16px;
	}
}

@media (max-width: 520px) {
	.home-intro__headline {
		font-size: 18px;
	}
}

@media (max-width: 380px) {
	.home-intro__headline {
		font-size: 15px;
	}
}
