/*
 * Single magazine article (single.php).
 *
 * Loaded asynchronously; the header block is duplicated in
 * critical-single.css, which is inlined. That one is the minimum needed
 * to paint the first screen, this stays the complete source.
 *
 * The content section is the important half of this file. It has to
 * carry articles that were written in Elementor and converted to blocks,
 * so it styles the plain tags — h2, p, ul, ol, blockquote, figure — and
 * never a builder's class names.
 */

.magazin--single {
	background: #fbfaf8;
	padding-bottom: clamp(3rem, 6vw, 5rem);
}

/* ---------- Header ---------- */

.post-header,
.post-body,
.post-related,
.post-comments {
	padding-inline: max(var(--fk-space), (100% - var(--fk-max-width)) / 2);
}

.post-header {
	padding-top: 1.5rem;
}

.post-header .breadcrumbs ol {
	margin-bottom: 1.75rem;
}

.post-header__inner {
	display: grid;
	gap: 1.75rem;
	align-items: center;
}

@media (min-width: 56em) {
	.post-header__inner {
		grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
		gap: 3.5rem;
	}
}

/* Square in CSS, not in a registered image size — see post-header.php.
   The ratio is declared so the row holds its height while the LCP image
   is still on the wire. */
.post-header__image {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
}

.post-eyebrow {
	margin: 0 0 0.875rem;
}

.post-eyebrow a {
	color: inherit;
	text-decoration: none;
}

.post-eyebrow a:hover,
.post-eyebrow a:focus-visible {
	text-decoration: underline;
	text-underline-offset: 0.3em;
}

.post-title {
	margin: 0;
	font-family: var(--fk-font-serif);
	font-weight: 500;
	font-size: clamp(2rem, 4.2vw, 3.25rem);
	line-height: 1.12;
	color: var(--fk-color-text);
	/* h1–h4 break long words globally, which is right in a narrow card
	   and wrong in a headline this size. */
	overflow-wrap: normal;
}

/* ---------- Body column ---------- */

.post-body {
	padding-top: clamp(2.5rem, 5vw, 4rem);
}

.post-toc,
.post-content {
	max-width: 46rem;
	margin-inline: auto;
}

/* ---------- Table of contents ---------- */

.post-toc {
	margin-bottom: 2.5rem;
	padding: 1.5rem 1.75rem;
	background: var(--fk-color-bg);
	border: 1px solid rgba(31, 31, 31, 0.08);
	border-radius: 0.5rem;
}

.post-toc__title {
	margin: 0 0 0.75rem;
	font-family: var(--fk-font-serif);
	font-weight: 500;
	font-size: 1.125rem;
	line-height: 1.3;
	color: var(--fk-color-text);
}

.post-toc__list {
	margin: 0 0 0 1.25rem;
	padding: 0;
	font-size: 0.9375rem;
	line-height: 1.5;
}

.post-toc__list li {
	margin-bottom: 0.5rem;
}

.post-toc__list li:last-child {
	margin-bottom: 0;
}

.post-toc__list a {
	color: var(--fk-color-sage-text);
	text-underline-offset: 0.2em;
}

.post-toc__list a:hover,
.post-toc__list a:focus-visible {
	color: var(--fk-color-text);
}

/* ---------- Article content ---------- */

.post-content {
	font-size: 1.0625rem;
	line-height: 1.8;
	color: var(--fk-color-body);
}

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

.post-content > *:last-child {
	margin-bottom: 0;
}

.post-content p {
	margin: 0 0 1.375rem;
}

/*
 * Left aligned, unlike the centred headings on the Firmengeschenke page:
 * there they punctuate a marketing column, here they are the article's
 * own outline and the reader scans down their left edge.
 */
.post-content h2,
.post-content h3,
.post-content h4 {
	margin: 2.75rem 0 1rem;
	font-family: var(--fk-font-serif);
	font-weight: 500;
	line-height: 1.2;
	color: var(--fk-color-text);
	overflow-wrap: normal;
}

.post-content h2 {
	font-size: clamp(1.625rem, 3vw, 2.125rem);
}

.post-content h3 {
	font-size: clamp(1.25rem, 2.2vw, 1.5rem);
}

.post-content h4 {
	font-size: 1.125rem;
}

/* Air above a heading that was jumped to from the table of contents.
   On the headings rather than on :target, so the browser knows the
   offset before it scrolls rather than while it does. */
.post-content h2,
.post-content h3 {
	scroll-margin-top: 1.5rem;
}

.post-content ul,
.post-content ol {
	margin: 0 0 1.375rem 1.5rem;
	padding: 0;
}

.post-content li {
	margin-bottom: 0.5rem;
}

.post-content li > ul,
.post-content li > ol {
	margin-top: 0.5rem;
	margin-bottom: 0;
}

.post-content a {
	color: var(--fk-color-sage-text);
	text-underline-offset: 0.2em;
}

.post-content a:hover,
.post-content a:focus-visible {
	color: var(--fk-color-text);
}

.post-content strong,
.post-content b {
	font-weight: 700;
	color: var(--fk-color-text);
}

.post-content blockquote {
	margin: 2rem 0;
	padding-left: 1.5rem;
	border-left: 2px solid var(--fk-color-sage);
	font-style: italic;
	color: var(--fk-color-text);
}

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

.post-content img {
	border-radius: 0.25rem;
}

.post-content figure {
	margin: 2rem 0;
}

.post-content figcaption {
	margin-top: 0.625rem;
	font-size: 0.875rem;
	color: var(--fk-color-sage-text);
}

/* Wide content scrolls inside its own box: the page body must never
   scroll sideways, and a migrated article may well carry a table wider
   than this column. */
.post-content table {
	display: block;
	overflow-x: auto;
	width: 100%;
	border-collapse: collapse;
	margin: 0 0 1.375rem;
	font-size: 0.9375rem;
}

.post-content th,
.post-content td {
	padding: 0.625rem 0.875rem;
	border: 1px solid rgba(31, 31, 31, 0.12);
	text-align: left;
}

.post-content th {
	background: var(--fk-color-greige);
	color: var(--fk-color-text);
	font-weight: 600;
}

.post-content pre {
	overflow-x: auto;
	padding: 1rem;
	background: var(--fk-color-greige);
	border-radius: 0.25rem;
	font-size: 0.875rem;
}

.post-content hr {
	margin: 2.5rem 0;
	border: 0;
	border-top: 1px solid rgba(31, 31, 31, 0.12);
}

/* ---------- Related ---------- */

.post-related {
	margin-top: clamp(3.5rem, 7vw, 5.5rem);
}

.post-related__title {
	margin: 0 0 2rem;
	font-family: var(--fk-font-serif);
	font-weight: 500;
	font-size: clamp(1.5rem, 3vw, 2rem);
	line-height: 1.2;
	color: var(--fk-color-text);
}

/* ---------- Comments ---------- */

.post-comments {
	max-width: 46rem;
	margin: clamp(3rem, 6vw, 4.5rem) auto 0;
}
