/*
Theme Name: Kestrel
Author: Werkstatt Redaktion
Description: Ein ruhiges, textorientiertes Redaktionstheme mit warmer Werkstatt-Palette, klarer Typografie und feinem Liniensystem fuer lange Fachartikel.
Version: 1.4.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kestrel
*/

/* ---------------------------------------------------------------
   Design tokens
--------------------------------------------------------------- */
:root {
	--bg: #faf6ee;
	--fg: #2f241b;
	--muted: #7c6c5a;
	--border: #e3d8c5;
	--border-soft: rgba(227, 216, 197, 0.55);
	--radius: 6px;
	--shadow: 0 1px 2px rgba(47, 36, 27, 0.06), 0 6px 18px rgba(47, 36, 27, 0.07);
	--accent: #8a9b76;

	--surface: #ffffff;
	--surface-warm: #f3ecdd;
	--paper: var(--surface);
	--ochre: #b9832f;
	--ochre-deep: #96691f;
	--ink-soft: #4d3f30;

	--font-body: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
	--font-head: Georgia, "Times New Roman", serif;
	--font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;

	--space-1: 0.25rem;
	--space-2: 0.5rem;
	--space-3: 0.75rem;
	--space-4: 1rem;
	--space-5: 1.5rem;
	--space-6: 2rem;
	--space-7: 3rem;
	--space-8: 4.5rem;

	--measure: 46rem;
	--shell: 72rem;
}

/* ---------------------------------------------------------------
   Reset / 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.7;
}

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

h1 { font-size: 2.125rem; letter-spacing: -0.01em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.0625rem; font-family: var(--font-body); }

p { margin: 0 0 var(--space-4); }

a { color: var(--ochre-deep); text-decoration-color: rgba(150, 105, 31, 0.4); text-underline-offset: 3px; }
a:hover { color: var(--fg); text-decoration-color: currentColor; }

ul, ol { margin: 0 0 var(--space-4); padding-left: var(--space-5); }
li { margin-bottom: var(--space-1); }

blockquote {
	margin: var(--space-5) 0;
	padding: var(--space-3) var(--space-5);
	border-left: 3px solid var(--ochre);
	background: var(--surface-warm);
	border-radius: 0 var(--radius) var(--radius) 0;
	color: var(--ink-soft);
}
blockquote p:last-child { margin-bottom: 0; }

code, kbd, samp {
	font-family: var(--font-mono);
	font-size: 0.9em;
	background: var(--surface-warm);
	border: 1px solid var(--border);
	border-radius: 4px;
	padding: 0.1em 0.35em;
}

pre {
	font-family: var(--font-mono);
	font-size: 0.9rem;
	background: var(--fg);
	color: var(--bg);
	border-radius: var(--radius);
	padding: var(--space-4) var(--space-5);
	overflow-x: auto;
	margin: 0 0 var(--space-4);
}
pre code { background: none; border: 0; padding: 0; color: inherit; }

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

table {
	width: 100%;
	border-collapse: collapse;
	margin: 0 0 var(--space-5);
	font-size: 0.95rem;
}
th, td {
	text-align: left;
	padding: var(--space-2) var(--space-3);
	border-bottom: 1px solid var(--border);
	vertical-align: top;
}
th {
	font-family: var(--font-body);
	font-weight: 600;
	border-bottom: 2px solid var(--fg);
	white-space: nowrap;
}
caption { caption-side: top; text-align: left; color: var(--muted); font-size: 0.85rem; padding-bottom: var(--space-2); }

::selection { background: rgba(185, 131, 47, 0.25); }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	border: 0;
	white-space: nowrap;
}
.screen-reader-text:focus {
	width: auto; height: auto;
	clip: auto; clip-path: none;
	margin: var(--space-3);
	padding: var(--space-2) var(--space-4);
	background: var(--fg);
	color: var(--bg);
	border-radius: var(--radius);
	z-index: 100;
}

.skip-link { display: block; }

/* ---------------------------------------------------------------
   Shell / layout
--------------------------------------------------------------- */
.site-shell {
	max-width: var(--shell);
	margin: 0 auto;
	padding: 0 var(--space-5);
}

.layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 17rem;
	gap: var(--space-6);
	padding: var(--space-7) 0 var(--space-8);
}

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

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

.single .layout,
.page .layout { padding-top: var(--space-4); }

.sheet {
	background: var(--paper);
	border: 1px solid var(--border-soft);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: var(--space-6);
}

.sheet > *:first-child { margin-top: 0; }
.sheet > *:last-child { margin-bottom: 0; }

