/* NRWZ Bildergalerie – Teaser im Artikel und Galerieseite.
 * Grundlage ist die senkrechte Bildstrecke (Smartphone). Ab der eingestellten Umbruchbreite setzt ein
 * Inline-Skript direkt am Seitenanfang die Klasse .nrwzg--slider – dann wird daraus ein Slider.
 */

.nrwzg-teaser,
.nrwzg {
	--nrwzg-akzent: var(--g-color, #c8102e);
	--nrwzg-dunkel: #111;
	--nrwzg-linie: rgba(0, 0, 0, .12);
	--nrwzg-text-hell: #f2f2f2;
}

/* ---------------------------------------------------------------- Teaser im Artikel */

.nrwzg-teaser {
	margin: 1.6em 0;
}

.nrwzg-teaser__haupt {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: 4px;
	background: var(--nrwzg-dunkel);
}

.nrwzg-teaser__haupt img {
	display: block;
	width: 100%;
	height: auto;
	transition: transform .4s ease;
}

.nrwzg-teaser__haupt:hover img,
.nrwzg-teaser__haupt:focus-visible img {
	transform: scale(1.02);
}

.nrwzg-teaser__plakette {
	position: absolute;
	left: 12px;
	bottom: 12px;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 14px;
	border-radius: 999px;
	background: rgba(0, 0, 0, .78);
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
}

.nrwzg-teaser__leiste {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 6px;
	margin-top: 6px;
}

.nrwzg-teaser__klein {
	position: relative;
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: 3px;
	background: var(--nrwzg-dunkel);
}

.nrwzg-teaser__klein img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.nrwzg-teaser__mehr {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, .55);
	color: #fff;
	font-size: 20px;
	font-weight: 700;
}

/* ---------------------------------------------------------------- Galerieseite: Grundlage (Smartphone) */

.nrwzg {
	max-width: 1240px;
	margin: 0 auto;
	padding: 16px 0 40px;
	box-sizing: border-box;
}

.nrwzg *,
.nrwzg *::before,
.nrwzg *::after {
	box-sizing: border-box;
}

.nrwzg-kopf {
	margin-bottom: 20px;
}

.nrwzg-zurueck {
	display: inline-block;
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	color: var(--nrwzg-akzent);
}

.nrwzg-titel {
	margin: 10px 0 4px;
	font-size: clamp(22px, 4.2vw, 34px);
	line-height: 1.2;
}

.nrwzg-titel__marke {
	display: block;
	margin-bottom: 4px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--nrwzg-akzent);
}

.nrwzg-meta {
	margin: 0;
	font-size: 14px;
	opacity: .7;
}

.nrwzg-spur {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 32px;
}

.nrwzg-folie {
	margin: 0;
	padding: 0;
	scroll-margin-top: 90px; /* Platz für die angeheftete Kopfzeile beim Springen zu Bild N */
}

.nrwzg-figur {
	margin: 0;
}

.nrwzg-bild {
	display: block;
	width: 100%;
	height: auto;
	background: #eee;
}

.nrwzg-unterschrift {
	margin-top: 8px;
	font-size: 15px;
	line-height: 1.45;
}

.nrwzg-nr {
	display: inline-block;
	margin-right: 6px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	opacity: .6;
}

.nrwzg-steuerung {
	display: none;
}

.nrwzg-seite {
	margin-top: 36px;
}

.nrwzg-fuss {
	margin-top: 32px;
}

/* Anzeigen: deutlicher Abstand zu Bildern und Bedienelementen. */
.nrwzg-anzeige {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	padding: 12px 0 16px;
	text-align: center;
}

.nrwzg-anzeige--oben {
	margin-bottom: 28px;
}

.nrwzg-anzeige__label {
	display: block;
	margin-bottom: 6px;
	font-size: 11px;
	letter-spacing: .06em;
	text-transform: uppercase;
	opacity: .55;
}

.nrwzg-anzeige__inhalt {
	width: 100%;
	min-height: 50px;
}

.nrwzg-folie--anzeige {
	border-top: 1px solid var(--nrwzg-linie);
	border-bottom: 1px solid var(--nrwzg-linie);
}

.nrwzg-folie--anzeige .nrwzg-anzeige__inhalt {
	min-height: 250px;
}

