/**
 * The body of a post.
 *
 * The design set every paragraph, heading and list item by hand with utility
 * classes. The editor does not write those, so the same values live here as
 * descendant rules and apply to whatever the block editor emits.
 *
 * Loaded on single posts only.
 *
 * @package GermanyAssignment
 */

.gah-art {
	max-width: none;
	color: var( --ink-4 );
}

/* --------------------------------------------------------------- text */

.gah-art p {
	font-size: 1.02rem;
	color: var( --ink-4 );
	line-height: 1.85;
	margin-top: 16px;
}

.gah-art > p:first-child {
	font-size: 1.13rem;
	color: var( --slate );
	line-height: 1.75;
	font-weight: 500;
	margin-top: 0;
	padding-bottom: 22px;
	border-bottom: 1px solid var( --line );
	margin-bottom: 26px;
}

.gah-art strong,
.gah-art b {
	font-weight: 800;
	color: var( --ink );
}

.gah-art a {
	color: var( --rot-700 );
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.gah-art a:hover { color: var( --rot-500 ); }

/* ----------------------------------------------------------- headings */

.gah-art h2 {
	margin: 38px 0 14px;
	font-size: 1.42rem;
	font-weight: 800;
	letter-spacing: -.03em;
	line-height: 1.28;
	color: var( --ink );

	/* the sticky header would otherwise sit on top of a heading jumped to */
	scroll-margin-top: 100px;
}

.gah-art h3 {
	margin: 24px 0 9px;
	font-size: 1.08rem;
	font-weight: 800;
	letter-spacing: -.022em;
	color: var( --ink );
	scroll-margin-top: 100px;
}

.gah-art h4 {
	margin: 20px 0 8px;
	font-size: .98rem;
	font-weight: 800;
	color: var( --ink );
	scroll-margin-top: 100px;
}

/* -------------------------------------------------------------- lists */

.gah-art ul,
.gah-art ol {
	list-style: none;
	margin: 13px 0 0;
	padding: 0;
	display: grid;
	gap: 9px;
}

.gah-art ol { counter-reset: gahli; }

.gah-art li {
	position: relative;
	font-size: 1rem;
	color: var( --ink-4 );
	line-height: 1.75;
}

.gah-art ul > li { padding-left: 24px; }

.gah-art ul > li::before {
	content: "";
	position: absolute;
	left: 5px;
	top: .66em;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var( --grad-red );
}

.gah-art ol > li {
	padding-left: 36px;
	counter-increment: gahli;
}

.gah-art ol > li::before {
	content: counter( gahli );
	position: absolute;
	left: 0;
	top: .02em;
	width: 26px;
	height: 26px;
	border-radius: 8px;
	display: grid;
	place-items: center;
	font-size: .72rem;
	font-weight: 800;
	color: var( --rot-700 );
	background: var( --grad-red-soft );
	border: 1px solid #F3D4D3;
}

/* a list inside a list keeps its own counter and indents */
.gah-art li > ul,
.gah-art li > ol { margin-top: 9px; }

/* -------------------------------------------------------------- quote */

.gah-art blockquote {
	position: relative;
	margin: 26px 0;
	padding: 26px 30px 26px 62px;
	border-radius: var( --r-lg, 22px );
	background: var( --grad-red-soft );
	border: 1px solid #F3D4D3;
}

.gah-art blockquote::before {
	content: "\201C";
	position: absolute;
	left: 18px;
	top: 2px;
	font-size: 4rem;
	line-height: 1;
	font-weight: 800;
	background: var( --grad-red );
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.gah-art blockquote p {
	font-size: 1.04rem;
	color: var( --rot-900 );
	line-height: 1.7;
	font-weight: 600;
	margin-top: 0;
}

.gah-art blockquote p + p { margin-top: 12px; }

@media ( max-width: 620px ) {
	.gah-art blockquote { padding: 22px 20px 22px 50px; }
}

/* ------------------------------------------------------------- tables */

.gah-art table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	margin-top: 16px;
	background: var( --grad-card );
	border: 1px solid var( --line );
	border-radius: var( --r-lg, 22px );
	overflow: hidden;
}

.gah-art th {
	background: var( --grad-red );
	color: #fff;
	font-size: .79rem;
	font-weight: 800;
	text-align: left;
	padding: 13px 16px;
	letter-spacing: .03em;
}

.gah-art td {
	padding: 13px 16px;
	border-top: 1px solid var( --line );
	font-size: .92rem;
	color: var( --slate );
}

.gah-art tbody tr:first-child td { border-top: 0; }

@media ( max-width: 620px ) {
	.gah-art table { display: block; overflow-x: auto; }
}

/* ------------------------------------------------------------- media */

.gah-art img,
.gah-art figure {
	margin-top: 22px;
	border-radius: var( --r-lg, 22px );
}

.gah-art figure img { margin-top: 0; }

.gah-art figcaption {
	margin-top: 10px;
	font-size: .8rem;
	color: var( --slate-lt );
	text-align: center;
}

.gah-art hr {
	margin: 30px 0;
	border: 0;
	border-top: 1px solid var( --line );
}

.gah-art pre {
	margin-top: 18px;
	padding: 18px 20px;
	border-radius: var( --r-md, 12px );
	background: var( --ink );
	color: #EBE5E5;
	overflow-x: auto;
	font-size: .86rem;
	line-height: 1.6;
}

.gah-art :not( pre ) > code {
	padding: 2px 6px;
	border-radius: 5px;
	background: var( --rot-050 );
	border: 1px solid #F3D4D3;
	font-size: .88em;
	color: var( --rot-800 );
}

@media ( max-width: 620px ) {
	.gah-art p,
	.gah-art li { font-size: .96rem; }
	.gah-art h2 { font-size: 1.2rem; }
}

/* the section clears the featured panel that overlaps it from above */
.gah-artsec { padding-top: 84px; }

/* ------------------------------------------------- the two-column layout */

/*
 * These few are written out rather than composed from utilities: the compiled
 * stylesheet is built from the markup the design shipped, and the design never
 * drew this column pair — so the utilities for it are not in there.
 */
.gah-artgrid {
	display: grid;
	grid-template-columns: 330px 1fr;
	gap: 38px;
	align-items: start;
	text-align: left;
}

/*
 * The sidebar follows the reader down the article.
 *
 * It scrolls inside itself once it is taller than the screen, so a long
 * contents list plus the form never leaves the bottom of the form unreachable.
 */
.gah-aside {
	position: sticky;
	top: 96px;
	align-self: start;
	display: grid;
	gap: 18px;
	max-height: calc( 100vh - 112px );
	overflow-y: auto;
	overscroll-behavior: contain;

	/* room for the scrollbar so the cards' shadows are not clipped */
	padding-right: 4px;
	margin-right: -4px;
}

/*
 * position:sticky does nothing inside a scroll container, and the compiled
 * stylesheet puts overflow-x:hidden on html and body — which makes one. clip
 * hides the same overflow without creating the container.
 */
@supports ( overflow: clip ) {
	html,
	body { overflow-x: clip; }
}

@media ( max-width: 1080px ) {
	.gah-artgrid { grid-template-columns: 1fr; }
	.gah-aside {
		position: static;
		grid-template-columns: 1fr 1fr;
		max-height: none;
		overflow: visible;
	}
}

@media ( max-width: 820px ) {
	.gah-aside { grid-template-columns: 1fr; }
}

/* --------------------------------------------------- the table of contents */

/* the sidebar around it does the scrolling, so this one just lists */
.gah-toc {
	list-style: none;
	margin: 0;
	padding: 0 10px 14px;
	counter-reset: gahtoc;
}

.gah-toc li { counter-increment: gahtoc; }

.gah-toc a {
	display: flex;
	gap: 9px;
	padding: 8px 11px;
	border-radius: 9px;
	font-size: .85rem;
	font-weight: 600;
	color: var( --slate );
	line-height: 1.45;
	transition: background .18s, color .18s;
}

.gah-toc a::before {
	content: counter( gahtoc );
	flex: none;
	font-weight: 800;
	color: var( --rot-600 );
}

.gah-toc a:hover,
.gah-toc a.is-here {
	background: var( --grad-red-soft );
	color: var( --rot-700 );
}

.gah-toc a.is-here { font-weight: 800; }

/* a second-level heading sits in from its parent */
.gah-toc li[data-level="3"] a {
	padding-left: 26px;
	font-size: .8rem;
}

/* ------------------------------------------------------- the side cards */

.gah-sidecard::before {
	content: "";
	display: block;
	height: 5px;
	background: linear-gradient( 90deg, var( --schwarz ), var( --rot-600 ), var( --gold-500 ), var( --rot-600 ), var( --schwarz ) );
	background-size: 220% 100%;
	animation: sheen 7s ease-in-out infinite;
}

@media ( prefers-reduced-motion: reduce ) {
	.gah-sidecard::before { animation: none; }
}
