/*
Theme Name: Bramble
Description: A classic archival theme with an aged rice-paper palette, ruled masthead and long-form reading typography for reference and folklore content sites.
Author: 一二三四五六
Version: 2.4.3
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

/* ---------------------------------------------------------------
   1. Tokens & base
--------------------------------------------------------------- */
:root {
	--bg: #f2ebda;
	--paper: #f8f3e8;
	--bg-deep: #eae1cb;
	--fg: #2b251b;
	--muted: #7c705c;
	--border: #d8ccb2;
	--border-strong: #bfae8d;
	--accent: #a63d26;
	--accent-deep: #86301d;
	--radius: 3px;
	--shadow: 0 1px 2px rgba(43, 37, 27, .07), 0 4px 14px rgba(43, 37, 27, .05);
	--media-ratio: 8/5;
	--thumb-ratio: 8/5;
	--max: 1120px;
	--serif: "Noto Serif TC", "Songti TC", "PMingLiU", "MingLiU", serif;
}

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

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

body {
	margin: 0;
	background-color: var(--bg);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23grain)' opacity='0.045'/%3E%3C/svg%3E");
	color: var(--fg);
	font-family: var(--serif);
	font-size: 16.5px;
	line-height: 1.85;
}

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

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

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

h1, h2, h3, h4, h5, h6 {
	font-family: var(--serif);
	line-height: 1.45;
	font-weight: 700;
	margin: 0 0 .6em;
	color: var(--fg);
}

p {
	margin: 0 0 1.4em;
}

.post-body p {
	text-align: justify;
	text-justify: inter-ideograph;
}

.post-body p,
.post-body li,
.post-title,
.hero-title,
.card-title,
.archive-title,
.comment-content,
.article-note {
	overflow-wrap: break-word;
}

th, td {
	overflow-wrap: normal;
}

ul, ol {
	margin: 0 0 1.4em;
	padding-left: 1.6em;
}

blockquote {
	margin: 1.8em 0;
	padding: .2em 0 .2em 1.4em;
	border-left: 3px solid var(--border-strong);
	color: var(--muted);
}

hr {
	border: 0;
	border-top: 1px solid var(--border);
	margin: 2.4em 0;
}

table {
	width: 100%;
	border-collapse: collapse;
	margin: 1.8em 0;
	font-size: .95rem;
	background: var(--paper);
}

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

th {
	background: var(--bg-deep);
	font-weight: 700;
}

caption {
	caption-side: top;
	text-align: left;
	font-size: .85rem;
	color: var(--muted);
	padding-bottom: .5em;
}

/* Wide tables scroll inside their own box; the page never scrolls sideways. */
.table-scroll {
	overflow-x: auto;
	margin: 1.8em 0;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--paper);
}

.table-scroll table {
	margin: 0;
	border: 0;
	min-width: 560px;
}

code, pre {
	font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
	font-size: .9em;
	background: var(--bg-deep);
	border-radius: var(--radius);
}

code {
	padding: .1em .4em;
}

pre {
	padding: 1em 1.2em;
	overflow-x: auto;
	border: 1px solid var(--border);
}

pre code {
	background: none;
	padding: 0;
}

.screen-reader-text {
	position: absolute !important;
	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 {
	width: auto;
	height: auto;
	clip: auto;
	padding: .4em .8em;
	background: var(--paper);
	border: 1px solid var(--border-strong);
	z-index: 100;
}

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

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

/* ---------------------------------------------------------------
   2. Header — ruled almanac masthead
--------------------------------------------------------------- */
.site-header {
	border-bottom: 1px solid var(--border-strong);
	background: var(--paper);
	background-image: inherit;
	margin-bottom: 40px;
}

.masthead {
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	padding: 32px 0 24px;
}

.site-name {
	font-size: 1.9rem;
	font-weight: 700;
	letter-spacing: .18em;
	text-decoration: none;
	color: var(--fg);
	padding: .1em .5em;
	border-top: 3px double var(--border-strong);
	border-bottom: 3px double var(--border-strong);
}

.site-name:hover {
	color: var(--accent-deep);
}

.nav-toggle {
	display: none;
	position: absolute;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	background: var(--paper);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius);
	padding: .5em .8em;
	font-family: var(--serif);
	font-size: .9rem;
	color: var(--fg);
	cursor: pointer;
	align-items: center;
	gap: .5em;
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
	display: block;
	width: 16px;
	height: 2px;
	background: var(--fg);
	position: relative;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
	content: "";
	position: absolute;
	left: 0;
}

