/*
 * Neurolink theme styles that theme.json cannot express.
 * Loaded on the front end and in the editor (add_editor_style).
 * Tokens: see theme.json (var(--wp--preset--color--*)).
 */

:root {
	--nl-radius: 6px;
	--nl-line-on-dark: rgba(172, 181, 160, 0.28);
	--nl-header-offset: 0px;
}

html {
	scroll-padding-top: 6rem;
	-webkit-text-size-adjust: 100%;
}

body {
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}

::selection {
	background: var(--wp--preset--color--green);
	color: var(--wp--preset--color--deep-green);
}

/* Focus: always visible, high contrast on light and dark backgrounds. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--wp--preset--color--green);
	outline-offset: 3px;
	border-radius: 2px;
}

.has-dark-green-background-color :where(a, button):focus-visible,
.has-deep-green-background-color :where(a, button):focus-visible,
.has-anthracite-background-color :where(a, button):focus-visible {
	outline-color: var(--wp--preset--color--white);
}

/* ---------- Header (fixed on scroll, per brief: "Kopfzeile fixiert") ---------- */

.site-header-part {
	position: sticky;
	top: 0;
	z-index: 100;
}

.admin-bar .site-header-part {
	top: 32px;
}

@media (max-width: 782px) {
	.admin-bar .site-header-part {
		top: 46px;
	}
}

@media (max-width: 600px) {
	.admin-bar .site-header-part {
		top: 0;
	}
}

.site-header {
	border-bottom: 1px solid var(--nl-line-on-dark);
}

.site-header__logo img,
.neurolink-logo img {
	display: block;
	height: auto;
	max-width: 100%;
}

.site-header__inner > .site-header__nav {
	margin-left: auto;
}

.site-header .wp-block-navigation-item,
.site-header .wp-block-navigation-item__content,
.site-header .wp-block-navigation-item__label {
	white-space: nowrap;
}

.site-header .wp-block-navigation__container {
	flex-wrap: nowrap;
	column-gap: 1.6rem;
}

/* Collapse to the overlay menu below 1000px (core switches at 600px). */
@media (min-width: 600px) and (max-width: 999px) {
	.site-header .wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex;
	}

	.site-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
		display: none;
	}
}

.site-header .wp-block-navigation a,
.site-header .wp-block-navigation .wp-block-navigation-item__content {
	text-decoration: none;
	color: var(--wp--preset--color--white);
}

.site-header .wp-block-navigation .wp-block-navigation-item__content:hover,
.site-header .wp-block-navigation .current-menu-item > .wp-block-navigation-item__content,
.site-header .wp-block-navigation .current-menu-ancestor > .wp-block-navigation-item__content {
	color: var(--wp--preset--color--green);
}

.site-header .wp-block-navigation .current-menu-item > .wp-block-navigation-item__content {
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 0.45em;
}

/* Dropdowns (desktop) */
.site-header .wp-block-navigation .wp-block-navigation__submenu-container {
	background: var(--wp--preset--color--deep-green) !important;
	color: var(--wp--preset--color--white) !important;
	border: 1px solid var(--nl-line-on-dark) !important;
	border-radius: var(--nl-radius);
	padding: 0.5rem 0;
	min-width: 15rem;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.site-header .wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	padding: 0.55rem 1.1rem;
}

/* Mobile overlay */
.site-header .wp-block-navigation__responsive-container.is-menu-open {
	padding: 1.5rem clamp(1rem, 4vw, 2.5rem);
}

.site-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	padding-top: 3rem;
	gap: 1.1rem;
	font-size: 1.15rem;
}

.site-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container {
	border: 0 !important;
	box-shadow: none;
	background: transparent !important;
	padding: 0.4rem 0 0 1rem;
	font-size: 1rem;
}

.site-header .wp-block-navigation__responsive-container-open,
.site-header .wp-block-navigation__responsive-container-close {
	color: var(--wp--preset--color--white);
	padding: 0.4rem;
}

