/**
 * Wānanga Theme – Komponenten-Styles (Frontend + Block-Editor).
 *
 * Farben, Schriften und Abstände kommen aus theme.json (CSS-Variablen
 * --wp--preset--*), damit Anpassungen im Website-Editor überall greifen.
 */

:root {
	--wananga-border-strong: color-mix(in srgb, var(--wp--preset--color--contrast) 14%, transparent);
	--wananga-primary-tint: color-mix(in srgb, var(--wp--preset--color--primary) 8%, transparent);
	--wananga-on-dark-08: color-mix(in srgb, var(--wp--preset--color--surface) 8%, transparent);
	--wananga-on-dark-18: color-mix(in srgb, var(--wp--preset--color--surface) 18%, transparent);
	--wananga-header-offset: 88px;
}

/* ---------- Basis ---------- */

html {
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--wananga-header-offset) + var(--wp-admin--admin-bar--height, 0px));
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4 {
	text-wrap: balance;
}

p {
	text-wrap: pretty;
}

a {
	transition: color 0.2s ease;
}

.wananga-lead {
	max-width: 520px;
}

/* Inline-Code als „Wiki-Link“-Chip, Farbe folgt einer evtl. gesetzten Textfarbe. */
:not(pre) > code {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.92em;
	color: var(--wp--preset--color--accent-dark);
	background: color-mix(in srgb, currentColor 13%, transparent);
	padding: 2px 5px;
	border-radius: 4px;
}

mark.has-inline-color > code {
	color: inherit;
}

kbd {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.65625rem;
	color: color-mix(in srgb, currentColor 60%, transparent);
	background: color-mix(in srgb, currentColor 12%, transparent);
	padding: 3px 7px;
	border-radius: 5px;
}

.wp-block-quote {
	margin: 0;
	padding-left: 10px;
	border-left: 2px solid var(--wp--preset--color--accent);
	font-size: var(--wp--preset--font-size--sm);
}

.wp-block-quote > * {
	margin: 0;
}

/* ---------- Header / Footer ---------- */

.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: var(--wp-admin--admin-bar--position-offset, 0px);
	z-index: 50;
}

.wananga-header {
	position: relative;
}

/* Hintergrund + Blur auf einem Pseudo-Element, damit das mobile Menü-Overlay
   (position: fixed) nicht vom Header eingeschlossen wird. */
.wananga-header::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: color-mix(in srgb, var(--wp--preset--color--base) 92%, transparent);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	border-bottom: 1px solid color-mix(in srgb, var(--wp--preset--color--contrast) 7%, transparent);
}

.wananga-header .wp-block-site-logo img,
.wananga-footer .wp-block-site-logo img {
	display: block;
	height: auto;
}

/* Sprachumschalter */
.wananga-lang {
	position: relative;
	font-size: var(--wp--preset--font-size--ms);
	line-height: 1.26;
}

.wananga-lang summary {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 9px 12px;
	border: 1px solid var(--wananga-border-strong);
	border-radius: 8px;
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--text-muted);
	font-weight: 600;
	list-style: none;
	cursor: pointer;
}

.wananga-lang summary::-webkit-details-marker {
	display: none;
}

.wananga-lang summary::after {
	content: "";
	width: 6px;
	height: 6px;
	margin-top: -3px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg);
}

.wananga-lang ul {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	z-index: 60;
	min-width: 150px;
	margin: 0;
	padding: 6px;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 10px;
	background: var(--wp--preset--color--surface);
	box-shadow: var(--wp--preset--shadow--card);
	list-style: none;
}

.wananga-lang li a {
	display: block;
	padding: 8px 10px;
	border-radius: 6px;
	color: var(--wp--preset--color--text-muted);
	font-weight: 500;
}

.wananga-lang li a:hover,
.wananga-lang li a[aria-current="true"] {
	background: var(--wananga-primary-tint);
	color: var(--wp--preset--color--primary);
}

.wananga-lang li a[aria-current="true"] {
	font-weight: 600;
}

