/**
 * Westphal Solutions — Slugify (self-contained)
 *
 * Owns everything under the `wsslug` 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.
 */

.wsslug {
	--wsslug-mono: 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;
	--wsslug-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 --------------------------------------------------------------- */
.wsslug__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);
}
.wsslug__bar-label { font-size: 0.8rem; font-weight: 700; color: var(--ws-muted); }
.wsslug__spacer { flex: 1 1 auto; }

.wsslug__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);
}
.wsslug__btn:hover { border-color: var(--ws-accent); }
.wsslug__btn:active { transform: translateY(1px); }
.wsslug__btn:focus-visible { outline: 2px solid var(--ws-accent); outline-offset: 2px; }
.wsslug__btn.is-copied {
	background: var(--ws-slate);
	border-color: var(--ws-slate);
	color: var(--ws-white);
}

/* ---- Separator toggle (sliding thumb) ------------------------------------- */
.wsslug__modes {
	position: relative;
	display: flex;
	padding: 3px;
	border: 1px solid var(--ws-border);
	border-radius: var(--ws-radius-pill);
	background: var(--ws-surface);
}
.wsslug__thumb {
	position: absolute;
	top: 3px;
	left: 3px;
	width: calc(50% - 3px);
	height: calc(100% - 6px);
	border-radius: var(--ws-radius-pill);
	background: var(--ws-accent);
	transition: transform 0.28s var(--ws-ease);
}
.wsslug__modes[data-active="underscore"] .wsslug__thumb { transform: translateX(100%); }
.wsslug__mode {
	position: relative;
	z-index: 1;
	flex: 1 1 0;
	min-width: 66px;
	padding: 6px 14px;
	border: 0;
	background: transparent;
	font-family: var(--wsslug-mono);
	font-size: 0.85rem;
	font-weight: 700;
	color: var(--ws-muted);
	cursor: pointer;
}
.wsslug__mode[aria-pressed="true"] { color: var(--ws-black); }
.wsslug__mode:focus-visible { outline: 2px solid var(--ws-accent); outline-offset: 2px; border-radius: var(--ws-radius-pill); }

/* ---- Panes ----------------------------------------------------------------- */
.wsslug__panes {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--wsslug-gap);
	background: var(--ws-border);
}
.wsslug__pane {
	display: flex;
	flex-direction: column;
	min-width: 0;
	background: var(--ws-surface);
}
.wsslug__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);
}
.wsslug__field {
	flex: 1 1 auto;
	width: 100%;
	min-height: 120px;
	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);
}
.wsslug__field:focus { outline: 0; box-shadow: inset 0 0 0 2px var(--ws-accent); }

/* The slug result is the prominent line. */
.wsslug__field--out {
	font-family: var(--wsslug-mono);
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--ws-slate);
	background: var(--ws-surface);
}
[data-theme="dark"] .wsslug__field--out { color: var(--ws-accent); }

/* ---- Footnote -------------------------------------------------------------- */
.wsslug__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: stack panes below 720px ----------------------------------- */
@media (max-width: 720px) {
	.wsslug__panes { grid-template-columns: 1fr; }
	.wsslug__field { min-height: 96px; }
}