.sheet .entry-note,
.sheet .author-box,
.sheet .related-card,
.sheet .entry-toc { background: var(--surface-warm); }

/* ---------------------------------------------------------------
   Header
--------------------------------------------------------------- */
.site-header {
	background: var(--surface);
	border-bottom: 1px solid var(--border);
	position: relative;
	z-index: 20;
}

.site-header::before {
	content: "";
	display: block;
	height: 3px;
	background: linear-gradient(90deg, var(--accent) 0 22%, var(--ochre) 22% 46%, var(--fg) 46% 100%);
}

.header-inner { display: block; padding-top: 0; padding-bottom: 0; }

.header-brand-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-4);
	min-height: 4rem;
	border-bottom: 1px solid var(--border);
}

.site-name {
	font-family: var(--font-head);
	font-size: 1.375rem;
	font-weight: 700;
	letter-spacing: 0.01em;
	margin: 0;
	white-space: nowrap;
}
.site-name a { color: var(--fg); text-decoration: none; }
.site-name a:hover { color: var(--ochre-deep); }

/* primary menu */
.primary-nav { padding: var(--space-2) 0; margin-left: calc(-1 * var(--space-3)); }

.nav-toggle {
	display: none;
	align-items: center;
	gap: var(--space-2);
	font: inherit;
	font-weight: 600;
	background: none;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: var(--space-2) var(--space-3);
	color: var(--fg);
	cursor: pointer;
}
.nav-toggle svg { display: block; }

.primary-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	gap: var(--space-1);
}

.primary-nav a {
	display: block;
	padding: var(--space-2) var(--space-3);
	color: var(--ink-soft);
	text-decoration: none;
	font-size: 0.9375rem;
	font-weight: 600;
	border-radius: var(--radius);
	white-space: nowrap;
}
.primary-nav a:hover { background: var(--surface-warm); color: var(--fg); }

.primary-nav .menu-item-has-children { position: relative; }
.primary-nav .menu-item-has-children > a { padding-right: var(--space-5); position: relative; }

.sub-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	position: absolute;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	width: 1.25rem;
	height: 1.25rem;
	background: none;
	border: 0;
	padding: 0;
	cursor: pointer;
	color: var(--muted);
	pointer-events: none;
}
.sub-toggle svg { display: block; transition: transform 0.15s ease; }

.primary-nav .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 16rem;
	flex-direction: column;
	align-items: stretch;
	gap: 0;
	background: var(--surface);
	border: 1px solid var(--border);
	border-top: 2px solid var(--accent);
	border-radius: 0 0 var(--radius) var(--radius);
	box-shadow: var(--shadow);
	padding: var(--space-2);
	visibility: hidden;
	opacity: 0;
	transition: opacity 0.12s ease;
}

.primary-nav .menu-item-has-children:hover > .sub-menu,
.primary-nav .menu-item-has-children:focus-within > .sub-menu,
.primary-nav .menu-item-has-children.sub-open > .sub-menu {
	visibility: visible;
	opacity: 1;
}

.primary-nav .sub-menu a {
	white-space: normal;
	font-weight: 500;
	padding: var(--space-2) var(--space-3);
	border-radius: 4px;
}
.primary-nav .sub-menu .menu-item-has-children > a { padding-right: var(--space-3); }
.primary-nav .sub-menu .sub-toggle { display: none; }

