/*
Theme Name: Sorrel
Description: Ruhiges, typografisch geführtes Theme für lange Fachartikel — ganz ohne Bilder.
Version: 1.2.0
*/

/* 1. Tokens ------------------------------------------------------------- */

:root {
	--bg: #f5eee0;
	--bg-raised: #fcf7ec;
	--bg-sunk: #eee4cf;
	--fg: #37312a;
	--muted: #8b7d67;
	--border: #e0d3ba;
	--accent: #b0522a;
	--accent-deep: #94431f;
	--slate: #2f3d46;
	--radius: 4px;
	--shadow: 0 1px 2px rgba(60, 45, 25, 0.06), 0 10px 26px rgba(60, 45, 25, 0.05);
	--serif: "Iowan Old Style", Georgia, "Times New Roman", serif;
	--sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 2. Reset / base ------------------------------------------------------- */

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

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

body {
	margin: 0;
	background-color: var(--bg);
	color: var(--fg);
	font-family: var(--serif);
	font-size: 1.0625rem;
	line-height: 1.8;
	text-rendering: optimizeLegibility;
}

/* faint paper grain, CSS only */
body::before {
	content: "";
	position: fixed;
	inset: 0;
	z-index: 9999;
	pointer-events: none;
	background-image:
		repeating-linear-gradient(0deg, rgba(55, 49, 42, 0.016) 0 1px, transparent 1px 3px),
		repeating-linear-gradient(90deg, rgba(55, 49, 42, 0.012) 0 1px, transparent 1px 3px);
}

::selection {
	background: #e7c6ae;
	color: var(--fg);
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--serif);
	font-weight: 600;
	line-height: 1.25;
	margin: 0 0 1rem;
	letter-spacing: -0.01em;
}

p {
	margin: 0 0 1.4rem;
}

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

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

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

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

li + li {
	margin-top: 0.45rem;
}

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

/* long words never break the layout; table cells are excluded on purpose */
h1, h2, h3, h4, h5, h6,
.entry-content p,
.entry-content li,
.entry-content blockquote,
.card-title,
.card-excerpt,
.side-list,
.comment-content,
.bio-text {
	overflow-wrap: break-word;
}

code {
	background: var(--bg-sunk);
	border-radius: var(--radius);
	font-size: 0.9em;
	padding: 0.15em 0.4em;
}

pre {
	background: var(--bg-sunk);
	border-radius: var(--radius);
	overflow-x: auto;
	padding: 1rem 1.25rem;
}

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

/* 3. Utilities ---------------------------------------------------------- */

.wrap {
	max-width: 1160px;
	margin: 0 auto;
	padding: 0 1.25rem;
}

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

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--slate);
	color: var(--bg-raised);
	font-family: var(--sans);
	font-size: 0.85rem;
	padding: 0.6rem 1.1rem;
	z-index: 10000;
	text-decoration: none;
}

.skip-link:focus {
	left: 0.75rem;
	top: 0.75rem;
}

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

/* 4. Layout skeleton ---------------------------------------------------- */

.layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 280px;
	gap: 3.5rem;
	padding-top: 2.5rem;
	padding-bottom: 3rem;
	align-items: start;
}

.content {
	min-width: 0;
}

/* 5. Header ------------------------------------------------------------- */

.site-header {
	border-bottom: 1px solid var(--slate);
	background: var(--bg);
}

.header-brand {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 2rem;
	min-height: 4.5rem;
}

.site-name {
	margin: 0;
	font-family: var(--serif);
	font-size: 1.4rem;
	font-weight: 600;
	letter-spacing: -0.01em;
	line-height: 1.2;
}

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

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

.nav-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	background: transparent;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	color: var(--slate);
	cursor: pointer;
}

.nav-toggle-icon {
	display: block;
}

/* 6. Primary navigation ------------------------------------------------- */

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

