/*
 * Mediathek – Dokumente im Frontend (Shortcodes, Blöcke, Elementor-Widgets).
 * Alles unter .prm-doks gekapselt; Schrift-, Flächen- und Randfarben werden immer gemeinsam gesetzt,
 * damit Theme-Regeln die Darstellung nicht verändern. Anpassung über CSS-Variablen (Elementor-Stil).
 */

.prm-doks {
	--prm-d-akzent: #24527a;
	--prm-d-akzent-text: #fff;
	--prm-d-text: #1d2327;
	--prm-d-leise: #50575e;
	--prm-d-flaeche: #fff;
	--prm-d-grund: #f4f6f8;
	--prm-d-rand: #dfe3e8;
	--prm-d-radius: 8px;
	--prm-d-abstand: 12px;
	--prm-d-schrift: inherit;
	--prm-d-spalten: 3;

	box-sizing: border-box;
	margin: 0 0 1.5em;
	color: var(--prm-d-text);
	font-family: var(--prm-d-schrift);
	font-size: 1rem;
	line-height: 1.45;
}

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

.prm-doks .prm-d-sr {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.prm-doks .prm-d-ico {
	flex: 0 0 auto;
	width: 1.1em;
	height: 1.1em;
	fill: none;
	stroke: currentcolor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 2;
}

/* Liste */
.prm-doks .prm-d-liste {
	display: grid;
	gap: var(--prm-d-abstand);
	margin: 0;
	padding: 0;
	list-style: none;
}

.prm-doks .prm-d-eintrag {
	display: flex;
	gap: 14px;
	align-items: center;
	margin: 0;
	padding: var(--prm-d-abstand);
	border: 1px solid var(--prm-d-rand);
	border-radius: var(--prm-d-radius);
	background: var(--prm-d-flaeche);
	color: var(--prm-d-text);
	list-style: none;
}

.prm-doks .prm-d-eintrag::before,
.prm-doks .prm-d-eintrag::marker {
	content: none;
}

.prm-doks .prm-d-bild {
	position: relative;
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 80px;
	overflow: hidden;
	border-radius: calc(var(--prm-d-radius) / 2);
	background: var(--prm-d-grund);
	color: var(--prm-d-leise);
}

.prm-doks .prm-d-bild img {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: cover;
	object-position: top;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

.prm-doks .prm-d-typ {
	display: flex;
	align-items: center;
}

/* Symbol füllt das Bildfeld (sonst hätte das SVG ohne feste Maße 0 × 0 px). */
.prm-doks .prm-d-bild > .prm-d-typ {
	justify-content: center;
	width: 100%;
	height: 100%;
}

/* Dateityp-Symbole (ab 1.3.3) */
.prm-doks .prm-d-symbol {
	display: block;
	width: auto;
	max-width: 80%;
	height: 82%;
	max-height: 140px;
}

/* Illustrierte Symbole (Grafik): quadratisch, Theme-Bildregeln (Rahmen, Schatten, height:auto) neutralisieren. */
.prm-doks img.prm-d-symbol.ist-illustriert {
	width: auto;
	max-width: 90%;
	height: 88%;
	max-height: 150px;
	aspect-ratio: 1;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	object-fit: contain;
}

.prm-doks .prm-d-symbol.ist-akzent .prm-d-symbol-band {
	fill: var(--prm-d-akzent);
}

.prm-doks .prm-d-tab-symbol {
	display: inline-flex;
	vertical-align: middle;
	margin-right: 10px;
}

.prm-doks .prm-d-tab-symbol .prm-d-symbol {
	width: 22px;
	height: 28px;
	max-width: none;
}

.prm-doks .prm-d-tab-symbol img.prm-d-symbol.ist-illustriert {
	flex-shrink: 0;
	width: 30px;
	max-width: none;
	height: 30px;
	max-height: none;
}

.prm-doks .prm-d-neu {
	position: absolute;
	top: 4px;
	left: 4px;
	padding: 1px 6px;
	border-radius: 999px;
	background: var(--prm-d-akzent);
	color: var(--prm-d-akzent-text);
	font-size: 11px;
	font-weight: 600;
	line-height: 1.5;
}

/* Vorschaubild als Link zur Ansicht (ab 1.3.0) */
.prm-doks a.prm-d-bild,
.prm-doks a.prm-d-bild:hover,
.prm-doks a.prm-d-bild:visited {
	border: 0;
	color: var(--prm-d-leise);
	text-decoration: none;
	box-shadow: none;
	cursor: zoom-in;
}

/* Formatzeichen auf dem Vorschaubild – nur in einigen Themes sichtbar */
.prm-doks .prm-d-format {
	position: absolute;
	right: 6px;
	bottom: 6px;
	display: none;
	padding: 1px 6px;
	border-radius: 3px;
	background: rgb(0 0 0 / 72%);
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	line-height: 1.6;
	letter-spacing: 0.06em;
}

.prm-doks td .prm-d-neu {
	position: static;
	display: inline-block;
}

.prm-doks .prm-d-text {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.prm-doks a.prm-d-titel,
.prm-doks a.prm-d-titel:visited {
	color: var(--prm-d-titel, var(--prm-d-text));
	font-weight: 600;
	text-decoration: none;
	overflow-wrap: anywhere;
	background: none;
	box-shadow: none;
}

.prm-doks a.prm-d-titel:hover,
.prm-doks a.prm-d-titel:focus {
	color: var(--prm-d-akzent);
	text-decoration: underline;
}

.prm-doks .prm-d-meta,
.prm-doks .prm-d-beschreibung {
	color: var(--prm-d-leise);
	font-size: 0.875em;
}

.prm-doks .prm-d-aktionen {
	display: flex;
	flex: 0 0 auto;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

/* Knöpfe */
.prm-doks a.prm-d-knopf,
.prm-doks button.prm-d-knopf {
	display: inline-flex;
	gap: 6px;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	margin: 0;
	padding: 8px 14px;
	border: 1px solid var(--prm-d-knopf-hg, var(--prm-d-akzent));
	border-radius: calc(var(--prm-d-radius) * 0.75);
	background: var(--prm-d-knopf-hg, var(--prm-d-akzent));
	color: var(--prm-d-knopf-text, var(--prm-d-akzent-text));
	font: 600 0.9375em/1.2 var(--prm-d-schrift);
	text-decoration: none;
	text-transform: none;
	letter-spacing: normal;
	box-shadow: none;
	cursor: pointer;
}

.prm-doks a.prm-d-knopf:hover,
.prm-doks button.prm-d-knopf:hover {
	border-color: var(--prm-d-knopf-hg-hover, var(--prm-d-knopf-hg, var(--prm-d-akzent)));
	background: var(--prm-d-knopf-hg-hover, var(--prm-d-knopf-hg, var(--prm-d-akzent)));
	color: var(--prm-d-knopf-text, var(--prm-d-akzent-text));
	filter: var(--prm-d-knopf-filter, brightness(0.92));
}

.prm-doks a.prm-d-knopf.ist-leise {
	border-color: var(--prm-d-ansehen-rand, var(--prm-d-akzent));
	background: var(--prm-d-ansehen-hg, var(--prm-d-flaeche));
	color: var(--prm-d-ansehen-text, var(--prm-d-akzent));
}

.prm-doks a.prm-d-knopf.ist-leise:hover {
	border-color: var(--prm-d-ansehen-rand, var(--prm-d-akzent));
	background: var(--prm-d-grund);
	color: var(--prm-d-ansehen-text, var(--prm-d-akzent));
	filter: none;
}

.prm-doks a.prm-d-knopf.ist-klein {
	min-width: 36px;
	min-height: 36px;
	padding: 6px;
}

.prm-doks .prm-d-knopf-text {
	display: none;
}

.prm-doks a.prm-d-knopf.ist-gross {
	min-height: 48px;
	padding: 12px 20px;
	font-size: 1em;
}

.prm-doks .prm-d-knopf-info {
	font-weight: 400;
	white-space: nowrap;
	opacity: 0.85;
}

.prm-doks a:focus-visible,
.prm-doks button:focus-visible,
.prm-doks input:focus-visible {
	outline: 2px solid var(--prm-d-akzent);
	outline-offset: 2px;
}

/* Kacheln */
.prm-doks.ist-kacheln .prm-d-liste {
	grid-template-columns: repeat(var(--prm-d-spalten), minmax(0, 1fr));
}

.prm-doks.ist-kacheln .prm-d-eintrag {
	flex-direction: column;
	align-items: stretch;
}

.prm-doks.ist-kacheln .prm-d-bild {
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
}

.prm-doks.ist-kacheln .prm-d-aktionen {
	margin-top: auto;
}

/* Ab 1.3.0: Knöpfe in Kacheln gleichmäßig breit (auch wenn sie umbrechen). */
.prm-doks.ist-kacheln .prm-d-aktionen .prm-d-knopf {
	flex: 1 1 auto;
}

.prm-doks.ist-einzel-karte .prm-d-liste {
	grid-template-columns: minmax(0, 340px);
}

/* Tabelle */
.prm-doks .prm-d-tabelle-huelle {
	position: relative;
	overflow-x: auto;
	border: 1px solid var(--prm-d-rand);
	border-radius: var(--prm-d-radius);
	background: var(--prm-d-flaeche);
}

.prm-doks table.prm-d-tabelle {
	width: 100%;
	margin: 0;
	border: 0;
	border-collapse: collapse;
	background: var(--prm-d-flaeche);
	color: var(--prm-d-text);
	font-size: 0.9375em;
}

.prm-doks .prm-d-tabelle th,
.prm-doks .prm-d-tabelle td {
	padding: 10px 12px;
	border: 0;
	border-bottom: 1px solid var(--prm-d-rand);
	background: none;
	color: var(--prm-d-text);
	text-align: left;
	vertical-align: middle;
}

.prm-doks .prm-d-tabelle th {
	background: var(--prm-d-grund);
	font-weight: 600;
}

.prm-doks .prm-d-tabelle tr:last-child td {
	border-bottom: 0;
}

.prm-doks .prm-d-tabelle .ist-zahl {
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.prm-doks .prm-d-tabelle td.prm-d-aktionen {
	display: table-cell;
	white-space: nowrap;
	text-align: right;
}

.prm-doks .prm-d-tabelle td.prm-d-aktionen a + a {
	margin-left: 6px;
}

/* Suche, Blättern, Hinweise */
.prm-doks .prm-d-suche {
	display: flex;
	gap: 8px;
	margin: 0 0 var(--prm-d-abstand);
}

/* Kopfzeile: Suche und Umschalter der Darstellung (ab 1.3.0) */
.prm-doks .prm-d-kopfzeile {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 12px;
	align-items: center;
	justify-content: flex-end;
	margin: 0 0 var(--prm-d-abstand);
}

.prm-doks .prm-d-kopfzeile .prm-d-suche {
	flex: 1 1 280px;
	margin: 0;
}

.prm-doks .prm-d-ansichten {
	display: inline-flex;
	flex: 0 0 auto;
	gap: 2px;
	padding: 2px;
	border: 1px solid var(--prm-d-rand);
	border-radius: calc(var(--prm-d-radius) * 0.75);
	background: var(--prm-d-flaeche);
}

.prm-doks a.prm-d-ansicht-knopf,
.prm-doks a.prm-d-ansicht-knopf:visited {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 36px;
	border: 0;
	border-radius: calc(var(--prm-d-radius) * 0.5);
	background: transparent;
	color: var(--prm-d-leise);
	text-decoration: none;
	box-shadow: none;
}

.prm-doks a.prm-d-ansicht-knopf:hover {
	background: var(--prm-d-grund);
	color: var(--prm-d-text);
}

.prm-doks a.prm-d-ansicht-knopf.ist-aktiv {
	background: var(--prm-d-akzent);
	color: var(--prm-d-akzent-text);
}

.prm-doks a.prm-d-ansicht-knopf .prm-d-ico {
	width: 20px;
	height: 20px;
}

.prm-doks.ist-laedt > :not(.prm-d-kopfzeile) {
	opacity: 0.5;
	transition: opacity 0.15s ease;
}

.prm-doks .prm-d-suche input[type="search"] {
	flex: 1 1 auto;
	min-width: 0;
	min-height: 40px;
	margin: 0;
	padding: 8px 12px;
	border: 1px solid var(--prm-d-rand);
	border-radius: calc(var(--prm-d-radius) * 0.75);
	background: var(--prm-d-flaeche);
	color: var(--prm-d-text);
	font: inherit;
}

.prm-doks .prm-d-treffer,
.prm-doks .prm-d-leer,
.prm-doks .prm-d-hinweis {
	margin: 0 0 var(--prm-d-abstand);
	color: var(--prm-d-leise);
}

.prm-doks .prm-d-hinweis {
	padding: 12px 14px;
	border: 1px solid var(--prm-d-rand);
	border-radius: var(--prm-d-radius);
	background: var(--prm-d-grund);
}

.prm-doks .prm-d-hinweis a {
	color: var(--prm-d-akzent);
}

.prm-doks .prm-d-zip {
	margin: var(--prm-d-abstand) 0 0;
}

.prm-doks .prm-d-blaettern {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: var(--prm-d-abstand);
}

.prm-doks .prm-d-seite {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	min-height: 36px;
	padding: 0 8px;
	border: 1px solid var(--prm-d-rand);
	border-radius: calc(var(--prm-d-radius) * 0.75);
	background: var(--prm-d-flaeche);
	color: var(--prm-d-text);
	text-decoration: none;
}

.prm-doks .prm-d-seite[aria-current="page"] {
	border-color: var(--prm-d-akzent);
	background: var(--prm-d-akzent);
	color: var(--prm-d-akzent-text);
	font-weight: 600;
}

/* Viewer */
.prm-doks .prm-d-viewer-rahmen {
	display: block;
	width: 100%;
	border: 1px solid var(--prm-d-rand);
	border-radius: var(--prm-d-radius);
	background: #e9eef2;
}

.prm-doks .prm-d-viewer-fuss {
	margin: 6px 0 0;
	font-size: 0.875em;
}

.prm-doks .prm-d-viewer-fuss a {
	color: var(--prm-d-akzent);
}

/* Öffentliche Mediensuche */
.prm-doks.prm-ms .prm-ms-ergebnis {
	transition: opacity 0.15s ease;
}

.prm-doks.prm-ms.ist-laedt .prm-ms-ergebnis {
	opacity: 0.55;
}

.prm-doks .prm-ms-typen {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0 0 var(--prm-d-abstand);
}

.prm-doks a.prm-ms-typ,
.prm-doks a.prm-ms-typ:visited {
	display: inline-flex;
	gap: 6px;
	align-items: center;
	min-height: 36px;
	padding: 4px 12px;
	border: 1px solid var(--prm-d-rand);
	border-radius: 999px;
	background: var(--prm-d-flaeche);
	color: var(--prm-d-text);
	font-size: 0.9375em;
	text-decoration: none;
	box-shadow: none;
}

.prm-doks a.prm-ms-typ span {
	color: var(--prm-d-leise);
	font-size: 0.875em;
}

.prm-doks a.prm-ms-typ:hover {
	border-color: var(--prm-d-akzent);
	color: var(--prm-d-akzent);
}

.prm-doks a.prm-ms-typ.ist-aktiv {
	border-color: var(--prm-d-akzent);
	background: var(--prm-d-akzent);
	color: var(--prm-d-akzent-text);
}

.prm-doks a.prm-ms-typ.ist-aktiv span {
	color: var(--prm-d-akzent-text);
}

.prm-doks .prm-ms-liste {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
	gap: var(--prm-d-abstand);
	margin: 0;
	padding: 0;
	list-style: none;
}

.prm-doks .prm-ms-eintrag {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	margin: 0;
	padding: 10px;
	border: 1px solid var(--prm-d-rand);
	border-radius: var(--prm-d-radius);
	background: var(--prm-d-flaeche);
}

.prm-doks .prm-ms-eintrag::marker {
	content: "";
}

.prm-doks a.prm-ms-bild {
	display: flex;
	flex: 0 0 72px;
	align-items: center;
	justify-content: center;
	width: 72px;
	height: 72px;
	overflow: hidden;
	border-radius: calc(var(--prm-d-radius) * 0.75);
	background: var(--prm-d-grund);
	text-decoration: none;
	box-shadow: none;
}

.prm-doks a.prm-ms-bild img {
	display: block;
	width: 100%;
	max-width: none;
	height: 100%;
	margin: 0;
	border: 0;
	border-radius: 0;
	object-fit: cover;
}

.prm-doks .prm-ms-format {
	color: var(--prm-d-akzent);
	font-weight: 700;
	font-size: 0.875em;
	letter-spacing: 0.04em;
}

.prm-doks .prm-ms-text {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.prm-doks .prm-ms-beschriftung {
	color: var(--prm-d-text);
	font-size: 0.875em;
}

.prm-doks .prm-ms-credit {
	color: var(--prm-d-leise);
	font-size: 0.8125em;
	font-style: italic;
}

.prm-doks .prm-d-seite.ist-luecke {
	min-width: 20px;
	padding: 0 2px;
	border-color: transparent;
	background: none;
}

/* Blättern: Pfeile „vorherige“/„nächste Seite“ (gekürzte Leiste, ab 1.3.4) */
.prm-doks .prm-d-seite.ist-schritt .prm-d-ico {
	width: 18px;
	height: 18px;
}

/* Fingerbedienung (Handy, Tablet hoch und quer): Tippflächen mindestens 44 px */
@media (pointer: coarse) {

	.prm-doks .prm-d-seite {
		min-width: 44px;
		min-height: 44px;
	}

	.prm-doks .prm-d-seite.ist-luecke {
		min-width: 20px;
	}
}

@media (max-width: 782px) {

	.prm-doks.ist-kacheln .prm-d-liste {
		grid-template-columns: repeat(min(var(--prm-d-spalten), 2), minmax(0, 1fr));
	}
}

@media (max-width: 560px) {

	.prm-doks .prm-d-eintrag {
		flex-wrap: wrap;
	}

	/* Größere Tippflächen für den Umschalter */
	.prm-doks a.prm-d-ansicht-knopf {
		width: 44px;
		height: 40px;
	}

	.prm-doks .prm-d-kopfzeile .prm-d-suche {
		flex-basis: 100%;
	}

	/* Tabelle als gestapelte Karten: keine waagerechte Scrollleiste auf dem Handy */
	.prm-doks .prm-d-tabelle-huelle {
		overflow: visible;
		border: 0;
		background: transparent;
	}

	.prm-doks table.prm-d-tabelle,
	.prm-doks .prm-d-tabelle tbody,
	.prm-doks .prm-d-tabelle tr,
	.prm-doks .prm-d-tabelle td {
		display: block;
		width: 100%;
	}

	.prm-doks table.prm-d-tabelle {
		background: transparent;
	}

	.prm-doks .prm-d-tabelle thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
	}

	.prm-doks .prm-d-tabelle tr {
		margin: 0 0 var(--prm-d-abstand);
		padding: 6px 0;
		border: 1px solid var(--prm-d-rand);
		border-radius: var(--prm-d-radius);
		background: var(--prm-d-flaeche);
	}

	.prm-doks .prm-d-tabelle td,
	.prm-doks .prm-d-tabelle tr:last-child td {
		padding: 4px 12px;
		border: 0;
		text-align: left;
	}

	.prm-doks .prm-d-tabelle td[data-label]::before {
		content: attr(data-label) ": ";
		color: var(--prm-d-leise);
		font-size: 0.875em;
	}

	.prm-doks .prm-d-tabelle td.prm-d-aktionen {
		display: flex;
		gap: 8px;
		padding-top: 8px;
		text-align: left;
	}

	.prm-doks .prm-d-tabelle td.prm-d-aktionen a.prm-d-knopf {
		flex: 1 1 0;
		min-height: 44px;
	}

	.prm-doks .prm-d-tabelle td.prm-d-aktionen a + a {
		margin-left: 0;
	}

	/* Auf dem Handy mit Beschriftung (in der Tabelle sonst nur Symbol) */
	.prm-doks .prm-d-tabelle .prm-d-knopf-text {
		display: inline;
	}

	.prm-doks.ist-liste .prm-d-aktionen {
		width: 100%;
	}

	.prm-doks.ist-liste .prm-d-aktionen .prm-d-knopf {
		flex: 1 1 auto;
	}

	.prm-doks.ist-kacheln .prm-d-liste {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* ==========================================================================
   Pop-up „Ansehen“ (ab 1.3.0) – natives <dialog>, Klasse prm-doks + Theme
   ========================================================================== */
html.prm-d-popup-offen {
	overflow: hidden;
}

dialog.prm-doks.prm-d-popup {
	position: fixed;
	inset: 0;
	width: min(1100px, calc(100vw - 32px));
	max-width: none;
	height: min(92vh, calc(100vh - 32px));
	max-height: none;
	margin: auto;
	padding: 0;
	overflow: hidden;
	border: 1px solid var(--prm-d-rand);
	border-radius: var(--prm-d-radius);
	background: var(--prm-d-flaeche);
	color: var(--prm-d-text);
	box-shadow: 0 24px 64px rgb(0 0 0 / 35%);
}

dialog.prm-doks.prm-d-popup[open] {
	display: flex;
	flex-direction: column;
}

dialog.prm-doks.prm-d-popup::backdrop {
	background: rgb(16 24 40 / 62%);
}

.prm-doks.prm-d-popup .prm-d-popup-kopf {
	display: flex;
	flex: 0 0 auto;
	gap: 8px;
	align-items: center;
	padding: 10px 12px 10px 18px;
	border-bottom: 1px solid var(--prm-d-rand);
	background: var(--prm-d-flaeche);
}

.prm-doks.prm-d-popup .prm-d-popup-titel {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	padding: 0;
	overflow: hidden;
	color: var(--prm-d-text);
	font: 600 1rem/1.3 var(--prm-d-schrift);
	letter-spacing: normal;
	text-overflow: ellipsis;
	text-transform: none;
	white-space: nowrap;
}

.prm-doks.prm-d-popup .prm-d-popup-rahmen {
	display: block;
	flex: 1 1 auto;
	width: 100%;
	min-height: 0;
	margin: 0;
	border: 0;
	background: #e9eef2;
}

@media (max-width: 600px) {

	dialog.prm-doks.prm-d-popup {
		width: 100vw;
		height: 100%;
		border: 0;
		border-radius: 0;
	}
}

/* ==========================================================================
   Themes (ab 1.3.0) – Klasse „thema-…“ an .prm-doks; „Klassisch“ = Grundgestaltung oben.
   ========================================================================== */

/* --- Kompakt: platzsparend für lange Listen --- */
.prm-doks.thema-kompakt {
	--prm-d-abstand: 8px;
	--prm-d-radius: 6px;

	font-size: 0.9375rem;
}

.prm-doks.thema-kompakt:not(.ist-kacheln) .prm-d-liste {
	gap: 0;
	overflow: hidden;
	border: 1px solid var(--prm-d-rand);
	border-radius: var(--prm-d-radius);
	background: var(--prm-d-flaeche);
}

.prm-doks.thema-kompakt:not(.ist-kacheln) .prm-d-eintrag {
	gap: 10px;
	padding: 8px 12px;
	border: 0;
	border-bottom: 1px solid var(--prm-d-rand);
	border-radius: 0;
}

.prm-doks.thema-kompakt:not(.ist-kacheln) .prm-d-eintrag:last-child {
	border-bottom: 0;
}

.prm-doks.thema-kompakt:not(.ist-kacheln) .prm-d-bild {
	width: 32px;
	height: 40px;
}

.prm-doks.thema-kompakt:not(.ist-kacheln) .prm-d-bild .prm-d-neu {
	display: none;
}

.prm-doks.thema-kompakt a.prm-d-knopf {
	min-height: 32px;
	padding: 4px 10px;
	font-size: 0.8125em;
}

.prm-doks.thema-kompakt a.prm-d-knopf.ist-klein {
	min-width: 32px;
	padding: 4px;
}

.prm-doks.thema-kompakt .prm-d-meta,
.prm-doks.thema-kompakt .prm-d-beschreibung {
	font-size: 0.8125em;
}

.prm-doks.thema-kompakt .prm-d-tabelle th,
.prm-doks.thema-kompakt .prm-d-tabelle td {
	padding: 6px 10px;
}

/* --- Karten: erhaben, große Vorschau, Knöpfe in voller Breite --- */
.prm-doks.thema-karten {
	--prm-d-radius: 14px;
	--prm-d-abstand: 18px;
}

.prm-doks.thema-karten .prm-d-eintrag,
.prm-doks.thema-karten .prm-d-tabelle-huelle {
	border-color: transparent;
	box-shadow: 0 1px 2px rgb(16 24 40 / 6%), 0 8px 24px rgb(16 24 40 / 9%);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.prm-doks.thema-karten .prm-d-eintrag:hover,
.prm-doks.thema-karten .prm-d-eintrag:focus-within {
	box-shadow: 0 2px 4px rgb(16 24 40 / 8%), 0 14px 32px rgb(16 24 40 / 14%);
	transform: translateY(-2px);
}

.prm-doks.thema-karten:not(.ist-kacheln) .prm-d-bild {
	width: 96px;
	height: 124px;
}

.prm-doks.thema-karten .prm-d-format,
.prm-doks.thema-amtlich .prm-d-format,
.prm-doks.thema-galerie .prm-d-format {
	display: block;
}

.prm-doks.thema-karten.ist-kacheln .prm-d-eintrag {
	gap: 0;
	padding: 0;
	overflow: hidden;
}

.prm-doks.thema-karten.ist-kacheln .prm-d-bild {
	border-radius: 0;
}

.prm-doks.thema-karten.ist-kacheln .prm-d-text {
	padding: 14px 16px 8px;
}

.prm-doks.thema-karten.ist-kacheln .prm-d-aktionen {
	padding: 4px 16px 16px;
}

.prm-doks.thema-karten.ist-kacheln .prm-d-aktionen .prm-d-knopf {
	flex: 1 1 0;
}

/* --- Minimal: Trennlinien und Textlinks statt Knöpfen --- */
.prm-doks.thema-minimal {
	--prm-d-radius: 0;
}

.prm-doks.thema-minimal:not(.ist-kacheln) .prm-d-liste {
	gap: 0;
}

.prm-doks.thema-minimal .prm-d-eintrag {
	padding: 14px 0;
	border: 0;
	border-bottom: 1px solid var(--prm-d-rand);
	border-radius: 0;
	background: transparent;
}

.prm-doks.thema-minimal.ist-kacheln .prm-d-liste {
	gap: 28px 24px;
}

.prm-doks.thema-minimal .prm-d-bild {
	border: 1px solid var(--prm-d-rand);
	background: transparent;
}

.prm-doks.thema-minimal .prm-d-aktionen {
	gap: 18px;
}

.prm-doks.thema-minimal a.prm-d-knopf,
.prm-doks.thema-minimal a.prm-d-knopf.ist-leise {
	min-height: 40px;
	padding: 4px 0;
	border: 0;
	background: none;
	color: var(--prm-d-knopf-hg, var(--prm-d-akzent));
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Textlinks: eigene Farben der Einstellungen als Linkfarbe (ab 1.3.3). */
.prm-doks.thema-minimal a.prm-d-knopf.ist-leise {
	color: var(--prm-d-ansehen-text, var(--prm-d-akzent));
}

.prm-doks.thema-minimal a.prm-d-knopf:hover,
.prm-doks.thema-minimal a.prm-d-knopf.ist-leise:hover {
	background: none;
	color: var(--prm-d-knopf-hg-hover, var(--prm-d-text));
	filter: none;
}

.prm-doks.thema-minimal a.prm-d-knopf.ist-klein {
	min-width: 32px;
	min-height: 32px;
	padding: 4px;
}

.prm-doks.thema-minimal .prm-d-tabelle-huelle {
	border: 0;
	border-radius: 0;
	background: transparent;
}

.prm-doks.thema-minimal table.prm-d-tabelle {
	background: transparent;
}

.prm-doks.thema-minimal .prm-d-tabelle th {
	border-bottom: 2px solid var(--prm-d-text);
	background: none;
}

/* --- Amtlich: sachlich, eckig, Akzentleiste, deutliches Formatzeichen --- */
.prm-doks.thema-amtlich {
	--prm-d-radius: 2px;
	--prm-d-grund: #eef1f4;
}

.prm-doks.thema-amtlich .prm-d-eintrag {
	border-left: 4px solid var(--prm-d-akzent);
}

.prm-doks.thema-amtlich.ist-kacheln .prm-d-eintrag {
	border-top: 4px solid var(--prm-d-akzent);
	border-left-width: 1px;
	border-left-color: var(--prm-d-rand);
}

.prm-doks.thema-amtlich .prm-d-bild {
	border: 1px solid var(--prm-d-rand);
	background: var(--prm-d-flaeche);
}

.prm-doks.thema-amtlich .prm-d-format {
	border-radius: 0;
	background: var(--prm-d-akzent);
	color: var(--prm-d-akzent-text);
}

.prm-doks.thema-amtlich a.prm-d-titel,
.prm-doks.thema-amtlich a.prm-d-titel:visited {
	color: var(--prm-d-titel, var(--prm-d-akzent));
	text-decoration: underline;
	text-underline-offset: 3px;
}

.prm-doks.thema-amtlich .prm-d-tabelle th {
	background: var(--prm-d-akzent);
	color: var(--prm-d-akzent-text);
}

/* --- Modern rund: weiche Flächen, pillenförmige Knöpfe --- */
.prm-doks.thema-rund {
	--prm-d-radius: 18px;
	--prm-d-grund: #eef3f8;
}

.prm-doks.thema-rund .prm-d-eintrag,
.prm-doks.thema-rund .prm-d-tabelle-huelle {
	border-color: transparent;
	background: var(--prm-d-grund);
	background: color-mix(in srgb, var(--prm-d-akzent) 7%, var(--prm-d-flaeche));
}

.prm-doks.thema-rund table.prm-d-tabelle,
.prm-doks.thema-rund .prm-d-tabelle th {
	background: transparent;
}

.prm-doks.thema-rund .prm-d-bild {
	border-radius: 12px;
	background: var(--prm-d-flaeche);
}

.prm-doks.thema-rund a.prm-d-knopf,
.prm-doks.thema-rund .prm-d-suche input[type="search"],
.prm-doks.thema-rund .prm-d-seite {
	border-radius: 999px;
}

.prm-doks.thema-rund a.prm-d-knopf {
	padding: 8px 18px;
}

.prm-doks.thema-rund a.prm-d-knopf.ist-leise {
	border-color: transparent;
	background: var(--prm-d-ansehen-hg, var(--prm-d-flaeche));
	box-shadow: inset 0 0 0 1.5px var(--prm-d-ansehen-rand, var(--prm-d-akzent));
}

.prm-doks.thema-rund a.prm-d-knopf.ist-klein {
	padding: 6px;
}

/* --- Galerie: Titelseiten im Raster, Knöpfe unter dem Bild --- */
.prm-doks.thema-galerie.ist-liste .prm-d-liste {
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr));
	gap: 28px 20px;
}

.prm-doks.thema-galerie .prm-d-eintrag {
	flex-direction: column;
	gap: 10px;
	align-items: stretch;
	padding: 0;
	border: 0;
	background: transparent;
}

.prm-doks.thema-galerie .prm-d-bild,
.prm-doks.thema-galerie.ist-kacheln .prm-d-bild {
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 4;
	border-radius: var(--prm-d-radius);
	box-shadow: 0 2px 10px rgb(16 24 40 / 14%);
}

.prm-doks.thema-galerie .prm-d-bild img {
	transition: transform 0.25s ease;
}

.prm-doks.thema-galerie a.prm-d-bild:hover img {
	transform: scale(1.03);
}

.prm-doks.thema-galerie .prm-d-beschreibung {
	display: -webkit-box;
	overflow: hidden;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
}

.prm-doks.thema-galerie .prm-d-aktionen {
	gap: 6px;
	margin-top: auto;
}

.prm-doks.thema-galerie .prm-d-aktionen .prm-d-knopf {
	flex: 1 1 0;
	min-height: 36px;
	padding: 6px 10px;
	font-size: 0.875em;
}

/* --- Redaktionell: große Titel, Rubrikzeile, Pfeil-Links --- */
.prm-doks.thema-redaktionell:not(.ist-kacheln) .prm-d-liste {
	gap: 0;
}

.prm-doks.thema-redaktionell .prm-d-eintrag {
	gap: 22px;
	align-items: flex-start;
	padding: 22px 0;
	border: 0;
	border-bottom: 1px solid var(--prm-d-rand);
	border-radius: 0;
	background: transparent;
}

.prm-doks.thema-redaktionell:not(.ist-kacheln) .prm-d-bild {
	width: 120px;
	height: 160px;
	box-shadow: 0 1px 6px rgb(16 24 40 / 16%);
}

.prm-doks.thema-redaktionell a.prm-d-titel {
	font-family: Georgia, "Times New Roman", serif;
	font-size: 1.3em;
	line-height: 1.25;
}

.prm-doks.thema-redaktionell .prm-d-meta {
	order: -1;
	font-size: 0.75em;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.prm-doks.thema-redaktionell .prm-d-beschreibung {
	margin-top: 4px;
	color: var(--prm-d-text);
	font-size: 1em;
}

.prm-doks.thema-redaktionell .prm-d-aktionen {
	gap: 18px;
	align-self: center;
}

.prm-doks.thema-redaktionell a.prm-d-knopf:not(.ist-klein, .ist-gross),
.prm-doks.thema-redaktionell a.prm-d-knopf.ist-leise:not(.ist-klein) {
	min-height: 40px;
	padding: 4px 0;
	border: 0;
	background: none;
	color: var(--prm-d-knopf-hg, var(--prm-d-akzent));
}

.prm-doks.thema-redaktionell a.prm-d-knopf.ist-leise:not(.ist-klein) {
	color: var(--prm-d-ansehen-text, var(--prm-d-akzent));
}

.prm-doks.thema-redaktionell a.prm-d-knopf:not(.ist-klein, .ist-gross) .prm-d-ico {
	display: none;
}

.prm-doks.thema-redaktionell a.prm-d-knopf:not(.ist-klein, .ist-gross)::after {
	content: "→";
	transition: transform 0.2s ease;
}

.prm-doks.thema-redaktionell a.prm-d-knopf:not(.ist-klein, .ist-gross):hover {
	background: none;
	color: var(--prm-d-knopf-hg-hover, var(--prm-d-text));
	filter: none;
}

.prm-doks.thema-redaktionell a.prm-d-knopf:not(.ist-klein, .ist-gross):hover::after {
	transform: translateX(3px);
}

/* --- Hoher Kontrast: Schwarz/Weiß, kräftige Rahmen, große Klickflächen --- */
.prm-doks.thema-kontrast {
	--prm-d-akzent: #000;
	--prm-d-akzent-text: #fff;
	--prm-d-text: #000;
	--prm-d-leise: #1d1d1d;
	--prm-d-flaeche: #fff;
	--prm-d-grund: #f2f2f2;
	--prm-d-rand: #000;
	--prm-d-radius: 4px;

	font-size: 1.125rem;
}

.prm-doks.thema-kontrast .prm-d-eintrag,
.prm-doks.thema-kontrast .prm-d-tabelle-huelle {
	border-width: 2px;
}

.prm-doks.thema-kontrast a.prm-d-titel,
.prm-doks.thema-kontrast a.prm-d-titel:visited {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.prm-doks.thema-kontrast a.prm-d-knopf {
	min-height: 48px;
	padding: 10px 18px;
	border-width: 2px;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.prm-doks.thema-kontrast a.prm-d-knopf.ist-klein {
	min-width: 44px;
	min-height: 44px;
	padding: 8px;
}

.prm-doks.thema-kontrast a.prm-d-knopf:hover,
.prm-doks.thema-kontrast a.prm-d-knopf.ist-leise:hover,
.prm-doks.thema-kontrast button.prm-d-knopf:hover {
	border-color: #000;
	background: #ffd400;
	color: #000;
	filter: none;
}

.prm-doks.thema-kontrast a:focus-visible,
.prm-doks.thema-kontrast button:focus-visible,
.prm-doks.thema-kontrast input:focus-visible {
	outline: 4px solid #ffd400;
	outline-offset: 2px;
	box-shadow: 0 0 0 6px #000;
}

.prm-doks.thema-kontrast .prm-d-tabelle th {
	background: #000;
	color: #fff;
}

.prm-doks.thema-kontrast .prm-d-tabelle td {
	border-bottom-width: 2px;
}

/* --- Dunkel: für dunkle Websites --- */
.prm-doks.thema-dunkel {
	--prm-d-akzent: #7cb7ff;
	--prm-d-akzent-text: #0b1520;
	--prm-d-text: #e8edf2;
	--prm-d-leise: #a9b4bf;
	--prm-d-flaeche: #1b2129;
	--prm-d-grund: #11161c;
	--prm-d-rand: #2e3742;

	color-scheme: dark;
}

.prm-doks.thema-dunkel .prm-d-viewer-rahmen,
.prm-doks.thema-dunkel.prm-d-popup .prm-d-popup-rahmen {
	background: #11161c;
}

/* Bewegung nur, wenn erwünscht */
@media (prefers-reduced-motion: reduce) {

	.prm-doks.thema-karten .prm-d-eintrag,
	.prm-doks.thema-galerie .prm-d-bild img,
	.prm-doks.thema-redaktionell a.prm-d-knopf::after {
		transition: none;
	}

	.prm-doks.thema-karten .prm-d-eintrag:hover,
	.prm-doks.thema-karten .prm-d-eintrag:focus-within,
	.prm-doks.thema-galerie a.prm-d-bild:hover img {
		transform: none;
	}
}

/* Themes auf schmalen Bildschirmen */
@media (max-width: 560px) {

	.prm-doks.thema-redaktionell:not(.ist-kacheln) .prm-d-bild,
	.prm-doks.thema-karten:not(.ist-kacheln) .prm-d-bild {
		width: 72px;
		height: 96px;
	}

	.prm-doks.thema-galerie.ist-liste .prm-d-liste {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 20px 12px;
	}

	.prm-doks.thema-galerie .prm-d-aktionen .prm-d-knopf span:not(.prm-d-sr) {
		display: none;
	}

	/* Einzelnes Dokument in der Galerie: eine Spalte, Knöpfe mit Text */
	.prm-doks.prm-d-einzel.thema-galerie.ist-liste .prm-d-liste {
		grid-template-columns: minmax(0, 340px);
	}

	.prm-doks.prm-d-einzel.thema-galerie .prm-d-aktionen .prm-d-knopf span:not(.prm-d-sr) {
		display: inline;
	}

	/* Download-Knopf: Format und Größe unter den Text statt daneben */
	.prm-doks a.prm-d-knopf.ist-gross {
		flex-wrap: wrap;
		justify-content: flex-start;
		width: 100%;
		text-align: left;
	}

	.prm-doks a.prm-d-knopf.ist-gross .prm-d-knopf-info {
		flex-basis: 100%;
		padding-left: calc(1.1em + 6px);
	}

	.prm-doks.thema-redaktionell .prm-d-aktionen,
	.prm-doks.thema-minimal .prm-d-aktionen {
		width: auto;
	}
}

/* ==========================================================================
   Passwortschutz (ab 1.3.1): Schloss in Listen, eigene Abfrageseite
   ========================================================================== */
.prm-doks .prm-d-schloss {
	display: inline-flex;
	align-items: center;
	margin-left: 4px;
	color: var(--prm-d-akzent);
	vertical-align: -2px;
}

.prm-doks .prm-d-schloss.ist-frei {
	color: var(--prm-d-leise);
}

.prm-doks .prm-d-schloss .prm-d-ico {
	width: 1em;
	height: 1em;
}

body.prm-d-pw-seite {
	min-height: 100vh;
	margin: 0;
	background: #f4f6f8;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

body.prm-d-pw-seite.ist-eingebettet {
	min-height: 0;
}

.prm-doks.prm-d-pw {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	margin: 0;
	padding: 16px;
	background: var(--prm-d-grund);
}

.prm-doks.prm-d-pw .prm-d-pw-karte {
	width: 100%;
	max-width: 420px;
	padding: 28px 24px;
	border: 1px solid var(--prm-d-rand);
	border-radius: var(--prm-d-radius);
	background: var(--prm-d-flaeche);
	box-shadow: 0 8px 28px rgb(16 24 40 / 10%);
	text-align: center;
}

.prm-doks.prm-d-pw .prm-d-pw-symbol {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	margin: 0 0 8px;
	border-radius: 50%;
	background: var(--prm-d-grund);
	color: var(--prm-d-akzent);
}

.prm-doks.prm-d-pw .prm-d-pw-symbol .prm-d-ico {
	width: 28px;
	height: 28px;
}

.prm-doks.prm-d-pw .prm-d-pw-titel {
	margin: 0 0 4px;
	color: var(--prm-d-text);
	font-size: 1.375rem;
	line-height: 1.3;
}

.prm-doks.prm-d-pw .prm-d-pw-dokument {
	margin: 0 0 12px;
	color: var(--prm-d-text);
	font-weight: 600;
	overflow-wrap: anywhere;
}

.prm-doks.prm-d-pw .prm-d-pw-text,
.prm-doks.prm-d-pw .prm-d-pw-hinweis {
	margin: 0 0 16px;
	color: var(--prm-d-leise);
	font-size: 0.9375em;
}

.prm-doks.prm-d-pw .prm-d-pw-hinweis {
	margin: 16px 0 0;
	font-size: 0.8125em;
}

.prm-doks.prm-d-pw .prm-d-pw-fehler {
	margin: 0 0 12px;
	padding: 10px 12px;
	border: 1px solid #b42318;
	border-radius: calc(var(--prm-d-radius) * 0.75);
	background: #fdecea;
	color: #8a1c12;
	font-size: 0.9375em;
}

.prm-doks.prm-d-pw .prm-d-pw-form {
	display: grid;
	gap: 8px;
	text-align: left;
}

.prm-doks.prm-d-pw .prm-d-pw-form label {
	color: var(--prm-d-text);
	font-weight: 600;
}

.prm-doks.prm-d-pw .prm-d-pw-form input[type="password"] {
	width: 100%;
	min-height: 44px;
	margin: 0;
	padding: 8px 12px;
	border: 1px solid var(--prm-d-rand);
	border-radius: calc(var(--prm-d-radius) * 0.75);
	background: var(--prm-d-flaeche);
	color: var(--prm-d-text);
	font: inherit;
}

.prm-doks.prm-d-pw .prm-d-pw-form input[aria-invalid="true"] {
	border-color: #b42318;
}

.prm-doks.prm-d-pw button.prm-d-knopf,
.prm-doks.prm-d-pw a.prm-d-knopf {
	width: 100%;
	min-height: 44px;
}

/* ==========================================================================
   Ordner-Hierarchie (ab 1.3.2): aufklappbar, gruppiert, Navigation mit Pfad
   ========================================================================== */
.prm-doks .prm-d-hierarchie {
	display: grid;
	gap: var(--prm-d-abstand);
}

.prm-doks .prm-d-ordner-kopf {
	display: flex;
	gap: 8px;
	align-items: center;
	margin: 0;
	color: var(--prm-d-text);
	font: 600 1em/1.3 var(--prm-d-schrift);
	letter-spacing: normal;
	text-transform: none;
}

.prm-doks .prm-d-ordner-kopf > .prm-d-ico {
	width: 1.25em;
	height: 1.25em;
	color: var(--prm-d-akzent);
}

.prm-doks .prm-d-ordner-name {
	flex: 1 1 auto;
	min-width: 0;
	overflow-wrap: anywhere;
}

.prm-doks .prm-d-ordner-zahl {
	flex: 0 0 auto;
	min-width: 1.75em;
	padding: 1px 8px;
	border-radius: 999px;
	background: var(--prm-d-grund);
	color: var(--prm-d-leise);
	font-size: 0.8125em;
	font-weight: 600;
	text-align: center;
}

/* Aufklappbar */
.prm-doks details.prm-d-ordner {
	margin: 0;
	border: 1px solid var(--prm-d-rand);
	border-radius: var(--prm-d-radius);
	background: var(--prm-d-flaeche);
}

.prm-doks details.prm-d-ordner > summary {
	min-height: 48px;
	padding: 10px 14px;
	border-radius: var(--prm-d-radius);
	list-style: none;
	cursor: pointer;
}

.prm-doks details.prm-d-ordner > summary::-webkit-details-marker {
	display: none;
}

.prm-doks details.prm-d-ordner > summary::marker {
	content: "";
}

.prm-doks details.prm-d-ordner > summary:hover {
	background: var(--prm-d-grund);
}

.prm-doks details.prm-d-ordner > summary:focus-visible {
	outline: 2px solid var(--prm-d-akzent);
	outline-offset: 2px;
}

.prm-doks details.prm-d-ordner > summary > .prm-d-ico:first-child {
	width: 1em;
	height: 1em;
	color: var(--prm-d-leise);
	transition: transform 0.15s ease;
}

.prm-doks details.prm-d-ordner[open] > summary > .prm-d-ico:first-child {
	transform: rotate(90deg);
}

.prm-doks details.prm-d-ordner[open] > summary {
	border-bottom: 1px solid var(--prm-d-rand);
	border-radius: var(--prm-d-radius) var(--prm-d-radius) 0 0;
}

.prm-doks details.prm-d-ordner > .prm-d-ordner-inhalt {
	display: grid;
	gap: var(--prm-d-abstand);
	padding: var(--prm-d-abstand);
}

/* Verschachtelte Ordner: weniger Einzug, damit tiefe Ebenen (auch auf dem Handy) nicht zu schmal werden */
.prm-doks details.prm-d-ordner details.prm-d-ordner {
	border-width: 0 0 0 2px;
	border-radius: 0;
}

.prm-doks details.prm-d-ordner details.prm-d-ordner > summary,
.prm-doks details.prm-d-ordner details.prm-d-ordner[open] > summary {
	border-radius: 0;
}

.prm-doks details.prm-d-ordner details.prm-d-ordner > .prm-d-ordner-inhalt {
	padding: 8px 0 4px 8px;
}

/* Gruppiert: Ordner als Zwischenüberschriften */
.prm-doks .prm-d-ordner.ist-gruppe {
	display: grid;
	gap: var(--prm-d-abstand);
	margin: 8px 0 0;
}

.prm-doks .prm-d-ordner.ist-gruppe > .prm-d-ordner-kopf {
	padding: 0 0 8px;
	border-bottom: 2px solid var(--prm-d-akzent);
	font-size: calc(1.125em - var(--prm-d-tiefe, 0) * 0.0625em);
}

.prm-doks .prm-d-ordner.ist-gruppe > .prm-d-ordner-inhalt {
	display: grid;
	gap: var(--prm-d-abstand);
	padding-left: calc(var(--prm-d-tiefe, 0) * 12px);
}

/* Navigation: Pfad und Ordnerkacheln */
.prm-doks .prm-d-pfad ol {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	align-items: center;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 0.9375em;
}

.prm-doks .prm-d-pfad li {
	display: inline-flex;
	gap: 4px;
	align-items: center;
	margin: 0;
}

.prm-doks .prm-d-pfad li + li::before {
	content: "›";
	color: var(--prm-d-leise);
}

.prm-doks .prm-d-pfad a,
.prm-doks .prm-d-pfad [aria-current] {
	display: inline-flex;
	gap: 6px;
	align-items: center;
	min-height: 36px;
	padding: 4px 6px;
	border-radius: calc(var(--prm-d-radius) * 0.5);
	color: var(--prm-d-akzent);
	text-decoration: underline;
	text-underline-offset: 3px;
	box-shadow: none;
}

.prm-doks .prm-d-pfad [aria-current] {
	color: var(--prm-d-text);
	font-weight: 600;
	text-decoration: none;
}

.prm-doks .prm-d-pfad .prm-d-ico {
	width: 1.1em;
	height: 1.1em;
}

.prm-doks .prm-d-ordnerliste {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
	gap: var(--prm-d-abstand);
	margin: 0;
	padding: 0;
	list-style: none;
}

.prm-doks .prm-d-ordnerliste li {
	margin: 0;
}

.prm-doks .prm-d-ordnerliste li::marker {
	content: "";
}

.prm-doks a.prm-d-ordner-kachel,
.prm-doks a.prm-d-ordner-kachel:visited {
	display: flex;
	gap: 10px;
	align-items: center;
	min-height: 56px;
	padding: 12px 14px;
	border: 1px solid var(--prm-d-rand);
	border-radius: var(--prm-d-radius);
	background: var(--prm-d-flaeche);
	color: var(--prm-d-text);
	font-weight: 600;
	text-decoration: none;
	box-shadow: none;
}

.prm-doks a.prm-d-ordner-kachel:hover {
	border-color: var(--prm-d-akzent);
	background: var(--prm-d-grund);
	color: var(--prm-d-text);
}

.prm-doks a.prm-d-ordner-kachel > .prm-d-ico {
	width: 1.5em;
	height: 1.5em;
	color: var(--prm-d-akzent);
}

/* Themes: Ordner passend gestalten */
.prm-doks.thema-minimal details.prm-d-ordner,
.prm-doks.thema-redaktionell details.prm-d-ordner {
	border-width: 0 0 1px;
	border-radius: 0;
	background: transparent;
}

.prm-doks.thema-minimal details.prm-d-ordner > .prm-d-ordner-inhalt,
.prm-doks.thema-redaktionell details.prm-d-ordner > .prm-d-ordner-inhalt {
	padding: 0 0 var(--prm-d-abstand) 24px;
}

.prm-doks.thema-karten details.prm-d-ordner,
.prm-doks.thema-karten a.prm-d-ordner-kachel {
	border-color: transparent;
	box-shadow: 0 1px 2px rgb(16 24 40 / 6%), 0 6px 18px rgb(16 24 40 / 8%);
}

.prm-doks.thema-rund details.prm-d-ordner,
.prm-doks.thema-rund a.prm-d-ordner-kachel {
	border-color: transparent;
	background: color-mix(in srgb, var(--prm-d-akzent) 7%, var(--prm-d-flaeche));
}

.prm-doks.thema-amtlich details.prm-d-ordner,
.prm-doks.thema-amtlich a.prm-d-ordner-kachel {
	border-left: 4px solid var(--prm-d-akzent);
}

.prm-doks.thema-kontrast details.prm-d-ordner,
.prm-doks.thema-kontrast a.prm-d-ordner-kachel {
	border-width: 2px;
}

.prm-doks.thema-kontrast a.prm-d-ordner-kachel:hover {
	background: #ffd400;
}

.prm-doks.thema-kompakt details.prm-d-ordner > summary {
	min-height: 40px;
	padding: 6px 10px;
}

.prm-doks.thema-galerie a.prm-d-ordner-kachel {
	flex-direction: column;
	justify-content: center;
	min-height: 120px;
	text-align: center;
}

.prm-doks.thema-galerie a.prm-d-ordner-kachel > .prm-d-ico {
	width: 2.5em;
	height: 2.5em;
}

@media (prefers-reduced-motion: reduce) {

	.prm-doks details.prm-d-ordner > summary > .prm-d-ico:first-child {
		transition: none;
	}
}

@media (max-width: 560px) {

	.prm-doks details.prm-d-ordner > .prm-d-ordner-inhalt {
		padding: 8px;
	}

	.prm-doks .prm-d-ordner.ist-gruppe > .prm-d-ordner-inhalt {
		padding-left: 0;
	}

	.prm-doks.thema-galerie a.prm-d-ordner-kachel {
		min-height: 96px;
	}
}