/* ---------------------------------------------------------------
   Breadcrumb
--------------------------------------------------------------- */
.breadcrumb {
	font-size: 0.8125rem;
	color: var(--muted);
	padding: var(--space-4) 0 0;
}
.breadcrumb .trail { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.breadcrumb .crumb a { color: var(--muted); text-decoration: none; }
.breadcrumb .crumb a:hover { color: var(--fg); text-decoration: underline; }
.breadcrumb .sep { color: var(--border); }
.breadcrumb .crumb[aria-current] { color: var(--ink-soft); font-weight: 600; }

/* ---------------------------------------------------------------
   Article lists
--------------------------------------------------------------- */
.archive-head {
	border-bottom: 1px solid var(--border);
	padding-bottom: var(--space-4);
	margin-bottom: var(--space-6);
}
.archive-head h1 { margin-bottom: var(--space-2); }
.archive-desc { color: var(--muted); margin: 0; max-width: var(--measure); }

.post-list { display: flex; flex-direction: column; }

.post-item {
	display: grid;
	grid-template-columns: 6.5rem minmax(0, 1fr);
	gap: var(--space-5);
	padding: var(--space-5) 0;
	border-bottom: 1px solid var(--border);
}
.post-item:first-child { padding-top: 0; }

.post-item .item-date {
	font-size: 0.8125rem;
	color: var(--muted);
	line-height: 1.5;
	padding-top: 0.3rem;
}
.post-item .item-date .day {
	display: block;
	font-family: var(--font-head);
	font-size: 1.75rem;
	font-weight: 700;
	color: var(--ochre);
	line-height: 1.1;
}

.post-item .item-title { font-size: 1.25rem; margin-bottom: var(--space-2); }
.post-item .item-title a { color: var(--fg); text-decoration: none; }
.post-item .item-title a:hover { color: var(--ochre-deep); text-decoration: underline; text-decoration-thickness: 1px; }

.post-item .item-excerpt {
	color: var(--ink-soft);
	font-size: 0.95rem;
	margin-bottom: var(--space-2);
}
.post-item .item-excerpt p { margin: 0; }
.post-item .item-meta { font-size: 0.8125rem; color: var(--muted); }
.post-item .item-meta a { color: var(--muted); }

.more-link { font-weight: 600; font-size: 0.875rem; text-decoration: none; }
.more-link::after { content: "\2192"; margin-left: var(--space-1); }

/* ---------------------------------------------------------------
   Pagination
--------------------------------------------------------------- */
.pagination {
	display: flex;
	justify-content: center;
	gap: var(--space-2);
	padding-top: var(--space-6);
}
.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.25rem;
	height: 2.25rem;
	padding: 0 var(--space-3);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	color: var(--ink-soft);
	text-decoration: none;
	font-size: 0.875rem;
	font-weight: 600;
	background: var(--surface);
}
.pagination .page-numbers:hover { border-color: var(--fg); color: var(--fg); }
.pagination .page-numbers.current { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.pagination .page-numbers.dots { border: 0; background: none; }

/* ---------------------------------------------------------------
   Single post
--------------------------------------------------------------- */
.entry { max-width: var(--measure); }
/* Sheet pages: let the paper fill the main column; text stays at --measure. */
.single .entry,
.page .entry { max-width: none; }

.entry-head { margin-bottom: var(--space-5); }
.entry-head h1 { margin-bottom: var(--space-3); }

.entry-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-2) var(--space-4);
	font-size: 0.8125rem;
	color: var(--muted);
	padding-bottom: var(--space-4);
	border-bottom: 1px solid var(--border);
}
.entry-meta a { color: var(--muted); }
.entry-meta a:hover { color: var(--fg); }
.entry-meta .meta-label { font-weight: 600; color: var(--ink-soft); }

.entry-note {
	margin: var(--space-4) 0 0;
	padding: var(--space-3) var(--space-4);
	background: var(--surface-warm);
	border-left: 3px solid var(--accent);
	border-radius: 0 var(--radius) var(--radius) 0;
	font-size: 0.9375rem;
	color: var(--ink-soft);
}
.entry-note p:last-child { margin-bottom: 0; }

.entry-toc {
	margin: var(--space-5) 0;
	padding: var(--space-4) var(--space-5);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
}
.entry-toc summary.toc-title {
	list-style: none;
	cursor: pointer;
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--muted);
	margin-bottom: 0;
}
.entry-toc summary.toc-title::-webkit-details-marker { display: none; }
.entry-toc summary.toc-title::after {
	content: "+";
	float: right;
	color: var(--ochre-deep);
	font-weight: 700;
}
.entry-toc[open] summary.toc-title {
	margin-bottom: var(--space-2);
	padding-bottom: var(--space-2);
	border-bottom: 1px solid var(--border);
}
.entry-toc[open] summary.toc-title::after { content: "\2212"; }
.entry-toc ol { margin: 0; padding-left: var(--space-5); }
.entry-toc li { margin-bottom: var(--space-1); font-size: 0.9375rem; }
.entry-toc a { color: var(--ink-soft); text-decoration: none; }
.entry-toc a:hover { color: var(--ochre-deep); text-decoration: underline; }

.entry-content { font-size: 1.0625rem; overflow-x: hidden; }
.entry-content > * { max-width: var(--measure); }
.entry-content .table-wrap,
.entry-content .wp-block-table { max-width: 100%; }
.entry-content .table-wrap { overflow-x: auto; margin-bottom: var(--space-5); }
.entry-content .table-wrap table { margin-bottom: 0; }

/* Neutral rendering for editor-inserted inline images (text-only theme:
   never hidden, never decorative, just quietly fitted). */
.entry-content img {
	max-width: 100%;
	height: auto;
	border-radius: var(--radius);
	display: block;
	margin: var(--space-4) 0;
}

