/**
 * CNA Shade Finder — tool-specific styles.
 *
 * Loaded after cna-core.css / cna-core-fallback.css and depends on the
 * shared CSS custom properties those files define (--cna-primary,
 * --cna-text, --cna-line, --cna-radius, etc). Only layout and swatch-card
 * presentation specific to this tool live here.
 */

.cna-sf-progress {
	margin-top: 0;
	margin-bottom: 4px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	font-size: 0.74rem;
}

.cna-sf-question h3,
.cna-sf-filters h3 {
	margin-top: 0;
}

.cna-sf-options {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 16px 0;
}

.cna-sf-option {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	border: 1px solid var(--cna-line);
	border-radius: calc(var(--cna-radius) - 4px);
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.cna-sf-option:hover {
	border-color: var(--cna-primary);
	background: rgba(0, 0, 0, 0.015);
}

.cna-sf-option input[type='radio'] {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	accent-color: var(--cna-primary);
}

.cna-sf-option:has(input:checked) {
	border-color: var(--cna-primary);
	background: rgba(0, 0, 0, 0.02);
	font-weight: 600;
}

.cna-sf-confidence {
	margin: 6px 0 14px;
}

.cna-sf-family {
	margin-top: 22px;
	padding-top: 18px;
	border-top: 1px solid var(--cna-line);
}

.cna-sf-family:first-of-type {
	border-top: none;
	padding-top: 0;
}

.cna-sf-family h3 {
	margin-bottom: 2px;
}

.cna-sf-swatch-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
	gap: 14px;
	margin-top: 12px;
}

.cna-sf-swatch-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 6px;
}

.cna-sf-swatch-card .cna-swatch {
	--cna-swatch-size: 56px;
}

.cna-sf-swatch-brand {
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--cna-muted);
}

.cna-sf-swatch-name {
	font-size: 0.82rem;
	line-height: 1.25;
}

.cna-sf-approx-notice {
	margin-top: 18px;
	font-style: italic;
}

.cna-sf-suggestions:empty {
	display: none;
}

@media (max-width: 480px) {
	.cna-sf-swatch-grid {
		grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
	}
}

/* :has() isn't supported everywhere yet — keep the checked state visible via
   a fallback that doesn't depend on it (focus-within covers keyboard nav,
   and the radio's own accent-color already shows the selection). */
.cna-sf-option:focus-within {
	outline: 2px solid var(--cna-secondary);
	outline-offset: 2px;
}
