/* Article shell and components for the modern stack. Loaded after
   tokens.css and base.css. The sheet only ships with $cssMode = 'modern'
   (php/artikel_meta.php), so component rules are not scoped to the .article
   ancestor; only the element defaults keep that scope. */

.article {
	box-sizing: border-box;
	font-family: var(--font-body);
	font-size: var(--fs-body);
	line-height: 1.6;
	color: var(--ink);
	text-align: left;
}
.article * {
	box-sizing: border-box;
}
.article p {
	margin: 0 0 12px;
	text-wrap: pretty;
}
.article strong,
.article b {
	font-weight: 700;
}
.article h1,
.article h2,
.article h3 {
	text-align: left;
	text-wrap: balance;
	color: var(--ink);
}
.article [id] {
	scroll-margin-top: 16px;
}

/* Media and links */

.article img {
	max-width: 100%;
	height: auto;
	border-radius: var(--radius-img);
}
.article figcaption {
	font-size: var(--fs-caption);
	line-height: 1.45;
	color: var(--muted);
}
/* Inline links stay underlined at rest so they are recognisable inside prose;
   text-decoration-color follows the link colour. */
.article a {
	color: var(--link);
	text-decoration: underline;
	text-decoration-color: currentColor;
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}
.article a:hover {
	color: var(--link-hover);
	text-decoration: underline;
	text-decoration-color: currentColor;
}
/* Navigation, image-only and boxed links stay undecorated. */
.article-kicker a,
.article-toc a,
.article-header h1 a,
.article .article-buy a,
.article .episode-card {
	text-decoration: none;
}
.article .article-buy a:hover {
	text-decoration: underline;
}

/* Mikro-Labels (Kicker, Inhaltsverzeichnis, Anzeige, Fakten) */

.article-kicker,
.article-toc-title,
.article-buy-label {
	font-size: var(--fs-label);
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--muted);
}

/* Kopf */

.article-header {
	padding: var(--pad) var(--pad) var(--space-3);
}
.article-kicker {
	margin: 0 0 10px;
}
.article-header h1 {
	margin: 0 0 12px;
	font-size: var(--fs-h1);
	line-height: 1.08;
	letter-spacing: -.01em;
}
/* Wordmark instead of the text title: the <img> carries the whole h1 and is
   centred in the header like a masthead. The intrinsic/HTML width sets the
   size, so each page's logo keeps its own dimensions. */
.article-header h1 img {
	display: block;
	max-width: 100%;
	height: auto;
	margin: 0 auto;
}
.article-lead {
	margin: 0;
	font-size: var(--fs-lead);
	line-height: 1.55;
	color: var(--ink-soft);
}
.article-byline {
	margin: 12px 0 0;
	font-size: var(--fs-caption);
	color: var(--muted);
}
.article-byline strong {
	color: var(--ink);
}
.article-byline time {
	white-space: nowrap;
}

/* Fakten */

/* Shifted right by the section padding, so the box edge lines up with the
   section bar while the box itself keeps its size. */

.article-facts {
	float: right;
	width: var(--w-aside);
	margin: 0 calc(-1 * var(--pad)) var(--space-3) var(--space-3);
	padding: 14px;
}
.article-facts > table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	font-size: var(--fs-caption);
	line-height: 1.35;
	text-align: left;
}
.article-facts caption {
	margin: 0 0 8px;
	padding: 0;
	font-size: var(--fs-micro);
	font-weight: 700;
	letter-spacing: .08em;
	text-align: left;
	text-transform: uppercase;
	color: var(--ink);
}
.article-facts th,
.article-facts td {
	padding: 7px 0;
	border: 0;
	background: none;
	vertical-align: middle;
	text-align: left;
}
.article-facts th {
	font-weight: 600;
	color: var(--muted);
}
.article-facts td {
	padding-left: 12px;
	font-size: 18px; /* value column stays larger than its row label */
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	text-align: right;
	white-space: nowrap;
}
.article-facts tr {
	position: relative;
}
.article-facts tr + tr th,
.article-facts tr + tr td {
	border-top: 1px solid var(--line);
}
.article-facts tr:last-child th,
.article-facts tr:last-child td {
	padding-bottom: 0;
}
.article-facts tr:hover {
	background: var(--paper);
}
.article-facts tr:hover th {
	color: var(--ink);
}
.article-facts tr:hover td a {
	color: var(--link);
	text-decoration-color: currentColor;
}
.article-facts td a {
	color: var(--ink);
	text-decoration: underline;
	text-decoration-color: var(--muted);
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}
/* The ::after overlay makes the whole row a click target; it anchors to the
   position: relative on the row, not on the anchor. */
