/*
 * ELV Mediathek. Gestaltung nach der Elvation-Website: graue Flächen, leichte Überschriften,
 * Schaltflächen als Pille mit Pfeil im Kreis, Felder mit dunklem Balken links.
 * Farben und Maße lassen sich über die Variablen im Theme überschreiben.
 */
.elvm,
.elvm-dialog,
.elvm-single {
	--elvm-accent: #0073ff;
	--elvm-ink: #141e3c;
	--elvm-muted: #5b6275;
	--elvm-surface: #f0eeef;
	--elvm-error: #c0262d;
	--elvm-radius: 8px;
	--elvm-field-radius: 5px;
}

.elvm [hidden],
.elvm-dialog [hidden] {
	display: none !important;
}

/* ---- Felder: graue Fläche, dunkler Balken links, wie in den Formularen der Website ---- */
.elvm-controls .elvm-filter,
.elvm-controls .elvm-search,
.elvm-dialog .elvm-input {
	box-sizing: border-box;
	height: 54px;
	margin: 0;
	padding: 0 18px;
	border: 0;
	border-left: 4px solid var(--elvm-ink);
	border-radius: var(--elvm-field-radius);
	background-color: var(--elvm-surface);
	color: var(--elvm-ink);
	font: inherit;
	font-size: 17px;
	font-weight: 300;
	line-height: 1.2;
	box-shadow: none;
}

.elvm-controls .elvm-search::placeholder,
.elvm-dialog .elvm-input::placeholder {
	color: var(--elvm-muted);
	opacity: 1;
}

.elvm-controls .elvm-filter:focus-visible,
.elvm-controls .elvm-search:focus-visible,
.elvm-dialog .elvm-input:focus-visible {
	outline: 2px solid var(--elvm-accent);
	outline-offset: 2px;
}

/* ---- Filter und Suche ---- */
.elvm-controls {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	margin: 0 0 40px;
}

.elvm-controls .elvm-filter {
	flex: 0 1 240px;
	min-width: 0;
	max-width: 100%;
	padding-right: 44px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='%23141e3c' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 5l4 4 4-4'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 16px center;
	background-size: 14px;
	appearance: none;
	-webkit-appearance: none;
	cursor: pointer;
	text-overflow: ellipsis;
}

.elvm-controls .elvm-search {
	flex: 1 1 240px;
	min-width: 0;
}

@media (max-width: 600px) {
	.elvm-controls .elvm-filter,
	.elvm-controls .elvm-search {
		flex: 1 1 100%;
	}
}

/* ---- Raster: höchstens --elvm-cols Spalten, bei wenig Platz automatisch weniger ---- */
.elvm-grid {
	--elvm-gap: 28px;
	display: grid;
	grid-template-columns: repeat(
		auto-fill,
		minmax(min(100%, max(210px, calc((100% - (var(--elvm-cols, 4) - 1) * var(--elvm-gap)) / var(--elvm-cols, 4)))), 1fr)
	);
	gap: var(--elvm-gap);
}

@media (max-width: 800px) {
	.elvm-grid {
		--elvm-gap: 18px;
	}
}

/* ---- Karte ---- */
.elvm-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border-radius: var(--elvm-radius);
	background: var(--elvm-surface);
}

/* Titelbild als Dokument auf grauer Fläche: ganz sichtbar, mit leichtem Schatten. Alle Karten gleich hoch. */
.elvm-card__img {
	position: relative;
	aspect-ratio: 1 / 1;
}

.elvm-card__img img,
.elvm-card__placeholder {
	position: absolute;
	top: 30px;
	bottom: 6px;
	filter: drop-shadow(0 10px 16px rgba(20, 30, 60, 0.18));
}

.elvm-card__img img {
	left: 30px;
	display: block;
	width: calc(100% - 60px);
	max-width: none;
	height: calc(100% - 36px);
	object-fit: contain;
}

