/**
 * ADHS-Selbsttest - Styles
 *
 * Uebernimmt bewusst die Design-Sprache von adhsgruppe.ch / Twenty Twenty-One:
 *
 * - Schriftgroesse: die Seite setzt --global--font-size-base auf 1.25rem (20px) bei
 *   Zeilenhoehe 1.7. Diese Datei rechnet deshalb NICHT in rem gegen die 16px-Root,
 *   sondern setzt die Komponentenbasis auf die Theme-Variable und verwendet innen em.
 *   Sonst rendert der Test rund 20 % zu klein und wirkt wie eine fremde Schrift.
 * - Buttons: rechteckig (border-radius 0), 3px Rahmen, 15px/30px Padding, Weight 500,
 *   #28303d auf #d1e4dd - identisch zu den wp-block-button__link der Seite.
 * - Ueberschriften: Weight 400 wie im Theme, nicht fett.
 *
 * Achtung bei em: nur eine Ebene tief relativ zum jeweiligen Elternelement rechnen,
 * sonst multiplizieren sich die Werte (siehe .adhs-test__gauge-value small).
 */

.adhs-test,
.adhs-test-faq,
.adhs-test-sources {
	--at-ink: var(--global--color-primary, #28303d);
	--at-ink-soft: #4f5a63;
	--at-mint: var(--global--color-background, #d1e4dd);
	--at-mint-soft: #e7f0ec;
	--at-surface: #ffffff;
	--at-surface-alt: #eef2f3;
	--at-line: #b7c6c1;
	--at-line-soft: #d7dfe0;
	--at-ok: #2c5f45;
	--at-warn: #8a5514;
	--at-alert: #8d3527;

	box-sizing: border-box;
	color: var(--at-ink);
	font-size: var(--global--font-size-base, 1.25rem);
	line-height: var(--global--line-height-body, 1.7);
	max-width: none;
	margin-inline: auto;
}

.adhs-test *,
.adhs-test *::before,
.adhs-test *::after,
.adhs-test-faq *,
.adhs-test-sources * {
	box-sizing: inherit;
}

/* ---------------------------------------------------------------- Karten */

.adhs-test__intro,
.adhs-test__form,
.adhs-test__result {
	background: var(--at-surface);
	border: 1px solid var(--at-line-soft);
	padding: clamp(1rem, 3.5vw, 1.9rem);
}

.adhs-test__noscript {
	background: var(--at-mint);
	border-left: 5px solid var(--at-ink);
	padding: 0.8em 1em;
	margin: 0 0 1em;
	font-size: 0.85em;
}

/* ----------------------------------------------------------------- Intro */

.adhs-test__eyebrow {
	margin: 0 0 0.5em;
	font-size: 0.7em;
	font-weight: 600;
	letter-spacing: 0.08em;
	line-height: 1.4;
	text-transform: uppercase;
	color: var(--at-ink-soft);
}

.adhs-test .adhs-test__title {
	margin: 0 0 0.5em;
	font-size: clamp(1.5em, 5vw, 1.9em);
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: normal;
}

.adhs-test__lead {
	margin: 0 0 1.2em;
	font-size: 0.9em;
	line-height: 1.6;
	color: var(--at-ink-soft);
}

.adhs-test__facts {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
	gap: 0.6em;
	list-style: none;
	margin: 0 0 1.4em;
	padding: 0;
}

.adhs-test__facts li {
	background: var(--at-mint-soft);
	padding: 0.8em 0.7em;
	text-align: center;
	line-height: 1.35;
}

.adhs-test__facts strong {
	display: block;
	font-size: 1.05em;
	font-weight: 600;
}

.adhs-test__facts span {
	display: block;
	font-size: 0.75em;
	color: var(--at-ink-soft);
	margin-top: 0.25em;
}

.adhs-test__note {
	margin: 1em 0 0;
	font-size: 0.8em;
	line-height: 1.5;
	color: var(--at-ink-soft);
}

/* --------------------------------------------------------------- Buttons
 *
 * Twenty Twenty-One stylt `button` innerhalb von .entry-content mit eigener
 * Hintergrund- und Textfarbe. Deshalb hoch spezifiziert (.adhs-test .adhs-test__btn)
 * und die Farben mit !important - sonst gewinnt das Eltern-Theme.
 * Masse exakt wie .wp-block-button__link der Seite.
 */

.adhs-test .adhs-test__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4em;
	padding: 0.6em 1.4em;
	border: 3px solid transparent;
	border-radius: 0;
	font-family: inherit;
	font-size: 0.9em;
	font-weight: 500;
	line-height: 1.35;
	letter-spacing: normal;
	text-transform: none;
	cursor: pointer;
	box-shadow: none;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.adhs-test .adhs-test__btn--primary {
	background-color: var(--at-ink) !important;
	border-color: var(--at-ink) !important;
	color: var(--at-mint) !important;
}

.adhs-test .adhs-test__btn--primary:hover,
.adhs-test .adhs-test__btn--primary:focus-visible {
	background-color: transparent !important;
	color: var(--at-ink) !important;
}

.adhs-test .adhs-test__btn--ghost {
	background-color: transparent !important;
	border-color: var(--at-ink) !important;
	color: var(--at-ink) !important;
}

.adhs-test .adhs-test__btn--ghost:hover,
.adhs-test .adhs-test__btn--ghost:focus-visible {
	background-color: var(--at-ink) !important;
	color: var(--at-mint) !important;
}

.adhs-test .adhs-test__btn[disabled] {
	opacity: 0.35;
	cursor: not-allowed;
}

.adhs-test .adhs-test__btn[disabled]:hover {
	background-color: var(--at-ink) !important;
	color: var(--at-mint) !important;
}

.adhs-test .adhs-test__btn--ghost[disabled]:hover {
	background-color: transparent !important;
	color: var(--at-ink) !important;
}

.adhs-test__btn:focus-visible,
.adhs-test-faq__item summary:focus-visible {
	outline: 3px solid var(--at-ink);
	outline-offset: 3px;
}

/* ------------------------------------------------------------ Fortschritt */

.adhs-test__progress {
	height: 6px;
	background: var(--at-surface-alt);
	overflow: hidden;
	margin-bottom: 0.7em;
}

.adhs-test__progress-bar {
	height: 100%;
	background: var(--at-ink);
	transition: width 0.3s ease;
}

.adhs-test__status {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1em;
	margin: 0 0 1.2em;
	font-size: 0.7em;
	line-height: 1.4;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--at-ink-soft);
}

.adhs-test__section {
	font-weight: 600;
	color: var(--at-ink);
}

.adhs-test__counter {
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- Fragen */

.adhs-test__question {
	border: 0;
	margin: 0;
	padding: 0;
	min-inline-size: 0;
}

/* Ohne JS bleiben alle Fragen als Liste sichtbar. */
.adhs-test:not(.is-enhanced) .adhs-test__question + .adhs-test__question {
	margin-top: 1.6em;
	padding-top: 1.6em;
	border-top: 1px solid var(--at-line-soft);
}

.adhs-test.is-enhanced .adhs-test__question {
	display: none;
}

.adhs-test.is-enhanced .adhs-test__question.is-active {
	display: block;
	animation: adhs-test-in 0.28s ease both;
}

@keyframes adhs-test-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.adhs-test .adhs-test__legend {
	display: flex;
	gap: 0.6em;
	padding: 0;
	margin-bottom: 1em;
	font-size: clamp(1.05em, 3vw, 1.25em);
	font-weight: 500;
	line-height: 1.35;
}

.adhs-test__qnum {
	flex: 0 0 auto;
	width: 1.7em;
	height: 1.7em;
	margin-top: 0.15em;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--at-mint);
	color: var(--at-ink);
	font-size: 0.6em;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.adhs-test__help {
	margin: -0.5em 0 1em 2.1em;
	font-size: 0.8em;
	line-height: 1.5;
	color: var(--at-ink-soft);
}

.adhs-test__options {
	display: grid;
	gap: 0.4em;
}

@media (min-width: 46rem) {
	.adhs-test__options:not(.adhs-test__options--stack) {
		grid-template-columns: repeat(5, 1fr);
	}
}

/*
 * Twenty Twenty-One gibt `label` ein eigenes --form--font-size (18px). Ohne das
 * explizite font-size:1em wuerden alle em-Werte darin gegen 18px statt gegen die
 * Komponentenbasis (20px) rechnen.
 */
.adhs-test .adhs-test__option {
	position: relative;
	display: flex;
	align-items: center;
	gap: 0.6em;
	min-height: 2.8em;
	padding: 0.6em 0.8em;
	font-size: 1em;
	font-weight: 400;
	background: var(--at-mint-soft);
	border: 2px solid transparent;
	cursor: pointer;
	transition: background-color 0.12s ease, border-color 0.12s ease;
}

@media (min-width: 46rem) {
	.adhs-test__options:not(.adhs-test__options--stack) .adhs-test__option {
		flex-direction: column;
		justify-content: center;
		gap: 0.3em;
		padding: 0.7em 0.3em;
		text-align: center;
	}
}

.adhs-test__option:hover {
	background: var(--at-mint);
}

.adhs-test__option input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	pointer-events: none;
}

.adhs-test__option-key {
	flex: 0 0 auto;
	width: 1.6em;
	height: 1.6em;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	border: 2px solid var(--at-line);
	font-size: 0.65em;
	font-weight: 600;
	color: var(--at-ink-soft);
	background: var(--at-surface);
}

/* Sichtbares Kaestchen fuer die Mehrfachauswahl. */
.adhs-test__option-box {
	flex: 0 0 auto;
	width: 1.1em;
	height: 1.1em;
	border: 2px solid var(--at-line);
	background: var(--at-surface);
	position: relative;
}

.adhs-test__option-box::after {
	content: "";
	position: absolute;
	left: 32%;
	top: 8%;
	width: 28%;
	height: 58%;
	border: solid var(--at-mint);
	border-width: 0 3px 3px 0;
	transform: rotate(45deg) scale(0);
	transition: transform 0.12s ease;
}

.adhs-test__option-label {
	font-size: 0.9em;
	line-height: 1.35;
}

.adhs-test__option:has(input:checked),
.adhs-test__option.is-checked {
	background: var(--at-mint);
	border-color: var(--at-ink);
}

.adhs-test__option:has(input:checked) .adhs-test__option-key,
.adhs-test__option.is-checked .adhs-test__option-key {
	background: var(--at-ink);
	border-color: var(--at-ink);
	color: var(--at-mint);
}

.adhs-test__option:has(input:checked) .adhs-test__option-label,
.adhs-test__option.is-checked .adhs-test__option-label {
	font-weight: 600;
}

.adhs-test__option:has(input:checked) .adhs-test__option-box,
.adhs-test__option.is-checked .adhs-test__option-box {
	background: var(--at-ink);
	border-color: var(--at-ink);
}

.adhs-test__option:has(input:checked) .adhs-test__option-box::after,
.adhs-test__option.is-checked .adhs-test__option-box::after {
	transform: rotate(45deg) scale(1);
}

/*
 * Bewusst :focus-visible statt :focus-within - das Script setzt den Fokus nach jedem
 * Schritt programmatisch auf die erste Option. Mit :focus-within saehe die erste
 * Antwort dadurch nach "bereits ausgewaehlt" aus, obwohl nichts angeklickt wurde.
 */
.adhs-test__option:has(input:focus-visible) {
	outline: 3px solid var(--at-ink);
	outline-offset: 2px;
}

.adhs-test__nav {
	display: flex;
	justify-content: space-between;
	gap: 0.6em;
	margin-top: 1.4em;
}

.adhs-test__hint {
	margin: 0.7em 0 0;
	font-size: 0.7em;
	color: var(--at-ink-soft);
	text-align: right;
}

@media (max-width: 45.99rem) {
	.adhs-test__hint {
		display: none;
	}
}

/* -------------------------------------------------------------- Ergebnis */

.adhs-test__verdict {
	padding: 1em 1.2em;
	margin-bottom: 1.4em;
	border-left: 6px solid var(--at-ink);
	background: var(--at-mint);
}

.adhs-test__verdict--alert {
	border-left-color: var(--at-alert);
	background: #f6e9e6;
}

.adhs-test__verdict--warn {
	border-left-color: var(--at-warn);
	background: #f7efe2;
}

.adhs-test__verdict--ok {
	border-left-color: var(--at-ok);
	background: #e4efe8;
}

.adhs-test .adhs-test__verdict h2 {
	margin: 0 0 0.4em;
	font-size: clamp(1.2em, 3.5vw, 1.5em);
	font-weight: 500;
	line-height: 1.25;
	letter-spacing: normal;
}

.adhs-test .adhs-test__verdict p {
	margin: 0;
	font-size: 0.85em;
	line-height: 1.6;
	color: var(--at-ink);
}

.adhs-test .adhs-test__result h3 {
	font-size: 0.8em;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--at-ink-soft);
	margin: 1.8em 0 0.7em;
	padding-bottom: 0.4em;
	border-bottom: 1px solid var(--at-line-soft);
}

