/**
 * beitrag.css – Einzel-Beitragsseite im Entwurf-D-Look (nur auf is_singular('post') geladen)
 *
 * Design-Tokens 1:1 aus assets/startseite.css uebernommen (nicht neu erfunden), aber auf
 * #primary.thr-post-area begrenzt, damit nichts ausserhalb der Beitragsseite beeinflusst wird.
 *
 * Warum jeder Selektor mit "#primary.thr-post-area" beginnt:
 *  - Das Parent-Theme setzt Beitragsstile ueber ID-Selektoren (z. B. "#primary .post .entry-title"
 *    { font-size:29px }), die reine Klassen-Selektoren immer schlagen.
 *  - thr-a11y-fixes.php: ".site-content a:not(.btn):not([class*=button])" { color:#517920 !important }
 *    wird dadurch ebenfalls sicher uebertroffen (ID > Klassen).
 * Weitere sitewide Regeln, die hier beruecksichtigt sind:
 *  - thr-a11y-fixes.php: "footer ..." { color:#999 !important } -> kein <footer> in der Vorlage.
 *  - Additional CSS: h1-h6 { color:#2b3111 !important }, Schrift Atkinson Hyperlegible per "*".
 *  - a11y-toolbar.css: html.thr-contrast -> Kontrastmodus (unten mit eigenen Overrides ergaenzt).
 *
 * Alle Farbkombinationen rechnerisch geprueft (WCAG 2.1, Stand 2026-09-28):
 *  Text #1d2a20 auf #f6f7ef 13,9:1 · #415662 auf Weiss 7,7:1 / auf #f6f7ef 7,1:1 / auf #f0f4e1 6,9:1
 *  Links #517920 auf Weiss 5,1:1 / auf #f0f4e1 4,6:1 · Weiss auf #596624 6,3:1 · #8a4128 auf Weiss 7,3:1
 *  Akzentpunkte (Waldgruen 6,3 · Moosgruen 5,8 · Terrakotta 5,5 · Ocker 5,0 gegen Weiss) - nur Deko,
 *  Kategorie steht immer zusaetzlich als Text daneben (WCAG 1.4.1).
 */

#primary.thr-post-area {
	--green-950: #2b3111;
	--green-800: #424b1b;
	--green-700: #596624;
	--green-hover: #3f4a1c;
	--green-200: #e4ebc6;
	--green-100: #f0f4e1;
	--rust-700: #8a4128;
	--rust-600: #a4522f;
	--rust-100: #f3e2d3;
	--bg: #f6f7ef;
	--card: #ffffff;
	--ink: #1d2a20;
	--ink-soft: #415662;
	--line: rgba(65, 86, 98, 0.22);
	--radius-l: 28px;
	--radius-m: 18px;
	--radius-s: 10px;
	--shadow: 0 20px 45px -25px rgba(23, 37, 28, 0.35);
	--measure: 720px;
	--wide: 1080px;
	--thr-accent: var(--green-700);

	/* Einspaltig, ohne Sidebar - unabhaengig davon, was das Theme als Layout vorsieht. */
	width: 100%;
	max-width: none;
	float: none;
	margin: 0;
	padding: 0;
}
#primary.thr-post-area .site-main {
	padding: 8px 0 24px;
}
#primary.thr-post-area article.thr-post {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none;
}

/* ---------- Wegweiser-Farbpunkt (Signatur aus Entwurf D) ---------- */
#primary.thr-post-area .thr-dot {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--thr-accent);
	flex-shrink: 0;
}