h1, h2, h3, .item-title a, .card-title { overflow-wrap: break-word; }
.entry-content h2 {
	margin-top: var(--space-7);
	padding-top: var(--space-4);
	border-top: 1px solid var(--border);
}
.entry-content h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.entry-content h3 { margin-top: var(--space-6); }
.entry-content h2::before {
	content: "";
	display: block;
	width: 2.25rem;
	height: 2px;
	background: var(--accent);
	margin-bottom: var(--space-3);
}
.entry-content .wp-block-table { overflow-x: auto; max-width: 100%; }

.entry-tags {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2);
	margin: var(--space-6) 0 0;
	padding-top: var(--space-5);
	border-top: 1px solid var(--border);
}
.entry-tags a {
	display: inline-block;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--ink-soft);
	background: var(--surface-warm);
	border: 1px solid var(--border);
	border-radius: 999px;
	padding: var(--space-1) var(--space-3);
	text-decoration: none;
}
.entry-tags a:hover { border-color: var(--ochre); color: var(--ochre-deep); }

/* author bio */
.author-box {
	margin-top: var(--space-6);
	padding: var(--space-5);
	background: var(--surface);
	border: 1px solid var(--border);
	border-left: 3px solid var(--ochre);
	border-radius: var(--radius);
}
.author-box .author-name { font-family: var(--font-head); font-size: 1.0625rem; font-weight: 700; margin-bottom: var(--space-2); }
.author-box .author-name a { color: var(--fg); }
.author-box .author-kicker {
	margin: 0 0 var(--space-1);
	font-family: var(--font-head);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--ochre-deep);
}
.author-box .author-more {
	display: inline-block;
	margin-top: var(--space-2);
	font-size: 0.9rem;
	font-weight: 700;
	color: var(--ochre-deep);
	text-decoration: none;
	border-bottom: 2px solid var(--ochre);
}
.author-box p { margin: 0; font-size: 0.9375rem; color: var(--ink-soft); }

/* related posts */
.related-posts { margin-top: var(--space-7); }
.related-posts .section-title {
	font-size: 0.8125rem;
	font-family: var(--font-body);
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--muted);
	margin-bottom: var(--space-4);
	padding-bottom: var(--space-2);
	border-bottom: 2px solid var(--fg);
}
.related-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--space-5);
}
.related-card {
	display: block;
	padding: var(--space-4) var(--space-5);
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	text-decoration: none;
}
.related-card:hover { border-color: var(--ochre); box-shadow: var(--shadow); }
.related-card .card-title { display: block; font-family: var(--font-head); font-size: 1.0625rem; font-weight: 700; color: var(--fg); margin-bottom: var(--space-2); }
.related-card:hover .card-title { color: var(--ochre-deep); }
.related-card .card-excerpt {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: 0.875rem;
	color: var(--muted);
	line-height: 1.6;
}
.related-card .card-date { display: block; font-size: 0.75rem; color: var(--muted); margin-top: var(--space-3); }

/* ---------------------------------------------------------------
   Comments
--------------------------------------------------------------- */
.comments-area {
	margin-top: var(--space-7);
	padding-top: var(--space-6);
	border-top: 2px solid var(--fg);
	max-width: var(--measure);
}
.comments-title { font-size: 1.25rem; margin-bottom: var(--space-5); }

.comment-list { list-style: none; margin: 0 0 var(--space-6); padding: 0; }
.comment-list .children { list-style: none; margin: var(--space-4) 0 0; padding-left: var(--space-5); border-left: 1px solid var(--border); }

.comment-body {
	padding: var(--space-4) 0;
	border-bottom: 1px solid var(--border);
}
.comment-meta { font-size: 0.8125rem; color: var(--muted); margin-bottom: var(--space-2); }
.comment-meta .fn { font-weight: 700; color: var(--fg); font-style: normal; }
.comment-meta .comment-date { margin-left: var(--space-2); }
.comment-meta .comment-date a { color: var(--muted); text-decoration: none; }
.comment-content { font-size: 0.95rem; }
.comment-content p:last-child { margin-bottom: 0; }
.comment .reply { margin-top: var(--space-2); font-size: 0.8125rem; }
.comment-awaiting-moderation { font-size: 0.8125rem; color: var(--ochre-deep); font-style: italic; }

.comment-respond { margin-top: var(--space-5); }
.comment-reply-title { font-size: 1.0625rem; margin-bottom: var(--space-4); }
.comment-form label { display: block; font-size: 0.8125rem; font-weight: 600; color: var(--ink-soft); margin-bottom: var(--space-1); }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	font: inherit;
	font-size: 0.95rem;
	padding: var(--space-2) var(--space-3);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	color: var(--fg);
}
.comment-form input:focus, .comment-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.comment-form p { margin-bottom: var(--space-4); }
.comment-form-cookies-consent { display: flex; align-items: center; gap: var(--space-2); }
.comment-form-cookies-consent input { width: auto; }
.comment-form-cookies-consent label { margin: 0; font-weight: 400; }