@media (max-width: 599px) {
	.wananga-lang ul {
		right: auto;
		left: 0;
	}
}

/* Mittlere Breiten: Logo + Aktionen in Zeile 1, Navigation darunter. */
@media (min-width: 600px) and (max-width: 1099px) {
	.wananga-header .wp-block-navigation {
		order: 3;
		flex-basis: 100%;
		justify-content: flex-start;
	}
}

/* Footer bleibt auch auf kurzen Seiten am unteren Rand. */
.wp-site-blocks {
	display: flex;
	flex-direction: column;
	min-height: calc(100vh - var(--wp-admin--admin-bar--height, 0px));
}

.wp-site-blocks > main {
	flex: 1 0 auto;
}

.wp-site-blocks > footer.wp-block-template-part {
	margin-block-start: 0;
}

/* ---------- Buttons ---------- */

.wp-element-button,
.wp-block-button__link {
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.wp-block-button__link:hover {
	transform: translateY(-1px);
}

.wp-block-button.is-style-secondary .wp-block-button__link {
	background-color: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--contrast);
	border: 1px solid var(--wananga-border-strong);
}

.wp-block-button.is-style-secondary .wp-block-button__link.has-text-color {
	border-color: color-mix(in srgb, currentColor 25%, transparent);
}

.wp-block-button.is-style-gold .wp-block-button__link {
	background-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--dark);
	font-weight: 700;
}

.wp-block-button.is-style-gold .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--accent-light);
}

.wp-block-button.is-style-ghost .wp-block-button__link {
	background-color: var(--wananga-on-dark-08);
	color: var(--wp--preset--color--surface);
	border: 1px solid var(--wananga-on-dark-18);
}

.wp-block-button.is-style-ghost .wp-block-button__link:hover {
	background-color: var(--wananga-on-dark-18);
}

/* ---------- Absatz-Stile ---------- */

p.is-style-eyebrow {
	font-size: var(--wp--preset--font-size--xs);
	font-weight: 600;
	letter-spacing: 0.08em;
	line-height: 1.3;
	text-transform: uppercase;
}

p.is-style-pill {
	display: flex;
	align-items: center;
	gap: 8px;
	width: fit-content;
	padding: 6px 12px;
	border-radius: 999px;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--primary) 18%, transparent);
	background: var(--wananga-primary-tint);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	color: var(--wp--preset--color--primary);
	font-size: var(--wp--preset--font-size--xs);
	font-weight: 600;
	letter-spacing: 0.04em;
	line-height: 1.3;
	text-transform: uppercase;
}

p.is-style-pill::before {
	content: "";
	flex: none;
	width: 5px;
	height: 5px;
	border-radius: 999px;
	background: var(--wp--preset--color--accent);
}

p.is-style-badge,
p.is-style-chip {
	flex: none;
	width: fit-content;
	white-space: nowrap;
	color: var(--wp--preset--color--primary);
	font-weight: 600;
	line-height: 1.3;
}

p.is-style-badge {
	padding: 4px 9px;
	border-radius: 999px;
	background: color-mix(in srgb, currentColor 11%, transparent);
	font-size: 0.65625rem;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

p.is-style-chip {
	padding: 7px 12px;
	border-radius: 8px;
	background: color-mix(in srgb, currentColor 9%, transparent);
	font-size: 0.75rem;
}

p.is-style-callout {
	padding: 14px 16px;
	border-left: 2px solid var(--wp--preset--color--primary);
	border-radius: 0 10px 10px 0;
	background: color-mix(in srgb, var(--wp--preset--color--primary) 6%, transparent);
	font-size: var(--wp--preset--font-size--ms);
}

p.wananga-dot {
	display: flex;
	align-items: center;
	gap: 7px;
}

p.wananga-dot::before {
	content: "";
	flex: none;
	width: 6px;
	height: 6px;
	border-radius: 999px;
	background: var(--wp--preset--color--accent);
}

/* ---------- Gruppen-Stile ---------- */

.wp-block-group.is-style-card,
.wp-block-group.is-style-card-featured {
	box-sizing: border-box;
	padding: 28px;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 14px;
	background-color: var(--wp--preset--color--surface);
}

.wp-block-group.is-style-card-featured {
	border: 1.5px solid var(--wp--preset--color--primary);
	box-shadow: var(--wp--preset--shadow--card);
}

.wp-block-group.is-style-glass {
	overflow: hidden;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--surface) 90%, transparent);
	border-radius: 16px;
	background: color-mix(in srgb, var(--wp--preset--color--surface) 94%, transparent);
	-webkit-backdrop-filter: blur(16px);
	backdrop-filter: blur(16px);
	box-shadow: var(--wp--preset--shadow--glass);
}