.adhs-test .adhs-test__result h3:first-of-type {
	margin-top: 0;
}

/* Score-Skala mit Cut-off-Markierung */

.adhs-test__gauge {
	margin-bottom: 0.5em;
}

.adhs-test__gauge-head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1em;
	margin-bottom: 0.4em;
	font-size: 0.8em;
}

.adhs-test__gauge-value {
	font-size: 1.9em;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	line-height: 1;
}

/* Eltern ist .adhs-test__gauge-value (1.9em), daher klein rechnen. */
.adhs-test__gauge-value small {
	font-size: 0.45em;
	font-weight: 400;
	color: var(--at-ink-soft);
}

.adhs-test__gauge-track {
	position: relative;
	height: 16px;
	background: var(--at-surface-alt);
}

.adhs-test__gauge-fill {
	height: 100%;
	background: var(--at-ink);
	transition: width 0.5s ease;
}

.adhs-test__gauge-fill--alert {
	background: var(--at-alert);
}

.adhs-test__gauge-cut {
	position: absolute;
	top: -5px;
	bottom: -5px;
	width: 3px;
	background: var(--at-ink);
}

.adhs-test__gauge-legend {
	display: flex;
	justify-content: space-between;
	margin: 0.4em 0 0;
	font-size: 0.7em;
	color: var(--at-ink-soft);
}

