/*
Theme Name: kestrel
Description: A warm, editorial classic theme for long-form guide sites, built on a soft clay, oatmeal and sage palette with a two-column reading layout and card-based archives.
Version: 1.4
Requires at least: 6.0
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
*/

/* ------------------------------------------------------------------
   Design tokens
------------------------------------------------------------------ */
:root {
	--bg: #f5efe3;
	--bg-raised: #fdfaf3;
	--bg-deep: #ece3cf;
	--fg: #3b2f24;
	--muted: #847a67;
	--border: #ddd0b8;
	--border-soft: #e9dfc9;
	--accent: #b05f3c;
	--accent-dark: #8c4a2d;
	--accent-soft: #f4e4d8;
	--sage: #6f7d5c;
	--sage-soft: #e7e9da;
	--radius: 14px;
	--radius-sm: 9px;
	--shadow: 0 14px 34px rgba(59, 47, 36, 0.10);
	--shadow-soft: 0 5px 16px rgba(59, 47, 36, 0.07);
	--media-ratio: 16 / 9;
	--wrap: 1180px;
	--gap: 28px;
	--font-body: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
	--font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

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

body {
	margin: 0;
	background: var(--bg);
	color: var(--fg);
	font-family: var(--font-body);
	font-size: 1.0625rem;
	line-height: 1.75;
}

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

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

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

h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-body);
	font-weight: 700;
	line-height: 1.25;
	color: var(--fg);
	margin: 0 0 0.6em;
}

p {
	margin: 0 0 1.2em;
}

.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 {
	position: static;
	width: auto;
	height: auto;
	margin: 0;
	clip: auto;
}

/* ------------------------------------------------------------------
   Header
------------------------------------------------------------------ */
.site-header {
	background: var(--bg-raised);
	border-bottom: 1px solid var(--border);
}

.header-inner {
	max-width: var(--wrap);
	margin: 0 auto;
	padding: 18px 24px;
	display: flex;
	align-items: center;
	gap: 24px;
	flex-wrap: wrap;
}

.site-branding {
	flex: 0 0 auto;
}

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

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

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

.primary-nav {
	flex: 1 1 auto;
}

.primary-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 4px 6px;
	font-family: var(--font-ui);
	font-size: 0.92rem;
}

.primary-menu li {
	position: relative;
}

.primary-menu a {
	display: block;
	padding: 9px 13px;
	color: var(--fg);
	text-decoration: none;
	border-radius: var(--radius-sm);
}

.primary-menu a:hover {
	background: var(--bg-deep);
	color: var(--fg);
}

.primary-menu .menu-item-has-children > a::after {
	content: "";
	display: inline-block;
	margin-left: 7px;
	width: 6px;
	height: 6px;
	border-right: 1.6px solid var(--muted);
	border-bottom: 1.6px solid var(--muted);
	transform: rotate(45deg) translateY(-2px);
}

.primary-menu .sub-menu {
	list-style: none;
	margin: 0;
	padding: 8px;
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	min-width: 250px;
	background: var(--bg-raised);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow);
	opacity: 0;
	visibility: hidden;
	transform: translateY(5px);
	transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
	z-index: 60;
}

.primary-menu li:hover > .sub-menu,
.primary-menu li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
}

.primary-menu .sub-menu a {
	padding: 8px 12px;
	white-space: nowrap;
}

.header-search {
	flex: 0 0 auto;
}

.nav-toggle {
	display: none;
	background: var(--bg-deep);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 10px 12px;
	cursor: pointer;
	font-family: var(--font-ui);
	font-size: 0.9rem;
	color: var(--fg);
}

.nav-toggle::before {
	content: "";
	display: block;
	width: 20px;
	height: 14px;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 14'%3E%3Crect y='0' width='20' height='2' rx='1'/%3E%3Crect y='6' width='20' height='2' rx='1'/%3E%3Crect y='12' width='20' height='2' rx='1'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 14'%3E%3Crect y='0' width='20' height='2' rx='1'/%3E%3Crect y='6' width='20' height='2' rx='1'/%3E%3Crect y='12' width='20' height='2' rx='1'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ------------------------------------------------------------------
   Layout
------------------------------------------------------------------ */
.site-main {
	max-width: var(--wrap);
	margin: 0 auto;
	padding: 36px 24px 64px;
}

.layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: var(--gap);
	align-items: start;
}

