/* ==========================================================================
   TSCale Consulting – global child styles
   Loaded after the parent project.css. Colours, fonts, headings, buttons,
   container widths and section spacing come from the theme options
   (Theme > Allgemein / Überschriften / Button / Breakpoints / Abstände);
   this file only adds what the options cannot express.
   ========================================================================== */

:root {
	--btw_schwarz: #111111;
	--btw_grau: #6e6e6e;
	--btw_hellgrau: #b8b8b8;
	--btw_linie: #dedede;
	--btw_flaeche: #f5f5f5;
	--btw_weiss: #ffffff;
	--btw_timeline: #3a3a3a;
	--btw_header_height: 88px;
	--btw_gutter: 24px;
	--btw_ease: cubic-bezier(.2, .7, .2, 1);
	--btw_speed: .35s;
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--btw_header_height) + 16px);
}

@media all and (max-width: 991px) {
	:root {
		--btw_header_height: 68px;
	}
}

@media all and (min-width: 768px) and (max-width: 1199px) {
	:root {
		--btw_gutter: 40px;
	}
}

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

body {
	padding-top: 0; /* header is sticky, the parent reserves space for a fixed one */
	font-family: var(--font_family);
	font-size: 1rem;
	line-height: 1.65;
	color: var(--btw_schwarz);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

/* Content width: fluid with gutter, max 1200 content (container 1248 from 1200px, Theme > Breakpoints) */
.mM_container {
	padding-left: var(--btw_gutter);
	padding-right: var(--btw_gutter);
}

/* Long German compounds must never push the layout */
h1, h2, h3, h4, h5, h6, p, li, a, span, label {
	overflow-wrap: break-word;
}

@media all and (max-width: 375px) {
	h1, h2, h3 {
		-webkit-hyphens: auto;
		hyphens: auto;
	}
}

/* ---------- Headings: letter spacing relative to the size (Figma: -4 % / -2 %) ---------- */
:root :is(h1, .h1) {
	letter-spacing: -0.04em;
}

:root :is(h2, .h2) {
	letter-spacing: -0.04em;
}

:root :is(h3, .h3, h4, .h4) {
	letter-spacing: -0.02em;
}

/* Eyebrow (title clone "Untertitel" above the heading) */
:root [class$="_untertitel"] {
	letter-spacing: 0.18em;
	margin: 0;
}

[class$="_untertitel_container"] + [class$="_titel_container"] {
	padding-top: 16px;
}

@media all and (max-width: 575px) {
	[class$="_untertitel_container"] + [class$="_titel_container"] {
		padding-top: 12px;
	}

	/* 11px eyebrows: rounding would otherwise wrap Figma's one-liners at 342px */
	:root [class$="_untertitel"] {
		letter-spacing: 0.175em;
	}
}

/* Highlight block: <span> in a heading or a marked text (Figma: black box, white text) */
.btw_mark {
	background-color: var(--btw_schwarz);
	color: var(--btw_weiss);
	padding: 0 0.2em;
	-webkit-box-decoration-break: clone;
	box-decoration-break: clone;
}

:root :is(h1, h2, h3, h4) span.btw_mark {
	color: var(--btw_weiss);
}

h1 .btw_mark {
	padding: 0 0.184em;
}

/* Inner text span (btw_mark_wrap()); the parent sets * { color } so it needs its own colour */
:root .btw_mark .btw_mark_text {
	display: inline-block;
	color: var(--btw_weiss);
}

/* ---------- Scroll effects (Kevin 2026-11-06) ----------
   Fade-in / stagger come from the parent (Theme-Optionen → Effekte: von unten +
   "gestaffelt", css/appearance.js sets .mM_in_view). Here only the distance is
   reduced and the project's own effects hang off .mM_in_view:
   - highlight block slides in from the left with its text (transform only)
   - m29 diagram draws itself (m29_vorgehen.css)
   Without the parent script (no html.mM_appear_js) or with reduced motion
   everything stays static. */
:root {
	--mM_scroll_distance: 28px; /* stagger items move half of it: 14px */
}

@media all and (max-width: 767px) {
	:root {
		--mM_scroll_distance: 24px;
	}
}

.btw_mark {
	display: inline-block;
}

@media (prefers-reduced-motion: no-preference) {
	.mM_appear_js .btw_mark {
		position: relative;
		z-index: 0;
		background-color: transparent;
		clip-path: inset(0); /* clips the sliding text without changing the baseline */
	}

	.mM_appear_js .btw_mark::before {
		content: '';
		position: absolute;
		inset: 0;
		z-index: -1;
		background-color: var(--btw_schwarz);
		transform: scaleX(0);
		transform-origin: left center;
	}

	:root.mM_appear_js .btw_mark .btw_mark_text {
		transform: translateX(calc(-100% - 0.5em));
	}

	.mM_appear_js .btw_mark::before,
	:root.mM_appear_js .btw_mark .btw_mark_text {
		transition: transform 0.8s var(--btw_ease) 0.45s;
	}

	.mM_appear_js .mM_in_view .btw_mark::before {
		transform: scaleX(1);
	}

	:root.mM_appear_js .mM_in_view .btw_mark .btw_mark_text {
		transform: none;
	}

	/* Lists inside a staggered block follow one by one (timeline steps, the
	   funding calculation, the fit/no-fit points). --mM_stagger_i is inherited
	   from the parent's stagger item, so the second box starts after the first. */
	.mM_appear_js :is(.m29_schritt, .m31_rechnung_zeile, .m32_punkt) {
		transition-property: opacity, translate;
		transition-duration: 0.6s;
		transition-timing-function: var(--mM_scroll_easing);
		transition-delay: calc(0.2s + var(--mM_stagger_i, 0) * var(--mM_stagger_step) + var(--btw_list_i, 0) * 80ms);
	}

	.mM_appear_js section:not(.mM_in_view) :is(.m29_schritt, .m31_rechnung_zeile, .m32_punkt) {
		opacity: 0;
		translate: 0 12px;
	}

	:is(.m29_schritt, .m31_rechnung_zeile, .m32_punkt):nth-child(2) { --btw_list_i: 1; }
	:is(.m29_schritt, .m31_rechnung_zeile, .m32_punkt):nth-child(3) { --btw_list_i: 2; }
	:is(.m29_schritt, .m31_rechnung_zeile, .m32_punkt):nth-child(4) { --btw_list_i: 3; }
	:is(.m29_schritt, .m31_rechnung_zeile, .m32_punkt):nth-child(5) { --btw_list_i: 4; }
	:is(.m29_schritt, .m31_rechnung_zeile, .m32_punkt):nth-child(6) { --btw_list_i: 5; }
	:is(.m29_schritt, .m31_rechnung_zeile, .m32_punkt):nth-child(n+7) { --btw_list_i: 6; }
}

/* WYSIWYG output in div wrappers: no outer paragraph margins */
.btw_wysiwyg > p {
	margin: 0;
}

.btw_wysiwyg > p + p {
	margin-top: 1em;
}

.btw_wysiwyg strong {
	font-weight: 700;
}

/* ---------- Buttons (Theme > Button: "Primär") ----------
   Hover "Invertieren" (Kevin 2026-11-06): a white block slides in from the left
   (scaleX) on top with mix-blend-mode: difference – the button turns light with
   black text, like the text links. The 1px border keeps the outline. Arrow moves
   4px. Only transform is animated; z-index: 0 isolates the blend to the button. */
:root .mM_button {
	position: relative;
	z-index: 0;
	overflow: hidden;
	height: 48px;
	padding: 0 21px;
	border: 1px solid var(--btn_bg);
	font-family: var(--font_family);
	font-size: 0.9375rem;
	font-weight: 500;
	line-height: 1.65;
	text-decoration: none;
	white-space: nowrap;
	-webkit-transition: none;
	transition: none;
}

:root .mM_button::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background-color: #fff;
	mix-blend-mode: difference;
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform var(--btw_speed) var(--btw_ease);
}

