/* NMW Datei-Upload – Frontend */
.nmw-du-list,
.nmw-du-form {
	--nmw-du-border: rgba(0, 0, 0, .12);
}

/* ---------- Liste ---------- */
.nmw-du-group + .nmw-du-group {
	margin-top: 2em;
}

.nmw-du-heading {
	margin: 0 0 .6em;
}

.nmw-du-items {
	list-style: none !important;
	margin: 0;
	padding: 0 !important;
	border-top: 1px solid var(--nmw-du-border);
}

.nmw-du-item {
	display: flex;
	align-items: center;
	gap: 1em;
	padding: .8em 0;
	border-bottom: 1px solid var(--nmw-du-border);
}

.nmw-du-icon {
	flex: 0 0 2.25em;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--nmw-du-accent, currentColor);
}

.nmw-du-icon .dashicons {
	width: 1em;
	height: 1em;
	font-size: 2em;
}

.nmw-du-icon img {
	display: block;
	width: 2.25em;
	height: 2.25em;
	object-fit: contain;
}

.nmw-du-text {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.nmw-du-name {
	font-weight: 600;
	overflow-wrap: anywhere;
}

.nmw-du-sub {
	font-size: .875em;
	opacity: .75;
	overflow-wrap: anywhere;
}

.nmw-du-buttons {
	flex: 0 0 auto;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .6em;
}

/* Layout fix; Farben kommen vom Standard-Button des Themes (et_pb_button / wp-element-button). */
.nmw-du-button {
	display: inline-block;
	text-decoration: none;
	cursor: pointer;
}

/*
 * Maße in allen Zuständen identisch → beim Hover wechselt nur die Farbe.
 * :not(#…) hebt die Spezifität auf ID-Niveau, damit auch Theme-Regeln wie
 * „body #page-container .et_pb_section .et_pb_button:hover { padding … !important }" verlieren.
 */
.nmw-du-button:not(#nmw-x):not(#nmw-y),
.nmw-du-button:not(#nmw-x):not(#nmw-y):hover,
.nmw-du-button:not(#nmw-x):not(#nmw-y):focus,
.nmw-du-button:not(#nmw-x):not(#nmw-y):active {
	padding: 10px 25px 10px 25px !important;
	line-height: 1.2 !important;
	letter-spacing: inherit !important;
	transform: none !important;
}

/* Hover-Icons des Themes (z. B. Divi-Pfeil) abschalten. */
.nmw-du-button:not(#nmw-x):not(#nmw-y)::before,
.nmw-du-button:not(#nmw-x):not(#nmw-y)::after {
	display: none !important;
	content: none !important;
}

/* Neutraler Fallback für Themes ohne Standard-Button (Spezifität 0 → jedes Theme-Styling gewinnt). */
:where(.nmw-du-button) {
	border: 1px solid currentColor;
	border-radius: 4px;
	background: transparent;
	color: inherit;
	font: inherit;
	font-weight: 600;
}

/* Eigene Akzentfarbe gesetzt → eigener Button statt Theme-Button. */
.nmw-du--custom .nmw-du-button {
	border: 0;
	background: var(--nmw-du-accent);
	color: #fff;
}

.nmw-du--custom .nmw-du-button:hover,
.nmw-du--custom .nmw-du-button:focus-visible {
	filter: brightness(1.12);
	color: #fff;
}

/* Löschen: Schwarz auf 80 %; beim Hover greift wieder die Theme-Farbe. */
.nmw-du-button.nmw-du-delete:not(:hover):not(:focus-visible) {
	background-color: rgba(0, 0, 0, .8) !important;
}

.nmw-du-button[disabled] {
	opacity: .6;
	cursor: default;
}

@media (max-width: 480px) {
	.nmw-du-item {
		flex-wrap: wrap;
	}

	.nmw-du-text {
		flex-basis: calc(100% - 3.25em);
	}

	.nmw-du-buttons {
		margin-left: 3.25em;
	}
}

/* ---------- Formular ---------- */
.nmw-du-form {
	max-width: 560px;
}

.nmw-du-field {
	margin: 0 0 1em;
}

.nmw-du-field[hidden] {
	display: none;
}

.nmw-du-field label {
	display: block;
	margin-bottom: .3em;
	font-weight: 600;
}

.nmw-du-field input[type="text"],
.nmw-du-field select {
	width: 100%;
	box-sizing: border-box;
	padding: .55em .7em;
	border: 1px solid var(--nmw-du-border);
	border-radius: 4px;
	font: inherit;
}

.nmw-du-hint {
	display: block;
	margin-top: .3em;
	font-size: .875em;
	opacity: .75;
}

.nmw-du-message:empty {
	display: none;
}

.nmw-du-message {
	margin-top: 1em;
	padding: .7em 1em;
	border-radius: 4px;
	background: rgba(0, 0, 0, .05);
}

.nmw-du-message.is-success {
	background: #e7f6ec;
	color: #14532d;
}

.nmw-du-message.is-error {
	background: #fdecec;
	color: #7f1d1d;
}