.content-area {
	min-width: 0;
}

/* Article/static pages: keep the breadcrumb-to-paper gap compact (~1rem). */
.single .site-main,
.page .site-main {
	padding-top: 16px;
}

/* ------------------------------------------------------------------
   Breadcrumb
------------------------------------------------------------------ */
.breadcrumb {
	margin: 0 0 16px;
	font-family: var(--font-ui);
	font-size: 0.84rem;
}

.breadcrumb .trail {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 4px 8px;
	align-items: center;
}

.breadcrumb .crumb {
	color: var(--muted);
}

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

.breadcrumb .crumb a:hover {
	color: var(--accent-dark);
}

.breadcrumb .crumb + .crumb::before {
	content: "›";
	margin-right: 8px;
	color: var(--border);
}

.breadcrumb .crumb span[aria-current] {
	color: var(--fg);
}

/* ------------------------------------------------------------------
   Archive headers
------------------------------------------------------------------ */
.archive-header {
	margin-bottom: 30px;
	padding-bottom: 22px;
	border-bottom: 1px solid var(--border);
}

.page-title {
	font-size: clamp(1.8rem, 3.4vw, 2.5rem);
	margin-bottom: 0.25em;
}

.archive-desc {
	color: var(--muted);
	max-width: 62ch;
}

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

.search-summary {
	color: var(--muted);
	font-family: var(--font-ui);
	font-size: 0.9rem;
	margin-top: 8px;
}

/* ------------------------------------------------------------------
   Hero feature (homepage first screen)
------------------------------------------------------------------ */
.hero-feature {
	display: grid;
	grid-template-columns: 1.25fr 1fr;
	gap: 0;
	background: var(--bg-raised);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
	box-shadow: var(--shadow);
	margin-bottom: 40px;
}

.hero-no-media {
	grid-template-columns: 1fr;
}

.hero-media {
	display: block;
	position: relative;
	overflow: hidden;
	min-height: 280px;
}

.hero-media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.hero-body {
	padding: 34px 36px;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.hero-title {
	font-size: clamp(1.5rem, 2.6vw, 2.05rem);
	margin-bottom: 0.45em;
}

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

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

.hero-excerpt {
	color: var(--muted);
	font-size: 1rem;
	margin-bottom: 14px;
}

.hero-meta {
	font-family: var(--font-ui);
	font-size: 0.84rem;
	color: var(--muted);
	margin: 0;
}

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

.hero-meta a:hover {
	color: var(--accent-dark);
}

.section-title {
	font-size: 1.35rem;
	margin: 0 0 20px;
	padding-top: 4px;
}

/* ------------------------------------------------------------------
   Card grid (archives + related posts)
------------------------------------------------------------------ */
.card-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--gap);
	margin-bottom: 42px;
}

.card {
	background: var(--bg-raised);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
	box-shadow: var(--shadow-soft);
	display: flex;
	flex-direction: column;
}

.card-media {
	display: block;
	aspect-ratio: var(--media-ratio);
	overflow: hidden;
	background: var(--bg-deep);
}

.card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.card-body {
	padding: 20px 22px 24px;
	display: flex;
	flex-direction: column;
	flex: 1;
}

.card-meta {
	font-family: var(--font-ui);
	font-size: 0.8rem;
	color: var(--muted);
	margin-bottom: 8px;
}

.card-cat {
	color: var(--sage);
	text-decoration: none;
	font-weight: 600;
}

.card-cat:hover {
	color: var(--accent-dark);
}

.meta-dot {
	margin: 0 6px;
	color: var(--border);
}

.card-title {
	font-size: 1.18rem;
	margin-bottom: 0.45em;
	overflow-wrap: break-word;
}

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

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

.card-excerpt {
	color: var(--muted);
	font-size: 0.95rem;
	margin-bottom: 0;
	flex: 1;
	overflow-wrap: break-word;
}