.nav-toggle-bars::before { top: -5px; }
.nav-toggle-bars::after { top: 5px; }

.site-nav {
	border-top: 1px solid var(--border);
}

.nav-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
}

.nav-list .menu-item {
	position: relative;
}

.nav-list .menu-item > a {
	display: block;
	padding: .75em 1.15em;
	font-size: .98rem;
	letter-spacing: .06em;
	text-decoration: none;
	color: var(--fg);
}

.nav-list .menu-item > a:hover {
	color: var(--accent);
}

.nav-list .menu-item-has-children > a::after {
	content: "▾";
	font-size: .7em;
	margin-left: .45em;
	color: var(--muted);
}

.nav-list .sub-menu {
	list-style: none;
	margin: 0;
	padding: .4em 0;
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	min-width: 13em;
	background: var(--paper);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	display: none;
	z-index: 50;
}

.nav-list .menu-item-has-children:hover > .sub-menu,
.nav-list .menu-item-has-children:focus-within > .sub-menu {
	display: block;
}

.nav-list .sub-menu a {
	display: block;
	padding: .45em 1.2em;
	font-size: .92rem;
	white-space: nowrap;
	text-decoration: none;
	border-left: 3px solid transparent;
}

.nav-list .sub-menu a:hover {
	border-left-color: var(--accent);
	background: var(--bg);
}

.nav-list .current-menu-item > a,
.nav-list .current-menu-ancestor > a {
	color: var(--accent);
}

/* ---------------------------------------------------------------
   3. Layout
--------------------------------------------------------------- */
.layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 52px;
	padding-bottom: 56px;
	flex: 1 0 auto;
	width: 100%;
}

.site-main {
	min-width: 0;
}

/* ---------------------------------------------------------------
   4. Breadcrumb
--------------------------------------------------------------- */
.breadcrumb {
	font-size: .85rem;
	color: var(--muted);
	margin: 0 0 1.6em;
	letter-spacing: .03em;
}

.breadcrumb .trail {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: .2em;
}

.breadcrumb .crumb a {
	color: var(--muted);
	text-decoration: none;
	border-bottom: 1px solid var(--border);
}

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

.breadcrumb .crumb-sep {
	color: var(--border-strong);
}

/* ---------------------------------------------------------------
   5. Cards & archives
--------------------------------------------------------------- */
.card-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 32px 28px;
	margin: 0 0 2.6em;
}

.post-card {
	background: var(--paper);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	display: flex;
	flex-direction: column;
}

.card-media {
	display: block;
	border-bottom: 1px solid var(--border);
}

.card-img {
	width: 100%;
	aspect-ratio: var(--thumb-ratio);
	object-fit: cover;
	border-radius: var(--radius) var(--radius) 0 0;
	filter: saturate(.92) sepia(.07);
}

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

.card-title {
	font-size: 1.18rem;
	margin: 0 0 .45em;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.card-title a {
	text-decoration: none;
}

.card-meta {
	font-size: .82rem;
	color: var(--muted);
	margin: 0 0 .7em;
	display: flex;
	flex-wrap: wrap;
	gap: .3em .9em;
}

.card-meta a {
	color: var(--muted);
	text-decoration: none;
	border-bottom: 1px solid var(--border);
}

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

.card-excerpt {
	font-size: .93rem;
	line-height: 1.6;
	color: var(--muted);
	margin: 0;
}

/* Homepage hero — first screen */
.hero-card {
	display: grid;
	grid-template-columns: minmax(0, 11fr) minmax(0, 9fr);
	background: var(--paper);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius);
	margin: 0 0 2.4em;
	align-items: stretch;
}

.hero-card.hero-no-thumb {
	grid-template-columns: minmax(0, 1fr);
}

.hero-media {
	display: block;
	border-right: 1px solid var(--border);
}

.hero-img {
	width: 100%;
	height: 100%;
	aspect-ratio: var(--media-ratio);
	object-fit: cover;
	border-radius: var(--radius) 0 0 var(--radius);
	filter: saturate(.92) sepia(.07);
}

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

.hero-kicker {
	font-size: .78rem;
	letter-spacing: .22em;
	color: var(--accent);
	margin: 0 0 1em;
}