.article-facts td a::after {
	content: "";
	position: absolute;
	inset: 0;
}

/* Tabellen (Steckbrief, Episodenverzeichnis) */

/* Plain content tables, not the facts aside: several rows hold more than one
   link, so the article-facts row overlay must not apply here. */
table.article-table {
	width: 100%;
	margin: var(--space-2) 0;
	border-collapse: collapse;
	font-size: var(--fs-body);
	line-height: 1.4;
	text-align: left;
}
table.article-table caption {
	margin: 0 0 8px;
	padding: 0;
	font-size: var(--fs-micro);
	font-weight: 700;
	letter-spacing: .08em;
	text-align: left;
	text-transform: uppercase;
	color: var(--muted);
}
table.article-table th,
table.article-table td {
	padding: var(--space-1);
	border-top: 1px solid var(--line);
	overflow-wrap: break-word;
	vertical-align: top;
	text-align: left;
}
table.article-table thead th,
table.article-table th[scope="col"] {
	padding-top: 0;
	border-top: 0;
	border-bottom: 1px solid var(--line);
	font-size: var(--fs-caption);
	color: var(--muted);
}
table.article-table th {
	font-weight: 700;
}
table.article-table th[scope="row"] {
	width: 34%;
	font-weight: 600;
	color: var(--muted);
}
/* Steckbrief: a narrower label column leaves more room for the descriptions. */
table.article-table.article-table-steckbrief th[scope="row"] {
	width: 26%;
}
/* Tables with a header row (the episode list) use the row label as a compact
   issue range instead of a description column. */
table.article-table thead + tbody th[scope="row"] {
	width: 1%;
	font-weight: 700;
	color: var(--ink-soft);
	white-space: nowrap;
}
/* Episode list: a minimal album column and a narrow publication column leave
   more room for the titles. */
table.article-table.article-table-episoden th:nth-child(1),
table.article-table.article-table-episoden td:nth-child(1) {
	width: 1%;
	white-space: nowrap;
}
table.article-table.article-table-episoden th:nth-child(4),
table.article-table.article-table-episoden td:nth-child(4) {
	width: 26%;
}
table.article-table a {
	text-underline-offset: 2px;
}
/* Parenthetical under a table title: own line, a step smaller and muted. */
table.article-table .article-table-sub {
	display: block;
	font-size: var(--fs-caption);
	line-height: 1.35;
	color: var(--muted);
}

/* Titelbild */

.article-cover {
	margin: var(--space-2) 0 0;
}
.article-cover img {
	display: block;
	width: 100%;
	aspect-ratio: var(--hero-ratio);
	object-fit: cover;
	object-position: center;
	background: var(--soft);
}
.article-cover figcaption {
	padding: 8px var(--pad) var(--space-2);
}

/* Inhalt */

.article-toc {
	margin: var(--space-2) 0 0;
	padding: 16px var(--pad) 20px;
	background: var(--paper);
	border-top: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
}
.article-toc-title {
	margin: 0 0 10px;
}
.article-toc ol {
	display: grid;
	grid-auto-flow: column;
	grid-template-rows: repeat(3, auto);
	gap: 2px var(--space-4);
	list-style: none;
	margin: 0;
	padding: 0;
	counter-reset: article-toc;
}
.article-toc li {
	display: grid;
	grid-template-columns: 20px minmax(0, 1fr);
	align-items: baseline;
	counter-increment: article-toc;
}
.article-toc li::before {
	content: counter(article-toc);
	font-size: 12px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	color: var(--muted);
}
.article-toc a {
	display: block;
	padding: 4px 0;
	font-size: 15px; /* one step below body text */
}

/* Abschnitte */