/* ---------- Kopfbereich ---------- */
#primary.thr-post-area .thr-post-hero {
	max-width: var(--measure);
	margin: 12px auto 28px;
	padding: 0;
	border: 0;
}
#primary.thr-post-area a.thr-post-back {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 1rem;
	font-weight: 700;
	color: var(--ink-soft) !important;
	text-decoration: none;
	padding: 6px 0;
	margin-bottom: 18px;
}
#primary.thr-post-area a.thr-post-back:hover {
	color: var(--rust-700) !important;
	text-decoration: underline;
}
#primary.thr-post-area .thr-post-kicker {
	display: flex;
	align-items: center;
	gap: 9px;
	margin: 0 0 12px;
	font-size: 0.85rem;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ink);
}
#primary.thr-post-area .thr-post-kicker .thr-dot {
	width: 12px;
	height: 12px;
}
#primary.thr-post-area h1.thr-post-title {
	font-size: clamp(2rem, 4.2vw, 3rem);
	line-height: 1.12;
	letter-spacing: -0.01em;
	font-weight: 700;
	margin: 0 0 0.4em;
	padding: 0;
	text-transform: none;
	text-align: left;
}
#primary.thr-post-area .thr-post-lede {
	font-size: 1.2rem;
	line-height: 1.6;
	color: var(--ink-soft);
	margin: 0 0 1.1em;
}
#primary.thr-post-area ul.thr-post-meta {
	list-style: none;
	margin: 0;
	padding: 14px 0 0;
	border-top: 1px solid var(--line);
	display: flex;
	flex-wrap: wrap;
	gap: 8px 22px;
	font-size: 1rem;
	line-height: 1.5;
	color: var(--ink-soft);
}
#primary.thr-post-area ul.thr-post-meta li {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin: 0;
	padding: 0;
}
#primary.thr-post-area ul.thr-post-meta li::before {
	content: none;
}
#primary.thr-post-area .thr-post-meta svg {
	color: var(--thr-accent);
	flex-shrink: 0;
}

/* ---------- Beitragsbild ---------- */
#primary.thr-post-area .thr-post-figure {
	max-width: var(--wide);
	margin: 0 auto 26px;
}
#primary.thr-post-area .thr-post-figure img {
	display: block;
	width: 100%;
	height: auto;
	max-height: min(70vh, 580px);
	object-fit: cover;
	object-position: 50% 35%;
	border-radius: var(--radius-l);
	box-shadow: var(--shadow);
	background: linear-gradient(135deg, var(--green-200), var(--rust-100));
}
#primary.thr-post-area .thr-post-figure figcaption {
	max-width: var(--measure);
	margin: 10px auto 0;
	font-size: 0.92rem;
	color: var(--ink-soft);
}

/* ---------- Teilen / Drucken ---------- */
#primary.thr-post-area .thr-post-actions {
	max-width: var(--measure);
	margin: 0 auto 30px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}
#primary.thr-post-area .thr-action {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px; /* Zielgroesse fuer Touch/Motorik */
	padding: 8px 16px;
	border: 2px solid var(--line);
	border-radius: 999px;
	background: var(--card);
	color: var(--ink) !important;
	font-family: inherit;
	font-size: 0.95rem;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	text-transform: none;
	letter-spacing: 0;
	cursor: pointer;
	box-shadow: none;
	transition: border-color 0.15s ease, background 0.15s ease;
}
#primary.thr-post-area .thr-action[hidden] {
	display: none;
}
#primary.thr-post-area .thr-action svg {
	color: var(--green-700);
}
#primary.thr-post-area .thr-action:hover {
	border-color: var(--rust-600);
	background: var(--green-100);
}
#primary.thr-post-area .thr-action-status {
	font-size: 0.95rem;
	font-weight: 700;
	color: var(--green-800);
}

