/**
 * GM3DTechnology – Markenregeln, die theme.json nicht abdecken kann.
 * Quelle: Markenhandbuch 1.0, November 2026.
 */

:root {
	/* Schenkel a der 30°-Fase. Wird von fase.js je Element exakt gesetzt,
	   das hier ist nur der Wert ohne JavaScript. */
	--fase-a: clamp(12px, 3.5vw, 48px);
	--gm3d-linie: var(--wp--custom--linie, #D9DBDD);
}

/* ---------- Text ---------- */

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

strong,
b {
	font-weight: 600;
}

/* Archivo Expanded ist breit: lange deutsche Wörter dürfen auf kleinen
   Bildschirmen trennen statt überzulaufen. */
:where(h1, h2) {
	hyphens: auto;
	overflow-wrap: break-word;
	text-wrap: balance;
}

:where(p, li) {
	text-wrap: pretty;
}

a {
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

a:hover {
	text-decoration-thickness: 2px;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--wp--preset--color--markenviolett);
	outline-offset: 3px;
}

/* ---------- 30°-Fase ----------
 * Immer oben rechts, immer nur eine Ecke.
 * Waagerechter Schenkel a, senkrechter Schenkel a · tan 30°.
 * a = 20 % der kürzeren Seite, bei Buttons ⅓ der Höhe.
 */

.wp-block-group.is-style-fase,
.wp-block-cover.is-style-fase,
.wp-block-image.is-style-fase img,
.wp-block-button:not(.is-style-outline) > .wp-block-button__link,
.wp-block-table.is-style-fase thead th:last-child,
.wp-block-file__button {
	clip-path: polygon(
		0 0,
		calc(100% - var(--fase-a)) 0,
		100% calc(var(--fase-a) * 0.57735),
		100% 100%,
		0 100%
	);
}

/* Buttons: a = ⅓ der Höhe (3rem Höhe → 1rem). */
.wp-block-button:not(.is-style-outline) > .wp-block-button__link,
.wp-block-file__button {
	--fase-a: 1rem;
}

/* clip-path schneidet den Fokusrahmen ab – er sitzt deshalb am Wrapper. */
.wp-block-button:not(.is-style-outline) > .wp-block-button__link:focus-visible {
	outline: none;
}

.wp-block-button:not(.is-style-outline):has(> .wp-block-button__link:focus-visible) {
	outline: 2px solid var(--wp--preset--color--markenviolett);
	outline-offset: 3px;
}

/* Fase und runde Ecken nie mischen. */
.is-style-fase,
.is-style-fase img,
.wp-block-button__link {
	border-radius: 0 !important;
}

/* ---------- Sekundärer Button: Kontur, ohne Fase ---------- */

.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent;
	border: 1.5px solid currentColor;
	color: var(--wp--preset--color--graphit);
	padding: calc(0.875rem - 1.5px) calc(1.5rem - 1.5px);
}

.wp-block-button.is-style-outline > .wp-block-button__link:hover,
.wp-block-button.is-style-outline > .wp-block-button__link:focus-visible {
	background: transparent;
	color: var(--wp--preset--color--tiefviolett);
}

/* ---------- Tabellen wie im Datenblatt: nur Zeilenlinien ---------- */

.wp-block-table table {
	border-collapse: collapse;
	font-variant-numeric: tabular-nums;
	width: 100%;
}

.wp-block-table table th,
.wp-block-table table td {
	border: 0;
	border-bottom: 1px solid var(--gm3d-linie);
	padding: 0.6em 1em 0.6em 0;
	text-align: left;
	vertical-align: top;
}

/* Schmale Bildschirme: Spalten nach Inhalt statt 50/50, Wörter trennen statt brechen. */
@media (max-width: 600px) {
	.wp-block-table table {
		table-layout: auto;
	}
}

.wp-block-table table th,
.wp-block-table table td {
	hyphens: auto;
	overflow-wrap: normal;
}

.wp-block-table table thead,
.wp-block-table table tfoot {
	border: 0;
}

.wp-block-table th {
	font-weight: 600;
}

/* Stil „Fase“: Tabellenkopf in Graphit mit Fase oben rechts. */
.wp-block-table.is-style-fase table thead th {
	background: var(--wp--preset--color--graphit);
	border-bottom: 0;
	color: var(--wp--preset--color--weiss);
	padding-left: 1em;
}

.wp-block-table.is-style-fase table tbody td {
	padding-left: 1em;
}

.wp-block-table figcaption {
	color: var(--wp--preset--color--textgrau);
	font-size: var(--wp--preset--font-size--beschriftung);
}

/* ---------- Kopf- und Fußzeile ---------- */

.gm3d-logo img {
	display: block;
	height: auto;
	width: clamp(170px, 20vw, 240px);
}

.gm3d-logo--fuss img {
	width: clamp(170px, 18vw, 220px);
}

.wp-block-navigation .wp-block-navigation-item__content {
	text-underline-offset: 0.3em;
}

.wp-block-navigation .current-menu-item > .wp-block-navigation-item__content {
	text-decoration: underline;
	text-decoration-color: var(--wp--preset--color--markenviolett);
	text-decoration-thickness: 2px;
}