.article-section {
	display: flow-root;
	padding: var(--space-3) var(--pad);
}
.article-section h2 {
	margin: calc(-1 * var(--space-3)) calc(-1 * var(--pad)) var(--space-3);
	padding: 4px var(--pad);
	background: var(--yellow);
	font-size: var(--fs-h2);
	line-height: 1.25;
}
.article-section h3 {
	clear: both;
	margin: var(--space-3) 0 var(--space-1);
	font-size: var(--fs-h3);
	line-height: 1.35;
}
.article-section h2 + h3 {
	margin-top: 0;
}
.article-section > :last-child {
	margin-bottom: 0;
}

/* Abbildungen */

.article-figure {
	margin: var(--space-3) 0;
	text-align: center;
}
.article-figure figcaption {
	margin-top: var(--space-1);
}
.article-float {
	float: right;
	width: var(--w-aside);
	max-width: 100%;
	margin: 0 0 var(--space-2) var(--space-2);
}
.article-facts,
.article-step,
.article-buy {
	background: var(--soft);
	border: 1px solid var(--line);
	border-radius: var(--radius-box);
}
.article-image-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
	gap: var(--space-2);
	margin: var(--space-3) 0;
}
.article-image-grid figure {
	display: grid;
	grid-template-rows: 1fr auto;
	justify-items: center;
	margin: 0;
	padding: 0;
	text-align: center;
}
.article-image-grid img {
	align-self: center;
	margin: 0 auto;
}
.article-image-grid figcaption {
	margin-top: var(--space-1);
}
/* Character figure sets sit on one row at their native size; the desktop
   column is wide enough for every set in comics/yinni.php. Narrow viewports
   keep the auto-fit stacking above. */
@media (min-width: 481px) {
	.article-image-grid.article-image-grid-figures {
		grid-template-columns: none;
		grid-auto-flow: column;
		grid-auto-columns: max-content;
		justify-content: center;
	}
}

/* Video */

.article-video-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--space-2);
	margin: var(--space-3) 0;
}
.article-video-grid figure {
	margin: 0;
}
.article-video-grid .article-video {
	margin: 0;
	max-width: none;
}
.article-video-grid figcaption {
	margin-top: var(--space-1);
}
.article-video {
	position: relative;
	width: 100%;
	max-width: 515px;
	margin: var(--space-3) 0;
	aspect-ratio: 4 / 3;
	background: #000;
	border-radius: var(--radius-img);
	overflow: hidden;
}
.article-video iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

/* Gimmick-Untertitel */

.article-section h3.article-subhead {
	margin: var(--space-3) 0 var(--space-2);
	padding: 7px 12px 8px;
	background: var(--soft);
	border: 1px solid var(--line);
	border-left: 4px solid var(--yellow);
	border-radius: var(--radius-box);
	font-size: 17px; /* boxed subhead sits between h3 and body text */
	line-height: 1.3;
}
.article-subhead-label {
	display: block;
	margin: 0 0 2px;
	color: var(--muted);
	font-size: var(--fs-label);
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}
.article-subhead-name {
	display: block;
	font-weight: 700;
	text-wrap: pretty;
}

/* Gimmick */

/* flow-root keeps the whole entry (image + text) in one block so the next
   heading's clear: both does not pull the text away from the float. */
.article-entry {
	display: flow-root;
}
.article-entry-img {
	float: left;
	margin: 0 var(--space-2) var(--space-1) 0;
}

/* Anzeige (affiliate box). The class stays `article-buy`, not `article-ad`:
   a class containing `ad` is a cosmetic-filter target in ad-blocker lists. */

.article-buy {
	display: grid;
	grid-template-columns: var(--w-ad-media) 1fr;
	gap: var(--space-2);
	align-items: start;
	margin: var(--space-3) 0;
	padding: var(--space-2);
	position: relative;
}
.article-buy-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: var(--space-1);
}
.article-buy-body .article-buy-label {
	flex: 0 0 auto;
	margin: 0;
	white-space: nowrap;
}
.article-buy-media {
	display: block;
}
.article-buy-media img {
	display: block;
	width: var(--w-ad-media);
}
.article-buy-body p {
	margin: 0 0 8px;
}
.article-buy-body p:last-child {
	margin-bottom: 0;
}
.article-buy-title {
	font-size: var(--fs-body);
	font-weight: 700;
	line-height: 1.3;
}
/* The title link's ::after overlay makes the whole box a click target; the
   disclosure trigger sits above it via its own stacking context. */
.article-buy-title a {
	text-decoration: none;
}
.article-buy-title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

