/**
 * Westphal Solutions — QR code generator (self-contained)
 *
 * Owns everything under the `wsqr` prefix. Reads only the theme's brand
 * variables from main.css; shares no classes, files, or hooks with any other
 * tool. Safe to edit or delete on its own.
 */

.wsqr {
	--wsqr-gap: 1px;

	border: 1px solid var(--ws-border);
	border-radius: var(--ws-radius);
	background: var(--ws-surface);
	overflow: hidden;
	font-family: var(--ws-font);
	color: var(--ws-text);
}

/* ---- Top bar --------------------------------------------------------------- */
.wsqr__bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	border-bottom: 1px solid var(--ws-border);
	background: var(--ws-bg);
}
.wsqr__spacer { flex: 1 1 auto; }
.wsqr__actions { display: flex; align-items: center; gap: 8px; }

.wsqr__btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-family: var(--ws-font);
	font-size: 0.85rem;
	font-weight: 700;
	line-height: 1;
	padding: 9px 14px;
	border-radius: var(--ws-radius);
	border: 1px solid var(--ws-border);
	background: var(--ws-surface);
	color: var(--ws-text);
	cursor: pointer;
	transition: transform 0.15s var(--ws-ease),
				background-color 0.2s var(--ws-ease),
				border-color 0.2s var(--ws-ease),
				color 0.2s var(--ws-ease);
}
.wsqr__btn:hover { border-color: var(--ws-accent); }
.wsqr__btn:active { transform: translateY(1px); }
.wsqr__btn:focus-visible { outline: 2px solid var(--ws-accent); outline-offset: 2px; }
.wsqr__btn:disabled {
	opacity: 0.45;
	cursor: not-allowed;
	border-color: var(--ws-border);
}
.wsqr__btn:disabled:hover { border-color: var(--ws-border); }

/* ---- Error-correction segmented buttons ----------------------------------- */
.wsqr__seg {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px;
}
.wsqr__seg-label { font-size: 0.78rem; font-weight: 700; color: var(--ws-muted); margin-right: 2px; }
.wsqr__opt {
	min-width: 34px;
	padding: 7px 10px;
	font-family: var(--ws-font);
	font-size: 0.82rem;
	font-weight: 700;
	color: var(--ws-text);
	background: var(--ws-surface);
	border: 1px solid var(--ws-border);
	border-radius: var(--ws-radius);
	cursor: pointer;
	transition: transform 0.15s var(--ws-ease),
				border-color 0.2s var(--ws-ease),
				background-color 0.2s var(--ws-ease),
				color 0.2s var(--ws-ease);
}
.wsqr__opt:hover { border-color: var(--ws-accent); }
.wsqr__opt:active { transform: translateY(1px); }
.wsqr__opt:focus-visible { outline: 2px solid var(--ws-accent); outline-offset: 2px; }
.wsqr__opt.is-active {
	background: var(--ws-accent);
	border-color: var(--ws-accent);
	color: var(--ws-black);
}

/* ---- Panes ----------------------------------------------------------------- */
.wsqr__panes {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--wsqr-gap);
	background: var(--ws-border);
}
.wsqr__pane {
	display: flex;
	flex-direction: column;
	min-width: 0;
	background: var(--ws-surface);
}
.wsqr__label {
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--ws-muted);
	padding: 9px 12px;
	border-bottom: 1px solid var(--ws-border);
}
.wsqr__field {
	flex: 1 1 auto;
	width: 100%;
	min-height: 160px;
	resize: vertical;
	border: 0;
	padding: 14px 16px;
	font-family: var(--ws-font);
	font-size: 0.98rem;
	line-height: 1.6;
	color: var(--ws-text);
	background: var(--ws-bg);
}
.wsqr__field:focus { outline: 0; box-shadow: inset 0 0 0 2px var(--ws-accent); }

/* ---- QR canvas (right pane) ------------------------------------------------ */
.wsqr__canvas {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 22px;
	background: var(--ws-surface);
	min-height: 220px;
}
.wsqr__canvas svg {
	display: block;
	width: 100%;
	height: auto;
	max-width: 240px;
	border-radius: 2px;
}
.wsqr__empty {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	justify-content: center;
	padding: 22px;
	min-height: 220px;
	text-align: center;
	font-size: 0.85rem;
	color: var(--ws-muted);
	background: var(--ws-surface);
}

/* ---- Footnote -------------------------------------------------------------- */
.wsqr__note {
	margin: 0;
	padding: 10px 14px;
	font-size: 0.8rem;
	color: var(--ws-muted);
	border-top: 1px solid var(--ws-border);
	background: var(--ws-bg);
}

/* ---- Responsive ------------------------------------------------------------ */
@media (max-width: 720px) {
	.wsqr__panes { grid-template-columns: 1fr; }
	.wsqr__field { min-height: 150px; }
	.wsqr__canvas, .wsqr__empty { min-height: 200px; }
}