/* Subskalen */

.adhs-test__bars {
	display: grid;
	gap: 0.9em;
	margin: 0;
	padding: 0;
	list-style: none;
}

.adhs-test__bar-head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1em;
	margin-bottom: 0.3em;
	font-size: 0.85em;
}

.adhs-test__bar-head strong {
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.adhs-test__bar-track {
	height: 12px;
	background: var(--at-surface-alt);
}

.adhs-test__bar-fill {
	height: 100%;
	background: var(--at-ink);
	transition: width 0.5s ease;
}

/* Kriterien-Checkliste */

.adhs-test__criteria {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.5em;
}

.adhs-test__criteria li {
	display: grid;
	grid-template-columns: 1.6em 1fr;
	gap: 0.7em;
	align-items: start;
	background: var(--at-mint-soft);
	padding: 0.7em 0.9em;
}

.adhs-test__criteria-mark {
	width: 1.6em;
	height: 1.6em;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 0.8em;
	font-weight: 700;
	color: #fff;
	background: var(--at-ink-soft);
}

.adhs-test__criteria li[data-met="yes"] .adhs-test__criteria-mark {
	background: var(--at-ok);
}

.adhs-test__criteria li[data-met="no"] .adhs-test__criteria-mark {
	background: #fff;
	color: var(--at-ink-soft);
	box-shadow: inset 0 0 0 2px var(--at-line);
}

.adhs-test__criteria-text strong {
	display: block;
	font-size: 0.85em;
	font-weight: 600;
	line-height: 1.4;
}

.adhs-test__criteria-text span {
	font-size: 0.8em;
	line-height: 1.5;
	color: var(--at-ink-soft);
}

/* Fliesstext, CTA, Aktionen */

.adhs-test__body {
	font-size: 0.85em;
	line-height: 1.65;
}

.adhs-test__body p {
	margin: 0 0 0.8em;
}

.adhs-test__body ul {
	margin: 0 0 0.8em;
	padding-left: 1.2em;
}

.adhs-test__body li {
	margin-bottom: 0.3em;
}

.adhs-test__cta {
	margin-top: 1.8em;
	padding: 1.1em 1.2em;
	background: var(--at-ink);
	color: var(--at-mint);
}

.adhs-test .adhs-test__cta h3 {
	margin: 0 0 0.4em;
	border: 0;
	padding: 0;
	color: var(--at-mint);
	font-size: 0.95em;
	font-weight: 600;
	letter-spacing: normal;
	text-transform: none;
}

.adhs-test .adhs-test__cta p {
	margin: 0 0 0.9em;
	color: rgba(209, 228, 221, 0.85);
	font-size: 0.82em;
	line-height: 1.6;
}

.adhs-test__cta-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6em;
}