.primary-nav .menu {
	display: flex;
	flex-wrap: wrap;
	gap: 0.1rem 1.6rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.primary-nav .menu li {
	margin: 0;
	position: relative;
}

.primary-nav .menu a {
	display: block;
	padding: 0.7rem 0;
	font-family: var(--sans);
	font-size: 0.9rem;
	line-height: 1.4;
	color: var(--fg);
	text-decoration: none;
}

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

.primary-nav .menu-item-has-children > a {
	padding-right: 1rem;
}

.primary-nav .menu-item-has-children > a::after {
	content: "";
	position: absolute;
	right: 0;
	top: 50%;
	width: 6px;
	height: 6px;
	margin-top: -5px;
	border-right: 1.5px solid var(--muted);
	border-bottom: 1.5px solid var(--muted);
	transform: rotate(45deg);
}

.primary-nav .sub-menu {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 1000;
	min-width: 17rem;
	list-style: none;
	margin: 0;
	padding: 0.4rem 0;
	background: var(--bg-raised);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}

.primary-nav li:hover > .sub-menu,
.primary-nav li:focus-within > .sub-menu {
	display: block;
}

.primary-nav .sub-menu a {
	padding: 0.5rem 1.1rem;
	font-size: 0.9rem;
}

.primary-nav .sub-menu a:hover {
	background: var(--bg-sunk);
}

.sub-toggle {
	display: none;
}

/* 7. Breadcrumb --------------------------------------------------------- */

.breadcrumb {
	margin-bottom: 1.75rem;
}

.breadcrumb .trail {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 0.6rem;
	list-style: none;
	margin: 0;
	padding: 0;
	font-family: var(--sans);
	font-size: 0.78rem;
	color: var(--muted);
}

.breadcrumb .crumb {
	margin: 0;
}

.breadcrumb .crumb + .crumb::before {
	content: "\203A";
	margin-right: 0.6rem;
	color: var(--accent);
}

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

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

/* 8. Archive headers ---------------------------------------------------- */

.page-head {
	margin-bottom: 2.25rem;
	padding-bottom: 1.25rem;
	border-bottom: 1px solid var(--border);
}

.page-head h1 {
	margin-bottom: 0.5rem;
	font-size: clamp(1.5rem, 1.1rem + 1.8vw, 2.2rem);
}

.archive-description,
.page-lead {
	margin: 0;
	max-width: 44rem;
	color: var(--muted);
	font-size: 0.98rem;
}

.archive-description p {
	margin-bottom: 0.6rem;
}

/* 9. Post list rows (single column, sitewide) --------------------------- */

.card-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0;
	margin-bottom: 2.5rem;
	border-top: 1px solid var(--border);
}

.card {
	display: flex;
	flex-direction: column;
	padding: 1.75rem 0 1.5rem;
	background: transparent;
	border: 0;
	border-bottom: 1px solid var(--border);
	border-radius: 0;
	box-shadow: none;
}

.card-meta {
	margin: 0 0 0.6rem;
	font-family: var(--sans);
	font-size: 0.7rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--muted);
}

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

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

.card-title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin: 0 0 0.7rem;
	font-size: 1.4rem;
	line-height: 1.35;
}

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

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

.card-excerpt {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin: 0 0 1.1rem;
	max-width: 52rem;
	font-size: 0.98rem;
	line-height: 1.7;
	color: #57503f;
}

.read-more {
	font-family: var(--sans);
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--accent);
	text-decoration: none;
}

.read-more::after {
	content: "\2192";
	margin-left: 0.35rem;
}

.read-more:hover {
	color: var(--accent-deep);
}

/* 10. Single post ------------------------------------------------------- */

.entry-head {
	margin-bottom: 1.75rem;
}

.entry-title {
	margin-bottom: 0.9rem;
	font-size: clamp(1.6rem, 1.15rem + 2.2vw, 2.6rem);
	line-height: 1.15;
	overflow-wrap: break-word;
}

.entry-meta {
	margin: 0;
	font-family: var(--sans);
	font-size: 0.78rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--muted);
}

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

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

.meta-sep {
	margin: 0 0.55rem;
	color: var(--border);
}

/* article body — full content-column width, no extra measure limit */

.entry-content > p:first-of-type {
	font-size: 1.12rem;
}

.entry-content h2 {
	margin: 2.75rem 0 1.1rem;
	padding-bottom: 0.45rem;
	border-bottom: 1px solid var(--border);
	font-size: 1.5rem;
}

.entry-content h3 {
	margin: 2.1rem 0 0.9rem;
	font-size: 1.22rem;
}

.entry-content h4 {
	margin: 1.8rem 0 0.75rem;
	font-size: 1.05rem;
}

.entry-content a {
	color: var(--fg);
	text-decoration-color: var(--accent);
}

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

.entry-content blockquote {
	margin: 2rem 0;
	padding: 0.25rem 0 0.25rem 1.5rem;
	border-left: 2px solid var(--accent);
	font-style: italic;
	color: #57503f;
}

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

.entry-content table {
	width: 100%;
	margin: 0 0 1.75rem;
	border-collapse: collapse;
	font-size: 0.93rem;
	line-height: 1.6;
}