:root .mM_button,
:root .mM_button:hover,
:root .mM_button:focus,
:root .mM_button:active,
:root .mM_button:visited {
	background-color: var(--btn_bg);
	color: var(--btn_fg);
	opacity: 1;
}

:root .mM_button *,
:root .mM_button:hover *,
:root .mM_button:visited * {
	color: var(--btn_fg);
}

/* The parent's mM_verlinkung.css loads later and sets the hover colours
   (.mM_button:hover:not([disabled])) – surface and border stay black, the
   inversion comes from the blended ::before only. */
:root .mM_button:is(:hover, :focus-visible):not([disabled]) {
	background-color: var(--btn_bg);
	border-color: var(--btn_bg);
}

:root .mM_button:is(:hover, :focus-visible):not([disabled]),
:root .mM_button:is(:hover, :focus-visible):not([disabled]) * {
	color: var(--btn_fg);
}

:root .mM_button .mM_button_text {
	position: relative;
}

:root .mM_button .mM_button_icon_wrap {
	width: 0.6em;
	height: 1.32em;
	margin-left: 0.6em;
	background: none;
	transition: transform var(--btw_speed) var(--btw_ease);
}

:root .mM_button .mM_button_icon_wrap svg,
:root .mM_link .mM_link_icon_wrap svg {
	display: block;
	width: 100%;
	height: 100%;
	fill: currentColor;
}

