/**
 * Xiaoqi Blog — main stylesheet
 * Warm off-white + single coral accent, small radius, clear borders.
 */

:root {
	--xq-bg: #faf8f5;
	--xq-surface: #ffffff;
	--xq-ink: #2c2a28;
	--xq-ink-muted: #6b6560;
	--xq-border: #e6e0d8;
	--xq-border-strong: #d4cbc0;
	--xq-accent: #ff6b3d;
	--xq-accent-hover: #e85a2e;
	--xq-accent-soft: rgba(255, 107, 61, 0.12);
	--xq-radius: 7px;
	--xq-shadow: 0 1px 2px rgba(44, 42, 40, 0.04);
	--xq-font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
	--xq-serif: "Source Han Serif SC", "Songti SC", "Noto Serif SC", Georgia, serif;
	--xq-container: 1080px;
	--xq-gap: 1.5rem;
	--xq-gap-lg: 2.25rem;
}

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

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	font-family: var(--xq-font);
	font-size: 16px;
	line-height: 1.65;
	color: var(--xq-ink);
	background: var(--xq-bg);
	-webkit-font-smoothing: antialiased;
}

img {
	max-width: 100%;
	height: auto;
	display: block;
	border-radius: var(--xq-radius);
}

a {
	color: var(--xq-ink);
	text-decoration: none;
	transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

a:hover,
a:focus-visible {
	color: var(--xq-accent);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
	outline: 2px solid var(--xq-accent);
	outline-offset: 2px;
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

.skip-link:focus {
	clip: auto;
	clip-path: none;
	height: auto;
	width: auto;
	left: 1rem;
	top: 1rem;
	z-index: 100000;
	background: var(--xq-surface);
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--xq-border-strong);
	border-radius: var(--xq-radius);
}

.container {
	width: min(100% - 2rem, var(--xq-container));
	margin-inline: auto;
}

/* —— Header —— */
.site-header {
	background: var(--xq-surface);
	border-bottom: 1px solid var(--xq-border);
	position: sticky;
	top: 0;
	z-index: 50;
}

.header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	min-height: 64px;
	padding-block: 0.65rem;
}

.site-title {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 700;
	letter-spacing: 0.02em;
}

.site-title a {
	color: var(--xq-ink);
}

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

.site-description {
	margin: 0.15rem 0 0;
	font-size: 0.8rem;
	color: var(--xq-ink-muted);
}

.custom-logo-link img {
	max-height: 40px;
	width: auto;
	border-radius: 0;
}

.main-navigation .menu {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 0.15rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.main-navigation a {
	display: block;
	padding: 0.4rem 0.75rem;
	border-radius: var(--xq-radius);
	font-size: 0.95rem;
	font-weight: 500;
	color: var(--xq-ink-muted);
	border: 1px solid transparent;
}

.main-navigation a:hover {
	color: var(--xq-ink);
	background: var(--xq-bg);
	border-color: var(--xq-border);
}

.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a {
	color: var(--xq-accent);
	background: var(--xq-accent-soft);
	border-color: transparent;
	font-weight: 600;
}

.nav-toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 40px;
	height: 40px;
	padding: 8px;
	border: 1px solid var(--xq-border-strong);
	border-radius: var(--xq-radius);
	background: var(--xq-surface);
	cursor: pointer;
}

.nav-toggle-bar {
	display: block;
	height: 2px;
	width: 100%;
	background: var(--xq-ink);
	border-radius: 1px;
}

/* —— Buttons & links —— */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	padding: 0.55rem 1.1rem;
	font: inherit;
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.2;
	border-radius: var(--xq-radius);
	border: 1px solid transparent;
	cursor: pointer;
	text-decoration: none;
}

.btn-primary {
	background: var(--xq-accent);
	color: #fff !important;
	border-color: var(--xq-accent);
	box-shadow: var(--xq-shadow);
}

.btn-primary:hover,
.btn-primary:focus-visible {
	background: var(--xq-accent-hover);
	border-color: var(--xq-accent-hover);
	color: #fff !important;
}

.text-link {
	font-weight: 600;
	font-size: 0.9rem;
	color: var(--xq-accent);
}

.text-link:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* —— Layout —— */
.site-main {
	padding-block: var(--xq-gap-lg) 3rem;
}

.layout-home .featured-block {
	margin-bottom: var(--xq-gap-lg);
}

.content-with-sidebar {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--xq-gap-lg);
}

@media (min-width: 900px) {
	.content-with-sidebar {
		grid-template-columns: minmax(0, 1fr) 280px;
		align-items: start;
	}
}

.section-header {
	margin-bottom: 1rem;
}

.section-title {
	margin: 0;
	font-size: 1.15rem;
	font-weight: 700;
	color: var(--xq-ink);
}

.archive-description {
	margin-top: 0.5rem;
	color: var(--xq-ink-muted);
	font-size: 0.95rem;
}

/* —— Cards —— */
.card {
	background: var(--xq-surface);
	border: 1px solid var(--xq-border);
	border-radius: var(--xq-radius);
	box-shadow: var(--xq-shadow);
}