/* Ende-Folie */
.nrwzg-ende {
	padding: 28px 16px;
	text-align: center;
	border: 1px solid var(--nrwzg-linie);
	border-radius: 4px;
}

.nrwzg-ende__titel {
	font-size: 18px;
	font-weight: 700;
}

.nrwzg-knopf {
	display: inline-block;
	padding: 11px 20px;
	border: 2px solid var(--nrwzg-akzent);
	border-radius: 4px;
	background: transparent;
	color: var(--nrwzg-akzent);
	font: inherit;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
}

.nrwzg-knopf--voll {
	background: var(--nrwzg-akzent);
	color: #fff;
}

/* Schranke */
.nrwzg-schranke {
	position: relative;
}

.nrwzg-schranke__bild {
	display: block;
	width: 100%;
	height: auto;
	filter: brightness(.55);
}

.nrwzg-schranke__kasten {
	max-width: 560px;
	margin: -60px auto 0;
	position: relative;
	padding: 24px;
	border-radius: 6px;
	background: var(--wc-bg, #fff);
	box-shadow: 0 8px 30px rgba(0, 0, 0, .18);
	text-align: center;
}

.nrwzg-schranke__marke,
.nrwzg-hinweis strong {
	color: var(--nrwzg-akzent);
	font-weight: 800;
}

.nrwzg-schranke__knoepfe {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
}

.nrwzg-hinweis {
	padding: 12px 16px;
	margin: 0 0 24px;
	border-left: 4px solid var(--nrwzg-akzent);
	background: rgba(0, 0, 0, .04);
}

/* ---------------------------------------------------------------- Slider (Tablet, Desktop) */

.nrwzg--slider .nrwzg-buehne {
	min-width: 0;
}

.nrwzg--slider .nrwzg-spur {
	position: relative;
	flex-direction: row;
	gap: 0;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
	background: var(--nrwzg-dunkel);
	border-radius: 4px;
	outline-offset: 3px;
}

.nrwzg--slider .nrwzg-spur::-webkit-scrollbar {
	display: none;
}

.nrwzg--slider .nrwzg-folie {
	flex: 0 0 100%;
	width: 100%;
	height: min(74vh, 700px);
	scroll-snap-align: start;
	scroll-snap-stop: always;
}

.nrwzg--slider .nrwzg-figur {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.nrwzg--slider .nrwzg-rahmen {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.nrwzg--slider .nrwzg-bild {
	width: 100%;
	height: 100%;
	object-fit: contain;
	background: transparent;
}

.nrwzg--slider .nrwzg-unterschrift {
	flex: 0 0 auto;
	max-height: 7.5em;
	overflow-y: auto;
	margin: 0;
	padding: 12px 18px 14px;
	color: var(--nrwzg-text-hell);
	background: rgba(0, 0, 0, .55);
}

.nrwzg--slider .nrwzg-folie--anzeige {
	display: flex;
	align-items: center;
	justify-content: center;
	border: 0;
	background: #f4f4f4;
	color: #222;
}

.nrwzg--slider .nrwzg-folie--ende {
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f4f4f4;
	color: #222;
}

.nrwzg--slider .nrwzg-ende {
	border: 0;
}

/* Steuerleiste unter dem Slider – mit Abstand, nie über Bild oder Anzeige. */
.nrwzg--slider .nrwzg-steuerung {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 24px;
	margin-top: 24px;
}

.nrwzg-pfeil {
	width: 52px;
	height: 52px;
	border: 2px solid var(--nrwzg-akzent);
	border-radius: 50%;
	background: transparent;
	color: var(--nrwzg-akzent);
	font-size: 30px;
	line-height: 1;
	cursor: pointer;
	transition: background .15s, color .15s;
}

.nrwzg-pfeil:hover:not(:disabled),
.nrwzg-pfeil:focus-visible {
	background: var(--nrwzg-akzent);
	color: #fff;
}

.nrwzg-pfeil:disabled {
	opacity: .3;
	cursor: default;
}

.nrwzg-zaehler {
	min-width: 140px;
	text-align: center;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.nrwzg--slider .nrwzg-seite {
	margin-top: 40px;
}

@media (min-width: 1100px) {
	.nrwzg--slider .nrwzg-raster {
		display: grid;
		grid-template-columns: minmax(0, 1fr) 300px;
		gap: 36px;
		align-items: start;
	}

	.nrwzg--slider .nrwzg-seite {
		margin-top: 0;
		position: sticky;
		top: 90px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.nrwzg--slider .nrwzg-spur { scroll-behavior: auto; }
	.nrwzg-teaser__haupt img { transition: none; }
}

/* ---------------------------------------------------------------- Galerieseite in Schwarz (0.2.0) */

.nrwzg-flaeche {
	background: #000;
	color: #e8e8e8;
	padding-bottom: 8px;
	overflow-x: clip;
}

.nrwzg-flaeche .nrwzg {
	--nrwzg-akzent-hell: #e5484d;
	--nrwzg-linie: rgba(255, 255, 255, .16);
	color: #e8e8e8;
}

.nrwzg-flaeche .nrwzg-titel,
.nrwzg-flaeche .nrwzg-ende__titel {
	color: #fff;
}

.nrwzg-flaeche .nrwzg-zurueck {
	color: #fff;
	opacity: .85;
}

.nrwzg-flaeche .nrwzg-zurueck:hover,
.nrwzg-flaeche .nrwzg-zurueck:focus-visible {
	opacity: 1;
	text-decoration: underline;
}

.nrwzg-flaeche .nrwzg-titel__marke,
.nrwzg-flaeche .nrwzg-schranke__marke,
.nrwzg-flaeche .nrwzg-hinweis strong {
	color: var(--nrwzg-akzent-hell);
}

.nrwzg-flaeche .nrwzg-unterschrift a,
.nrwzg-flaeche .nrwzg-hinweis a {
	color: #fff;
	text-decoration: underline;
}

.nrwzg-flaeche .nrwzg-bild {
	background: #111;
}

.nrwzg-flaeche .nrwzg-meta,
.nrwzg-flaeche .nrwzg-anzeige__label {
	color: #bbb;
	opacity: 1;
}

/* Umrandete Knöpfe und Pfeile: weiß auf Schwarz, gefüllt rot. */
.nrwzg-flaeche .nrwzg-knopf {
	border-color: #fff;
	color: #fff;
}

.nrwzg-flaeche .nrwzg-knopf--voll {
	border-color: var(--nrwzg-akzent);
	background: var(--nrwzg-akzent);
}

.nrwzg-flaeche .nrwzg-pfeil {
	border-color: #fff;
	color: #fff;
}

.nrwzg-flaeche .nrwzg-pfeil:hover:not(:disabled),
.nrwzg-flaeche .nrwzg-pfeil:focus-visible {
	border-color: var(--nrwzg-akzent);
	background: var(--nrwzg-akzent);
}

.nrwzg-flaeche .nrwzg-zaehler {
	color: #fff;
}

/* Slider: Bühne und Sonderfolien dunkel. */
.nrwzg-flaeche .nrwzg--slider .nrwzg-spur {
	background: #0b0b0b;
}

.nrwzg-flaeche .nrwzg--slider .nrwzg-folie--anzeige,
.nrwzg-flaeche .nrwzg--slider .nrwzg-folie--ende {
	background: #161616;
	color: #e8e8e8;
}

.nrwzg-flaeche .nrwzg-schranke__kasten {
	background: #1a1a1a;
	color: #e8e8e8;
}

.nrwzg-flaeche .nrwzg-hinweis {
	background: rgba(255, 255, 255, .06);
}

/* ---------------------------------------------------------------- Smartphone: Anzeigen über die volle Breite (0.2.0)
 * Feste Formate wie 336 × 280 passen sonst auf schmalen Telefonen nicht zwischen die Seitenränder. */

.nrwzg:not(.nrwzg--slider) .nrwzg-anzeige {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	overflow: hidden;
}

/* Diagnose (#diagnose an der Adresse) */
.nrwzg-diagnose {
	position: fixed;
	left: 8px;
	right: 8px;
	bottom: 8px;
	z-index: 2147483000;
	max-height: 45vh;
	overflow: auto;
	padding: 10px 12px;
	border-radius: 6px;
	background: rgba(20, 20, 20, .95);
	color: #fff;
	font: 12px/1.45 ui-monospace, Menlo, Consolas, monospace;
	white-space: pre-wrap;
}