.adhs-test .adhs-test__cta-links a {
	display: inline-flex;
	align-items: center;
	padding: 0.55em 1.3em;
	border: 3px solid var(--at-mint);
	background: var(--at-mint);
	color: var(--at-ink);
	font-size: 0.82em;
	font-weight: 500;
	line-height: 1.35;
	text-decoration: none;
}

.adhs-test .adhs-test__cta-links a:hover,
.adhs-test .adhs-test__cta-links a:focus-visible {
	background: transparent;
	color: var(--at-mint);
}

.adhs-test .adhs-test__cta-links a + a {
	background: transparent;
	color: var(--at-mint);
}

.adhs-test .adhs-test__cta-links a + a:hover,
.adhs-test .adhs-test__cta-links a + a:focus-visible {
	background: var(--at-mint);
	color: var(--at-ink);
}

.adhs-test__disclaimer {
	margin-top: 1.5em;
	padding-top: 1.1em;
	border-top: 1px solid var(--at-line-soft);
	font-size: 0.78em;
	line-height: 1.6;
	color: var(--at-ink-soft);
}

.adhs-test__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6em;
	margin-top: 1.3em;
}

/* --------------------------------------------------------- FAQ & Quellen */

.adhs-test-faq,
.adhs-test-sources {
	margin-top: 2.5em;
}