/* ---------- Linien und Zitate ---------- */

.wp-block-separator {
	border: 0;
	border-top: 1px solid currentColor;
	opacity: 1;
}

.wp-block-separator:where(:not(.has-text-color):not(.has-background)) {
	color: var(--gm3d-linie);
}

.wp-block-quote {
	border-left: 2px solid var(--wp--preset--color--markenviolett);
	padding-left: var(--wp--preset--spacing--30);
}

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

.wp-block-image img {
	height: auto;
}

/* Keine Schatten, keine Verläufe – auch nicht durch Fremd-CSS. */
.wp-block-group,
.wp-block-cover,
.wp-block-image img,
.wp-block-button__link {
	box-shadow: none !important;
}

/* ---------- Dachzeile ---------- */

.is-style-dachzeile {
	color: var(--wp--preset--color--markenviolett);
	font-size: var(--wp--preset--font-size--beschriftung);
	font-weight: 600;
	letter-spacing: 0.01em;
}

/* ---------- Dunkle und violette Flächen ---------- */

.has-graphit-background-color a:not(.wp-element-button),
.has-tiefviolett-background-color a:not(.wp-element-button),
.has-markenviolett-background-color a:not(.wp-element-button) {
	color: var(--wp--preset--color--weiss);
}

.has-graphit-background-color a:not(.wp-element-button):hover {
	color: var(--wp--preset--color--lavendel);
}

.has-graphit-background-color .is-style-dachzeile {
	color: var(--wp--preset--color--lavendel);
}

/* Auf Graphit wird der Button hell, sonst verschwindet er. */
.has-graphit-background-color .wp-block-button:not(.is-style-outline) > .wp-block-button__link:not(.has-background) {
	background-color: var(--wp--preset--color--weiss);
	color: var(--wp--preset--color--graphit);
}

.has-graphit-background-color .wp-block-button:not(.is-style-outline) > .wp-block-button__link:not(.has-background):hover {
	background-color: var(--wp--preset--color--lavendel);
}

.has-graphit-background-color .wp-block-button.is-style-outline > .wp-block-button__link {
	color: var(--wp--preset--color--weiss);
}

.has-graphit-background-color .wp-block-button.is-style-outline > .wp-block-button__link:hover {
	color: var(--wp--preset--color--lavendel);
}

/* ---------- Seitenaufbau ---------- */

/* Abstände zwischen Kopf, Inhalt und Fuß regeln die Abschnitte selbst. */
.wp-site-blocks > * + * {
	margin-block-start: 0;
}

/* ---------- Seitenbausteine ---------- */

/* Absätze in Archivo Expanded: Kennzahlen, Schrittnummern. */
p.has-archivo-expanded-font-family {
	hyphens: auto;
	letter-spacing: -0.01em;
	line-height: 1.12;
}

/* Karte: Linie oben, folgt der Textfarbe (hell auf Graphit, dunkel auf Weiß). */
.gm3d-karte {
	border-top: 1px solid currentColor;
	padding-top: var(--wp--preset--spacing--30);
}

/* Kennzahl-Kachel im Bildformat 4:3 – steht, wo noch kein Foto ist. */
.gm3d-kachel {
	aspect-ratio: 4 / 3;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
}

.gm3d-kachel > * {
	margin-block: 0;
}

.gm3d-kachel > * + * {
	margin-block-start: 0.5rem;
}

.wp-block-column .wp-block-image img {
	width: 100%;
}

/* Kopfzeile: Button „Projekt anfragen“ erst ab Tablet. */
@media (max-width: 781px) {
	.gm3d-kopf-cta {
		display: none !important;
	}
}

/* Sprungmarken (#leistungen, #mmm …) */
[id] {
	scroll-margin-top: 1.5rem;
}

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

/* Aufklappbare Fragen (Details-Block): Linie zwischen den Fragen, Pfeil in Markenviolett. */
.wp-block-details {
	border-top: 1px solid var(--wp--preset--color--stahl);
	padding-block: var(--wp--preset--spacing--20);
	margin-block: 0 !important;
}

.wp-block-details:last-child {
	border-bottom: 1px solid var(--wp--preset--color--stahl);
}

.wp-block-details summary {
	cursor: pointer;
	font-weight: 600;
	list-style: none;
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding-block: 0.35rem;
}

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

.wp-block-details summary::after {
	content: "+";
	color: var(--wp--preset--color--markenviolett);
	font-family: var(--wp--preset--font-family--archivo-expanded);
	font-weight: 400;
}

.wp-block-details[open] summary::after {
	content: "–";
}

.wp-block-details > p {
	margin-top: 0.5rem;
	max-width: 65ch;
}

/* Bild füllt die Höhe der Nachbarspalte (z. B. Foto neben der Ansprechpartner-Box). */
.wp-block-image.gm3d-bild-fuellend {
	height: 100%;
	margin: 0;
}

.wp-block-image.gm3d-bild-fuellend img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 8% center;
}

@media (max-width: 781px) {
	.wp-block-image.gm3d-bild-fuellend img {
		height: auto;
		aspect-ratio: 1;
	}
}