/* Language switcher (Polylang block) */
.nl-lang {
	font-size: 0.8125rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	font-weight: 500;
}

.nl-lang ul {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 0;
	list-style: none;
	margin: 0;
	padding: 0;
}

.nl-lang li {
	display: flex;
	align-items: center;
	white-space: nowrap;
	margin: 0;
}

.nl-lang li + li::before {
	content: "";
	display: inline-block;
	width: 1px;
	height: 0.9em;
	background: var(--nl-line-on-dark);
	margin: 0 0.6rem;
	vertical-align: -0.1em;
}

.nl-lang a {
	color: var(--wp--preset--color--sage);
	text-decoration: none;
	padding: 0.35rem 0.1rem;
}

.nl-lang a:hover,
.nl-lang .current-lang a,
.nl-lang a[aria-current],
.nl-lang a[lang][aria-current="true"] {
	color: var(--wp--preset--color--white);
}

.nl-lang .current-lang a {
	text-decoration: underline;
	text-underline-offset: 0.4em;
	text-decoration-thickness: 2px;
	text-decoration-color: var(--wp--preset--color--green);
}

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

.site-footer p {
	margin: 0;
}

.site-footer .site-footer__logo {
	margin-bottom: 1.25rem;
}

.site-footer .wp-block-navigation a {
	text-decoration: none;
}

.site-footer .wp-block-navigation a:hover {
	text-decoration: underline;
}

.site-footer__rule {
	border-color: var(--nl-line-on-dark) !important;
	opacity: 1;
}

.site-footer__copy {
	color: var(--wp--preset--color--sage);
}

@media (max-width: 781px) {
	.site-footer .wp-block-navigation__container,
	.site-footer .wp-block-navigation {
		justify-content: flex-start !important;
	}
}

/* ---------- Page hero (inner pages) ---------- */

.page-hero .page-hero__title {
	color: var(--wp--preset--color--white);
	text-wrap: balance;
}

.page-hero .page-hero__lead,
.page-hero .page-hero__lead p {
	color: #C9D2BE;
	margin-top: 1rem;
}

.page-hero .page-hero__lead .wp-block-post-excerpt__more-text {
	display: none;
}

.page-content {
	padding-top: var(--wp--preset--spacing--60);
	padding-bottom: var(--wp--preset--spacing--70);
}

.page-content:has(> .alignfull:last-child) {
	padding-bottom: 0;
}

.page-content:has(> .alignfull:first-child) {
	padding-top: 0;
}

/* Full-width bands after regular content need their own spacing
   (bands carry an inline margin-top:0 so adjacent bands stay flush). */
.page-content > :not(.alignfull) + .alignfull {
	margin-block-start: var(--wp--preset--spacing--60) !important;
}

/* No gap between the last full-width band and the footer. */
.site-footer-part {
	margin-block-start: 0;
}

/* ---------- Block style variations ---------- */

/* Group / Cover: neural network motif */
.is-style-neural {
	background-image: url(../images/neural-on-dark.svg);
	background-repeat: no-repeat;
	background-position: right -6% center;
	background-size: min(62%, 820px) auto;
}

.page-hero.is-style-neural {
	background-size: min(46%, 640px) auto;
	background-position: right -4% center;
}

@media (max-width: 781px) {
	.is-style-neural {
		background-position: right -40% bottom -10%;
		background-size: 110% auto;
	}

	.is-style-neural:not(.page-hero) {
		background-image: linear-gradient(rgba(28, 52, 36, 0.55), rgba(28, 52, 36, 0.55)), url(../images/neural-on-dark.svg);
	}

	.page-hero.is-style-neural {
		background-size: 90% auto;
		background-position: right -30% bottom -20%;
		background-image: linear-gradient(rgba(28, 52, 36, 0.6), rgba(28, 52, 36, 0.6)), url(../images/neural-on-dark.svg);
	}
}

/* Group: card */
.wp-block-group.is-style-card {
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--nl-radius);
	padding: clamp(1.4rem, 3vw, 2rem);
	height: 100%;
}