.submit,
.comment-form .submit {
	font: inherit;
	font-weight: 700;
	font-size: 0.9375rem;
	background: var(--fg);
	color: var(--bg);
	border: 0;
	border-radius: var(--radius);
	padding: var(--space-2) var(--space-5);
	cursor: pointer;
}
.submit:hover, .comment-form .submit:hover { background: var(--ochre-deep); }

/* ---------------------------------------------------------------
   Sidebar
--------------------------------------------------------------- */
.sidebar { min-width: 0; }
.sidebar section,
.sidebar .widget-block {
	margin-bottom: var(--space-6);
	padding-bottom: var(--space-5);
	border-bottom: 1px solid var(--border);
}
.sidebar .widget-title {
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--muted);
	margin-bottom: var(--space-3);
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { margin-bottom: var(--space-2); font-size: 0.9rem; }
.sidebar li a { color: var(--ink-soft); text-decoration: none; }
.sidebar li a:hover { color: var(--ochre-deep); text-decoration: underline; }

.tool-link-card {
	display: block;
	padding: var(--space-3) var(--space-4);
	background: var(--surface-warm);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	text-decoration: none;
	margin-bottom: var(--space-3);
}
.tool-link-card:hover { border-color: var(--ochre); }
.tool-link-card .tool-name { display: block; font-weight: 700; font-size: 0.9rem; color: var(--fg); }
.tool-link-card .tool-desc { display: block; font-size: 0.8rem; color: var(--muted); margin-top: var(--space-1); line-height: 1.5; }

/* ---------------------------------------------------------------
   Search form
--------------------------------------------------------------- */
.search-form {
	display: flex;
	gap: var(--space-2);
	max-width: 26rem;
}
.search-form label { flex: 1; }
.search-field {
	width: 100%;
	font: inherit;
	font-size: 0.9375rem;
	padding: var(--space-2) var(--space-3);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	color: var(--fg);
}
.search-field:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.search-submit {
	font: inherit;
	font-weight: 700;
	font-size: 0.875rem;
	background: var(--fg);
	color: var(--bg);
	border: 0;
	border-radius: var(--radius);
	padding: var(--space-2) var(--space-4);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
}
.search-submit:hover { background: var(--ochre-deep); }