.wananga-mock-bar {
	background: color-mix(in srgb, var(--wp--preset--color--surface) 70%, transparent);
}

.wp-block-group.is-style-box {
	box-sizing: border-box;
	padding: 22px;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 14px;
	background-color: var(--wp--preset--color--base);
}

/* ---------- Listen ---------- */

:where(ol.wp-block-list) li + li {
	margin-top: 0.6em;
}

ul.is-style-checklist {
	display: flex;
	flex-direction: column;
	gap: 9px;
	padding-left: 0;
	list-style: none;
	line-height: 1.4;
}

ul.is-style-checklist li {
	position: relative;
	padding-left: 1.3em;
}

ul.is-style-checklist li::before {
	content: "✓";
	position: absolute;
	left: 0;
}

.wananga-price {
	font-size: 0.8125rem;
	line-height: 1.2;
}

.wananga-price strong {
	margin-right: 2px;
	color: var(--wp--preset--color--contrast);
	font-size: 2.5rem;
	font-weight: 700;
	letter-spacing: -0.035em;
}

/* ---------- Icons (Sammlung „Wānanga“ = Linien-Icons) ---------- */

.wp-block-icon svg.wananga-icon path {
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.wp-block-icon.is-style-tile svg {
	width: 38px;
	height: 38px;
	padding: 9px;
	border-radius: 10px;
	background-color: color-mix(in srgb, currentColor 10%, transparent);
}

/* ---------- Bilder ---------- */

.wp-block-image.is-style-frame img {
	display: block;
	height: auto;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 14px;
	box-shadow: var(--wp--preset--shadow--card);
}

/* ---------- Vergleichstabelle ---------- */

.wp-block-table.is-style-comparison {
	overflow-x: auto;
}

.wp-block-table.is-style-comparison table {
	min-width: 860px;
	overflow: hidden;
	table-layout: fixed;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 14px;
	border-collapse: separate;
	border-spacing: 0;
	background: var(--wp--preset--color--surface);
	font-size: var(--wp--preset--font-size--ms);
	line-height: 1.45;
}

.wp-block-table.is-style-comparison th,
.wp-block-table.is-style-comparison td {
	padding: 13px 16px;
	border: 0;
	border-bottom: 1px solid var(--wp--preset--color--border);
	color: var(--wp--preset--color--text-muted);
	text-align: left;
	vertical-align: top;
}

.wp-block-table.is-style-comparison thead th {
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--text-subtle);
	font-size: var(--wp--preset--font-size--xs);
	font-weight: 600;
	letter-spacing: 0.07em;
	text-transform: uppercase;
}

.wp-block-table.is-style-comparison tbody tr:last-child td {
	border-bottom: 0;
}

.wp-block-table.is-style-comparison th:first-child,
.wp-block-table.is-style-comparison td:first-child {
	width: 28%;
	color: var(--wp--preset--color--contrast);
	font-weight: 600;
}

/* Zweite Spalte = eigenes Produkt, hervorgehoben. */
.wp-block-table.is-style-comparison th:nth-child(2),
.wp-block-table.is-style-comparison td:nth-child(2) {
	background: var(--wananga-primary-tint);
	color: var(--wp--preset--color--contrast);
}