.has-surface-background-color .wp-block-group.is-style-card {
	border-color: transparent;
}

/* Group: top rule (service teasers) */
.wp-block-group.is-style-topline {
	border-top: 3px solid var(--wp--preset--color--green-strong);
	padding-top: 1.6rem;
	height: 100%;
}

.has-dark-green-background-color .wp-block-group.is-style-topline,
.has-anthracite-background-color .wp-block-group.is-style-topline {
	border-top-color: var(--wp--preset--color--green);
}

/* Paragraph: eyebrow */
p.is-style-eyebrow {
	font-size: 0.8125rem;
	font-weight: 500;
	letter-spacing: 0.14em;
	line-height: 1.4;
	text-transform: uppercase;
	color: var(--wp--preset--color--olive-dark);
	margin-bottom: 0.75rem;
}

.has-dark-green-background-color p.is-style-eyebrow,
.has-deep-green-background-color p.is-style-eyebrow,
.has-anthracite-background-color p.is-style-eyebrow {
	color: var(--wp--preset--color--sage);
}

/* Home hero */
.nl-hero .nl-hero__title {
	max-width: 17ch;
	text-wrap: balance;
}

/* Paragraph: lead */
p.is-style-lead,
.is-style-lead p {
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.55;
}

.nl-hero p.is-style-lead {
	max-width: 42rem;
}

.has-dark-green-background-color p.is-style-lead {
	color: #C9D2BE;
}

/* List: chips */
ul.is-style-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	list-style: none;
	padding: 0;
	margin-left: 0;
}

ul.is-style-chips li {
	border: 1px solid var(--wp--preset--color--line);
	background: var(--wp--preset--color--white);
	border-radius: 999px;
	padding: 0.45rem 1rem;
	font-size: 0.9375rem;
	line-height: 1.4;
}

/* List: ruled */
ul.is-style-ruled,
ol.is-style-ruled {
	list-style: none;
	padding: 0;
	margin-left: 0;
	border-top: 1px solid var(--wp--preset--color--line);
}

.is-style-ruled li {
	padding: 0.9rem 0;
	border-bottom: 1px solid var(--wp--preset--color--line);
}

ol.is-style-ruled {
	counter-reset: nl-step;
}

ol.is-style-ruled li {
	counter-increment: nl-step;
}

ol.is-style-ruled li::before {
	content: counter(nl-step, decimal-leading-zero);
	display: inline-block;
	min-width: 2.5rem;
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600;
	font-size: 0.875rem;
	letter-spacing: 0.08em;
	color: var(--wp--preset--color--green-strong);
}

/* Quote: statement */
.wp-block-quote.is-style-statement {
	border: 0;
	padding: 0;
	margin: 0;
}

.wp-block-quote.is-style-statement p {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 500;
	font-size: clamp(1.45rem, 2.6vw, 2.1rem);
	line-height: 1.35;
	color: var(--wp--preset--color--dark-green);
	max-width: 48rem;
}

.wp-block-quote.is-style-statement cite {
	display: block;
	margin-top: 1rem;
	font-style: normal;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--anthracite-soft);
}

/* Heading: numbered step */
.wp-block-heading.is-style-step {
	border-left: 1px solid var(--nl-line-on-dark);
	padding-left: 1.25rem;
	font-size: var(--wp--preset--font-size--large);
	margin-top: 0;
}

.has-white-background-color .wp-block-heading.is-style-step,
.has-surface-background-color .wp-block-heading.is-style-step {
	border-left-color: var(--wp--preset--color--line);
}

/* ---------- Components used in page content ---------- */

/* Key figures */
.nl-facts .wp-block-column p:first-child {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600;
	font-size: clamp(1.7rem, 3vw, 2.2rem);
	line-height: 1.1;
	color: var(--wp--preset--color--dark-green);
	margin-bottom: 0.35rem;
}