:root .mM_button .mM_button_icon_wrap svg path,
:root .mM_link .mM_link_icon_wrap svg path {
	fill: currentColor;
}

@media (hover: hover) {
	:root .mM_button:not(:disabled, [aria-disabled="true"]):hover::before {
		transform: scaleX(1);
	}

	:root .mM_button:not(:disabled, [aria-disabled="true"]):hover .mM_button_icon_wrap {
		transform: translateX(4px);
	}
}

:root .mM_button:not(:disabled, [aria-disabled="true"]):focus-visible::before {
	transform: scaleX(1);
}

/* Disabled buttons look inactive and have no hover */
:root .mM_button:is(:disabled, [aria-disabled="true"]) {
	background-color: var(--btw_linie);
	border-color: var(--btw_linie);
	cursor: not-allowed;
}

:root .mM_button:is(:disabled, [aria-disabled="true"]),
:root .mM_button:is(:disabled, [aria-disabled="true"]) * {
	color: var(--btw_grau);
}

/* ---------- Text links: Block-Effekt ----------
   A block slides in behind the text (scaleX). mix-blend-mode: difference turns the
   text white on the block without animating the colour. */
:root .btw_block_link,
:root .mM_link {
	position: relative;
	text-decoration: none;
}

:root .btw_block_link::after,
:root .mM_link::after {
	content: '';
	position: absolute;
	top: -2px;
	right: -6px;
	bottom: -2px;
	left: -6px;
	background-color: #ffffff;
	mix-blend-mode: difference;
	pointer-events: none;
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform var(--btw_speed) var(--btw_ease);
}

@media (hover: hover) {
	:root .btw_block_link:hover::after,
	:root .mM_link:hover::after {
		transform: scaleX(1);
	}
}

/* Links in running text (form consent + note, legal pages, WYSIWYG): same block,
   the underline stays. inline-block keeps the block on one box; max-width +
   overflow-wrap let long addresses wrap inside it down to 280px. */
:root :is(.btw_wysiwyg, .wpcf7-acceptance, .m34_hinweis_container, .m1_text_container) a:not(.mM_button, .mM_link, .btw_block_link) {
	position: relative;
	display: inline-block;
	max-width: 100%;
	overflow-wrap: anywhere;
}

:root :is(.btw_wysiwyg, .wpcf7-acceptance, .m34_hinweis_container, .m1_text_container) a:not(.mM_button, .mM_link, .btw_block_link)::after {
	content: '';
	position: absolute;
	top: -1px;
	right: -4px;
	bottom: -1px;
	left: -4px;
	background-color: #ffffff;
	mix-blend-mode: difference;
	pointer-events: none;
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform var(--btw_speed) var(--btw_ease);
}

@media (hover: hover) {
	:root :is(.btw_wysiwyg, .wpcf7-acceptance, .m34_hinweis_container, .m1_text_container) a:not(.mM_button, .mM_link, .btw_block_link):hover::after {
		transform: scaleX(1);
	}
}

:root :is(.btw_wysiwyg, .wpcf7-acceptance, .m34_hinweis_container, .m1_text_container) a:not(.mM_button, .mM_link, .btw_block_link):focus-visible::after {
	transform: scaleX(1);
}

:root .btw_block_link:focus-visible::after,
:root .mM_link:focus-visible::after,
:root .btw_block_link.is_active::after {
	transform: scaleX(1);
}

/* Link variant "Unterstrichen" (Theme > Link), e.g. "So läuft es ab ↓" */
:root .mM_link.unterstrichen,
:root .mM_link.unterstrichen:visited,
:root .mM_link.unterstrichen:hover,
:root .mM_link.unterstrichen:focus,
:root .mM_link.unterstrichen:active {
	display: inline-flex;
	align-items: center;
	padding-bottom: 8px;
	border-bottom: 1px solid currentColor;
	font-size: 1.0625rem;
	font-weight: 500;
	line-height: 1.65;
	color: var(--btw_schwarz);
}

:root .mM_link.unterstrichen *,
:root .mM_link.unterstrichen:hover *,
:root .mM_link.unterstrichen:visited * {
	color: var(--btw_schwarz);
}

:root .mM_link.unterstrichen::after {
	bottom: 4px;
}

:root .mM_link .mM_link_icon_wrap {
	width: 0.6em;
	height: 1.32em;
	margin-left: 0.6em;
	transition: transform var(--btw_speed) var(--btw_ease);
}

