/* Stazora Labs, hands-on (2026-11): the guess step on the Evidence Lab and KID Lab pages (inc/labs-hands-on.php):
   the guess card, its controls, the switch and the reveal. Roles from tokens.css only; loads on those four pages
   only (the panels of the Evidence Lab are in labs-hands-on-panels.css). The controls are printed with the hidden
   attribute and nothing here shows them. One rule hides content, the first: it needs the class the script adds
   once it has set up, and it is screen-only, so print always carries every answer. Pills follow the Labs hub's
   look (white capsule, blue when chosen) without loading the hub's sheets. */

@media screen {
	.stz-lab-on [data-lab-held]:not([data-lab-open]) {
		display: none;
	}
}

/* A revealed block comes in with a short rise. The selector outranks the page entrance in motion.css, so a block
   that site-motion.js had parked below the first screen plays this once instead of waiting for a scroll. */
@keyframes stz-lab-in {
	from {
		opacity: 0;
		transform: translateY(var(--stz-space-2));
	}
}

.stz-lab-on .wp-block-post-content > [data-lab-held][data-lab-open] {
	animation: stz-lab-in var(--stz-dur) var(--stz-ease) backwards;
	animation-delay: 0s;
}

.stz-lab-guess[hidden],
.stz-lab-all[hidden] {
	display: none;
}

/* ---- Guess block: an off-white card with the control, the two actions and the comparison line ---- */
.stz-lab-guess {
	box-sizing: border-box; /* the card, padding included, keeps the width of the text column */
	margin-block: var(--stz-space-5);
	padding: var(--stz-space-5);
	border-radius: var(--stz-radius-card);
	background: var(--stz-surface-2);
}

.stz-lab-choice {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.stz-lab-label {
	display: block;
	margin: 0 0 var(--stz-space-3);
	padding: 0;
	font-weight: var(--stz-fw-semibold);
	letter-spacing: var(--stz-track-body);
	line-height: var(--stz-lh-snug);
}

.stz-lab-field {
	display: inline-flex;
	align-items: center;
	gap: var(--stz-space-2);
	max-width: 100%;
	font-variant-numeric: var(--stz-numeric);
}

.stz-lab-field input {
	box-sizing: border-box;
	width: 11rem;
	max-width: 100%;
	min-height: var(--stz-hit);
	padding: 0 var(--stz-space-4);
	border: 1px solid var(--stz-hairline);
	border-radius: var(--stz-radius-control);
	background: var(--stz-surface);
	color: var(--stz-text);
	font: inherit;
	font-variant-numeric: var(--stz-numeric);
}

.stz-lab-range {
	display: flex;
	align-items: center;
	gap: var(--stz-space-4);
}

.stz-lab-range input {
	flex: 1;
	min-width: 0;
	height: var(--stz-hit);
	margin: 0;
	accent-color: var(--stz-cta);
}

.stz-lab-range output {
	min-width: 3.25rem;
	font-weight: var(--stz-fw-semibold);
	font-variant-numeric: var(--stz-numeric);
	text-align: right;
}

.stz-lab-pills {
	display: flex;
	flex-wrap: wrap;
	gap: var(--stz-space-2);
}

.stz-lab-pill {
	position: relative;
	display: inline-flex;
	max-width: 100%;
}

/* The native radio stays in place, invisible, over the whole pill: keyboard and screen readers get a real radio */
.stz-lab-pill input,
.stz-lab-switch input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.stz-lab-pill span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-height: var(--stz-hit);
	padding: var(--stz-space-2) var(--stz-space-5);
	border: 1px solid var(--stz-hairline);
	border-radius: var(--stz-radius-pill);
	background: var(--stz-surface);
	color: var(--stz-text);
	font: inherit;
	font-weight: var(--stz-fw-medium);
	line-height: var(--stz-lh-snug);
	-webkit-tap-highlight-color: transparent;
	transition: transform var(--stz-dur-press) var(--stz-ease-press), background-color var(--stz-dur-fade) var(--stz-ease), border-color var(--stz-dur-fade) var(--stz-ease), color var(--stz-dur-fade) var(--stz-ease);
}

.stz-lab-pill input:checked + span {
	border-color: var(--stz-cta);
	background: var(--stz-cta);
	color: var(--stz-on-cta);
}

.stz-lab-pill input:active + span,
.stz-lab-btn:active {
	transform: scale(0.97);
}