.entry-content th,
.entry-content td {
	padding: 0.55rem 0.8rem;
	border: 1px solid var(--border);
	text-align: left;
	vertical-align: top;
}

.entry-content th {
	background: var(--bg-sunk);
	font-family: var(--sans);
	font-size: 0.72rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.entry-content img {
	border-radius: var(--radius);
	margin: 1.5rem 0;
}

/* tables scroll inside their own wrapper on narrow screens */
.table-scroll {
	max-width: 100%;
	overflow-x: auto;
	margin: 0 0 1.75rem;
}

.table-scroll > table {
	margin-bottom: 0;
}

.entry-content figure {
	margin: 1.75rem 0;
}

.entry-content figcaption {
	margin-top: 0.6rem;
	font-family: var(--sans);
	font-size: 0.78rem;
	color: var(--muted);
}

/* tags */
.tag-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	list-style: none;
	margin: 2.5rem 0 0;
	padding: 2rem 0 0;
	border-top: 1px solid var(--border);
}

.tag-list li {
	margin: 0;
}

.tag-list a {
	display: inline-block;
	padding: 0.3rem 0.85rem;
	border: 1px solid var(--border);
	border-radius: 999px;
	font-family: var(--sans);
	font-size: 0.78rem;
	color: var(--fg);
	text-decoration: none;
}

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

/* author bio */
.author-bio {
	margin-top: 2.5rem;
	padding: 1.5rem;
	background: var(--bg-raised);
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

.bio-label {
	margin: 0 0 0.5rem;
	font-family: var(--sans);
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--slate);
}

.bio-name {
	margin: 0 0 0.6rem;
	font-size: 1.15rem;
}

.bio-text {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.7;
}

/* related posts */
.related {
	margin-top: 3rem;
	padding-top: 1.75rem;
	border-top: 1px solid var(--slate);
}

.related-title {
	font-size: 1.35rem;
	margin-bottom: 1.5rem;
}

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

/* 11. Comments ---------------------------------------------------------- */

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

.comments-title {
	font-size: 1.35rem;
	margin-bottom: 1.5rem;
}

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

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

.comment-item {
	margin-bottom: 1rem;
}

.comment-list .children .comment-item {
	margin-bottom: 0;
}

.comment-body {
	padding: 1.25rem 1.5rem;
	background: var(--bg-raised);
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

.comment-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.25rem 0.9rem;
	margin-bottom: 0.7rem;
	font-family: var(--sans);
	font-size: 0.75rem;
}

.comment-author {
	font-family: var(--serif);
	font-size: 1rem;
	font-weight: 600;
	color: var(--fg);
}

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

.comment-date:hover {
	color: var(--accent);
}

.edit-link a {
	color: var(--muted);
	font-size: 0.72rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
}

.comment-awaiting {
	margin: 0 0 0.7rem;
	font-family: var(--sans);
	font-size: 0.8rem;
	font-style: italic;
	color: var(--accent);
}

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

.reply {
	margin-top: 0.9rem;
}

.comment-reply-link {
	font-family: var(--sans);
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--accent);
	text-decoration: none;
}

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

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

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

.comment-form label {
	display: block;
	margin-bottom: 0.35rem;
	font-family: var(--sans);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--muted);
}

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

.comment-form input:focus,
.comment-form textarea:focus {
	border-color: var(--accent);
	outline: none;
}

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

.comment-submit,
.search-submit {
	display: inline-block;
	padding: 0.7rem 1.6rem;
	background: var(--accent);
	border: 1px solid var(--accent);
	border-radius: var(--radius);
	font-family: var(--sans);
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #fdf8ee;
	cursor: pointer;
}

.comment-submit:hover,
.search-submit:hover {
	background: var(--accent-deep);
	border-color: var(--accent-deep);
	color: #fdf8ee;
}

/* 12. Sidebar ----------------------------------------------------------- */

.sidebar {
	font-size: 0.95rem;
}

.side-block {
	margin-bottom: 2.5rem;
}

.side-title {
	margin: 0 0 1rem;
	padding-bottom: 0.55rem;
	border-bottom: 1px solid var(--slate);
	font-family: var(--sans);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--slate);
}

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

.side-list li {
	margin: 0;
	padding: 0.45rem 0;
	border-bottom: 1px dashed var(--border);
	line-height: 1.5;
}

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

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

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