/* ---------------------------------------------------------------
   Footer
--------------------------------------------------------------- */
.site-footer {
	background: var(--fg);
	color: #d8ccba;
	margin-top: var(--space-8);
}
.footer-groups {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--space-6);
	padding: var(--space-7) 0 var(--space-6);
}
.footer-group .group-title {
	display: block;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--accent);
	margin-bottom: var(--space-4);
	padding-bottom: var(--space-3);
	border-bottom: 1px solid rgba(216, 204, 186, 0.2);
}
.footer-group ul { list-style: none; margin: 0; padding: 0; }
.footer-group li { margin-bottom: var(--space-2); }
.footer-group a {
	color: #d8ccba;
	text-decoration: none;
	font-size: 0.875rem;
}
.footer-group a:hover { color: #fff; text-decoration: underline; }

.footer-tools {
	border-top: 1px solid rgba(216, 204, 186, 0.2);
	padding: var(--space-4) 0;
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2) var(--space-5);
	font-size: 0.8125rem;
}
.footer-tools a { color: #bfa77f; text-decoration: none; }
.footer-tools a:hover { color: #fff; text-decoration: underline; }

.footer-base {
	border-top: 1px solid rgba(216, 204, 186, 0.2);
	padding: var(--space-4) 0 var(--space-6);
	font-size: 0.8125rem;
	color: #a89880;
}
.footer-base p { margin: 0 0 var(--space-1); }
.footer-base p:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------
   Homepage hero
--------------------------------------------------------------- */
.home-hero {
	padding: 0 0 var(--space-6);
	border-bottom: 1px solid var(--border);
	margin-bottom: var(--space-6);
	max-width: var(--measure);
}
.home-hero h1 { font-size: 2.5rem; }
.home-hero .lead { font-size: 1.125rem; color: var(--ink-soft); margin-bottom: var(--space-5); }
.home-hero .hero-tools { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.hero-tool-link {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	font-weight: 700;
	font-size: 0.9375rem;
	color: var(--fg);
	background: var(--surface);
	border: 1px solid var(--border);
	border-left: 3px solid var(--ochre);
	border-radius: var(--radius);
	padding: var(--space-3) var(--space-4);
	text-decoration: none;
}
.hero-tool-link:hover { border-color: var(--ochre); box-shadow: var(--shadow); color: var(--ochre-deep); }

/* ---------------------------------------------------------------
   404 / search / states
--------------------------------------------------------------- */
.notfound { max-width: var(--measure); padding: var(--space-6) 0; }
.notfound h1 { margin-bottom: var(--space-4); }
.notfound .suggestions { margin: var(--space-6) 0; }

.no-results-note { color: var(--muted); padding: var(--space-5) 0; }

/* ---------------------------------------------------------------
   Interactive pages (shared tool styles)
--------------------------------------------------------------- */
.tool-page { max-width: none; }
.tool-intro { max-width: var(--measure); color: var(--ink-soft); }
.tool-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: var(--space-6);
	margin-top: var(--space-6);
	align-items: start;
}
.tool-panel {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: var(--space-5);
}
.tool-panel h2 { font-size: 1.125rem; margin-bottom: var(--space-4); padding-bottom: var(--space-2); border-bottom: 2px solid var(--fg); font-family: var(--font-body); }

.tool-question { margin-bottom: var(--space-5); padding-bottom: var(--space-4); border-bottom: 1px solid var(--border); }
.tool-question:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.tool-question .q-label { display: block; font-weight: 700; font-size: 0.9375rem; margin-bottom: var(--space-2); }
.tool-question .q-options { display: flex; flex-direction: column; gap: var(--space-2); }
.tool-question .q-option {
	display: flex;
	align-items: flex-start;
	gap: var(--space-2);
	font-size: 0.9rem;
	padding: var(--space-2) var(--space-3);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	cursor: pointer;
	background: var(--bg);
}
.tool-question .q-option:hover { border-color: var(--ochre); }
.tool-question .q-option input { margin-top: 0.25rem; accent-color: var(--ochre-deep); }
.tool-question .q-option.is-selected { border-color: var(--ochre); background: var(--surface-warm); }

.rank-list { display: flex; flex-direction: column; gap: var(--space-3); }
.rank-card {
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: var(--space-3) var(--space-4);
	background: var(--bg);
	transition: border-color 0.2s ease;
}
.rank-card.is-top { border-color: var(--ochre); background: var(--surface-warm); }
.rank-card .rank-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); margin-bottom: var(--space-2); }
.rank-card .rank-pos { font-family: var(--font-head); font-weight: 700; color: var(--ochre); margin-right: var(--space-1); }
.rank-card .rank-name { font-weight: 700; font-size: 0.95rem; }
.rank-card .rank-score { font-size: 0.8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.rank-card .rank-bar { height: 6px; background: var(--border); border-radius: 999px; overflow: hidden; }
.rank-card .rank-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--ochre)); border-radius: 999px; transition: width 0.25s ease; }
.rank-card .rank-note { font-size: 0.8125rem; color: var(--muted); margin-top: var(--space-2); display: none; }
.rank-card.is-top .rank-note { display: block; }

.tool-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-5); }
.tool-btn {
	font: inherit;
	font-weight: 700;
	font-size: 0.875rem;
	border-radius: var(--radius);
	padding: var(--space-2) var(--space-4);
	cursor: pointer;
	border: 1px solid var(--fg);
	background: var(--fg);
	color: var(--bg);
}
.tool-btn:hover { background: var(--ochre-deep); border-color: var(--ochre-deep); }
.tool-btn--ghost { background: var(--surface); color: var(--fg); border-color: var(--border); }
.tool-btn--ghost:hover { border-color: var(--fg); background: var(--surface); color: var(--fg); }
.copy-status { font-size: 0.8125rem; color: var(--ochre-deep); margin-top: var(--space-2); min-height: 1.2em; }