.hero-title {
	font-size: 1.75rem;
	margin: 0 0 .5em;
}

.hero-title a {
	text-decoration: none;
}

.hero-meta {
	font-size: .85rem;
	color: var(--muted);
	margin: 0 0 1em;
	display: flex;
	flex-wrap: wrap;
	gap: .3em 1em;
}

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

.hero-excerpt {
	font-size: .98rem;
	line-height: 1.6;
	color: var(--muted);
	margin: 0 0 1em;
}

.hero-more {
	align-self: flex-start;
	font-size: .9rem;
	color: var(--accent);
	text-decoration: none;
	border-bottom: 1px solid var(--accent);
	padding-bottom: .1em;
}

/* Archive header */
.archive-head {
	margin: 0 0 2em;
	padding-bottom: 1.2em;
	border-bottom: 3px double var(--border-strong);
}

.archive-title {
	font-size: 1.8rem;
	margin: 0 0 .3em;
}

.archive-title .archive-label {
	display: block;
	font-size: .8rem;
	font-weight: 400;
	letter-spacing: .2em;
	color: var(--muted);
	margin-bottom: .8em;
}

.archive-desc {
	font-size: .95rem;
	color: var(--muted);
}

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

/* Pagination */
.pagination {
	margin: 2.6em 0 0;
	border-top: 1px solid var(--border);
	padding-top: 1.6em;
}

.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: .4em;
}

.pagination .page-numbers {
	display: inline-block;
	min-width: 2.3em;
	padding: .3em .6em;
	text-align: center;
	font-size: .92rem;
	text-decoration: none;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--paper);
	color: var(--fg);
}

.pagination .page-numbers:hover {
	border-color: var(--accent);
	color: var(--accent);
}

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

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

/* ---------------------------------------------------------------
   6. Single post modules
--------------------------------------------------------------- */
.post-single {
	margin: 0 0 2.4em;
}

.post-head {
	margin: 0 0 1.6em;
}

.post-title {
	font-size: 2.05rem;
	margin: 0 0 .5em;
}

.post-meta {
	font-size: .87rem;
	color: var(--muted);
	display: flex;
	flex-wrap: wrap;
	gap: .3em 1.2em;
	padding-bottom: 1.1em;
	border-bottom: 1px solid var(--border);
}

.post-meta a {
	color: var(--muted);
	text-decoration: none;
	border-bottom: 1px solid var(--border);
}

.post-meta a:hover {
	color: var(--accent);
	border-bottom-color: var(--accent);
}

.post-cover {
	margin: 0 0 2em;
	border: 1px solid var(--border-strong);
	border-radius: var(--radius);
	background: var(--paper);
	padding: 10px;
}

.post-cover img {
	width: 100%;
	aspect-ratio: var(--media-ratio);
	object-fit: cover;
	border-radius: var(--radius);
	filter: saturate(.92) sepia(.07);
}

.article-note {
	margin: 0 0 2em;
	padding: 1.1em 1.4em;
	background: var(--bg-deep);
	border: 1px solid var(--border);
	border-left: 4px solid var(--accent);
	border-radius: var(--radius);
	font-size: .95rem;
}

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