.wp-block-table.is-style-comparison thead th:nth-child(2) {
	color: var(--wp--preset--color--primary);
}

.wp-block-table.is-style-comparison th:nth-child(2) {
	width: 21%;
}

/* Schmale Bildschirme: Tabelle scrollt seitlich, die Kriterien-Spalte bleibt stehen. */
@media (max-width: 781px) {
	.wp-block-table.is-style-comparison table {
		min-width: 760px;
		overflow: visible;
		font-size: var(--wp--preset--font-size--sm);
	}

	.wp-block-table.is-style-comparison th,
	.wp-block-table.is-style-comparison td {
		padding: 11px 12px;
	}

	.wp-block-table.is-style-comparison th:first-child,
	.wp-block-table.is-style-comparison td:first-child {
		position: sticky;
		left: 0;
		z-index: 1;
		width: 150px;
		background: var(--wp--preset--color--surface);
		box-shadow: 1px 0 0 var(--wp--preset--color--border);
	}

	.wp-block-table.is-style-comparison thead th:first-child {
		background: var(--wp--preset--color--base);
	}

	.wp-block-table.is-style-comparison th:nth-child(2) {
		width: 170px;
	}
}

.wp-block-table.is-style-comparison td mark {
	margin-right: 3px;
	font-size: 1.08em;
}

.wp-block-table.is-style-comparison figcaption {
	margin-top: 14px;
	color: var(--wp--preset--color--text-subtle);
	font-size: var(--wp--preset--font-size--xs);
	line-height: 1.6;
	text-align: left;
}

/* ---------- Details / FAQ ---------- */

.wananga-faq {
	border-top: 1px solid color-mix(in srgb, var(--wp--preset--color--contrast) 10%, transparent);
}

.wp-block-details {
	padding: 22px 0;
	border-bottom: 1px solid color-mix(in srgb, var(--wp--preset--color--contrast) 10%, transparent);
}

.wp-block-details summary {
	list-style: none;
	cursor: pointer;
	font-size: 1.0625rem;
	font-weight: 600;
	letter-spacing: -0.01em;
	line-height: 1.3;
}

.wp-block-details summary::-webkit-details-marker {
	display: none;
}

.wp-block-details > :not(summary) {
	max-width: 640px;
	margin-block: 12px 0;
	color: var(--wp--preset--color--text-muted);
	font-size: 0.90625rem;
	line-height: 1.7;
}

/* ---------- Tabs: Pills auf dunklem Hintergrund ---------- */

.wp-block-tabs.is-style-pills .wp-block-tab-list {
	gap: 8px;
}

.wp-block-tabs.is-style-pills .wp-block-tab-list button,
.wp-block-tabs.is-style-pills .wp-block-tab-list .wp-block-tab-list__tab {
	padding: 9px 16px;
	border: 1px solid var(--wananga-on-dark-18);
	border-radius: 999px;
	background: var(--wananga-on-dark-08);
	color: color-mix(in srgb, var(--wp--preset--color--surface) 82%, transparent);
	font-size: 0.8125rem;
	font-weight: 500;
	line-height: 1.3;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.wp-block-tabs.is-style-pills .wp-block-tab-list button[aria-selected="true"],
.wp-block-tabs.is-style-pills .wp-block-tab-list .is-active {
	border-color: var(--wp--preset--color--surface);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--dark);
	font-weight: 600;
}

.wp-block-tabs.is-style-pills .wp-block-tab-list button::before {
	display: none;
}

.wp-block-tabs.is-style-pills .wp-block-tab-panels {
	padding: clamp(18px, 2.5vw, 28px);
	border-radius: 18px;
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--contrast);
	box-shadow: var(--wp--preset--shadow--panel);
}

/* ---------- Produkt-Mockups ---------- */

.wananga-graph {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 360px;
	overflow: hidden;
	border-radius: 14px;
	background: var(--wp--preset--color--dark);
	color: var(--wp--preset--color--surface);
}