.tool-result-block { margin-top: var(--space-6); }
.tool-result-block h2 { font-size: 1.125rem; font-family: var(--font-body); padding-bottom: var(--space-2); border-bottom: 2px solid var(--fg); }
.result-card {
	border: 1px solid var(--border);
	border-left: 3px solid var(--ochre);
	border-radius: var(--radius);
	background: var(--surface);
	padding: var(--space-4) var(--space-5);
	margin-bottom: var(--space-4);
}
.result-card .result-rank { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.result-card h3 { font-family: var(--font-head); font-size: 1.25rem; margin: var(--space-1) 0 var(--space-2); }
.result-card p { font-size: 0.9375rem; }
.result-card .tradeoffs { list-style: none; margin: var(--space-3) 0 0; padding: 0; }
.result-card .tradeoffs li {
	font-size: 0.875rem;
	padding: var(--space-2) 0 var(--space-2) var(--space-4);
	border-top: 1px dashed var(--border);
	position: relative;
	color: var(--ink-soft);
}
.result-card .tradeoffs li::before { content: ""; position: absolute; left: 0; top: 1.05em; width: 0.5rem; height: 2px; background: var(--accent); }

.tool-table-wrap { overflow-x: auto; }
.tool-table { min-width: 34rem; }
.tool-table tr.is-winner td { background: var(--surface-warm); font-weight: 600; }
.tool-table tr.is-winner td:first-child { border-left: 3px solid var(--ochre); }

.merksatz {
	margin-top: var(--space-6);
	padding: var(--space-4) var(--space-5);
	background: var(--fg);
	color: var(--bg);
	border-radius: var(--radius);
	font-family: var(--font-head);
	font-size: 1.0625rem;
	line-height: 1.6;
}
.merksatz strong { color: #e8c98a; }

.notice-box {
	margin-top: var(--space-4);
	padding: var(--space-3) var(--space-4);
	border: 1px solid var(--border);
	border-left: 3px solid var(--accent);
	border-radius: 0 var(--radius) var(--radius) 0;
	background: var(--surface-warm);
	font-size: 0.9rem;
	color: var(--ink-soft);
}
.notice-box:empty { display: none; }

/* calculator */
.calc-modes { display: flex; gap: var(--space-2); margin: var(--space-5) 0 0; flex-wrap: wrap; }
.calc-mode-btn {
	font: inherit;
	font-weight: 700;
	font-size: 0.9rem;
	padding: var(--space-2) var(--space-4);
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--surface);
	color: var(--ink-soft);
	cursor: pointer;
}
.calc-mode-btn.is-active { background: var(--fg); border-color: var(--fg); color: var(--bg); }

.calc-field { margin-bottom: var(--space-4); }
.calc-field label { display: block; font-weight: 700; font-size: 0.875rem; margin-bottom: var(--space-1); }
.calc-field .field-row { display: flex; align-items: center; gap: var(--space-3); }
.calc-field input[type="number"] {
	width: 7.5rem;
	font: inherit;
	padding: var(--space-2) var(--space-3);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	font-variant-numeric: tabular-nums;
}
.calc-field input[type="range"] { flex: 1; accent-color: var(--ochre-deep); }
.calc-field select {
	font: inherit;
	font-size: 0.9375rem;
	padding: var(--space-2) var(--space-3);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	max-width: 100%;
}
.calc-field .unit { color: var(--muted); font-size: 0.875rem; }
.calc-hint { font-size: 0.8125rem; color: var(--muted); margin-top: var(--space-1); }

.calc-memo {
	padding: var(--space-3) var(--space-4);
	background: var(--surface-warm);
	border-radius: var(--radius);
	font-size: 0.9rem;
	color: var(--ink-soft);
	margin-bottom: var(--space-5);
	border-left: 3px solid var(--ochre);
}

.calc-result-card {
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
	padding: var(--space-4) var(--space-5);
	margin-bottom: var(--space-4);
}
.calc-result-card .result-big {
	font-family: var(--font-head);
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--fg);
}
.calc-result-card .result-sub { font-size: 0.875rem; color: var(--muted); margin-top: var(--space-1); }