/* ---------- Fliesstext ---------- */
#primary.thr-post-area .thr-post-content {
	max-width: var(--measure);
	margin: 0 auto;
	font-size: 1.125rem;
	line-height: 1.7;
	color: var(--ink);
}
#primary.thr-post-area .thr-post-content > * {
	margin-top: 0;
	margin-bottom: 1.15em;
}
#primary.thr-post-area .thr-post-content p {
	font-size: inherit;
	line-height: inherit;
	color: inherit;
	text-align: left;
}
#primary.thr-post-area .thr-post-content h2 {
	font-size: clamp(1.5rem, 2.4vw, 1.85rem);
	line-height: 1.25;
	margin: 1.9em 0 0.6em;
}
#primary.thr-post-area .thr-post-content h2::before {
	content: "";
	display: block;
	width: 44px;
	height: 4px;
	border-radius: 4px;
	background: var(--thr-accent);
	margin-bottom: 12px;
}
#primary.thr-post-area .thr-post-content h3 {
	font-size: 1.3rem;
	line-height: 1.3;
	margin: 1.6em 0 0.5em;
}
#primary.thr-post-area .thr-post-content a:not([class*="button"]) {
	text-decoration: underline;
	text-underline-offset: 0.18em;
	text-decoration-thickness: 1px;
}
#primary.thr-post-area .thr-post-content a:not([class*="button"]):hover {
	text-decoration-thickness: 2px;
}
#primary.thr-post-area .thr-post-content img {
	border-radius: var(--radius-m);
	height: auto;
}
#primary.thr-post-area .thr-post-content figure {
	margin-left: 0;
	margin-right: 0;
}
#primary.thr-post-area .thr-post-content figcaption {
	font-size: 0.92rem;
	color: var(--ink-soft);
	text-align: left;
	margin-top: 8px;
}
/* Galerien und "weite" Bilder duerfen breiter als die Textspalte sein. */
#primary.thr-post-area .thr-post-content > .wp-block-gallery,
#primary.thr-post-area .thr-post-content > .alignwide {
	max-width: none;
	width: min(var(--wide), 100vw - 48px);
	margin-left: 50%;
	transform: translateX(-50%);
}
#primary.thr-post-area .thr-post-content .wp-block-gallery img {
	border-radius: var(--radius-s);
}
#primary.thr-post-area .thr-post-content ul,
#primary.thr-post-area .thr-post-content ol {
	padding-left: 1.4em;
}
#primary.thr-post-area .thr-post-content li {
	margin-bottom: 0.35em;
}
#primary.thr-post-area .thr-post-content li::marker {
	color: var(--thr-accent);
}
#primary.thr-post-area .thr-post-content blockquote {
	margin: 1.6em 0;
	padding: 18px 22px;
	border: 0;
	border-left: 5px solid var(--thr-accent);
	border-radius: 0 var(--radius-m) var(--radius-m) 0;
	background: var(--green-100);
	font-size: 1.15rem;
	font-style: normal;
	color: var(--ink);
}
#primary.thr-post-area .thr-post-content blockquote p:last-child {
	margin-bottom: 0;
}
#primary.thr-post-area .thr-post-content blockquote cite {
	display: block;
	margin-top: 8px;
	font-size: 0.95rem;
	font-style: normal;
	color: var(--ink-soft);
}
#primary.thr-post-area .thr-post-content table {
	width: 100%;
	border-collapse: collapse;
	font-size: 1rem;
}
#primary.thr-post-area .thr-post-content th,
#primary.thr-post-area .thr-post-content td {
	padding: 10px 8px;
	border-bottom: 1px solid var(--line);
	text-align: left;
}
#primary.thr-post-area .thr-post-content .page-links {
	margin-top: 2em;
	font-weight: 700;
}

/* Block-Muster: Einleitung, Infobox, Hinweis, Autor:innen-Zeile */
#primary.thr-post-area .thr-post-content .thr-lede {
	font-size: 1.25rem;
	line-height: 1.6;
	color: var(--ink);
}
#primary.thr-post-area .thr-post-content .thr-infobox {
	background: var(--green-100);
	border-left: 6px solid var(--thr-accent);
	border-radius: 0 var(--radius-m) var(--radius-m) 0;
	padding: 22px 26px;
	margin: 2em 0;
}
#primary.thr-post-area .thr-post-content .thr-infobox h3 {
	margin-top: 0;
	font-size: 1.15rem;
}
#primary.thr-post-area .thr-post-content .thr-infobox ul {
	list-style: none;
	padding-left: 0;
	margin-bottom: 0;
}
#primary.thr-post-area .thr-post-content .thr-hinweis {
	background: var(--rust-100);
	border: 2px solid var(--rust-600);
	border-radius: var(--radius-m);
	padding: 18px 22px;
	margin: 2em 0;
}
#primary.thr-post-area .thr-post-content .thr-hinweis p:last-child {
	margin-bottom: 0;
}
#primary.thr-post-area .thr-post-content .thr-credits {
	font-size: 0.95rem;
	color: var(--ink-soft);
	border-top: 1px solid var(--line);
	padding-top: 12px;
	margin-top: 2.2em;
}

