/* Font generator — mobile-first. The composer (input + emoji picker) is
 * sticky so it stays reachable while scrolling through 50+ style cards. */

.ldh-tool__composer {
	position: sticky;
	top: 0;
	z-index: 10;
	background: var(--ldh-color-surface);
	border: 1px solid var(--ldh-color-border);
	border-radius: 20px;
	padding: var(--ldh-space-md);
	margin-top: var(--ldh-space-md);
}

.ldh-tool__input-wrap {
	position: relative;
}

/* Floating, uppercase label that overlaps the input's top border — same
 * pattern as the composer's own field labels elsewhere on the theme. */
.ldh-tool__input-label {
	position: absolute;
	top: -9px;
	left: 16px;
	padding: 0 8px;
	background: var(--ldh-color-surface);
	font-family: var(--ldh-font-mono);
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--ldh-color-muted);
}

.ldh-tool__input {
	width: 100%;
	min-height: 0;
	padding: 20px 56px 20px 20px;
	font-size: 20px; /* also prevents iOS Safari auto-zoom on focus */
	font-weight: 500;
	letter-spacing: -0.01em;
	border: 1px solid var(--ldh-color-border);
	border-radius: 14px;
	background: var(--ldh-color-bg);
	color: var(--ldh-color-text);
}

.ldh-tool__input:focus {
	outline: 2px solid var(--ldh-color-accent);
	outline-offset: 2px;
}

.ldh-tool__clear {
	position: absolute;
	top: 50%;
	right: 12px;
	transform: translateY(-50%);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--ldh-color-muted);
	cursor: pointer;
	transition: background-color 200ms ease, color 200ms ease;
}

.ldh-tool__clear:hover,
.ldh-tool__clear:focus-visible {
	background: var(--ldh-color-bg);
	color: var(--ldh-color-text);
}

.ldh-tool__results {
	display: grid;
	width: 100%;
	grid-template-columns: 100%;
	gap: 12px;
	margin-top: var(--ldh-space-md);
	padding-bottom: var(--ldh-space-lg);
}

.ldh-style-card {
	display: grid;
	grid-template-columns: 1fr auto;
	column-gap: var(--ldh-space-md);
	row-gap: var(--ldh-space-xs);
	padding: var(--ldh-space-md);
	border: 1px solid var(--ldh-color-border);
	border-radius: var(--ldh-radius);
	background: var(--ldh-color-surface);
}

.ldh-style-card__label {
	grid-column: 1;
	grid-row: 1;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	color: var(--ldh-color-muted);
}

.ldh-style-card__preview {
	grid-column: 1;
	grid-row: 2;
	font-size: 18px;
	line-height: 1.4;
	word-break: break-word;
}

.ldh-style-card__copy {
	grid-column: 2;
	grid-row: 1 / 3;
	align-self: center;
	justify-self: end;
	display: inline-flex;
	align-items: center;
	gap: var(--ldh-space-xs);
	min-height: 44px;
	min-width: 44px;
	padding: 0 var(--ldh-space-sm);
	border: 1px solid var(--ldh-color-accent);
	border-radius: var(--ldh-radius-sm);
	background: transparent;
	color: var(--ldh-color-accent);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease;
}

.ldh-style-card__copy:hover,
.ldh-style-card__copy:focus-visible {
	background: var(--ldh-color-accent);
	color: #ffffff;
}

.ldh-style-card__copy.is-copied {
	background: var(--ldh-color-success);
	border-color: var(--ldh-color-success);
	color: #ffffff;
}

/* Emoji decoration picker — injected by hub-common.js, absent entirely
 * when JS is disabled (progressive enhancement, no SSR footprint). */

/* Sits inside .ldh-tool__composer, under a divider — same bordered box
 * as the input, not a separate floating card. */
.ldh-emoji-panel {
	margin-top: var(--ldh-space-md);
	padding-top: var(--ldh-space-md);
	border-top: 1px solid var(--ldh-color-border);
}

.ldh-emoji-panel__toggle {
	display: inline-flex;
	align-items: center;
	gap: var(--ldh-space-xs);
	min-height: 40px;
	padding: 0 var(--ldh-space-md);
	border: 1px solid var(--ldh-color-border);
	border-radius: 999px;
	background: var(--ldh-color-bg);
	color: var(--ldh-color-text);
	font-size: 14px;
	font-weight: 600;
}