@media (hover: hover) {
	:root .mM_link:hover .mM_link_icon_wrap {
		transform: translateY(3px);
	}
}

@media all and (max-width: 575px) {
	:root .mM_link.unterstrichen,
	:root .mM_link.unterstrichen:visited,
	:root .mM_link.unterstrichen:hover {
		font-size: 0.9375rem;
		padding-bottom: 6px;
	}
}

/* Links in running text */
.btw_wysiwyg a,
.btw_wysiwyg a:visited,
.btw_wysiwyg a:hover,
.btw_wysiwyg a:focus,
.btw_wysiwyg a:active {
	color: var(--btw_schwarz);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ---------- Focus ---------- */
:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

a:focus,
button:focus {
	outline: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
	outline: 2px solid var(--btw_schwarz);
	outline-offset: 3px;
}

/* Skip link visible on focus */
.skip-link:focus-visible {
	z-index: 10000;
	background: var(--btw_schwarz);
	color: var(--btw_weiss);
	padding: 12px 16px;
	outline-color: var(--btw_weiss);
}

/* ---------- Reduced motion: static end states ---------- */
@media (prefers-reduced-motion: reduce) {
	:root .mM_button::before,
	:root .mM_button .mM_button_icon_wrap,
	:root .mM_link::after,
	:root .mM_link .mM_link_icon_wrap,
	:root .btw_block_link::after,
	:root :is(.btw_wysiwyg, .wpcf7-acceptance, .m34_hinweis_container, .m1_text_container) a::after {
		transition: none;
	}
}

/* ---------- Shared module parts ---------- */
/* Lead under a section heading (Figma: 20/33 #6e6e6e, max 640; mobile 16/26.4) */
.btw_lead {
	max-width: 640px;
	padding-top: 24px;
	font-size: 1.25rem;
	line-height: 1.65;
	color: var(--btw_grau);
}

.btw_lead,
.btw_lead p {
	color: var(--btw_grau);
}

/* Titles from the title clone never carry outer margins */
section [class$="_titel"] {
	margin: 0;
}

/* Programmatic focus on anchor targets (menu.js) shows no ring */
section[tabindex="-1"]:focus {
	outline: none;
}

@media all and (max-width: 575px) {
	.btw_lead {
		padding-top: 16px;
		font-size: 1rem;
	}
}

/* Parent underlines links in li/p (1.4.1) – navigation and tiles are no running text */
:root .btw_block_link:is(:link, :visited, :hover, :focus, :active),
:root .mM_button:is(:link, :visited, :hover, :focus, :active),
:root .mM_link:is(:link, :visited, :hover, :focus, :active) {
	text-decoration: none;
}

/* ---------- Subpages (m1_text with wrapper class "btw_rechtstext"): legal texts, booking ---------- */
section.m1_text.btw_rechtstext .m1_text_main {
	max-width: 800px;
}

section.m1_text.btw_rechtstext .m1_titel {
	font-size: 2.5rem;
	line-height: 1.15;
}

section.m1_text.btw_rechtstext .m1_text_container {
	padding-top: 40px;
	font-size: 1rem;
	line-height: 1.65;
}

section.m1_text.btw_rechtstext .m1_text_container h2 {
	margin: 40px 0 12px;
	font-size: 1.25rem;
	line-height: 1.2;
	letter-spacing: -0.02em;
}

section.m1_text.btw_rechtstext .m1_text_container h2:first-child {
	margin-top: 0;
}

section.m1_text.btw_rechtstext .m1_text_container p {
	margin: 0 0 16px;
}

section.m1_text.btw_rechtstext .m1_text_container a,
section.m1_text.btw_rechtstext .m1_text_container a:visited,
section.m1_text.btw_rechtstext .m1_text_container a:hover,
section.m1_text.btw_rechtstext .m1_text_container a:focus,
section.m1_text.btw_rechtstext .m1_text_container a:active {
	display: inline-block; /* Block-Effekt needs one box (see "Links in running text") */
	color: var(--btw_schwarz);
	text-decoration: underline;
	text-underline-offset: 3px;
	overflow-wrap: anywhere;
}

/* Booking page: the wizard may use the full container width */
section.m1_text.btw_rechtstext:has(.btw_tb) .m1_text_main {
	max-width: none;
}

section.m1_text.btw_rechtstext:has(.btw_tb) .m1_text_container > p {
	max-width: 640px;
	font-size: 1.25rem;
	color: var(--btw_grau);
}

@media all and (max-width: 575px) {
	section.m1_text.btw_rechtstext .m1_titel {
		font-size: 1.875rem;
	}

	section.m1_text.btw_rechtstext .m1_text_container {
		padding-top: 24px;
	}

	section.m1_text.btw_rechtstext:has(.btw_tb) .m1_text_container > p {
		font-size: 1rem;
	}
}

/* btw-terminbuchung in the project look (plugin variables only) */
:root .btw_tb {
	--btw-tb-accent: #111111;
	--btw-tb-accent-dark: #3a3a3a;
	--btw-tb-accent-soft: #f5f5f5;
	--btw-tb-accent-softer: #fafafa;
	--btw-tb-ink: #111111;
	--btw-tb-text: #111111;
	--btw-tb-muted: #6e6e6e;
	--btw-tb-line: #dedede;
	--btw-tb-bg: #ffffff;
	--btw-tb-bg-soft: #f5f5f5;
	--btw-tb-radius: 0px;
	--btw-tb-radius-sm: 0px;
	--btw-tb-shadow: none;
	font-family: var(--font_family);
}

/* Square controls (the plugin rounds buttons/radios with a fixed 999px) */
:root .btw_tb :is(.btw_tb_btn, .btw_tb_radio) {
	border-radius: 0;
}

:root .btw_tb :is(input[type="radio"], input[type="checkbox"]) {
	accent-color: var(--btw_schwarz);
}

/* Submit: the project's button with the invert hover */
:root .btw_tb .btw_tb_btn {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	padding: 0 21px;
	height: 46px;
	border-color: var(--btw_schwarz);
	background: var(--btw_schwarz);
	color: var(--btw_weiss);
	font-size: 0.875rem;
	font-weight: 500;
}

:root .btw_tb .btw_tb_btn::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background-color: #fff;
	mix-blend-mode: difference;
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform var(--btw_speed) var(--btw_ease);
}