/* ------------------------------------------------------------------
   Pagination
------------------------------------------------------------------ */
.pagination {
	font-family: var(--font-ui);
	font-size: 0.92rem;
	margin: 8px 0 10px;
}

.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.pagination .page-numbers {
	display: inline-block;
	padding: 8px 14px;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: var(--bg-raised);
	color: var(--fg);
	text-decoration: none;
}

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

.pagination .page-numbers:hover:not(.current) {
	background: var(--bg-deep);
}

.pagination .page-numbers.dots {
	border: none;
	background: none;
	color: var(--muted);
}

/* ------------------------------------------------------------------
   Single post
------------------------------------------------------------------ */
.single-article {
	background: var(--bg-raised);
	border: 1px solid var(--border-soft);
	border-radius: var(--radius);
	box-shadow: 0 1px 2px rgba(59, 47, 36, 0.05), 0 12px 30px rgba(59, 47, 36, 0.09);
	padding: clamp(22px, 4.5vw, 52px);
}

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

.entry-title {
	font-size: clamp(1.9rem, 3.6vw, 2.6rem);
	margin-bottom: 0.35em;
}

.entry-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 0;
	align-items: center;
	font-family: var(--font-ui);
	font-size: 0.86rem;
	color: var(--muted);
}

.entry-meta .meta-dot {
	margin: 0 10px;
}

.entry-meta .meta-by {
	margin-right: 4px;
}

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

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

.entry-media {
	margin: 0 0 30px;
	border-radius: var(--radius-sm);
	overflow: hidden;
	background: var(--bg-deep);
}

.entry-media img {
	display: block;
	width: 100%;
	height: auto;
}

.article-note {
	background: var(--accent-soft);
	border-left: 4px solid var(--accent);
	border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
	padding: 18px 22px;
	margin: 0 0 32px;
	font-size: 0.98rem;
}

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

.toc {
	background: var(--bg-deep);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	margin: 0 0 34px;
}

.toc .toc-title {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	list-style: none;
	cursor: pointer;
	padding: 18px 26px;
	font-family: var(--font-ui);
	font-size: 0.82rem;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--sage);
	margin: 0;
}

.toc .toc-title::-webkit-details-marker {
	display: none;
}

.toc .toc-title::after {
	content: "+";
	font-size: 1.05rem;
	line-height: 1;
	color: var(--sage);
}

.toc[open] .toc-title::after {
	content: "\2212";
}

.toc[open] .toc-title {
	padding-bottom: 12px;
}

.toc .toc-list {
	margin: 0;
	padding: 0 26px 20px 48px;
	font-size: 0.98rem;
}

.toc-list li {
	margin-bottom: 6px;
}

.toc-list li::marker {
	color: var(--accent);
}

.toc-list a {
	text-decoration: none;
}

.toc-list a:hover {
	text-decoration: underline;
}

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

.entry-content p,
.entry-content li,
.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6,
.entry-content blockquote,
.entry-content figcaption {
	overflow-wrap: break-word;
}

.entry-content .table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	margin: 0 0 1.4em;
}

.entry-content .table-wrap table {
	margin-bottom: 0;
}

.entry-content h2 {
	font-size: 1.65rem;
	margin: 1.7em 0 0.55em;
	scroll-margin-top: 24px;
}

.entry-content h3 {
	font-size: 1.28rem;
	margin: 1.5em 0 0.5em;
	scroll-margin-top: 24px;
}

.entry-content h4 {
	font-size: 1.1rem;
	margin: 1.4em 0 0.5em;
}

.entry-content ul,
.entry-content ol {
	padding-left: 1.5em;
	margin: 0 0 1.3em;
}

.entry-content li {
	margin-bottom: 0.4em;
}

.entry-content blockquote {
	margin: 1.6em 0;
	padding: 4px 0 4px 24px;
	border-left: 4px solid var(--sage);
	color: var(--muted);
	font-style: italic;
}

.entry-content blockquote p:last-child {
	margin-bottom: 0;
}

.entry-content table {
	width: 100%;
	border-collapse: collapse;
	margin: 0 0 1.4em;
	font-size: 0.95rem;
}