/* ---------- Kategorien & Schlagwoerter ---------- */
#primary.thr-post-area .thr-post-terms {
	max-width: var(--measure);
	margin: 36px auto 0;
	padding-top: 22px;
	border-top: 1px solid var(--line);
	display: grid;
	gap: 14px;
}
#primary.thr-post-area .thr-terms-row {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 10px 14px;
}
#primary.thr-post-area .thr-terms-label {
	font-size: 0.85rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--ink-soft);
	min-width: 120px;
}
#primary.thr-post-area ul.thr-chip-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	flex: 1;
}
#primary.thr-post-area ul.thr-chip-list li {
	margin: 0;
	padding: 0;
}
#primary.thr-post-area ul.thr-chip-list li::before {
	content: none;
}
#primary.thr-post-area a.thr-chip {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 6px 14px;
	border: 2px solid var(--line);
	border-radius: 999px;
	background: var(--card);
	color: var(--ink) !important;
	font-size: 0.92rem;
	font-weight: 700;
	line-height: 1.4;
	text-decoration: none;
	transition: border-color 0.15s ease, background 0.15s ease;
}
#primary.thr-post-area a.thr-chip:hover {
	border-color: var(--thr-accent);
	background: var(--green-100);
}
#primary.thr-post-area a.thr-chip-tag {
	font-weight: 400;
	background: var(--bg);
}
#primary.thr-post-area a.thr-chip-tag::before {
	content: "#";
	color: var(--ink-soft);
	margin-right: -3px;
}

/* ---------- Vorheriger / naechster Beitrag ---------- */
#primary.thr-post-area .thr-post-nav {
	max-width: var(--wide);
	margin: 48px auto 0;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 18px;
}
#primary.thr-post-area a.thr-post-nav-link {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 20px 24px;
	border: 1px solid var(--line);
	border-radius: var(--radius-m);
	background: var(--card);
	color: var(--ink) !important;
	text-decoration: none;
	transition: border-color 0.15s ease, transform 0.15s ease;
}
#primary.thr-post-area a.thr-post-nav-link:hover {
	border-color: var(--rust-600);
	transform: translateY(-2px);
}
#primary.thr-post-area a.thr-next {
	grid-column: 2;
	text-align: right;
	align-items: flex-end;
}
#primary.thr-post-area .thr-post-nav-dir {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.85rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--rust-700);
}
#primary.thr-post-area .thr-post-nav-title {
	font-size: 1.1rem;
	font-weight: 700;
	line-height: 1.35;
	color: var(--green-950);
}

/* ---------- Weitere Beitraege (Karten wie auf der Startseite) ---------- */
#primary.thr-post-area .thr-related {
	max-width: var(--wide);
	margin: 48px auto 0;
	padding: 38px 34px;
	background: var(--bg);
	border-radius: var(--radius-l);
}
#primary.thr-post-area .thr-related-head {
	margin-bottom: 26px;
}
#primary.thr-post-area .thr-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	margin: 0 0 10px;
	font-size: 0.85rem;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ink);
}
#primary.thr-post-area .thr-related-head h2 {
	font-size: clamp(1.5rem, 2.6vw, 2rem);
	line-height: 1.2;
	margin: 0;
}
#primary.thr-post-area ul.thr-related-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 22px;
}
#primary.thr-post-area li.thr-card {
	position: relative;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius-m);
	overflow: hidden;
	box-shadow: var(--shadow);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#primary.thr-post-area li.thr-card::before {
	content: none;
}
#primary.thr-post-area li.thr-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 26px 50px -22px rgba(23, 37, 28, 0.4);
}
/* Ganze Karte klickbar, Fokus-Rahmen um die ganze Karte */
#primary.thr-post-area li.thr-card:focus-within {
	outline: 3px solid var(--rust-600);
	outline-offset: 3px;
}
#primary.thr-post-area .thr-card-thumb {
	position: relative;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	flex-shrink: 0;
	background: linear-gradient(135deg, var(--green-200), var(--rust-100));
	border-bottom: 4px solid var(--thr-accent);
}
/* Absolut positioniert, damit auch Hochformat-Fotos die Karte nicht in die Laenge ziehen. */
#primary.thr-post-area .thr-card-thumb img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	display: block;
}
#primary.thr-post-area .thr-card-placeholder {
	display: block;
	width: 100%;
	height: 100%;
}
#primary.thr-post-area .thr-card-body {
	padding: 18px 20px 22px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex-grow: 1;
}
#primary.thr-post-area .thr-card-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin: 0;
	font-size: 0.82rem;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--ink-soft);
}
#primary.thr-post-area h3.thr-card-title {
	font-size: 1.15rem;
	line-height: 1.3;
	margin: 0;
}
#primary.thr-post-area a.thr-card-link {
	color: var(--green-950) !important;
	text-decoration: none;
}
#primary.thr-post-area a.thr-card-link:hover {
	text-decoration: underline;
}
#primary.thr-post-area a.thr-card-link:focus-visible {
	outline: none !important; /* Fokus wird an der ganzen Karte gezeigt (:focus-within) */
}
#primary.thr-post-area a.thr-card-link::after {
	content: "";
	position: absolute;
	inset: 0;
}
#primary.thr-post-area .thr-card-excerpt {
	margin: 0;
	font-size: 1rem;
	line-height: 1.5;
	color: var(--ink-soft);
}
#primary.thr-post-area .thr-related-more {
	margin: 28px 0 0;
	text-align: center;
}
#primary.thr-post-area a.thr-button-primary {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	padding: 12px 26px;
	border-radius: 999px;
	background: var(--green-700);
	color: #fff !important;
	font-weight: 700;
	text-decoration: none;
	transition: background 0.15s ease;
}
#primary.thr-post-area a.thr-button-primary:hover,
#primary.thr-post-area a.thr-button-primary:focus {
	background: var(--green-hover);
	color: #fff !important;
}

