/*
 * aiandblog practice tests: modes, practice by area, timed mock, and the sticky
 * "Test yourself" CTA (desktop sidebar card + mobile bottom sheet). Draft, Nov 23 2026.
 * Loaded after practice-tests.css, only where the practice tests are visible.
 */

:root {
	--ab-pm-ink: var(--wp--preset--color--graphite, #12151b);
	--ab-pm-muted: var(--wp--preset--color--steel, #5f6a7d);
	--ab-pm-line: var(--wp--preset--color--line, #e2e6ed);
	--ab-pm-fog: var(--wp--preset--color--fog, #f3f5f8);
	--ab-pm-card: #ffffff;
	--ab-pm-brand: var(--wp--preset--color--indigo, #4b4ded);
	--ab-pm-brand-deep: var(--wp--preset--color--indigo-deep, #3536c9);
	--ab-pm-tint: #f2f1ff;
	--ab-pm-tint-line: #d9d6ff;
	--ab-pm-lime: var(--wp--preset--color--lime, #c6f36b);
	--ab-pm-warn: #b42318;
}

[data-theme="dark"] {
	--ab-pm-ink: #e8ebf1;
	--ab-pm-muted: #a3acbb;
	--ab-pm-line: #2b313c;
	--ab-pm-fog: #171b22;
	--ab-pm-card: #11151b;
	--ab-pm-tint: #1d1f3a;
	--ab-pm-tint-line: #34377a;
	--ab-pm-brand: #8f90ff;
	--ab-pm-brand-deep: #b3b4ff;
	--ab-pm-warn: #ff8a80;
}

/* ---------- Mode switch and practice by area ---------- */

.ab-tools {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 0.85rem;
	margin: 0 0 1.25rem;
	min-width: 0;
}

.ab-areas,
.ab-chips {
	min-width: 0;
}

.ab-cta-sheet .ab-btn,
.ab-cta-side .ab-btn {
	text-decoration: none;
}

.ab-tools[hidden],
.ab-mock[hidden],
.ab-cta-sheet[hidden] {
	display: none !important;
}

.ab-modes {
	display: inline-flex;
	gap: 0.25rem;
	padding: 0.25rem;
	border: 1px solid var(--ab-pm-line);
	border-radius: 999px;
	background: var(--ab-pm-fog);
	justify-self: start;
	max-width: 100%;
}

.ab-mode {
	appearance: none;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--ab-pm-muted);
	font: inherit;
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1.2;
	padding: 0.5rem 1rem;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	min-height: 40px;
}

.ab-mode.is-on {
	background: var(--ab-pm-card);
	color: var(--ab-pm-ink);
	box-shadow: 0 1px 3px rgba(18, 21, 27, 0.12);
}

.ab-mode:focus-visible,
.ab-chip:focus-visible,
.ab-cta-x:focus-visible,
.ab-link-btn:focus-visible {
	outline: 2px solid var(--ab-pm-brand);
	outline-offset: 2px;
}

.ab-mode-lock {
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--ab-pm-muted);
	border: 1px solid var(--ab-pm-line);
	border-radius: 999px;
	padding: 0.1rem 0.45rem;
}

.ab-areas-label {
	margin: 0 0 0.4rem;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--ab-pm-muted);
}

.ab-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
}

.ab-chip {
	appearance: none;
	border: 1px solid var(--ab-pm-line);
	border-radius: 999px;
	background: var(--ab-pm-card);
	color: var(--ab-pm-ink);
	font: inherit;
	font-size: 0.85rem;
	font-weight: 600;
	line-height: 1.25;
	padding: 0.45rem 0.8rem;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	min-height: 38px;
	text-align: left;
}

.ab-chip span {
	font-size: 0.75rem;
	font-weight: 700;
	color: var(--ab-pm-muted);
	background: var(--ab-pm-fog);
	border-radius: 999px;
	padding: 0.05rem 0.45rem;
}

.ab-chip:hover {
	border-color: var(--ab-pm-brand);
}

.ab-chip.is-on {
	background: var(--ab-pm-brand);
	border-color: var(--ab-pm-brand);
	color: #ffffff;
}

.ab-chip.is-on span {
	background: rgba(255, 255, 255, 0.2);
	color: #ffffff;
}

[data-theme="dark"] .ab-chip.is-on {
	color: #0d1015;
}

[data-theme="dark"] .ab-chip.is-on span {
	color: #0d1015;
}

@media (max-width: 600px) {
	.ab-chips {
		flex-wrap: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: thin;
		padding-bottom: 0.35rem;
		margin-right: -1rem;
		padding-right: 1rem;
	}

	.ab-chip {
		flex: 0 0 auto;
		white-space: nowrap;
	}

	.ab-modes {
		display: flex;
		width: 100%;
	}

	.ab-mode {
		flex: 1 1 0;
		justify-content: center;
	}
}

/* ---------- Timed mock ---------- */

.ab-mock {
	border: 1px solid var(--ab-pm-tint-line);
	background: var(--ab-pm-tint);
	border-radius: 14px;
	padding: clamp(1rem, 3vw, 1.5rem);
	margin: 0 0 1.25rem;
	color: var(--ab-pm-ink);
}

.ab-mock .ab-hub-kicker {
	margin: 0 0 0.35rem;
	display: block;
}

.ab-mock-h {
	margin: 0 0 0.6rem;
	font-size: clamp(1.15rem, 2.5vw, 1.4rem);
	line-height: 1.25;
}

.ab-mock p {
	margin: 0 0 0.8rem;
	line-height: 1.55;
}

.ab-mock-rules {
	margin: 0 0 1rem;
	padding-left: 1.2rem;
	line-height: 1.55;
}

.ab-mock-rules li + li {
	margin-top: 0.3rem;
}

.ab-mock-lock strong {
	color: var(--ab-pm-ink);
}

.ab-mock-meter {
	height: 10px;
	border-radius: 999px;
	background: var(--ab-pm-card);
	border: 1px solid var(--ab-pm-tint-line);
	overflow: hidden;
	margin: 0 0 0.8rem;
}

.ab-mock-meter span {
	display: block;
	height: 100%;
	min-width: 4px;
	background: var(--ab-pm-brand);
	border-radius: 999px;
}

.ab-quiz-head {
	flex-wrap: wrap;
	row-gap: 0.4rem;
}

.ab-timer {
	font-variant-numeric: tabular-nums;
	font-weight: 700;
	color: var(--ab-pm-ink);
	background: var(--ab-pm-fog);
	border: 1px solid var(--ab-pm-line);
	border-radius: 999px;
	padding: 0.2rem 0.65rem;
}

.ab-timer.is-low {
	color: var(--ab-pm-warn);
	border-color: currentColor;
}

.ab-link-btn {
	appearance: none;
	border: 0;
	background: none;
	padding: 0.2rem 0;
	font: inherit;
	font-size: 0.85rem;
	font-weight: 700;
	color: var(--ab-pm-brand);
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.ab-link-btn[data-armed="1"] {
	color: var(--ab-pm-warn);
}

.is-mock-run .ab-q-answer {
	display: none;
}

.ab-result-extra {
	color: var(--ab-pm-muted);
	margin: 0.25rem 0 0;
}

.ab-area-list li[hidden] {
	display: none;
}

/* ---------- Sticky CTA: desktop sidebar card ---------- */

.ab-side-stick > .ab-cta-side {
	margin: 0 0 1rem;
}

.ab-cta-side {
	margin-top: 1.25rem;
	padding: 1.1rem 1.1rem 1.2rem;
	border: 1px solid var(--ab-pm-tint-line);
	border-radius: 14px;
	background: var(--ab-pm-tint);
	color: var(--ab-pm-ink);
	z-index: 2;
}

.ab-cta-side .ab-hub-kicker {
	display: block;
	margin: 0 0 0.3rem;
}

.ab-cta-title {
	margin: 0 0 0.35rem;
	font-weight: 700;
	font-size: 1.05rem;
	line-height: 1.3;
}

.ab-cta-text {
	margin: 0 0 0.9rem;
	font-size: 0.9rem;
	line-height: 1.5;
	color: var(--ab-pm-muted);
}

@media (max-width: 781px) {
	.ab-cta-side {
		display: none;
	}
}

/* ---------- Sticky CTA: mobile bottom sheet ---------- */

.ab-cta-sheet {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 90;
	background: var(--ab-pm-card);
	color: var(--ab-pm-ink);
	border-top: 1px solid var(--ab-pm-line);
	border-radius: 16px 16px 0 0;
	box-shadow: 0 -8px 24px rgba(18, 21, 27, 0.12);
	padding: 0.45rem 1rem calc(0.7rem + env(safe-area-inset-bottom, 0px));
	transform: translateY(110%);
	transition: transform 0.25s ease;
	touch-action: pan-x;
}

.ab-cta-sheet.is-in {
	transform: translateY(0);
}

.ab-cta-grip {
	display: block;
	width: 40px;
	height: 4px;
	border-radius: 999px;
	background: var(--ab-pm-line);
	margin: 0 auto 0.45rem;
}

.ab-cta-sheet-in {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.ab-cta-sheet-t {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	line-height: 1.3;
}

.ab-cta-sheet-t strong {
	font-size: 0.95rem;
}

.ab-cta-sheet-t span {
	font-size: 0.8rem;
	color: var(--ab-pm-muted);
}

.ab-btn.ab-btn-sm {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	line-height: 1;
	padding: 0 1.1rem;
	font-size: 0.85rem;
	min-height: 40px;
	white-space: nowrap;
}

.ab-cta-x {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}

.ab-cta-x {
	appearance: none;
	border: 0;
	background: var(--ab-pm-fog);
	color: var(--ab-pm-muted);
	width: 36px;
	height: 36px;
	border-radius: 999px;
	font-size: 1.25rem;
	line-height: 1;
	cursor: pointer;
	flex: 0 0 auto;
}

@media (min-width: 782px) {
	.ab-cta-sheet {
		display: none !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ab-cta-sheet {
		transition: none;
	}
}

/* Leave room so the sheet never covers the last lines of the page. */
body.ab-sheet-on {
	padding-bottom: 76px;
}