.stz-lab-btn,
.stz-lab-link {
	cursor: pointer;
}

.stz-lab-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--stz-space-2) var(--stz-space-4);
	margin: var(--stz-space-4) 0 0;
}

.stz-lab-btn {
	box-sizing: border-box;
	min-height: var(--stz-hit);
	padding: 0 var(--stz-space-6);
	border: 1px solid var(--stz-cta);
	border-radius: var(--stz-radius-pill);
	background: var(--stz-cta);
	color: var(--stz-on-cta);
	font: inherit;
	letter-spacing: var(--stz-track-lead);
	-webkit-tap-highlight-color: transparent;
	transition: transform var(--stz-dur-press) var(--stz-ease-press), background-color var(--stz-dur-fade) var(--stz-ease);
}

.stz-lab-btn:active {
	background: var(--stz-cta-press);
}

.stz-lab-link {
	min-height: var(--stz-hit);
	padding: 0 var(--stz-space-1);
	border: 0;
	background: none;
	color: var(--stz-link);
	font: inherit;
	font-weight: var(--stz-fw-semibold);
}

.stz-lab-line {
	margin: var(--stz-space-4) 0 0;
	font-weight: var(--stz-fw-semibold);
	line-height: var(--stz-lh-snug);
}

.stz-lab-line:empty {
	display: none;
}

.stz-lab-hint,
.stz-lab-tag,
.stz-lab-nojs,
.stz-lab-note,
.stz-lab-source {
	margin: var(--stz-space-3) 0 0;
	color: var(--stz-text-2);
	font-size: var(--stz-fs-footnote);
	line-height: var(--stz-lh-small);
}

/* ---- "Show all answers" and the other switches: a native checkbox with role="switch" under a drawn track ---- */
.stz-lab-all {
	margin-block: var(--stz-space-5);
}

.stz-lab-switch {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: var(--stz-space-3);
	min-height: var(--stz-hit);
	font-weight: var(--stz-fw-medium);
	cursor: pointer;
}

.stz-lab-switch__track {
	position: relative;
	flex: none;
	width: 3.25rem;
	height: 2rem;
	border-radius: var(--stz-radius-pill);
	background: var(--stz-dot-inactive); /* 5.07:1 on white, 4.66:1 on off-white */
	transition: background-color var(--stz-dur-fade) var(--stz-ease);
}

.stz-lab-switch__track::after {
	content: "";
	position: absolute;
	top: 0.25rem;
	left: 0.25rem;
	width: 1.5rem;
	height: 1.5rem;
	border-radius: 50%;
	background: var(--stz-surface);
	transition: transform var(--stz-dur) var(--stz-ease);
}

.stz-lab-switch input:checked + .stz-lab-switch__track {
	background: var(--stz-cta);
}

.stz-lab-switch input:checked + .stz-lab-switch__track::after {
	transform: translateX(1.25rem);
}

@media (hover: hover) and (pointer: fine) {
	.stz-lab-pill:hover span {
		border-color: var(--stz-hairline-hover);
	}

	.stz-lab-pill:hover input:checked + span {
		border-color: var(--stz-cta-hover);
		background: var(--stz-cta-hover);
	}

	.stz-lab-btn:hover {
		border-color: var(--stz-cta-hover);
		background: var(--stz-cta-hover);
	}

	.stz-lab-link:hover {
		text-decoration: underline;
	}
}

.stz-lab-pill input:focus-visible + span,
.stz-lab-switch input:focus-visible + .stz-lab-switch__track,
.stz-lab-btn:focus-visible,
.stz-lab-link:focus-visible,
.stz-lab-field input:focus-visible,
.stz-lab-range input:focus-visible {
	outline: 3px solid var(--stz-focus);
	outline-offset: 2px;
}

@media (prefers-contrast: more) {
	.stz-lab-guess {
		border: 1px solid var(--stz-ring);
	}

	.stz-lab-link {
		text-decoration: underline;
	}
}

@media (forced-colors: active) {
	.stz-lab-guess,
	.stz-lab-switch__track {
		border: 1px solid CanvasText;
	}

	.stz-lab-pill input:checked + span,
	.stz-lab-switch input:checked + .stz-lab-switch__track {
		forced-color-adjust: none;
		border-color: Highlight;
		background: Highlight;
		color: HighlightText;
	}

	.stz-lab-switch__track::after {
		background: CanvasText;
	}
}