.entry-content th,
.entry-content td {
	border: 1px solid var(--border);
	padding: 10px 14px;
	text-align: left;
}

.entry-content th {
	background: var(--bg-deep);
	font-family: var(--font-ui);
	font-size: 0.86rem;
}

.entry-content img {
	border-radius: var(--radius-sm);
}

.entry-content .wp-caption,
.entry-content figure {
	margin: 0 0 1.4em;
}

.entry-content figcaption,
.entry-content .wp-caption-text {
	font-family: var(--font-ui);
	font-size: 0.82rem;
	color: var(--muted);
	margin-top: 8px;
}

.entry-content code {
	background: var(--bg-deep);
	border-radius: 4px;
	padding: 2px 6px;
	font-size: 0.9em;
}

.entry-content pre {
	background: var(--fg);
	color: var(--bg);
	padding: 18px 20px;
	border-radius: var(--radius-sm);
	overflow-x: auto;
	margin: 0 0 1.4em;
}

.entry-content pre code {
	background: none;
	padding: 0;
	color: inherit;
}

.entry-tags {
	margin: 34px 0 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	font-family: var(--font-ui);
	font-size: 0.84rem;
}

.entry-tags a {
	display: inline-block;
	padding: 6px 14px;
	background: var(--sage-soft);
	color: var(--sage);
	border-radius: 999px;
	text-decoration: none;
}

.entry-tags a:hover {
	background: var(--sage);
	color: #fff;
}

.author-bio {
	display: flex;
	gap: 20px;
	align-items: flex-start;
	background: var(--sage-soft);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 24px 26px;
	margin-top: 38px;
}

.author-bio-avatar {
	flex: 0 0 96px;
}

.author-bio-avatar img {
	border-radius: 50%;
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: cover;
}

.author-bio-title {
	font-size: 1.1rem;
	margin-bottom: 0.35em;
}

.author-bio .author-bio-label {
	margin: 0 0 0.25em;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--accent);
}

.author-bio .author-bio-link {
	display: inline-block;
	margin-top: 0.7em;
	font-size: 0.88rem;
	font-weight: 600;
	color: var(--accent-dark);
	text-decoration: none;
	border-bottom: 1px dashed var(--border);
}

.author-bio-title a {
	color: var(--fg);
	text-decoration: none;
}

.author-bio-body p {
	margin: 0;
	color: var(--fg);
	font-size: 0.96rem;
}

.related-posts {
	margin-top: 44px;
	padding-top: 30px;
	border-top: 1px solid var(--border);
}

.related-title {
	font-size: 1.4rem;
	margin-bottom: 22px;
}

.related-posts .card-grid {
	margin-bottom: 0;
}

.related-posts .card {
	box-shadow: none;
}

/* ------------------------------------------------------------------
   Comments
------------------------------------------------------------------ */
.comments-area {
	margin-top: 46px;
	padding-top: 32px;
	border-top: 1px solid var(--border);
}

.comments-title {
	font-size: 1.3rem;
	margin-bottom: 24px;
}

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

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

.comment-body {
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 18px 20px;
	margin-bottom: 16px;
}

.comment-meta {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 10px;
	font-family: var(--font-ui);
	font-size: 0.86rem;
}

.comment-meta .avatar {
	border-radius: 50%;
}

.comment-meta .fn {
	font-weight: 600;
	color: var(--fg);
}

.comment-metadata {
	font-size: 0.8rem;
	color: var(--muted);
}

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

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

.reply {
	font-family: var(--font-ui);
	font-size: 0.84rem;
	margin-top: 8px;
}

.comment-reply-link {
	display: inline-block;
	padding: 5px 14px;
	background: var(--bg-deep);
	border-radius: 999px;
	color: var(--fg);
	text-decoration: none;
}

.comment-reply-link:hover {
	background: var(--accent);
	color: #fff;
}

.comment-respond .comment-reply-title {
	font-size: 1.2rem;
	margin-bottom: 14px;
}

.comment-form {
	font-family: var(--font-ui);
	font-size: 0.92rem;
}