.nl-facts .wp-block-column p:last-child {
	color: var(--wp--preset--color--anthracite-soft);
	font-size: 0.9375rem;
	margin-top: 0;
}

.nl-facts {
	border-bottom: 1px solid var(--wp--preset--color--line);
}

/* Step numbers */
.nl-step-number {
	font-family: var(--wp--preset--font-family--heading);
	font-size: 0.875rem !important;
	font-weight: 600;
	letter-spacing: 0.12em;
	color: var(--wp--preset--color--green);
	margin-bottom: 0.4rem !important;
}

/* Arrow links */
.nl-more a,
a.nl-more {
	font-weight: 600;
	text-decoration: none;
}

.nl-more a::after,
a.nl-more::after {
	content: " →";
}

.nl-more a:hover {
	text-decoration: underline;
}

/* Links on dark sections */
.has-dark-green-background-color a:where(:not(.wp-element-button)),
.has-anthracite-background-color a:where(:not(.wp-element-button)),
.has-deep-green-background-color a:where(:not(.wp-element-button)) {
	color: var(--wp--preset--color--green);
}

/* Buttons */
.wp-block-button .wp-block-button__link {
	transition: background-color 0.15s ease, color 0.15s ease;
}

.wp-block-button.is-style-outline > .wp-block-button__link {
	border: 1px solid currentColor;
	background: transparent;
	color: inherit;
	padding: calc(0.85rem - 1px) calc(1.5rem - 1px);
}

.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: rgba(255, 255, 255, 0.08);
}

.has-dark-green-background-color .wp-block-button:not(.is-style-outline) .wp-block-button__link:not(.has-background) {
	background: var(--wp--preset--color--green);
	color: var(--wp--preset--color--deep-green);
}

.has-dark-green-background-color .wp-block-button:not(.is-style-outline) .wp-block-button__link:not(.has-background):hover {
	background: var(--wp--preset--color--white);
}

/* People (shareholders) */
.nl-person .wp-block-heading {
	margin-bottom: 0.2rem;
}

.nl-person p {
	margin-top: 0;
}

/* Tables (legal page) */
.wp-block-table table {
	border-collapse: collapse;
	width: 100%;
}

.wp-block-table td,
.wp-block-table th {
	border: 0;
	border-bottom: 1px solid var(--wp--preset--color--line);
	padding: 0.7rem 1rem 0.7rem 0;
	text-align: left;
	vertical-align: top;
}

.wp-block-table td:first-child {
	color: var(--wp--preset--color--anthracite-soft);
	width: 40%;
}

/* Projects table: year · tasks · sector/company */
.wp-block-table.nl-projects th {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: 0.04em;
	color: var(--wp--preset--color--dark-green);
	border-bottom: 2px solid var(--wp--preset--color--dark-green);
}

.wp-block-table.nl-projects td:first-child,
.wp-block-table.nl-projects th:first-child {
	width: 8rem;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
	color: var(--wp--preset--color--green-strong);
	font-weight: 600;
}

.wp-block-table.nl-projects td:last-child,
.wp-block-table.nl-projects th:last-child {
	width: 32%;
	color: var(--wp--preset--color--anthracite-soft);
}

@media (max-width: 640px) {
	.wp-block-table.nl-projects thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
	}

	.wp-block-table.nl-projects tr {
		display: block;
		padding: 0.8rem 0;
		border-bottom: 1px solid var(--wp--preset--color--line);
	}

	.wp-block-table.nl-projects td,
	.wp-block-table.nl-projects td:first-child,
	.wp-block-table.nl-projects td:last-child {
		display: block;
		width: auto;
		border: 0;
		padding: 0.1rem 0;
		white-space: normal;
	}
}

/* Long words (German compounds) must not overflow on small screens. */
h1, h2, h3, h4 {
	overflow-wrap: break-word;
	hyphens: auto;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

@media print {
	.site-header-part,
	.site-footer-part {
		position: static;
	}

	.is-style-neural {
		background-image: none !important;
	}
}