/* Featured — primary */
.featured-card {
	display: grid;
	grid-template-columns: 1fr;
	overflow: hidden;
}

@media (min-width: 720px) {
	.featured-card {
		grid-template-columns: 1.15fr 1fr;
	}
}

.featured-card__media {
	min-height: 200px;
	background: linear-gradient(145deg, #f0e8df, #e8ddd2);
}

.featured-card__media img,
.featured-card__placeholder {
	width: 100%;
	height: 100%;
	min-height: 220px;
	object-fit: cover;
	border-radius: 0;
}

.featured-card__placeholder {
	display: block;
	background:
		radial-gradient(circle at 30% 40%, rgba(255, 107, 61, 0.25), transparent 50%),
		linear-gradient(145deg, #efe6dc, #e2d5c8);
}

.featured-card__body {
	padding: 1.5rem 1.6rem;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 0.65rem;
}

.eyebrow {
	margin: 0;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--xq-accent);
}

.featured-card__title {
	margin: 0;
	font-size: clamp(1.35rem, 2.5vw, 1.75rem);
	line-height: 1.3;
	font-weight: 700;
}

.featured-card__title a {
	color: var(--xq-ink);
}

.featured-card__title a:hover {
	color: var(--xq-accent);
}

.featured-card__excerpt {
	color: var(--xq-ink-muted);
	font-size: 0.95rem;
}

.featured-card__excerpt p {
	margin: 0;
}

.featured-card__cta {
	margin: 0.35rem 0 0;
}

/* Post list — secondary */
.posts-list {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.post-card {
	display: grid;
	grid-template-columns: 1fr;
	overflow: hidden;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

@media (min-width: 560px) {
	.post-card {
		grid-template-columns: 200px 1fr;
	}
}

.post-card:hover {
	border-color: var(--xq-border-strong);
	box-shadow: 0 2px 8px rgba(44, 42, 40, 0.06);
}

.post-card__thumb {
	display: block;
	background: #efe6dc;
	min-height: 140px;
}

.post-card__thumb img {
	width: 100%;
	height: 100%;
	min-height: 140px;
	object-fit: cover;
	border-radius: 0;
}

.post-card__body {
	padding: 1.1rem 1.25rem;
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.post-card__title {
	margin: 0;
	font-size: 1.1rem;
	line-height: 1.35;
	font-weight: 650;
}

.post-card__title a {
	color: var(--xq-ink);
}

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

.post-card__excerpt {
	color: var(--xq-ink-muted);
	font-size: 0.9rem;
}

.post-card__excerpt p {
	margin: 0;
}

.post-card__more {
	margin: 0.25rem 0 0;
}

.entry-meta {
	font-size: 0.8rem;
	color: var(--xq-ink-muted);
}

.entry-meta a {
	color: var(--xq-ink-muted);
}

.entry-meta a:hover {
	color: var(--xq-accent);
}

.meta-sep {
	margin: 0 0.25rem;
	opacity: 0.6;
}

/* Single / page */
.single-card,
.page-card {
	padding: 1.75rem 1.6rem 2rem;
}

.entry-header .entry-title {
	margin: 0 0 0.65rem;
	font-size: clamp(1.5rem, 3vw, 2rem);
	line-height: 1.3;
}

.entry-thumb--single {
	margin: 1.25rem 0;
}

.entry-thumb--single img {
	width: 100%;
	border-radius: var(--xq-radius);
}

.entry-content {
	font-size: 1.05rem;
	line-height: 1.75;
}

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

.entry-content h2,
.entry-content h3,
.entry-content h4 {
	margin-top: 1.75em;
	line-height: 1.35;
}

.entry-content a {
	color: var(--xq-accent);
	text-decoration: underline;
	text-underline-offset: 2px;
}

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

.entry-content blockquote {
	margin: 1.5em 0;
	padding: 0.75rem 1rem;
	border-left: 3px solid var(--xq-accent);
	background: var(--xq-accent-soft);
	border-radius: 0 var(--xq-radius) var(--xq-radius) 0;
	color: var(--xq-ink);
}

.entry-footer {
	margin-top: 1.75rem;
	padding-top: 1rem;
	border-top: 1px solid var(--xq-border);
}

.tags-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.85rem;
}

.tags-label {
	font-weight: 600;
	color: var(--xq-ink-muted);
	margin-right: 0.25rem;
}

.tags-links a {
	display: inline-block;
	padding: 0.2rem 0.55rem;
	border: 1px solid var(--xq-border);
	border-radius: var(--xq-radius);
	background: var(--xq-bg);
	color: var(--xq-ink-muted);
}

.tags-links a:hover {
	border-color: var(--xq-accent);
	color: var(--xq-accent);
	background: var(--xq-accent-soft);
}

.post-navigation {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
	margin-top: 1.25rem;
}

.post-navigation a {
	display: block;
	padding: 0.85rem 1rem;
	border: 1px solid var(--xq-border);
	border-radius: var(--xq-radius);
	background: var(--xq-surface);
	font-size: 0.9rem;
	font-weight: 500;
}

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

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

/* —— Sidebar — tertiary —— */
.sidebar .widget {
	background: var(--xq-surface);
	border: 1px solid var(--xq-border);
	border-radius: var(--xq-radius);
	padding: 1.15rem 1.2rem;
	margin-bottom: 1rem;
	box-shadow: var(--xq-shadow);
}

.widget-title {
	margin: 0 0 0.85rem;
	font-size: 0.9rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	padding-bottom: 0.55rem;
	border-bottom: 1px solid var(--xq-border);
}

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

.widget li {
	padding: 0.4rem 0;
	border-bottom: 1px dashed var(--xq-border);
	font-size: 0.9rem;
}

.widget li:last-child {
	border-bottom: 0;
	padding-bottom: 0;
}

.widget a {
	color: var(--xq-ink);
}

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

.tagcloud a {
	display: inline-block;
	margin: 0.2rem 0.25rem 0.2rem 0;
	padding: 0.2rem 0.5rem;
	border: 1px solid var(--xq-border);
	border-radius: var(--xq-radius);
	font-size: 0.8rem !important;
	background: var(--xq-bg);
}

.tagcloud a:hover {
	border-color: var(--xq-accent);
	color: var(--xq-accent);
	background: var(--xq-accent-soft);
}

/* Search form */
.search-form {
	display: flex;
	gap: 0.5rem;
}

.search-field {
	flex: 1;
	min-width: 0;
	padding: 0.55rem 0.75rem;
	font: inherit;
	font-size: 0.9rem;
	border: 1px solid var(--xq-border-strong);
	border-radius: var(--xq-radius);
	background: var(--xq-bg);
	color: var(--xq-ink);
}

.search-field:focus {
	border-color: var(--xq-accent);
	background: var(--xq-surface);
}

.search-submit {
	flex-shrink: 0;
}

/* Pagination */
.pagination,
.navigation.pagination {
	margin-top: 1.5rem;
}

.pagination ul,
.nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.pagination a,
.pagination span,
.nav-links a,
.nav-links span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.25rem;
	padding: 0.4rem 0.7rem;
	border: 1px solid var(--xq-border);
	border-radius: var(--xq-radius);
	background: var(--xq-surface);
	font-size: 0.9rem;
	font-weight: 500;
}

.pagination .current,
.nav-links .current {
	background: var(--xq-accent);
	border-color: var(--xq-accent);
	color: #fff;
}

.pagination a:hover,
.nav-links a:hover {
	border-color: var(--xq-accent);
	color: var(--xq-accent);
}

/* Comments */
.comments-area {
	margin-top: 1.25rem;
	padding: 1.5rem;
}

.comments-title {
	margin: 0 0 1rem;
	font-size: 1.1rem;
}

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

.comment-list .comment {
	padding: 1rem 0;
	border-bottom: 1px solid var(--xq-border);
}

.comment-list .children {
	list-style: none;
	margin: 0.75rem 0 0 1.25rem;
	padding: 0;
}

.comment-form label {
	display: block;
	margin-bottom: 0.35rem;
	font-size: 0.85rem;
	font-weight: 600;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	padding: 0.55rem 0.75rem;
	font: inherit;
	border: 1px solid var(--xq-border-strong);
	border-radius: var(--xq-radius);
	background: var(--xq-bg);
	margin-bottom: 0.85rem;
}

.comment-form input:focus,
.comment-form textarea:focus {
	border-color: var(--xq-accent);
	background: var(--xq-surface);
}

/* 404 */
.error-404 {
	max-width: 520px;
	margin: 2rem auto;
	padding: 2rem 1.75rem;
	text-align: center;
}

.error-404 .page-title {
	margin-top: 0;
}

.error-404 .search-form {
	margin-top: 1.25rem;
	justify-content: center;
}

.no-posts {
	padding: 1.5rem;
	border: 1px dashed var(--xq-border-strong);
	border-radius: var(--xq-radius);
	color: var(--xq-ink-muted);
	background: var(--xq-surface);
}

/* Footer */
.site-footer {
	border-top: 1px solid var(--xq-border);
	background: var(--xq-surface);
	padding: 1.75rem 0;
	margin-top: auto;
}

.footer-inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.85rem;
	text-align: center;
}

.footer-navigation .menu {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.5rem 1rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.footer-navigation a {
	font-size: 0.9rem;
	color: var(--xq-ink-muted);
}

.footer-navigation a:hover {
	color: var(--xq-accent);
}

.site-info {
	margin: 0;
	font-size: 0.85rem;
	color: var(--xq-ink-muted);
}

.site-info a {
	color: var(--xq-ink-muted);
}

.site-info a:hover {
	color: var(--xq-accent);
}

.site {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

/* Mobile nav */
@media (max-width: 720px) {
	.nav-toggle {
		display: flex;
	}

	.main-navigation {
		display: none;
		position: absolute;
		left: 0;
		right: 0;
		top: 100%;
		background: var(--xq-surface);
		border-bottom: 1px solid var(--xq-border);
		padding: 0.75rem 1rem 1rem;
	}

	.main-navigation.is-open {
		display: block;
	}

	.main-navigation .menu {
		flex-direction: column;
	}

	.site-header {
		position: relative;
	}

	.site-header.is-nav-open {
		position: sticky;
	}

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

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