.comment-form label {
	display: block;
	font-weight: 600;
	margin-bottom: 6px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 11px 14px;
	font-family: var(--font-body);
	font-size: 1rem;
	color: var(--fg);
	margin-bottom: 18px;
}

.comment-form input:focus,
.comment-form textarea:focus {
	outline: 2px solid var(--sage);
	outline-offset: 1px;
	border-color: var(--sage);
}

.comment-form-cookies-consent {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	margin-bottom: 18px;
}

.comment-form-cookies-consent label {
	font-weight: 400;
	margin: 0;
}

.comment-form .submit {
	background: var(--accent);
	color: #fff;
	border: none;
	border-radius: 999px;
	padding: 12px 30px;
	font-family: var(--font-ui);
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
}

.comment-form .submit:hover {
	background: var(--accent-dark);
}

.comment-form .submit:focus-visible {
	outline: 2px solid var(--accent-dark);
	outline-offset: 2px;
}

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

.comment-navigation {
	font-family: var(--font-ui);
	font-size: 0.9rem;
	margin-bottom: 22px;
}

.no-comments {
	color: var(--muted);
	font-family: var(--font-ui);
	font-size: 0.9rem;
}

/* ------------------------------------------------------------------
   Page template
------------------------------------------------------------------ */
.page-article {
	background: var(--bg-raised);
	border: 1px solid var(--border-soft);
	border-radius: var(--radius);
	box-shadow: 0 1px 2px rgba(59, 47, 36, 0.05), 0 12px 30px rgba(59, 47, 36, 0.09);
	padding: clamp(22px, 4.5vw, 52px);
}

/* ------------------------------------------------------------------
   Sidebar
------------------------------------------------------------------ */
.site-sidebar {
	display: flex;
	flex-direction: column;
	gap: var(--gap);
}

.side-module {
	background: var(--bg-raised);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow-soft);
	padding: 24px 24px 26px;
}

.side-title {
	font-family: var(--font-ui);
	font-size: 0.82rem;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--sage);
	margin-bottom: 14px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--border);
}

.side-list {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 0.95rem;
}

.side-list li {
	margin-bottom: 10px;
}

.side-list li:last-child {
	margin-bottom: 0;
}

.side-list a {
	color: var(--fg);
	text-decoration: none;
}

.side-list a:hover {
	color: var(--accent-dark);
}

.side-list .side-date {
	display: block;
	font-family: var(--font-ui);
	font-size: 0.78rem;
	color: var(--muted);
	margin-top: 2px;
}

.side-list .cat-count {
	color: var(--muted);
	font-family: var(--font-ui);
	font-size: 0.78rem;
	margin-left: 6px;
}

/* ------------------------------------------------------------------
   Search form
------------------------------------------------------------------ */
.search-form {
	display: flex;
	gap: 8px;
	align-items: stretch;
}

.search-field {
	flex: 1;
	min-width: 0;
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: 999px;
	padding: 9px 16px;
	font-family: var(--font-ui);
	font-size: 0.9rem;
	color: var(--fg);
}

.search-field:focus {
	outline: 2px solid var(--sage);
	outline-offset: 1px;
	border-color: var(--sage);
}

.search-submit {
	background: var(--accent);
	color: #fff;
	border: none;
	border-radius: 999px;
	padding: 9px 20px;
	font-family: var(--font-ui);
	font-size: 0.88rem;
	font-weight: 600;
	cursor: pointer;
	flex: 0 0 auto;
}

.search-submit:hover {
	background: var(--accent-dark);
}

.header-search .search-form {
	max-width: 260px;
}

/* ------------------------------------------------------------------
   404 & empty states
------------------------------------------------------------------ */
.empty-state,
.not-found-article {
	background: var(--bg-raised);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow-soft);
	padding: clamp(30px, 5vw, 56px);
	text-align: center;
}

.empty-state .search-form,
.not-found-article .search-form {
	max-width: 420px;
	margin: 26px auto 0;
}

.not-found-links {
	margin-top: 34px;
	text-align: left;
	max-width: 460px;
	margin-left: auto;
	margin-right: auto;
}

.not-found-links h2 {
	font-size: 1.05rem;
	margin-bottom: 10px;
}