.elvm-card__placeholder {
	left: 50%;
	display: flex;
	align-items: flex-end;
	box-sizing: border-box;
	aspect-ratio: 3 / 4;
	padding: 14px 16px;
	background: #fff;
	transform: translateX(-50%);
}

.elvm-card__placeholder span {
	color: var(--elvm-accent);
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.04em;
	line-height: 1;
}

@media (max-width: 480px) {
	.elvm-card__img {
		aspect-ratio: 4 / 3;
	}
}

.elvm-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: 22px 26px 28px;
}

.elvm-card .elvm-card__label {
	margin: 0 0 8px;
	padding: 0;
	color: var(--elvm-accent);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	text-transform: uppercase;
}

.elvm-card .elvm-card__title {
	margin: 0 0 10px;
	padding: 0;
	color: var(--elvm-ink);
	font-size: 21px;
	font-weight: 300;
	line-height: 1.2;
	overflow-wrap: break-word;
	hyphens: auto;
}

.elvm-card .elvm-card__text {
	margin: 0 0 6px;
	padding: 0;
	color: var(--elvm-ink);
	font-size: 15px;
	font-weight: 300;
	line-height: 1.45;
	overflow-wrap: break-word;
	hyphens: auto;
}

.elvm-card__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 14px;
	margin-top: auto;
	padding-top: 16px;
}

.elvm-card__meta {
	color: var(--elvm-muted);
	font-size: 13px;
	font-weight: 400;
	line-height: 1.2;
	white-space: nowrap;
}

.elvm .elvm-empty {
	margin: 24px 0 0;
	color: var(--elvm-muted);
	font-weight: 300;
}