/* Affiliate marks and dialog trigger. The Amazon mark sits inside an inline
   link, the trigger is a button filled by js/affiliate.js from the
   #affiliate-hinweis template; the dialog styles follow the media queries. */

.article-affiliate-amazon,
.article-affiliate-info img {
	width: auto;
	height: 1em;
}
.article-affiliate-amazon {
	margin-left: .25em;
	vertical-align: -.1em;
}
.article-affiliate-info {
	display: inline-flex;
	align-items: center;
	margin-left: .25em;
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	vertical-align: -.1em;
	cursor: pointer;
	position: relative;
	z-index: 1;
}

/* Anleitung */

.article-steps {
	list-style: none;
	margin: var(--space-3) 0 0;
	padding: 0;
	counter-reset: article-step;
	display: grid;
	gap: var(--space-2);
}
.article-step {
	counter-increment: article-step;
	display: grid;
	grid-template-columns: 44px 1fr;
	gap: var(--space-2);
	padding: var(--space-2);
}
.article-step::before {
	content: counter(article-step);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: 50%;
	font-size: 18px; /* the counter is the step's primary marker */
	font-weight: 700;
	line-height: 1;
	color: var(--muted);
}
.article-step-body {
	display: grid;
	grid-template-columns: 1fr var(--w-step-media);
	gap: var(--space-2);
	align-items: start;
}
.article-step-body p {
	margin: 0;
}
.article-step-body img {
	justify-self: end;
}

/* YPS-Hefte */

.article-issue-list {
	margin: 0;
}
.article-issue-list dt {
	margin: 0 0 6px;
	font-weight: 700;
}
.article-issue-list dd {
	margin: 0 0 var(--space-2);
	line-height: 1.75;
}
.article-issue-list dd:last-child {
	margin-bottom: 0;
}
.article-issue-list a {
	font-variant-numeric: tabular-nums;
	text-decoration: none;
	text-underline-offset: 2px;
}
.article-issue-list dd ul {
	margin: 0;
	padding-left: 1.25em;
}
.article-issue-list dd li + li {
	margin-top: 4px;
}

/* Episodenverzeichnis teaser */

.episode-card {
	display: grid;
	grid-template-columns: 96px 1fr auto;
	align-items: center;
	gap: var(--space-2);
	margin: 0;
	padding: var(--space-2);
	background: var(--soft);
	border: 1px solid var(--line);
	border-radius: var(--radius-box);
	color: var(--ink);
	text-decoration: none;
}
.article .episode-card {
	color: var(--ink);
}
.article .episode-card:hover {
	color: var(--ink);
	text-decoration: none;
	border-color: var(--muted);
}
.episode-card:focus-visible {
	outline: 3px solid var(--link);
	outline-offset: 3px;
}
.episode-card img {
	display: block;
	width: 96px;
}
.episode-card-body {
	display: grid;
	gap: 2px;
}
.episode-card-kicker {
	font-size: var(--fs-label);
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--muted);
}
.episode-card-title {
	font-size: var(--fs-h3);
	font-weight: 700;
	line-height: 1.3;
}
.episode-card-text {
	font-size: var(--fs-small);
	line-height: 1.4;
	color: var(--muted);
}
.episode-card-arrow {
	font-size: 28px;
	line-height: 1;
	color: var(--link);
	transition: transform .15s ease;
}
.episode-card:hover .episode-card-arrow {
	transform: translateX(4px);
}

@media screen and (max-width: 480px) {
	.episode-card {
		grid-template-columns: 72px 1fr;
	}
	.episode-card img {
		width: 72px;
	}
	.episode-card-arrow {
		display: none;
	}
}

/* Lesergeschichten */

.article-note {
	margin: 0 0 var(--space-2);
	font-size: var(--fs-small);
	color: var(--muted);
}
.article-comments {
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: var(--space-1);
}
.article-comment {
	border: 1px solid var(--line);
	border-radius: var(--radius-box);
	background: var(--soft);
	padding: var(--space-2);
}
.article-comment-meta {
	margin: 0 0 var(--space-1);
	font-size: var(--fs-caption);
	color: var(--muted);
	text-align: left;
}
.article-comment-author {
	font-weight: 700;
}
.article-comment-origin {
	white-space: nowrap;
}
.article-comment-text {
	margin: 0;
	font-size: var(--fs-body);
	text-align: left;
}
.article-comments-more {
	margin: var(--space-2) 0 0;
}