.post-toc {
	margin: 0 0 2.2em;
	padding: 1.2em 1.5em;
	background: var(--paper);
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

.toc-title {
	font-size: .82rem;
	font-weight: 700;
	letter-spacing: .22em;
	color: var(--muted);
	margin: 0 0 .9em;
}

summary.toc-title {
	cursor: pointer;
	list-style: none;
}

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

summary.toc-title::after {
	content: "＋";
	float: right;
	font-weight: 400;
}

.toc-box[open] summary.toc-title::after {
	content: "－";
}

.toc-box[open] summary.toc-title {
	margin: 0 0 .9em;
}

.toc-box:not([open]) summary.toc-title {
	margin: 0;
}

.toc-list {
	margin: 0;
	padding-left: 1.4em;
	font-size: .95rem;
}

.toc-list li {
	margin: .3em 0;
}

.toc-list a {
	text-decoration: none;
	border-bottom: 1px solid var(--border);
}

.toc-list a:hover {
	color: var(--accent);
	border-bottom-color: var(--accent);
}

.post-body {
	font-size: 1.02rem;
}

.post-body > h2 {
	font-size: 1.5rem;
	margin: 2em 0 .8em;
	padding-top: 1.1em;
	border-top: 3px double var(--border-strong);
	scroll-margin-top: 1.5em;
}

.post-body > h2:first-child {
	margin-top: 0;
	padding-top: 0;
	border-top: 0;
}

.post-body h3 {
	font-size: 1.22rem;
	margin: 1.8em 0 .7em;
}

.post-body h3::before {
	content: "";
	display: inline-block;
	width: .5em;
	height: .5em;
	margin-right: .55em;
	background: var(--accent);
	vertical-align: baseline;
}

.post-body h4 {
	font-size: 1.05rem;
	margin: 1.6em 0 .6em;
}

.post-body img {
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

.post-body figcaption,
.wp-caption-text {
	font-size: .84rem;
	color: var(--muted);
	text-align: center;
	margin-top: .6em;
}

.post-body .wp-block-pullquote {
	border-top: 3px double var(--border-strong);
	border-bottom: 3px double var(--border-strong);
	border-left: 0;
	padding: 1.4em 0;
	text-align: center;
	font-size: 1.15rem;
	color: var(--fg);
}

.page-links {
	margin: 1.8em 0;
	font-size: .95rem;
}

.page-links a,
.page-links > span {
	display: inline-block;
	min-width: 2.2em;
	text-align: center;
	padding: .2em .5em;
	margin: 0 .15em;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--paper);
	text-decoration: none;
}

.page-links > span {
	background: var(--accent);
	border-color: var(--accent);
	color: var(--paper);
}

/* Tags */
.post-tags {
	display: flex;
	flex-wrap: wrap;
	gap: .5em;
	margin: 2.2em 0 0;
	padding-top: 1.6em;
	border-top: 1px solid var(--border);
}

.tag-pill {
	display: inline-block;
	padding: .18em .85em;
	font-size: .85rem;
	text-decoration: none;
	color: var(--fg);
	background: var(--paper);
	border: 1px solid var(--border-strong);
	border-radius: 999px;
}

.tag-pill:hover {
	color: var(--accent);
	border-color: var(--accent);
}

/* Author bio */
.author-bio {
	margin: 2.4em 0 0;
	padding: 1.3em 0 1.3em 1.4em;
	border-left: 3px solid var(--accent);
}

.author-label {
	margin: 0 0 0.7em;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	color: var(--accent);
}

.author-head {
	display: flex;
	align-items: center;
	gap: 0.8em;
	margin-bottom: 0.7em;
}

.author-avatar img {
	width: 52px;
	height: 52px;
	border-radius: 50%;
	border: 1px solid var(--border-strong);
}

.author-title {
	font-size: 1.05rem;
	margin: 0;
}

.author-desc {
	font-size: .93rem;
	color: var(--muted);
	margin: 0;
}

.author-more {
	display: inline-block;
	margin-top: 0.8em;
	font-size: .88rem;
	font-weight: 600;
	color: var(--accent-deep);
	text-decoration: none;
	border-bottom: 1px dashed var(--border-strong);
}

/* Related posts */
.related-posts {
	margin: 2.6em 0 0;
}

.related-title {
	font-size: 1.3rem;
	margin: 0 0 1.2em;
	padding-top: 1.2em;
	border-top: 3px double var(--border-strong);
}

/* ---------------------------------------------------------------
   7. Comments
--------------------------------------------------------------- */
.comments-area {
	margin: 2.6em 0 0;
	padding-top: 1.6em;
	border-top: 3px double var(--border-strong);
}

.comments-title {
	font-size: 1.3rem;
	margin: 0 0 1.2em;
}

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

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

.comment-list .children {
	list-style: none;
	margin: 0;
	padding-left: 2.2em;
}

.comment-list .children .comment {
	border-bottom: 0;
	border-top: 1px dashed var(--border);
}

.comment-body {
	font-size: .96rem;
}

.comment-meta {
	display: flex;
	align-items: center;
	gap: .8em;
	margin: 0 0 .6em;
	font-size: .85rem;
	color: var(--muted);
}

.comment-meta .avatar {
	border-radius: 50%;
	border: 1px solid var(--border-strong);
}

.comment-author .fn {
	font-weight: 700;
	font-size: .95rem;
	color: var(--fg);
}

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

.reply a {
	font-size: .85rem;
	color: var(--accent);
	text-decoration: none;
	border-bottom: 1px solid var(--accent);
}

.comments-closed {
	font-size: .9rem;
	color: var(--muted);
}

.comment-respond {
	margin: 2em 0 0;
}

.comment-reply-title {
	font-size: 1.15rem;
}

.comment-form label {
	display: block;
	font-size: .88rem;
	margin: 0 0 .35em;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	padding: .55em .8em;
	font-family: var(--serif);
	font-size: .95rem;
	color: var(--fg);
	background: var(--paper);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius);
}

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