.wananga-graph::before {
	content: "";
	position: absolute;
	inset: 0;
	opacity: 0.18;
	background-image: radial-gradient(color-mix(in srgb, var(--wp--preset--color--accent) 90%, transparent) 1px, transparent 1px);
	background-size: 26px 26px;
}

.wp-block-group.wananga-graph > *,
.wp-block-group.wananga-graph__hub > * {
	margin: 0;
}

.wananga-graph__hub {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3px;
	padding: 16px 20px;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--accent) 70%, transparent);
	border-radius: 12px;
	background: var(--wp--preset--color--primary);
	text-align: center;
}

/* Spezifität bewusst höher: der Editor setzt Blöcke sonst auf position: relative. */
.wp-block-group.wananga-graph > .wananga-graph__node {
	position: absolute;
	z-index: 2;
	padding: 9px 13px;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--surface) 16%, transparent);
	border-radius: 10px;
	background: color-mix(in srgb, var(--wp--preset--color--surface) 9%, transparent);
	font-size: 0.78125rem;
	line-height: 1.3;
}

.wp-block-group.wananga-graph > .wananga-graph__node:nth-of-type(1) {
	top: 22%;
	left: 12%;
}

.wp-block-group.wananga-graph > .wananga-graph__node:nth-of-type(2) {
	top: 26%;
	right: 12%;
}

.wp-block-group.wananga-graph > .wananga-graph__node:nth-of-type(3) {
	bottom: 20%;
	left: 24%;
}

.wp-block-group.wananga-graph > .wananga-graph__node:nth-of-type(4) {
	right: 20%;
	bottom: 22%;
}

@media (max-width: 600px) {
	.wp-block-group.wananga-graph > .wananga-graph__node:nth-of-type(n) {
		padding: 7px 10px;
		font-size: 0.71875rem;
	}

	.wp-block-group.wananga-graph > .wananga-graph__node:nth-of-type(1) {
		top: 8%;
		left: 5%;
	}

	.wp-block-group.wananga-graph > .wananga-graph__node:nth-of-type(2) {
		top: 21%;
		right: 5%;
	}

	.wp-block-group.wananga-graph > .wananga-graph__node:nth-of-type(3) {
		bottom: 21%;
		left: 5%;
	}

	.wp-block-group.wananga-graph > .wananga-graph__node:nth-of-type(4) {
		right: 5%;
		bottom: 8%;
	}
}

.wananga-search__field {
	padding: 13px 15px;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--surface) 14%, transparent);
	border-radius: 10px;
	background: var(--wananga-on-dark-08);
}

.wananga-search__result {
	padding: 14px 16px;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--surface) 10%, transparent);
	border-radius: 10px;
	background: color-mix(in srgb, var(--wp--preset--color--surface) 5%, transparent);
}

/* ---------- Registrierungs-Formular ---------- */

.wananga-signup-form {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-block-end: 0;
}

.wananga-signup-form label {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 600;
	line-height: 1.3;
}

.wananga-signup-form input,
.wananga-signup-form select {
	box-sizing: border-box;
	width: 100%;
	padding: 11px 13px;
	border: 1px solid var(--wananga-border-strong);
	border-radius: 9px;
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--contrast);
	font-family: inherit;
	font-size: var(--wp--preset--font-size--md);
	font-weight: 400;
	line-height: 1.3;
}

.wananga-signup-form select {
	color: var(--wp--preset--color--text-muted);
}

.wananga-signup-form input:focus-visible,
.wananga-signup-form select:focus-visible {
	outline: none;
	border-color: var(--wp--preset--color--primary);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--wp--preset--color--primary) 18%, transparent);
}

.wananga-signup-form button {
	width: 100%;
	margin-top: 4px;
	padding: 13px;
	border-radius: 9px;
	font-size: var(--wp--preset--font-size--md);
	cursor: pointer;
}

.wananga-signup-form__status {
	margin: 0;
	padding: 10px 12px;
	border-radius: 9px;
	background: var(--wananga-primary-tint);
	color: var(--wp--preset--color--primary);
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 600;
	line-height: 1.4;
}