/* Fokus und Bewegung */

.article a:focus-visible,
.article button:focus-visible {
	outline: 3px solid var(--link);
	outline-offset: 2px;
}
@media (prefers-reduced-motion: no-preference) {
	.article a {
		transition: background-color .15s ease, color .15s ease, border-color .15s ease;
	}
}

/* Kleine Bildschirme */

@media (max-width: 480px) {
	.article {
		--hero-ratio: 3 / 2;
	}
	.article [id] {
		scroll-margin-top: 56px;
	}
	.article-toc ol {
		grid-auto-flow: row;
		grid-template-columns: 1fr;
		grid-template-rows: none;
		gap: 2px;
	}
	.article-video-grid {
		grid-template-columns: 1fr;
	}
	.article-facts {
		float: none;
		width: auto;
		margin: 0 0 var(--space-3);
	}
	.article-cover img {
		border-radius: 0;
	}
	.article-float {
		float: none;
		margin: var(--space-2) auto;
	}
	.article-step {
		grid-template-columns: 1fr;
		gap: var(--space-1);
	}
	.article-step::before {
		width: 32px;
		height: 32px;
		font-size: 16px;
	}
}
@media (max-width: 430px) {
	.article-entry-img {
		float: none;
		display: block;
		margin: 0 auto var(--space-1);
	}
	.article-step-body,
	.article-buy {
		grid-template-columns: 1fr;
	}
	.article-step-body img {
		justify-self: center;
	}
	.article-buy-media {
		justify-self: center;
	}
}

/* Affiliate-Hinweis dialog. js/affiliate.js appends it to <body>, outside
   .article, so these rules are deliberately unscoped. `margin: auto` restores
   the UA centering that base.css's `* { margin: 0 }` would drop. */

.article-affiliate-dialog {
	box-sizing: border-box;
	margin: auto;
	width: calc(100% - 2rem);
	max-width: 32rem;
	padding: var(--space-3);
	border: 1px solid var(--line);
	border-radius: var(--radius-box);
	background: var(--paper);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: 15px; /* dialog copy is one step smaller than the page */
	line-height: 1.5;
	text-align: left;
}
.article-affiliate-dialog::backdrop {
	background: rgba(0, 0, 0, .5);
}
.article-affiliate-dialog p {
	margin: 0 0 8px;
}
.article-affiliate-dialog form {
	margin: var(--space-2) 0 0;
	text-align: right;
}
.article-affiliate-dialog button {
	padding: 6px 14px;
	border: 1px solid var(--line);
	border-radius: var(--radius-box);
	background: var(--soft);
	color: var(--ink);
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

/* Druck */

@media print {
	.article {
		background: none;
		font-size: 11pt;
	}
	.article-header,
	.article-toc,
	.article-section {
		padding: 0;
		margin: 0 0 10mm;
		border: 0;
		background: none;
	}
	.article-toc ol {
		gap: 1mm 8mm;
	}
	.article-facts {
		float: none;
		width: auto;
		margin: 0 0 4mm;
	}
	.article-facts caption {
		margin: 0 0 2mm;
		color: #000;
	}
	.article-facts th,
	.article-facts td {
		padding: 1px 0;
		border: 0;
		font-size: 10pt;
	}
	table.article-table {
		font-size: 10pt;
	}
	table.article-table caption {
		color: #000;
	}
	table.article-table th,
	table.article-table td {
		border-color: #999;
	}
	.article-section h2 {
		margin: 0 0 6mm;
		padding: 0;
		background: none;
		font-size: 16pt;
	}
	.article-section h3.article-subhead {
		margin: 0 0 3mm;
		padding: 0;
		background: none;
		border: 0;
		font-size: 12pt;
	}
	.article-cover img {
		aspect-ratio: auto;
		height: auto;
		border-radius: 0;
	}
	.article-cover figcaption {
		padding: 2px 0 0;
		color: #000;
	}
	.article-affiliate-info,
	.article-affiliate-amazon {
		display: none;
	}
	.article a {
		color: #000;
	}
	.article figure,
	.article-step,
	.article-facts,
	.article-buy,
	.article-comment,
	.article-facts a {
		border: 0;
		background: none;
		padding: 0;
		color: #000;
		break-inside: avoid;
	}
}