:root .btw_tb .btw_tb_btn:is(:hover, :focus-visible):not(:disabled) {
	border-color: var(--btw_schwarz);
	background: var(--btw_schwarz);
}

:root .btw_tb .btw_tb_btn:is(:hover, :focus-visible):not(:disabled)::before {
	transform: scaleX(1);
}

:root .btw_tb .btw_tb_btn:focus-visible {
	outline: 2px solid var(--btw_schwarz);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	:root .btw_tb .btw_tb_btn::before {
		transition: none;
	}
}

/* ---------- Overlay dialogs (Förder-Check m35, Terminbuchung m36) ---------- */
.btw_dialog {
	width: calc(100% - 48px);
	max-width: 640px;
	max-height: calc(100svh - 48px);
	margin: auto;
	padding: 0;
	overflow: auto;
	overscroll-behavior: contain;
	background-color: var(--btw_weiss);
	border: 1px solid var(--btw_schwarz);
	color: var(--btw_schwarz);
}

.btw_dialog[open] {
	animation: btw_dialog_in var(--btw_speed) var(--btw_ease);
}

.btw_dialog::backdrop {
	background-color: rgba(17, 17, 17, .6);
}

@keyframes btw_dialog_in {
	from { opacity: 0; transform: translateY(12px); }
	to   { opacity: 1; transform: translateY(0); }
}

html.btw_dialog_open {
	overflow: hidden;
}

.btw_dialog p {
	margin: 0;
}

.btw_dialog_inner {
	position: relative;
	padding: 40px;
}

.btw_dialog_close_container {
	position: absolute;
	top: 16px;
	right: 16px;
	z-index: 2;
}

.btw_dialog_close {
	position: relative;
	display: block;
	width: 44px;
	height: 44px;
	padding: 0;
	background: var(--btw_weiss);
	border: 1px solid var(--btw_schwarz);
	border-radius: 0;
	cursor: pointer;
	transition: transform var(--btw_speed) var(--btw_ease);
}

.btw_dialog_close_bar {
	position: absolute;
	left: 12px;
	top: 21px;
	width: 18px;
	height: 2px;
	background-color: var(--btw_schwarz);
	transform: rotate(45deg);
}

.btw_dialog_close_bar + .btw_dialog_close_bar {
	transform: rotate(-45deg);
}

@media (hover: hover) {
	.btw_dialog_close:hover {
		transform: rotate(90deg);
	}
}

@media all and (max-width: 575px) {
	.btw_dialog {
		width: calc(100% - 24px);
		max-height: calc(100svh - 24px);
	}

	.btw_dialog_inner {
		padding: 72px 20px 24px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.btw_dialog[open] {
		animation: none;
	}

	.btw_dialog_close {
		transition: none;
	}
}
