/*
 * Single news article — body region layout glue.
 *
 * The masthead, share rail, sidebar, related grid and prev/next nav
 * are server-rendered blocks that each ship their own CSS. This file
 * styles only what lives on plain template markup:
 *
 *  - `.sghr-article`         the core/group wrapping share + content
 *                            + sidebar (the three-column body grid).
 *  - `.sghr-article__content` the core/post-content holding the
 *                            author's body blocks (paragraphs, H2s,
 *                            lists, quotes, images).
 *
 * Desktop: share rail | reading column | sticky sidebar. Mobile: a
 * single column with the share rail on top and the sidebar below.
 */

/* The single-article view is white end-to-end (the global page
 * background is the subtle grey); only the "Weitere Beiträge" band and
 * the footer break that. Painting the whole main region white lets the
 * related block's own surface-subtle fill read as an intentional band. */
#sghr-content {
	background: var(--wp--preset--color--surface);
	/* Drop the root block-gap above main so the warm masthead sits flush
	 * under the header — otherwise the grey page background shows as a
	 * bar in that gap (invisible on white-topped pages, obvious here). */
	margin-top: 0;
}

.sghr-article {
	/* Match the theme's section width: an 80rem inner with the shared
	 * gutter, expressed on one element so the body grid lines up exactly
	 * with the full-width featured image and the related band above/below
	 * (which use the outer-padding + 80rem-inner pattern). */
	--sghr-pad-x: var(--sghr-section-pad-x, clamp(1.25rem, 1.5rem + 4vw, 7.5rem));
	width: min(80rem, 100% - 2 * var(--sghr-pad-x));
	margin-inline: auto;
	padding-block:  clamp(2.5rem, 3rem + 2vw, 4rem);
	display: grid;
	grid-template-columns: 3rem minmax(0, 1fr) 20rem;
	column-gap: clamp(1.5rem, 1rem + 2vw, 3.5rem);
	row-gap: 2rem;
	align-items: start;
}

/* Reading column ----------------------------------------------------- */
.sghr-article__content {
	min-width: 0;
	font-size: var(--wp--preset--font-size--lg);
	line-height: 1.7;
	color: var(--wp--preset--color--ink);
}

.sghr-article__content > * {
	margin-block: 0 1.25rem;
}

.sghr-article__content > *:last-child {
	margin-bottom: 0;
}

/* Lead-in: first paragraph reads a touch larger and heavier. */
.sghr-article__content > p:first-of-type {
	font-size: var(--wp--preset--font-size--lg);
	font-weight: 500;
	line-height: 1.6;
	color: var(--wp--preset--color--ink);
}

.sghr-article__content h2 {
	margin-top: 2.5rem;
	scroll-margin-top: 6rem;
	font-size: var(--wp--preset--font-size--display-sm);
	line-height: 1.25;
}

.sghr-article__content h3 {
	margin-top: 2rem;
	scroll-margin-top: 6rem;
	font-size: var(--wp--preset--font-size--xl);
	line-height: 1.3;
}

.sghr-article__content :is(h2, h3):first-child {
	margin-top: 0;
}

.sghr-article__content img {
	max-width: 100%;
	height: auto;
	border-radius: 12px;
}

.sghr-article__content figure {
	margin-block: 2rem;
}

.sghr-article__content figcaption {
	margin-top: 0.625rem;
	font-size: var(--wp--preset--font-size--sm);
	color: var(--wp--preset--color--ink-subtle);
	line-height: 1.5;
	text-align: left;
}

.sghr-article__content ol {
	padding-left: 1.5rem;
}

.sghr-article__content li {
	margin-block: 0.4rem;
}

/* Unordered lists use a primary check marker (design's check-icon list). */
.sghr-article__content ul {
	list-style: none;
	padding-left: 0;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.sghr-article__content ul li {
	position: relative;
	margin-block: 0;
	padding-left: 2rem;
}

.sghr-article__content ul li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.2em;
	width: 1.25rem;
	height: 1.25rem;
	background-color: var(--wp--preset--color--primary);
	-webkit-mask: var(--sghr-check-mask) center / contain no-repeat;
	mask: var(--sghr-check-mask) center / contain no-repeat;
}

.sghr-article__content {
	--sghr-check-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}

/* Pull-quote: warm accent rule, no fill (design pullquote). */
.sghr-article__content blockquote {
	margin-block: 2rem;
	padding: 0.25rem 0 0.25rem 1.75rem;
	border-left: 4px solid var(--wp--preset--color--accent-warm);
	font-size: var(--wp--preset--font-size--xl);
	font-weight: 500;
	line-height: 1.4;
	color: var(--wp--preset--color--ink);
}

.sghr-article__content blockquote p {
	margin: 0;
}

.sghr-article__content blockquote cite {
	display: block;
	margin-top: 0.625rem;
	font-size: var(--wp--preset--font-size--sm);
	font-style: normal;
	font-weight: 500;
	color: var(--wp--preset--color--ink-muted);
}

/* Tablet / mobile: collapse to a single column. The design stacks the
 * article body as content → share row → newsletter, and flips the
 * lower sections to related → prev/next. */
@media (max-width: 60rem) {
	.sghr-article {
		display: flex;
		flex-direction: column;
		gap: 2rem;
	}

	.sghr-article > .sghr-article__content {
		order: 1;
		font-size: var(--wp--preset--font-size--base);
	}

	.sghr-article > .wp-block-sghr-article-share {
		order: 2;
	}

	.sghr-article > .wp-block-sghr-article-sidebar {
		order: 3;
	}

	/* Reorder the lower full-width sections (related before prev/next). */
	#sghr-content {
		display: flex;
		flex-direction: column;
	}

	#sghr-content > .wp-block-sghr-news-related {
		order: 1;
	}

	#sghr-content > .wp-block-sghr-article-nav {
		order: 2;
	}
}