.adhs-test-faq h2,
.adhs-test-sources h2 {
	font-size: 1.3em;
	font-weight: 400;
	line-height: 1.25;
	margin: 0 0 0.7em;
}

.adhs-test-faq__item {
	border-bottom: 1px solid var(--at-line-soft);
}

.adhs-test-faq__item summary {
	cursor: pointer;
	padding: 0.7em 0;
	font-size: 0.9em;
	font-weight: 600;
	line-height: 1.4;
	list-style: none;
	display: flex;
	justify-content: space-between;
	gap: 1em;
	align-items: center;
}

.adhs-test-faq__item summary::-webkit-details-marker {
	display: none;
}

.adhs-test-faq__item summary::after {
	content: "+";
	flex: 0 0 auto;
	font-size: 1.2em;
	font-weight: 400;
	line-height: 1;
}

.adhs-test-faq__item[open] summary::after {
	content: "\2212";
}

.adhs-test-faq__item p {
	margin: 0 0 1em;
	font-size: 0.85em;
	line-height: 1.65;
	color: var(--at-ink-soft);
}

.adhs-test-sources ol {
	padding-left: 1.3em;
	font-size: 0.78em;
	line-height: 1.6;
	color: var(--at-ink-soft);
}

.adhs-test-sources li {
	margin-bottom: 0.6em;
}

.adhs-test-sources__note {
	font-size: 0.72em;
	line-height: 1.6;
	color: var(--at-ink-soft);
	border-top: 1px solid var(--at-line-soft);
	padding-top: 0.8em;
}

/* ------------------------------------------------------------- Bewegung */

@media (prefers-reduced-motion: reduce) {
	.adhs-test *,
	.adhs-test *::before,
	.adhs-test *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

/* --------------------------------------------------------------- Druck */

@media print {
	.adhs-test__intro,
	.adhs-test__form,
	.adhs-test__actions,
	.adhs-test-faq,
	.adhs-test__cta-links {
		display: none !important;
	}

	.adhs-test__result {
		border: 0;
		padding: 0;
	}

	.adhs-test__cta {
		background: none;
		color: #000;
		border: 1px solid #999;
	}

	.adhs-test .adhs-test__cta h3,
	.adhs-test .adhs-test__cta p {
		color: #000;
	}
}