/* ---- Schaltflächen: Pille mit Pfeil im Kreis ---- */
.elvm-btn,
.elvm-dialog .elvm-btn {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	box-sizing: border-box;
	max-width: 100%;
	min-height: 36px;
	margin: 0;
	padding: 5px 20px 5px 6px;
	border: 1px solid var(--elvm-accent);
	border-radius: 100px;
	background: var(--elvm-accent);
	color: #fff;
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.2;
	text-align: left;
	text-decoration: none;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.elvm-btn__icon {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: #fff;
	color: var(--elvm-accent);
	transition: background-color 0.2s ease, color 0.2s ease;
}

.elvm-btn__icon svg {
	display: block;
}

.elvm-btn:hover,
.elvm-dialog .elvm-btn:hover {
	border-color: var(--elvm-ink);
	background: var(--elvm-ink);
	color: #fff;
}

.elvm-btn:hover .elvm-btn__icon {
	color: var(--elvm-ink);
}

/* Variante mit Rahmen, wie „Jetzt lesen“ auf der Startseite */
.elvm-btn--outline,
.elvm-dialog .elvm-btn--outline {
	background: transparent;
	color: var(--elvm-accent);
}

.elvm-btn--outline .elvm-btn__icon {
	background: var(--elvm-accent);
	color: #fff;
}

.elvm-btn--outline:hover,
.elvm-dialog .elvm-btn--outline:hover {
	border-color: var(--elvm-accent);
	background: var(--elvm-accent);
	color: #fff;
}

.elvm-btn--outline:hover .elvm-btn__icon {
	background: #fff;
	color: var(--elvm-accent);
}

/* Ohne Pfeil, z. B. „Schließen“ */
.elvm-btn--plain,
.elvm-dialog .elvm-btn--plain {
	padding-left: 20px;
}

.elvm-btn:focus-visible {
	outline: 2px solid var(--elvm-ink);
	outline-offset: 2px;
}

.elvm-btn[disabled] {
	opacity: 0.6;
	cursor: default;
}

/* ---- Dialoge ---- */
.elvm-dialog {
	box-sizing: border-box;
	width: calc(100% - 32px);
	max-width: 520px;
	max-height: calc(100% - 32px);
	margin: auto;
	padding: 44px 40px 40px;
	overflow: auto;
	border: 0;
	border-radius: var(--elvm-radius);
	background: #fff;
	color: var(--elvm-ink);
	box-shadow: 0 24px 70px rgba(20, 30, 60, 0.28);
	font-size: 16px;
	font-weight: 300;
	line-height: 1.5;
	text-align: left;
}

@media (max-width: 480px) {
	.elvm-dialog {
		padding: 40px 24px 28px;
	}
}

.elvm-dialog::backdrop {
	background: rgba(20, 30, 60, 0.6);
}

/* Ohne JavaScript bleibt der Dialog sichtbar, mittig über der Seite. */
.elvm-dialog[open]:not(:modal) {
	position: fixed;
	inset: 0;
	z-index: 100000;
	height: fit-content;
}

.elvm-dialog .elvm-dialog__close {
	position: absolute;
	top: 14px;
	right: 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	margin: 0;
	padding: 0 0 2px;
	border: 1px solid var(--elvm-ink);
	border-radius: 50%;
	background: transparent;
	color: var(--elvm-ink);
	font-size: 22px;
	font-weight: 300;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.elvm-dialog .elvm-dialog__close:hover {
	background: var(--elvm-ink);
	color: #fff;
}

.elvm-dialog .elvm-dialog__label {
	margin: 0 0 10px;
	padding: 0 40px 0 0;
	color: var(--elvm-accent);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
	text-transform: uppercase;
}

.elvm-dialog p {
	margin: 0 0 18px;
	padding: 0;
}

.elvm-dialog .elvm-dialog__doc {
	margin-bottom: 20px;
}

.elvm-dialog .elvm-dialog__name {
	display: block;
	color: var(--elvm-ink);
	font-size: 28px;
	font-weight: 300;
	line-height: 1.15;
	overflow-wrap: break-word;
}

.elvm-dialog .elvm-dialog__meta {
	display: block;
	margin-top: 6px;
	color: var(--elvm-muted);
	font-size: 13px;
	font-weight: 400;
}

/* Auswahl der Variante */
.elvm-dialog .elvm-variants {
	min-width: 0;
	margin: 0 0 20px;
	padding: 0;
	border: 0;
}

.elvm-dialog .elvm-variants legend {
	padding: 0;
}

.elvm-dialog .elvm-radio {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0 0 8px;
	padding: 13px 16px 13px 14px;
	border-left: 4px solid transparent;
	border-radius: var(--elvm-field-radius);
	background: var(--elvm-surface);
	font-size: 16px;
	line-height: 1.3;
	cursor: pointer;
}

.elvm-dialog .elvm-radio:has(input:checked) {
	border-left-color: var(--elvm-ink);
}

.elvm-dialog .elvm-radio input {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--elvm-accent);
}

.elvm-dialog .elvm-radio__label {
	font-weight: 500;
	overflow-wrap: anywhere;
}

.elvm-dialog .elvm-radio__meta {
	margin-left: auto;
	color: var(--elvm-muted);
	font-size: 13px;
	font-weight: 400;
	white-space: nowrap;
}

.elvm-dialog .elvm-label {
	display: block;
	margin: 0 0 8px;
	font-size: 14px;
	font-weight: 500;
}

.elvm-dialog .elvm-input {
	display: block;
	width: 100%;
	margin-bottom: 18px;
}

.elvm-dialog .elvm-input[aria-invalid="true"] {
	border-left-color: var(--elvm-error);
}

.elvm-dialog .elvm-check {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin: 0 0 22px;
	font-size: 14px;
	font-weight: 300;
	line-height: 1.45;
	cursor: pointer;
}

.elvm-dialog .elvm-check input {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin: 2px 0 0;
	accent-color: var(--elvm-accent);
}

.elvm-dialog .elvm-check a {
	color: var(--elvm-accent);
	text-decoration: underline;
}

.elvm-dialog .elvm-msg {
	margin: 0 0 16px;
	color: var(--elvm-error);
	font-size: 14px;
	font-weight: 400;
}

.elvm-dialog .elvm-done__text,
.elvm-dialog .elvm-unavailable__text {
	font-size: 18px;
	line-height: 1.45;
}

.elvm-dialog .elvm-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