.not-found-links ul {
	margin: 0;
	padding-left: 1.3em;
}

.not-found-links li {
	margin-bottom: 6px;
}

/* ------------------------------------------------------------------
   Footer
------------------------------------------------------------------ */
.site-footer {
	background: #33291f;
	color: #d8cdbb;
	margin-top: 20px;
}

.footer-inner {
	max-width: var(--wrap);
	margin: 0 auto;
	padding: 48px 24px 30px;
}

.footer-nav {
	margin-bottom: 34px;
}

.footer-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 26px var(--gap);
}

.footer-group > .footer-heading {
	display: block;
	font-family: var(--font-ui);
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: #f1e8d7;
	margin-bottom: 14px;
	padding-bottom: 10px;
	border-bottom: 1px solid rgba(216, 205, 187, 0.22);
}

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

.footer-item {
	margin-bottom: 8px;
}

.footer-item a {
	color: #d8cdbb;
	text-decoration: none;
	font-size: 0.92rem;
}

.footer-item a:hover {
	color: #ffffff;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.footer-item .footer-text {
	color: #d8cdbb;
	font-size: 0.92rem;
}

.footer-note {
	font-size: 0.9rem;
	color: #b8ac97;
	border-top: 1px solid rgba(216, 205, 187, 0.22);
	padding-top: 22px;
	margin-bottom: 8px;
}

.footer-copy {
	font-family: var(--font-ui);
	font-size: 0.8rem;
	color: #9a8d78;
	margin: 0;
}

.footer-copy a {
	color: inherit;
}

/* ------------------------------------------------------------------
   Responsive
------------------------------------------------------------------ */
@media (max-width: 900px) {
	.author-bio-avatar {
		flex-basis: 64px;
		width: 64px;
	}
}

@media (max-width: 1080px) {
	.layout {
		grid-template-columns: 1fr;
	}

	.site-sidebar {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.header-search {
		display: none;
	}

	/* Sidebar falls below content from here on: converge the stacked
	   last-widget -> footer gap (main padding-bottom + footer margin-top)
	   to about 3.5rem total. */
	.site-main {
		padding-bottom: 32px;
	}

	.site-footer {
		margin-top: 24px;
	}
}

@media (max-width: 960px) {
	.nav-toggle {
		display: block;
		margin-left: auto;
	}

	.primary-nav {
		flex-basis: 100%;
		order: 3;
		display: none;
		border-top: 1px solid var(--border);
		padding-top: 14px;
		margin-top: 14px;
	}

	.site-header.nav-open .primary-nav {
		display: block;
	}

	.primary-menu {
		flex-direction: column;
		gap: 2px;
	}

	.primary-menu a {
		padding: 11px 12px;
	}

	.primary-menu .sub-menu {
		position: static;
		opacity: 1;
		visibility: visible;
		transform: none;
		box-shadow: none;
		border: none;
		border-left: 2px solid var(--border);
		border-radius: 0;
		margin: 2px 0 6px 14px;
		padding: 0 0 0 10px;
		display: none;
		background: transparent;
	}

	.primary-menu .sub-menu a {
		white-space: normal;
	}

	.primary-menu li.sub-open > .sub-menu {
		display: block;
	}

	.hero-feature {
		grid-template-columns: 1fr;
	}

	.hero-media {
		aspect-ratio: var(--media-ratio);
		min-height: 0;
	}

	.footer-menu {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	body {
		font-size: 1rem;
	}

	/* Narrow the wrap gutters for a wider reading column; the header uses
	   .header-inner (its own class), so its vertical padding is untouched. */
	.site-main {
		padding-left: 14px;
		padding-right: 14px;
	}

	.card-grid {
		grid-template-columns: 1fr;
	}

	.site-sidebar {
		grid-template-columns: 1fr;
	}

	.footer-menu {
		grid-template-columns: 1fr;
	}

	.author-bio {
		flex-direction: column;
	}

	.author-bio-avatar {
		flex-basis: auto;
		width: 56px;
	}

	.hero-body {
		padding: 24px 22px 28px;
	}

	.comment-list .children {
		padding-left: 14px;
	}
}