.ldh-emoji-panel__toggle.is-open {
	border-color: var(--ldh-color-accent);
	background: var(--ldh-color-accent);
	color: #ffffff;
}

.ldh-emoji-panel__body {
	margin-top: var(--ldh-space-md);
}

.ldh-emoji-panel__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--ldh-space-sm);
	margin-bottom: var(--ldh-space-xs);
}

.ldh-emoji-panel__chips-label {
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	color: var(--ldh-color-muted);
}

.ldh-emoji-panel__show-all {
	flex: 0 0 auto;
	border: 0;
	background: transparent;
	color: var(--ldh-color-accent);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	min-height: 32px;
	padding: 0 var(--ldh-space-xs);
}

.ldh-emoji-panel__show-all:hover,
.ldh-emoji-panel__show-all:focus-visible {
	text-decoration: underline;
}

.ldh-emoji-panel__chips {
	display: flex;
	flex-wrap: wrap;
	gap: var(--ldh-space-xs);
	min-height: 32px;
	margin-bottom: var(--ldh-space-sm);
}

.ldh-emoji-panel__chips[hidden] {
	display: none;
}

.ldh-emoji-panel__chip {
	display: inline-flex;
	align-items: center;
	gap: var(--ldh-space-xs);
	padding: var(--ldh-space-xs) var(--ldh-space-sm);
	border-radius: 999px;
	background: var(--ldh-color-bg);
	border: 1px solid var(--ldh-color-border);
	font-size: 16px;
}

.ldh-emoji-panel__chip-remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--ldh-color-muted);
	font-size: 12px;
	line-height: 1;
	cursor: pointer;
}

.ldh-emoji-panel__chip-remove:hover,
.ldh-emoji-panel__chip-remove:focus-visible {
	background: var(--ldh-color-border);
	color: var(--ldh-color-text);
}

.ldh-emoji-panel__categories {
	display: flex;
	gap: var(--ldh-space-xs);
	overflow-x: auto;
	padding-bottom: var(--ldh-space-xs);
	margin-bottom: var(--ldh-space-sm);
	border-bottom: 1px solid var(--ldh-color-border);
}

.ldh-emoji-panel__category {
	flex: 0 0 auto;
	min-height: 36px;
	padding: 0 var(--ldh-space-sm);
	border: 0;
	border-radius: var(--ldh-radius-sm);
	background: transparent;
	color: var(--ldh-color-muted);
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
	cursor: pointer;
}

.ldh-emoji-panel__category.is-active {
	background: var(--ldh-color-accent);
	color: #ffffff;
}

.ldh-emoji-panel__palette {
	display: flex;
	flex-wrap: nowrap;
	gap: var(--ldh-space-xs);
	overflow-x: auto;
	padding-bottom: var(--ldh-space-xs);
}

.ldh-emoji-panel__item {
	flex: 0 0 auto;
	min-width:35px;
	min-height: 35px;
	padding: 0 var(--ldh-space-sm);
	border: 1px solid var(--ldh-color-border);
	border-radius: var(--ldh-radius-sm);
	background: var(--ldh-color-bg);
	color: var(--ldh-color-text);
	font-size: 16px;
	cursor: pointer;
}

.ldh-emoji-panel__item.is-selected {
	border-color: var(--ldh-color-accent);
	background: var(--ldh-color-accent);
	color: #ffffff;
}

/* "Ver todos" — every category stacked with its own heading, items
 * wrapping instead of the single-row horizontal scroll used above. */

.ldh-emoji-panel__palette.is-expanded {
	display: block;
	max-height: 320px;
}

.ldh-emoji-panel__section + .ldh-emoji-panel__section {
	margin-top: var(--ldh-space-sm);
}

.ldh-emoji-panel__section-title {
	font-size: 13px;
	font-weight: 700;
	color: var(--ldh-color-text);
	margin-bottom: var(--ldh-space-xs);
}

.ldh-emoji-panel__section-items {
	display: flex;
	flex-wrap: wrap;
	gap: var(--ldh-space-xs);
}