.comment-form .submit {
	padding: .55em 1.6em;
	font-family: var(--serif);
	font-size: .95rem;
	color: var(--paper);
	background: var(--accent);
	border: 1px solid var(--accent-deep);
	border-radius: var(--radius);
	cursor: pointer;
}

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

.comment-form-cookies-consent {
	font-size: .88rem;
	color: var(--muted);
}

/* ---------------------------------------------------------------
   8. Sidebar
--------------------------------------------------------------- */
.site-sidebar {
	min-width: 0;
}

.side-block {
	margin: 0 0 2.2em;
	padding: 1.3em 1.4em 1.5em;
	background: var(--paper);
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

.side-title {
	font-size: .82rem;
	font-weight: 700;
	letter-spacing: .22em;
	color: var(--muted);
	margin: 0 0 1em;
	padding-bottom: .8em;
	border-bottom: 3px double var(--border-strong);
}

.side-title::before {
	content: "";
	display: inline-block;
	width: .55em;
	height: .55em;
	margin-right: .6em;
	background: var(--accent);
	vertical-align: baseline;
}

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

.side-list li {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: .8em;
	padding: .42em 0;
	border-bottom: 1px dashed var(--border);
}

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

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

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

.side-count {
	font-size: .78rem;
	color: var(--muted);
	border: 1px solid var(--border);
	border-radius: 999px;
	padding: 0 .6em;
	line-height: 1.6;
}

.side-recent li {
	flex-direction: column;
	align-items: flex-start;
	gap: .1em;
}

.side-recent a {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.side-recent time {
	font-size: .78rem;
	color: var(--muted);
}

.side-tags {
	display: flex;
	flex-wrap: wrap;
	gap: .5em;
}

/* ---------------------------------------------------------------
   9. Search form
--------------------------------------------------------------- */
.search-form {
	display: flex;
	gap: .5em;
	align-items: stretch;
}

.search-field {
	flex: 1 1 auto;
	min-width: 0;
	padding: .5em .85em;
	font-family: var(--serif);
	font-size: .95rem;
	color: var(--fg);
	background: var(--paper);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius);
}

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

.search-submit {
	flex: 0 0 auto;
	padding: .5em 1.3em;
	font-family: var(--serif);
	font-size: .95rem;
	color: var(--paper);
	background: var(--accent);
	border: 1px solid var(--accent-deep);
	border-radius: var(--radius);
	cursor: pointer;
}

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

.search-hero {
	max-width: 560px;
	margin: 1.6em 0 2.4em;
}

/* ---------------------------------------------------------------
   10. Footer
--------------------------------------------------------------- */
.site-footer {
	margin-top: auto;
	background: var(--bg-deep);
	border-top: 3px double var(--border-strong);
	padding: 44px 0 30px;
}

.footer-top {
	display: grid;
	grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
	gap: 44px;
	align-items: start;
	margin: 0 0 2.2em;
}

.footer-brand {
	padding-top: .2em;
}

.footer-site-desc {
	font-size: .88rem;
	color: var(--muted);
	margin: 1.2em 0 0;
	max-width: 24em;
	line-height: 1.9;
}

.footer-site-name {
	display: inline-block;
	font-size: 1.25rem;
	font-weight: 700;
	letter-spacing: .18em;
	text-decoration: none;
	color: var(--fg);
	padding: .15em .4em;
	border-top: 3px double var(--border-strong);
	border-bottom: 3px double var(--border-strong);
}

.footer-site-name:hover {
	color: var(--accent-deep);
}

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

.footer-heading {
	display: block;
	font-size: .82rem;
	font-weight: 700;
	letter-spacing: .22em;
	color: var(--muted);
	margin: 0 0 1em;
	padding-bottom: .7em;
	border-bottom: 1px solid var(--border-strong);
}

.footer-heading::before {
	content: "";
	display: inline-block;
	width: .55em;
	height: .55em;
	margin-right: .6em;
	background: var(--accent);
	vertical-align: baseline;
}

.footer-sub {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: .92rem;
}

.footer-item {
	margin: .35em 0;
}

.footer-item a {
	color: var(--fg);
	text-decoration: none;
	border-bottom: 1px solid transparent;
}

.footer-item a:hover {
	color: var(--accent);
	border-bottom-color: var(--accent);
}

.footer-note {
	font-size: .85rem;
	color: var(--muted);
	margin: 0 0 .8em;
	text-align: center;
}

.copyright {
	font-size: .85rem;
	color: var(--muted);
	text-align: center;
	margin: 0;
	padding-top: 1.2em;
	border-top: 1px solid var(--border);
	letter-spacing: .05em;
}

/* ---------------------------------------------------------------
   11. Misc pages
--------------------------------------------------------------- */
.notfound-panel {
	text-align: center;
	padding: 3em 0 1em;
}

.notfound-code {
	font-size: 3.4rem;
	font-weight: 700;
	letter-spacing: .3em;
	color: var(--accent);
	margin: 0 0 .2em;
}

.notfound-title {
	font-size: 1.5rem;
}

.notfound-text {
	color: var(--muted);
	max-width: 34em;
	margin: 0 auto 2em;
}

.notfound-links {
	margin: 2.4em 0 0;
	text-align: left;
}

.notfound-links h2 {
	font-size: 1.1rem;
}

/* ---------------------------------------------------------------
   12. Responsive
--------------------------------------------------------------- */
@media (max-width: 1020px) {
	.footer-top {
		grid-template-columns: minmax(0, 1fr);
		gap: 32px;
	}

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

@media (max-width: 900px) {
	.layout {
		grid-template-columns: minmax(0, 1fr);
		gap: 40px;
	}

	.site-header {
		margin-bottom: 28px;
	}

	.masthead {
		justify-content: flex-start;
		padding: 20px 0 16px;
	}

	.site-name {
		font-size: 1.45rem;
	}

	.nav-toggle {
		display: inline-flex;
	}

	.site-nav {
		display: none;
		border-top: 1px solid var(--border);
	}

	.site-nav.is-open {
		display: block;
	}

	.nav-list {
		flex-direction: column;
		padding: .6em 0 1em;
	}

	.nav-list .menu-item > a {
		padding: .65em .4em;
	}

	.nav-list .sub-menu {
		position: static;
		transform: none;
		display: none;
		box-shadow: none;
		border: 0;
		border-left: 2px solid var(--border);
		border-radius: 0;
		margin: 0 0 .4em 1em;
		padding: 0 0 0 .8em;
		min-width: 0;
	}

	/* On touch screens tap = hover + focus, which would force sub-menus
	   open via the desktop rules below and make them impossible to close.
	   Only the .is-open class (toggled by JS) may show a sub-menu here. */
	.nav-list .menu-item-has-children:hover > .sub-menu,
	.nav-list .menu-item-has-children:focus-within > .sub-menu {
		display: none;
	}

	.nav-list .menu-item-has-children.is-open > .sub-menu {
		display: block;
	}

	/* A freshly opened sub-menu lands right under the fingertip, so the
	   browser's default tap-highlight flashes one of its links, and touch
	   browsers may apply a phantom :hover to it. Kill both. */
	.nav-list .menu-item > a,
	.nav-list .sub-menu a {
		-webkit-tap-highlight-color: transparent;
	}

	@media (hover: none) {
		.nav-list .menu-item > a:hover {
			color: var(--fg);
		}

		.nav-list .sub-menu a:hover {
			border-left-color: transparent;
			background: none;
		}
	}

	.hero-card {
		grid-template-columns: minmax(0, 1fr);
	}

	.breadcrumb {
		margin-top: .4em;
	}

	.hero-media {
		border-right: 0;
		border-bottom: 1px solid var(--border);
	}

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

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

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

	.wrap {
		padding: 0 18px;
	}

	.card-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.post-title {
		font-size: 1.7rem;
	}

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

	.author-bio {
		padding-left: 1em;
	}

	.author-avatar img {
		width: 44px;
		height: 44px;
	}

	.search-form {
		flex-wrap: wrap;
	}

	.search-submit {
		width: 100%;
	}
}