/* ---------- Responsiv ---------- */
@media (max-width: 980px) {
	#primary.thr-post-area ul.thr-related-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}
@media (max-width: 640px) {
	#primary.thr-post-area ul.thr-related-grid,
	#primary.thr-post-area .thr-post-nav {
		grid-template-columns: 1fr;
	}
	#primary.thr-post-area a.thr-next {
		grid-column: 1;
	}
	#primary.thr-post-area .thr-related {
		padding: 26px 18px;
		border-radius: var(--radius-m);
	}
	#primary.thr-post-area .thr-post-figure img {
		border-radius: var(--radius-m);
	}
	#primary.thr-post-area .thr-terms-label {
		min-width: 0;
		width: 100%;
	}
	#primary.thr-post-area .thr-post-content > .wp-block-gallery,
	#primary.thr-post-area .thr-post-content > .alignwide {
		width: 100%;
		margin-left: 0;
		transform: none;
	}
}

/* ---------- Bewegung reduzieren ---------- */
@media (prefers-reduced-motion: reduce) {
	#primary.thr-post-area *,
	#primary.thr-post-area *::before,
	#primary.thr-post-area *::after {
		transition-duration: 0.001ms !important;
	}
	#primary.thr-post-area li.thr-card:hover,
	#primary.thr-post-area a.thr-post-nav-link:hover {
		transform: none;
	}
}

/* ---------- Kontrastmodus (Toolbar "Kontrast erhoehen") ---------- */
html.thr-contrast #primary.thr-post-area a.thr-post-back,
html.thr-contrast #primary.thr-post-area a.thr-chip,
html.thr-contrast #primary.thr-post-area a.thr-card-link,
html.thr-contrast #primary.thr-post-area a.thr-post-nav-link,
html.thr-contrast #primary.thr-post-area .thr-action {
	color: #000 !important;
	border-color: #000;
	background: #fff;
	text-decoration: underline;
}
html.thr-contrast #primary.thr-post-area a.thr-button-primary {
	background: #000;
	color: #fff !important;
}
html.thr-contrast #primary.thr-post-area li.thr-card,
html.thr-contrast #primary.thr-post-area .thr-related,
html.thr-contrast #primary.thr-post-area .thr-post-content .thr-infobox,
html.thr-contrast #primary.thr-post-area .thr-post-content .thr-hinweis,
html.thr-contrast #primary.thr-post-area .thr-post-content blockquote {
	border: 2px solid #000;
	background: #fff;
}
html.thr-contrast #primary.thr-post-area .thr-post-nav-dir {
	color: #000;
}

/* ---------- Druckansicht ---------- */
@media print {
	.thr-a11y-bar,
	.thr-skip-link,
	#masthead,
	.site-header,
	.site-footer,
	.page-header,
	#cmplz-cookiebanner-container,
	.cmplz-manage-consent,
	#primary.thr-post-area .thr-post-back,
	#primary.thr-post-area .thr-post-actions,
	#primary.thr-post-area .thr-post-nav,
	#primary.thr-post-area .thr-related,
	#primary.thr-post-area .thr-post-terms {
		display: none !important;
	}
	#primary.thr-post-area .thr-post-figure img {
		box-shadow: none;
		max-height: 12cm;
	}
	#primary.thr-post-area .thr-post-content {
		max-width: none;
		font-size: 11pt;
	}
	#primary.thr-post-area .thr-post-content a[href^="http"]::after {
		content: " (" attr(href) ")";
		font-size: 0.85em;
		word-break: break-all;
	}
}
