/**
 * Happy FAQs → Shortcodes and Templates.
 *
 * @since 3.0.0
 */
.ffw-sc-builder {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
	gap: 18px;
	align-items: start;
}

.ffw-sc-controls > .ffw-ui-card + .ffw-ui-card {
	margin-top: 18px;
}

.ffw-sc-output {
	position: sticky;
	top: 48px;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.ffw-sc-output > .ffw-ui-card + .ffw-ui-card {
	margin-top: 0;
}

.ffw-sc-sub {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid var(--ffw-line);
}

.ffw-sc-sublabel {
	display: block;
	margin-bottom: 8px;
	color: var(--ffw-muted);
	font-size: 12.5px;
	font-weight: 600;
}

.ffw-sc-code code {
	font-size: 13.5px !important;
	white-space: normal !important;
	word-break: break-all;
}

.ffw-app .ffw-sc-problem {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 10px 0 0;
	color: var(--ffw-warn);
	font-size: 12.5px;
	font-weight: 550;
}

.ffw-sc-code-card .ffw-ui-field-help {
	margin: 10px 0 0;
}

/* Picker. */
.ffw-sc-picker {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ffw-sc-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.ffw-sc-chip {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 4px 4px 10px;
	border-radius: 999px;
	background: var(--ffw-brand-soft);
	font-size: 12.5px;
	font-weight: 550;
}

.ffw-sc-chip button {
	display: inline-flex;
	padding: 3px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--ffw-ink);
	cursor: pointer;
}

.ffw-sc-chip button:hover {
	background: rgba(0, 0, 0, 0.08);
}

.ffw-sc-results {
	max-height: 220px;
	margin: 0;
	padding: 4px;
	overflow-y: auto;
	border: 1px solid var(--ffw-line);
	border-radius: 10px;
	list-style: none;
}

.ffw-sc-results li {
	margin: 0;
	padding: 0;
}

.ffw-sc-results li.ffw-ui-muted {
	padding: 8px 10px;
	font-size: 13px;
}

.ffw-sc-results button {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	margin: 0;
	padding: 8px 10px;
	border: 0;
	border-radius: 8px;
	background: none;
	color: var(--ffw-ink);
	font: inherit;
	font-size: 13.5px;
	text-align: left;
	cursor: pointer;
}

.ffw-sc-results button:hover {
	background: var(--ffw-tint);
}

.ffw-sc-results button.is-selected {
	background: var(--ffw-brand-soft);
}

.ffw-sc-check {
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	border: 1px solid var(--ffw-line-strong);
	border-radius: 5px;
	background: #fff;
}

.ffw-sc-results button.is-selected .ffw-sc-check {
	border-color: var(--ffw-black);
	background: var(--ffw-black);
	color: var(--ffw-brand);
}

.ffw-sc-result-title {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Reference. */
.ffw-sc-ref {
	margin: 6px 0 0;
	padding: 0;
	list-style: none;
}

.ffw-sc-ref li {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(220px, 340px);
	gap: 10px 24px;
	align-items: center;
	margin: 0;
	padding: 14px 22px;
	border-top: 1px solid var(--ffw-line);
}

.ffw-sc-ref-text strong {
	display: block;
	font-size: 13.5px;
}

.ffw-sc-ref-text span {
	color: var(--ffw-muted);
	font-size: 12.5px;
	line-height: 1.45;
}

/* Templates. */
.ffw-tpl-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 16px;
}

.ffw-tpl-card {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--ffw-line);
	border-radius: var(--ffw-radius);
	background: #fff;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ffw-tpl-card:hover {
	border-color: var(--ffw-faint);
	box-shadow: 0 6px 18px rgba(17, 17, 19, 0.08);
}

.ffw-tpl-card.is-active {
	border-color: var(--ffw-black);
	box-shadow: 0 0 0 1px var(--ffw-black);
}

.ffw-tpl-shot {
	position: relative;
	display: block;
	height: 170px;
	padding: 0;
	overflow: hidden;
	border: 0;
	border-bottom: 1px solid var(--ffw-line);
	background: var(--ffw-tint);
	cursor: zoom-in;
}

.ffw-tpl-shot img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top center;
}

.ffw-tpl-shot .ffw-ui-badge {
	position: absolute;
	top: 10px;
	left: 10px;
}

.ffw-tpl-body {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 12px 14px;
}

.ffw-tpl-body strong {
	font-size: 14px;
}

.ffw-tpl-body .ffw-ui-row {
	gap: 6px;
}

.ffw-tpl-live {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 260px;
	gap: 18px;
	align-items: start;
	margin-top: 18px;
}

.ffw-tpl-live-side p {
	color: var(--ffw-muted);
	font-size: 13px;
}

@media (max-width: 1200px) {
	.ffw-sc-builder,
	.ffw-tpl-live {
		grid-template-columns: minmax(0, 1fr);
	}

	.ffw-sc-output {
		position: static;
	}
}

@media (max-width: 782px) {
	.ffw-sc-ref li {
		grid-template-columns: minmax(0, 1fr);
		padding: 14px 16px;
	}
}