.bar-steps { margin: var(--space-4) 0; }
.bar-steps .bar-row { display: grid; grid-template-columns: 9rem minmax(0, 1fr) 5rem; align-items: center; gap: var(--space-3); margin-bottom: var(--space-2); font-size: 0.8125rem; }
.bar-steps .bar-row .bar-label { color: var(--ink-soft); font-weight: 600; }
.bar-steps .bar-track { height: 10px; background: var(--border); border-radius: 999px; overflow: hidden; }
.bar-steps .bar-val { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar-steps .bar-fill { display: block; height: 100%; border-radius: 999px; }
.bar-fill--roh { background: var(--fg); }
.bar-fill--zarge { background: var(--ochre); }
.bar-fill--blatt { background: var(--accent); }

.ampel {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	font-size: 0.875rem;
	font-weight: 700;
	padding: var(--space-2) var(--space-3);
	border-radius: var(--radius);
	margin-top: var(--space-3);
}
.ampel::before { content: ""; width: 0.75rem; height: 0.75rem; border-radius: 50%; }
.ampel--green { background: #e7efe0; color: #3d5a2e; border: 1px solid #c6d8b4; }
.ampel--green::before { background: #5c8a3c; }
.ampel--yellow { background: #f7efd4; color: #7a5a14; border: 1px solid #e6d196; }
.ampel--yellow::before { background: #d9a521; }
.ampel--red { background: #f6e3dc; color: #8c3524; border: 1px solid #e2b7a9; }
.ampel--red::before { background: #b64a32; }

details.tool-details {
	margin-top: var(--space-5);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
}
details.tool-details summary {
	cursor: pointer;
	font-weight: 700;
	font-size: 0.9rem;
	padding: var(--space-3) var(--space-4);
	list-style: none;
}
details.tool-details summary::-webkit-details-marker { display: none; }
details.tool-details summary::after { content: "+"; float: right; color: var(--ochre-deep); font-weight: 700; }
details.tool-details[open] summary::after { content: "\2212"; }
details.tool-details .details-body { padding: 0 var(--space-4) var(--space-4); }

.hidden-panel { display: none; }
.hidden-panel.is-visible { display: block; }

.warn-line { font-size: 0.875rem; color: #8c3524; font-weight: 600; margin-top: var(--space-3); }
.warn-line:empty { display: none; }

/* ---------------------------------------------------------------
   Responsive
--------------------------------------------------------------- */
@media (max-width: 62rem) {
	.layout { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); padding: var(--space-5) 0 var(--space-6); }
	.sheet { padding: var(--space-5) var(--space-5); }
	.sidebar { border-top: 2px solid var(--fg); padding-top: var(--space-5); }
	.sidebar section:last-child { border-bottom: 0; }
	.tool-grid { grid-template-columns: minmax(0, 1fr); }
	.footer-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.site-footer { margin-top: var(--space-5); }
}

@media (max-width: 50rem) {
	.nav-toggle { display: inline-flex; }

	.primary-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; margin-left: 0; padding: 0; background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
	.primary-nav.is-open { display: block; }
	.primary-nav > ul { flex-direction: column; align-items: stretch; padding: var(--space-3) var(--space-5) var(--space-5); gap: 0; }
	.primary-nav a { white-space: normal; padding: var(--space-3) var(--space-2); border-radius: 0; border-bottom: 1px solid var(--border); }
	.primary-nav a:hover { background: none; }
	.primary-nav .menu-item-has-children > a { padding-right: 3rem; }
	.primary-nav .sub-toggle { pointer-events: auto; right: var(--space-2); width: 2.25rem; height: 2.25rem; }
	.primary-nav .sub-menu {
		position: static;
		visibility: visible;
		opacity: 1;
		display: none;
		border: 0;
		border-top: 0;
		box-shadow: none;
		border-radius: 0;
		padding: 0 0 0 var(--space-4);
		background: var(--surface-warm);
	}
	.primary-nav .menu-item-has-children.sub-open > .sub-menu { display: block; }
	.primary-nav .menu-item-has-children.sub-open > a .sub-toggle svg,
	.primary-nav .sub-menu .sub-toggle { display: inline-flex; }
	.primary-nav .menu-item-has-children.sub-open > .sub-toggle svg { transform: translateY(-50%) rotate(180deg); }
	.primary-nav .sub-menu a { border-bottom: 0; font-size: 0.9rem; }

	.post-item { grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
	.post-item .item-date { display: flex; gap: var(--space-2); align-items: baseline; padding-top: 0; }
	.post-item .item-date .day { font-size: 1rem; }

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

	.bar-steps .bar-row { grid-template-columns: 6.5rem minmax(0, 1fr) 4rem; }
}

@media (max-width: 34rem) {
	h1 { font-size: 1.75rem; }
	.home-hero h1 { font-size: 2rem; }
	.footer-groups { grid-template-columns: minmax(0, 1fr); }
	.search-form { flex-direction: column; }
	.site-shell { padding: 0 var(--space-4); }
	.sheet { padding: 1.25rem var(--space-4); }
}

@media print {
	.site-header, .site-footer, .sidebar, .entry-toc, .related-posts, .comments-area, .pagination, .breadcrumb { display: none; }
	body { background: #fff; }
}

/* Article body internal links · 03 */

.entry-content a.article-internal-link {
	color: #5d4c27;
	text-decoration-line: underline;
	text-decoration-style: solid;
	text-decoration-color: currentColor;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
	background-color: #f3ead4;
	border-radius: 3px;
	padding: 0.08em 0.2em;
	-webkit-box-decoration-break: clone;
	box-decoration-break: clone;
}

.entry-content a.article-internal-link:hover,
.entry-content a.article-internal-link:focus-visible {
	text-decoration-line: underline;
	text-decoration-color: currentColor;
	background-color: #ebdfc1;
	text-decoration-thickness: 2px;
}

.entry-content a.article-internal-link:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}
