/**
 * Cover Type Quiz + type-vs-type pages.
 * Loads after fitment.css and reuses its card/verdict vocabulary — this file
 * only adds what the quiz needs: the question grid, the ranked result list and
 * the two-column comparison table.
 */

/* ---- Quiz form ---------------------------------------------------------- */

.ct-quiz {
	display: grid;
	gap: 1.25rem;
	margin-top: 1.75rem;
}

.ct-q {
	border: 1px solid var(--color-line);
	border-radius: var(--radius-lg, 14px);
	background: var(--color-bg-subtle);
	padding: 1.15rem 1.25rem;
}

.ct-q__label {
	font-family: var(--font-display, inherit);
	font-weight: 700;
	font-size: 1.05rem;
	line-height: 1.3;
}

.ct-q__help {
	margin-top: .35rem;
	font-size: .875rem;
	line-height: 1.55;
	color: var(--color-ink-2);
}

.ct-q__opts {
	display: grid;
	gap: .5rem;
	margin-top: .9rem;
}

/* Each option is a full-width hit target, so it works on a phone. */
.ct-opt {
	display: flex;
	align-items: flex-start;
	gap: .7rem;
	padding: .7rem .85rem;
	border: 1px solid var(--color-line);
	border-radius: 10px;
	background: var(--color-bg);
	cursor: pointer;
	transition: border-color .15s ease, background-color .15s ease;
}

.ct-opt:hover { border-color: var(--color-ink-2); }

.ct-opt input { margin-top: .2rem; flex: 0 0 auto; }

.ct-opt__l { font-weight: 600; line-height: 1.4; }

.ct-opt__note {
	display: block;
	margin-top: .2rem;
	font-size: .85rem;
	line-height: 1.5;
	color: var(--color-ink-2);
	font-weight: 400;
}

/* Checked state — :has() where supported, harmless where not. */
.ct-opt:has(input:checked) {
	border-color: var(--color-accent, #d97706);
	background: color-mix(in srgb, var(--color-accent, #d97706) 7%, var(--color-bg));
}

.ct-actions {
	display: flex;
	flex-wrap: wrap;
	gap: .75rem;
	align-items: center;
	margin-top: 1.5rem;
}

/* ---- Ranked results ----------------------------------------------------- */

.ct-results { display: grid; gap: .85rem; margin-top: 1.5rem; }

.ct-res {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: .5rem 1rem;
	align-items: start;
	padding: 1.1rem 1.25rem;
	border: 1px solid var(--color-line);
	border-radius: var(--radius-lg, 14px);
	background: var(--color-bg);
}

.ct-res--win {
	border-color: var(--color-accent, #d97706);
	border-width: 2px;
	background: color-mix(in srgb, var(--color-accent, #d97706) 5%, var(--color-bg));
}

.ct-res--out { opacity: .72; }

.ct-res__rank {
	font-family: var(--font-display, inherit);
	font-weight: 800;
	font-size: 1.35rem;
	line-height: 1;
	min-width: 2ch;
	color: var(--color-ink-2);
}

.ct-res--win .ct-res__rank { color: var(--color-accent, #d97706); }

.ct-res__name {
	font-family: var(--font-display, inherit);
	font-weight: 700;
	font-size: 1.15rem;
	line-height: 1.25;
}

.ct-res__tag {
	display: inline-block;
	margin-left: .5rem;
	padding: .12rem .5rem;
	border-radius: 999px;
	font-size: .7rem;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	vertical-align: middle;
	background: var(--color-accent, #d97706);
	color: #fff;
}

.ct-res__tag--out { background: var(--color-ink-2); }

.ct-res__body { grid-column: 2; }

.ct-res__short { margin-top: .3rem; color: var(--color-ink-2); line-height: 1.6; }

.ct-res__why {
	margin-top: .6rem;
	padding-left: 1.1rem;
	list-style: disc;
	font-size: .9rem;
	line-height: 1.6;
	color: var(--color-ink-2);
}

.ct-res__why strong { color: var(--color-ink); }

.ct-res__traits {
	display: flex;
	flex-wrap: wrap;
	gap: .4rem .9rem;
	margin-top: .7rem;
	font-size: .85rem;
	color: var(--color-ink-2);
	list-style: none;
	padding: 0;
}

.ct-res__traits strong { color: var(--color-ink); }

.ct-res__links { margin-top: .8rem; display: flex; flex-wrap: wrap; gap: 1rem; font-size: .9rem; }

/* ---- Head-to-head comparison -------------------------------------------- */

.ct-vs {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
	margin-top: 1.5rem;
}

@media (max-width: 640px) { .ct-vs { grid-template-columns: 1fr; } }

.ct-vscard {
	border: 1px solid var(--color-line);
	border-radius: var(--radius-lg, 14px);
	padding: 1.15rem 1.25rem;
	background: var(--color-bg-subtle);
}

.ct-vscard__name {
	font-family: var(--font-display, inherit);
	font-weight: 700;
	font-size: 1.2rem;
}

.ct-vscard__short { margin-top: .4rem; color: var(--color-ink-2); line-height: 1.6; }

.ct-vscard__best {
	margin-top: .8rem;
	padding-top: .8rem;
	border-top: 1px solid var(--color-line);
	font-size: .9rem;
	line-height: 1.6;
}

/* The comparison table scrolls on its own rather than pushing the page wide. */
.ct-table-wrap { overflow-x: auto; margin-top: 1.5rem; }

.ct-table { width: 100%; border-collapse: collapse; min-width: 34rem; }

.ct-table th,
.ct-table td {
	padding: .7rem .85rem;
	text-align: left;
	border-bottom: 1px solid var(--color-line);
	vertical-align: top;
	line-height: 1.5;
}

.ct-table thead th {
	font-family: var(--font-display, inherit);
	font-size: .95rem;
	border-bottom-width: 2px;
}

.ct-table tbody th {
	font-weight: 600;
	color: var(--color-ink-2);
	font-size: .9rem;
	white-space: nowrap;
}

.ct-table .ct-win { font-weight: 700; }

.ct-table .ct-win::after {
	content: "✓";
	margin-left: .4rem;
	color: var(--color-accent, #d97706);
}