.side-list .post-count,
.side-list li > span {
	font-family: var(--sans);
	font-size: 0.75rem;
	color: var(--muted);
}

.side-list.recent a {
	display: block;
}

.side-list.recent time {
	display: block;
	font-family: var(--sans);
	font-size: 0.72rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--muted);
}

/* 13. Search form ------------------------------------------------------- */

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

.search-field {
	flex: 1;
	min-width: 0;
	padding: 0.6rem 0.8rem;
	background: var(--bg-raised);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	font-family: var(--serif);
	font-size: 0.98rem;
	color: var(--fg);
}

.search-field:focus {
	border-color: var(--accent);
	outline: none;
}

.search-submit {
	padding: 0.6rem 1.2rem;
}

/* 14. Pagination -------------------------------------------------------- */

.pagination,
.comment-navigation {
	margin: 1rem 0 0;
}

.pagination .nav-links,
.comment-navigation .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.5rem;
}

.page-numbers {
	display: inline-block;
	padding: 0.45rem 0.95rem;
	background: var(--bg-raised);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	font-family: var(--sans);
	font-size: 0.85rem;
	color: var(--fg);
	text-decoration: none;
}

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

.page-numbers.current {
	background: var(--slate);
	border-color: var(--slate);
	color: var(--bg-raised);
}

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

/* 15. Footer ------------------------------------------------------------ */

.site-footer {
	margin-top: 3rem;
	border-top: 1px solid var(--slate);
	padding: 3rem 0 2rem;
}

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

.footer-col {
	margin: 0;
}

.footer-heading {
	display: block;
	margin-bottom: 0.9rem;
	font-family: var(--sans);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--slate);
}

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

.footer-list li {
	margin: 0;
	padding: 0.3rem 0;
}

.footer-list a {
	font-size: 0.9rem;
	line-height: 1.5;
	color: var(--fg);
	text-decoration: none;
}

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

.footer-list .footer-text {
	font-size: 0.9rem;
	line-height: 1.5;
	color: var(--muted);
}

.footer-base {
	margin-top: 2.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--border);
}

.footer-note {
	margin: 0 0 0.5rem;
	font-family: var(--sans);
	font-size: 0.8rem;
	color: var(--muted);
}

.copyright {
	margin: 0;
	font-family: var(--sans);
	font-size: 0.78rem;
	color: var(--muted);
}

/* 16. 404 --------------------------------------------------------------- */

.error-content {
	max-width: 44rem;
}

.error-content .search-form {
	margin-top: 1.5rem;
	max-width: 26rem;
}

/* 17. Responsive -------------------------------------------------------- */

@media (max-width: 64rem) {
	.footer-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 56rem) {
	.layout {
		grid-template-columns: 1fr;
		gap: 2.5rem;
	}

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

	.primary-nav {
		display: none;
	}

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

	.primary-nav .wrap {
		padding-top: 0.5rem;
		padding-bottom: 1.25rem;
	}

	.primary-nav .menu {
		flex-direction: column;
		gap: 0;
	}

	.primary-nav .menu li {
		border-top: 1px dashed var(--border);
	}

	.primary-nav .menu > li:first-child {
		border-top: 0;
	}

	.primary-nav .menu a {
		padding: 0.75rem 0;
	}

	.primary-nav .menu-item-has-children > a::after {
		display: none;
	}

	.primary-nav .menu-item-has-children {
		display: grid;
		grid-template-columns: 1fr auto;
		align-items: center;
	}

	.sub-toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 2.5rem;
		height: 2.5rem;
		padding: 0;
		background: transparent;
		border: 0;
		cursor: pointer;
	}

	.sub-toggle::before {
		content: "";
		width: 8px;
		height: 8px;
		border-right: 1.5px solid var(--muted);
		border-bottom: 1.5px solid var(--muted);
		transform: rotate(45deg);
	}

	.sub-open > .sub-toggle::before {
		transform: rotate(225deg);
	}

	.primary-nav .sub-menu {
		position: static;
		grid-column: 1 / -1;
		min-width: 0;
		padding: 0 0 0.5rem 1.1rem;
		background: transparent;
		border: 0;
		border-radius: 0;
		box-shadow: none;
	}

	.primary-nav li:hover > .sub-menu,
	.primary-nav li:focus-within > .sub-menu {
		display: none;
	}

	.primary-nav .sub-open > .sub-menu {
		display: block !important;
	}
}

@media (max-width: 36rem) {
	.footer-grid {
		grid-template-columns: 1fr;
	}
}

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