/* =========================================================
   Plakatgenerator – Styles
   Alle Klassen sind mit "plakatgen-" geprefixt, um Konflikte
   mit dem WordPress-Theme zu vermeiden. Es wird bewusst mit
   px statt rem/em gearbeitet, damit die Bedienelemente nicht
   von der (oft abweichenden) Basis-Schriftgröße des Themes
   beeinflusst werden.
   ========================================================= */

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

.plakatgen {
	--plakatgen-ui-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--plakatgen-border: #d7d7d7;
	--plakatgen-accent: #111111;
	font-family: var(--plakatgen-ui-font);
	font-size: 16px;
	line-height: 1.4;
	color: #1a1a1a;
	max-width: 100%;
	width: 100%;
}

/* ---------- Bühne / Vorschau ---------- */

.plakatgen-stage {
	width: 100%;
	background: #e7e7e7;
	border-radius: 10px;
	padding: 24px;
	display: flex;
	justify-content: center;
	align-items: center;
	overflow: hidden;
}

.plakatgen-stage-sizer {
	position: relative;
	/* width / height werden per JS in px gesetzt, passend zur Skalierung */
}

.plakatgen-poster {
	position: absolute;
	top: 0;
	left: 0;
	transform-origin: top left;
	background: #ffffff;
	color: #000000;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
	padding: 6mm;
	/* width / height / font-family werden per JS in mm gesetzt */
	-webkit-print-color-adjust: exact;
	print-color-adjust: exact;
	color-adjust: exact;
}

.plakatgen-content {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	gap: 4mm;
	overflow: hidden;
	min-height: 0;
}

.plakatgen-editable {
	outline: none;
	cursor: text;
}

.plakatgen-editable:focus {
	outline: 2px dashed rgba(0, 0, 0, 0.35);
	outline-offset: 6px;
}

.plakatgen-editable:empty::before {
	content: attr(data-placeholder);
	opacity: 0.35;
}

.plakatgen-headline {
	font-weight: normal;
	line-height: 0.98;
	white-space: pre-wrap;
	word-break: break-word;
	overflow-wrap: break-word;
	min-height: 1.05em;
}

.plakatgen-kleingedruckt {
	font-weight: normal;
	line-height: 1.2;
	white-space: pre-wrap;
	word-break: break-word;
	overflow-wrap: break-word;
	min-height: 1.2em;
}

.plakatgen-absender-box {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4mm 6mm;
	background: #000000;
	overflow: hidden;
	-webkit-print-color-adjust: exact;
	print-color-adjust: exact;
	color-adjust: exact;
}

.plakatgen-absender-text {
	font-weight: normal;
	color: #ffffff;
	white-space: pre;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
	line-height: 1.1;
	display: inline-block;
}

/* Platzhalter nie mit exportieren/drucken */
.plakatgen-poster.plakatgen-exporting .plakatgen-editable:empty::before {
	content: none !important;
}

/* ---------- Toolbar / Bedienelemente ---------- */

.plakatgen-toolbar {
	margin-top: 20px;
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
}

.plakatgen-group {
	flex: 1 1 220px;
	min-width: 200px;
	border: 1px solid var(--plakatgen-border);
	border-radius: 10px;
	padding: 14px 16px;
	background: #fafafa;
}

.plakatgen-group-actions {
	flex: 1 1 260px;
}

.plakatgen-group legend {
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #666;
	padding: 0;
	margin-bottom: 10px;
}

.plakatgen-row {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 10px;
}

.plakatgen-row:last-child {
	margin-bottom: 0;
}

.plakatgen-row-compact {
	justify-content: space-between;
}

.plakatgen-row label {
	font-size: 14px;
	font-weight: 600;
	flex: 0 0 auto;
	min-width: 90px;
}

.plakatgen-row-compact label {
	min-width: 0;
}

.plakatgen select,
.plakatgen input[type="text"] {
	font-family: inherit;
	font-size: 16px;
	line-height: 1.3;
	padding: 6px 8px;
	border: 1px solid var(--plakatgen-border);
	border-radius: 6px;
	background: #fff;
	color: #1a1a1a;
	flex: 1 1 auto;
	min-width: 0;
	max-width: 100%;
}

.plakatgen input[type="color"] {
	width: 40px;
	height: 30px;
	padding: 2px;
	border: 1px solid var(--plakatgen-border);
	border-radius: 6px;
	background: #fff;
	flex: 0 0 auto;
	cursor: pointer;
}

.plakatgen input[type="range"] {
	flex: 1 1 auto;
	min-width: 0;
	accent-color: var(--plakatgen-accent);
	height: 20px;
}

.plakatgen output {
	font-size: 13px;
	font-variant-numeric: tabular-nums;
	color: #444;
	flex: 0 0 auto;
	min-width: 3.6em;
	text-align: right;
}

.plakatgen-font-custom-wrap {
	margin-top: 10px;
}

.plakatgen-hint {
	font-size: 12px;
	color: #777;
	margin: 6px 0 0 0;
	line-height: 1.4;
}

.plakatgen-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.plakatgen-btn {
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	padding: 9px 14px;
	border-radius: 6px;
	border: 1px solid var(--plakatgen-accent);
	background: #fff;
	color: var(--plakatgen-accent);
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
	line-height: 1.2;
}

.plakatgen-btn:hover {
	background: #f0f0f0;
}

.plakatgen-btn-primary {
	background: var(--plakatgen-accent);
	color: #fff;
}

.plakatgen-btn-primary:hover {
	background: #333;
}

.plakatgen-btn:disabled {
	opacity: 0.5;
	cursor: default;
}

.plakatgen-status {
	font-size: 13px;
	color: #666;
	margin: 10px 0 0 0;
	min-height: 1.2em;
}

/* ---------- Druck ---------- */

@media print {
	.plakatgen-editable:empty::before {
		content: none !important;
	}

	body * {
		visibility: hidden !important;
	}

	.plakatgen-print-active,
	.plakatgen-print-active * {
		visibility: visible !important;
	}

	.plakatgen-print-active .plakatgen-toolbar {
		display: none !important;
	}

	.plakatgen-print-active .plakatgen-stage {
		position: fixed;
		inset: 0;
		margin: 0;
		padding: 0;
		background: none;
		display: block;
	}

	.plakatgen-print-active .plakatgen-stage-sizer {
		position: static;
		width: auto !important;
		height: auto !important;
	}

	.plakatgen-print-active .plakatgen-poster {
		position: fixed;
		top: 0;
		left: 0;
		margin: 0;
		box-shadow: none;
		transform: none !important;
	}
}
