/* ro-cos.css — erzeugt aus tokens.css, base.css, components.css.
   Nicht von Hand aendern: tools/build-css.sh ueberschreibt die Datei.
   Quellen und Reihenfolge sind in diesem Skript festgelegt. */

/* ro-cos — Tokens. Quelle: ROC-319 Abschnitt 5.1 bis 5.3.
   Farben sind aus den Markenassets gemessen, nicht erfunden; --petrol-700 ist
   aus dem gemessenen Markenfarbton abgeleitet und in 5.1 so gekennzeichnet. */

:root {
	/* 5.1 Farbe */
	--ink-900: #2a363a;
	--ink-700: #324a54;
	--petrol-700: #14505f;
	--slate-600: #4a5a60;
	--border-200: #d6dee1;
	--surface-50: #f4f7f8;
	--white: #fff;

	/* 5.2 Typografie — System-Stack, keine Webfont-Datei */
	--font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
		Arial, sans-serif;

	--step--1: clamp(0.875rem, 0.84rem + 0.17vw, 0.9375rem);
	--step-0: clamp(1.0625rem, 1.03rem + 0.17vw, 1.125rem);
	--step-1: clamp(1.1875rem, 1.12rem + 0.34vw, 1.375rem);
	--step-2: clamp(1.375rem, 1.26rem + 0.57vw, 1.75rem);
	--step-3: clamp(1.625rem, 1.42rem + 1.02vw, 2.25rem);
	--step-4: clamp(2rem, 1.63rem + 1.87vw, 3rem);

	--leading-body: 1.65;
	--leading-lead: 1.5;
	--leading-head: 1.2;
	--tracking-eyebrow: 0.08em;

	/* Zeilenlaenge: 68 Zeichen im Fliesstext, 34 in h1/h2 */
	--measure-body: 68ch;
	--measure-head: 34ch;

	/* 5.3 Abstandssystem — 4-px-Basis, eine Skala fuer alles */
	--space-3xs: 0.25rem;
	--space-2xs: 0.5rem;
	--space-xs: 0.75rem;
	--space-s: 1rem;
	--space-m: 1.5rem;
	--space-l: 2rem;
	--space-xl: 3rem;
	--space-2xl: 4rem;
	--space-3xl: 6rem;

	/* Rhythmus und Breite */
	--section-pad: clamp(3rem, 6vw, 6rem);
	--content-max: 72rem;
	--gutter: clamp(1rem, 4vw, 2rem);

	/* Bedienung — WCAG 2.1 Zielgroesse */
	--target-min: 2.75rem; /* 44px */

	--radius: 4px;
	--transition: 150ms ease;
}

/* ro-cos — Basis. Grundtypografie, vertikaler Fluss, Fokus, Reduced Motion.
   Das Elternthema liefert hier nichts zu: seine drei Stylesheets sind in
   functions.php abgehaengt, diese Datei ist die einzige Grundlage. */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	/* Ankerziele aus den 301-Weiterleitungen nicht unter den Kopf schieben */
	scroll-padding-top: var(--space-l);
}

body {
	margin: 0;
	background: var(--white);
	color: var(--ink-900);
	font-family: var(--font-sans);
	font-size: var(--step-0);
	line-height: var(--leading-body);
	-webkit-font-smoothing: antialiased;
	/* Deutsche Komposita sind lang. In einer schmalen Karte bricht
	   „Softwarebeschaffung“ sonst mitten im Wort um — mit Trennung an einer
	   erlaubten Stelle. Greift nur, wenn das Wort wirklich nicht passt, und
	   gilt deshalb auch fuer Ueberschriften. Das Dokument traegt lang="de",
	   der Browser nimmt die deutsche Trennung. */
	hyphens: auto;
	/* D5, letzte Sicherung: nichts darf ueber die Viewportbreite
	   hinausragen, auch kein Wort ohne erlaubte Trennstelle. */
	overflow-wrap: break-word;
}

/* --- Ueberschriften ------------------------------------------------------ */

h1,
h2,
h3,
h4 {
	margin: 0;
	color: var(--ink-900);
	line-height: var(--leading-head);
	font-weight: 600;
	letter-spacing: -0.01em;
	text-wrap: balance;
}

h1 {
	font-size: var(--step-4);
	max-width: var(--measure-head);
}

h2 {
	font-size: var(--step-3);
	max-width: var(--measure-head);
}

h3 {
	font-size: var(--step-2);
}

h4 {
	font-size: var(--step-1);
}

/* --- Fliesstext ---------------------------------------------------------- */

p,
ul,
ol,
dl,
blockquote,
figure,
table,
pre {
	margin: 0;
}

p,
li {
	max-width: var(--measure-body);
}

strong,
b {
	font-weight: 600;
}

small,
.meta {
	font-size: var(--step--1);
	color: var(--slate-600);
}

ul,
ol {
	padding-left: 1.25em;
}

li + li {
	margin-top: var(--space-3xs);
}

/* Verschachtelte Listen erben den Fluss nicht — sonst reissen sie auf. */
li > ul,
li > ol {
	margin-top: var(--space-3xs);
}

/* Der Redaktionstext enthaelt stellenweise <p> in <li>; ohne diese Regel
   entstaende dort der volle Absatzabstand. Ersetzt die heutigen
   Inline-Abstandsbehelfe aus dem Elementor-Bestand (Plan 4). */
li > p {
	margin: 0;
}

hr {
	height: 1px;
	margin: var(--space-l) 0;
	border: 0;
	background: var(--border-200);
}

blockquote {
	padding-left: var(--space-s);
	border-left: 3px solid var(--border-200);
	color: var(--slate-600);
}

/* --- Verweise ------------------------------------------------------------ */

a {
	color: var(--petrol-700);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
	transition: color var(--transition);
}

a:hover {
	color: var(--ink-700);
}

/* Farbe ist nie alleiniger Bedeutungstraeger: Verweise im Fliesstext sind
   zusaetzlich unterstrichen (Plan 5.6). */
.content a,
.legal a {
	text-decoration: underline;
}

/* --- Fokus --------------------------------------------------------------- */

:focus-visible {
	outline: 2px solid var(--petrol-700);
	outline-offset: 2px;
	border-radius: 2px;
}

/* Auf dunklen Flaechen braucht der Ring eine helle Fassung, sonst verschwindet
   er auf --ink-900. */
.site-footer :focus-visible,
.btn:focus-visible {
	outline-color: var(--white);
}

/* --- Medien und Tabellen ------------------------------------------------- */

img,
svg,
video {
	display: block;
	max-width: 100%;
	height: auto;
}

table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--step--1);
}

th,
td {
	padding: var(--space-2xs) var(--space-xs);
	border-bottom: 1px solid var(--border-200);
	text-align: left;
	vertical-align: top;
}

th {
	font-weight: 600;
}

/* --- Vertikaler Fluss ---------------------------------------------------- */

/* Eine Regel statt Einzelmargen. Alles, was im Fluss steht, bekommt seinen
   Abstand vom Vorgaenger — nicht von sich selbst. */
.flow > * + * {
	margin-top: var(--flow, var(--space-m));
}

.flow > h2 + *,
.flow > h3 + * {
	--flow: var(--space-s);
}

.flow > * + h2 {
	--flow: var(--space-xl);
}

.flow > * + h3 {
	--flow: var(--space-l);
}

/* Dieselbe Staffelung eine Ebene tiefer (ROC-581).
   Vier Routen legen ihren Inhalt in einen Zwischenbehaelter:

       <div class="content flow">
         <section class="ueber-uns-block"><h2>…</h2><p>…</p><p>…</p></section>

   Die Sektion ist direktes Kind und bekommt ihren Abstand von der Regel oben.
   Ihre Kinder sind Enkel, werden von `.flow > * + *` nicht erreicht und
   behalten die weiter oben genullten Margen — Ueberschrift und Absatz kleben
   dann aneinander. Die Sektionen tragen die Sprungziele aus ROC-400 und
   duerfen nicht wegfallen; deshalb eine Regel und kein Markup-Eingriff.

   Wiederholt statt verallgemeinert: `.flow * + *` mit dem Nachfahren-
   Kombinator traefe auch `li` und `li > p`, die weiter oben bewusst auf
   `margin: 0` stehen, und risse jede Liste auf.

   `--flow` wird in der ersten Regel ausdruecklich gesetzt und nicht geerbt.
   Steht die Sektion selbst hinter einer `h2`, traegt sie
   `--flow: var(--space-s)`; ohne diese Zuweisung faende der Wert ueber die
   Vererbung in ihre Kinder, und der Abstand im Inneren haenge davon ab, was
   *vor* der Sektion steht. */
.flow > section > * + * {
	--flow: var(--space-m);
	margin-top: var(--flow);
}

.flow > section > h2 + *,
.flow > section > h3 + * {
	--flow: var(--space-s);
}

.flow > section > * + h2 {
	--flow: var(--space-xl);
}

.flow > section > * + h3 {
	--flow: var(--space-l);
}

/* Die Sektion erbt den Rang ihrer ersten Ueberschrift (ROC-371).
   Steht die `h2` als erstes Kind der Sektion, hat sie keinen Vorgaenger:
   `.flow > * + h2` greift nicht, und den sichtbaren Abstand setzt die Sektion
   ueber `.flow > * + *`, also `--space-m`. Damit steht die Rangfolge auf dem
   Kopf — gemessen auf `/leistungen/` bekommt die `h3` im Inneren 32 px Luft,
   die `h2`, die sie einordnet, nur 24 px.

   `:first-child` statt `:has(h2)` ist Absicht: nur eine Sektion, die *mit* der
   Ueberschrift anfaengt, uebernimmt deren Abstand. Regel statt Markup-Eingriff,
   weil die Sektionen die Sprungziele aus ROC-400 tragen. */
.flow > * + section:has(> :first-child:is(h2)) {
	--flow: var(--space-xl);
}

.flow > * + section:has(> :first-child:is(h3)) {
	--flow: var(--space-l);
}

/* --- Layoutgeruest ------------------------------------------------------- */

.wrap {
	width: 100%;
	max-width: var(--content-max);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.section {
	padding-block: var(--section-pad);
}

.section--tint {
	background: var(--surface-50);
}

/* --- Nur fuer Screenreader ----------------------------------------------- */

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* --- D7: Reduced Motion schaltet alle Uebergaenge ab --------------------- */

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

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		transition-delay: 0ms !important;
		scroll-behavior: auto !important;
	}
}

/* ro-cos — die neun Komponenten aus ROC-319 Abschnitt 5.4.
   Reines CSS auf klassischem HTML: kein Block-Plugin, kein Shortcode-Plugin,
   keine JavaScript-Abhaengigkeit. Raster ausschliesslich ueber auto-fit/minmax
   und die drei Schwellen aus 5.5. */

/* === gemeinsame Bausteine ================================================ */

.eyebrow {
	margin: 0;
	font-size: var(--step--1);
	font-weight: 600;
	letter-spacing: var(--tracking-eyebrow);
	text-transform: uppercase;
	color: var(--slate-600);
}

.lead {
	font-size: var(--step-1);
	line-height: var(--leading-lead);
	color: var(--ink-700);
	max-width: var(--measure-body);
}

/* Handlungsschaltflaeche. D4: Trefferflaeche mindestens 44x44 px. */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: var(--target-min);
	padding: var(--space-xs) var(--space-m);
	background: var(--petrol-700);
	color: var(--white);
	border-radius: var(--radius);
	font-weight: 600;
	text-decoration: none;
	transition: background-color var(--transition);
}

.btn:hover {
	background: var(--ink-700);
	color: var(--white);
}

.btn--ghost {
	background: transparent;
	color: var(--petrol-700);
	box-shadow: inset 0 0 0 1px var(--border-200);
}

.btn--ghost:hover {
	background: var(--surface-50);
	color: var(--ink-700);
}

/* === 1 — Kopf ============================================================ */

.skip-link {
	position: absolute;
	left: var(--space-s);
	top: var(--space-s);
	z-index: 10;
	display: inline-flex;
	align-items: center;
	min-height: var(--target-min);
	padding: var(--space-2xs) var(--space-s);
	background: var(--petrol-700);
	color: var(--white);
	border-radius: var(--radius);
	text-decoration: none;
	transform: translateY(-200%);
}

.skip-link:focus {
	transform: translateY(0);
	color: var(--white);
}

.site-header {
	border-bottom: 1px solid var(--border-200);
	background: var(--white);
}

.site-header__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-xs) var(--space-l);
	padding-block: var(--space-s);
}

/* `.brand` ist der Markenlink im Kopf. Seit ROC-401 traegt er immer
   assets/logo.svg; das Mediathek-Markup `.custom-logo-link` entsteht nicht
   mehr und seine Regeln sind deshalb entfallen. */
.brand {
	display: inline-flex;
	align-items: center;
	min-height: var(--target-min);
	font-weight: 600;
	text-decoration: none;
	color: var(--ink-900);
}

/* `aspect-ratio` doppelt die width/height-Attribute des Bildes ab: faellt die
   SVG-Datei aus oder kommt sie spaet, bleibt die Flaeche trotzdem reserviert
   (Abnahmekriterium A5, CLS). 390/100 ist das Seitenverhaeltnis des viewBox. */
.brand__logo {
	display: block;
	width: auto;
	height: 2.25rem;
	aspect-ratio: 390 / 100;
}

.site-nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-3xs) var(--space-m);
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-nav li {
	max-width: none;
	margin: 0;
}

.site-nav a {
	display: flex;
	align-items: center;
	min-height: var(--target-min);
	color: var(--ink-900);
	font-weight: 500;
	text-decoration: none;
}

.site-nav a:hover {
	color: var(--petrol-700);
	text-decoration: underline;
	text-underline-offset: 0.3em;
}

/* Der aktive Eintrag ist nicht nur farblich markiert (Plan 5.6). */
.site-nav [aria-current="page"] {
	color: var(--petrol-700);
	box-shadow: inset 0 -2px 0 var(--petrol-700);
}

/* 5.5: unter 48 rem bricht die Navigation unter das Logo um. */
@media (max-width: 47.999rem) {
	.site-header__inner {
		flex-direction: column;
		align-items: flex-start;
	}
}

/* === 2 — Einstiegsblock ================================================== */

.hero {
	position: relative;
	overflow: hidden;
	background: var(--surface-50);
	padding-block: var(--section-pad);
}

/* Das Signet als grosse, stark beschnittene Hintergrundform — als CSS, nicht
   als Rasterbild, damit das Transferbudget unberuehrt bleibt (Plan 5.7).
   Rein dekorativ und sehr kontrastarm; traegt keine Bedeutung.

   Erst ab 48 rem: darunter ist der Einstiegsblock schmaler als die Form, die
   Leiterbahnen laufen dann als lange Striche quer durch den ganzen Block und
   lesen sich als Fehler statt als Motiv. */
@media (min-width: 48rem) {
.hero::before {
	content: "";
	position: absolute;
	right: -14rem;
	top: 50%;
	width: 42rem;
	height: 42rem;
	transform: translateY(-50%);
	border-radius: 50%;
	background:
		radial-gradient(circle, transparent 0 46%, currentcolor 46% 48%, transparent 48%),
		radial-gradient(circle, transparent 0 30%, currentcolor 30% 31%, transparent 31%),
		repeating-linear-gradient(
			to bottom,
			currentcolor 0 2px,
			transparent 2px 3.5rem
		);
	color: var(--ink-900);
	opacity: 0.05;
	pointer-events: none;
}
}

.hero__inner {
	position: relative;
	max-width: 44rem;
}

.hero h1 {
	margin-block: var(--space-xs) 0;
}

.hero .lead {
	margin-top: var(--space-m);
}

.hero__action {
	margin-top: var(--space-l);
}

/* === 3 — Abschnittskopf ================================================== */

.section-head {
	max-width: var(--measure-body);
	margin-bottom: var(--space-xl);
}

.section-head h2 {
	margin-top: var(--space-3xs);
}

.section-head p {
	margin-top: var(--space-s);
	color: var(--slate-600);
}

/* === 4 — Leistungskarte ================================================== */

/* 5.5: eine Spalte unter 48 rem, zwei bis 64 rem, drei darueber — allein ueber
   auto-fit/minmax, keine Pixel-Breakpoints. */
.cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
	gap: var(--space-m);
}

.card {
	display: flex;
	flex-direction: column;
	padding: var(--space-m);
	background: var(--white);
	border: 1px solid var(--border-200);
	border-radius: var(--radius);
}

.card h3 {
	font-size: var(--step-2);
}

/* „Gemeint, wenn …“ — die Einordnungszeile der Karte. */
.card__when {
	margin-top: var(--space-2xs);
	font-size: var(--step--1);
	color: var(--slate-600);
}

.card ul {
	margin-top: var(--space-s);
	padding-left: 1.1em;
}

.card li {
	max-width: none;
}

/* Die Ergebniszeile sitzt immer am Kartenfuss, damit die Karten im Raster
   trotz unterschiedlicher Listenlaenge auf einer Linie abschliessen. */
.card__result {
	margin-top: auto;
	padding-top: var(--space-s);
	border-top: 1px solid var(--border-200);
	font-size: var(--step--1);
	font-weight: 600;
	color: var(--ink-700);
}

.card__result + .card__result {
	border-top: 0;
}

/* === 5 — Schrittfolge ==================================================== */

.steps {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
	gap: var(--space-l);
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: step;
}

.steps > li {
	max-width: none;
	margin: 0;
	padding-top: var(--space-s);
	border-top: 2px solid var(--border-200);
	counter-increment: step;
}

/* Die Nummer ist CSS-generiert und damit dekorativ; die Reihenfolge traegt
   bereits das <ol>. Screenreader lesen sie deshalb nicht doppelt. */
.steps > li::before {
	content: counter(step);
	display: block;
	margin-bottom: var(--space-2xs);
	font-size: var(--step-2);
	font-weight: 600;
	color: var(--petrol-700);
}

.steps h3 {
	font-size: var(--step-1);
}

.steps p {
	margin-top: var(--space-2xs);
	color: var(--slate-600);
}

/* === 6 — Handlungsblock ================================================== */

.cta {
	background: var(--surface-50);
	border-radius: var(--radius);
	padding: var(--space-xl) var(--space-m);
	text-align: center;
}

.cta p {
	max-width: 46ch;
	margin-inline: auto;
	font-size: var(--step-1);
	line-height: var(--leading-lead);
}

.cta .btn {
	margin-top: var(--space-m);
}

.cta__note {
	margin-top: var(--space-s);
	font-size: var(--step--1);
	color: var(--slate-600);
}

/* === 7 — Angabenblock ==================================================== */

.facts {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
	gap: var(--space-m);
	margin: 0;
	padding: var(--space-m);
	border: 1px solid var(--border-200);
	border-radius: var(--radius);
}

.facts dt {
	font-size: var(--step--1);
	font-weight: 600;
	letter-spacing: var(--tracking-eyebrow);
	text-transform: uppercase;
	color: var(--slate-600);
}

.facts dd {
	margin: var(--space-3xs) 0 0;
}

/* Standalone-E-Mail-Verweise sind eigene Bedienelemente und erfuellen D4.
   Fuer Verweise im Fliesstext gilt die Inline-Ausnahme aus WCAG 2.5.8. */
.facts a,
.site-footer__contact a {
	display: inline-flex;
	align-items: center;
	min-height: var(--target-min);
}

/* === 8 — Rechtstext-Layout =============================================== */

/* /impressum/ und /datenschutz/: nur das Layout, der Text bleibt unberuehrt
   (Plan 7.1, Abnahmekriterium E1). */
.legal {
	max-width: 62ch;
}

.legal h2 {
	max-width: none;
	font-size: var(--step-2);
	padding-top: var(--space-s);
	border-top: 1px solid var(--border-200);
}

.legal h3 {
	font-size: var(--step-1);
}

.legal p,
.legal li {
	max-width: none;
}

/* Der Rechtstext traegt Absatzmarken wie „§ 3“ im Fliesstext; eine engere
   Zeilenlaenge und ein ruhigerer Rhythmus machen ihn lesbar, ohne ein Zeichen
   des Textes anzufassen. */
.legal.flow > * + * {
	--flow: var(--space-s);
}

.legal.flow > * + h2 {
	--flow: var(--space-xl);
}

.legal.flow > * + h3 {
	--flow: var(--space-m);
}

/* Derselbe ruhigere Rhythmus eine Ebene tiefer (ROC-581).
   `/impressum/` legt seine vier Abschnitte in `<section class=
   "impressum-block">`; `/datenschutz/` nicht. Ohne diese drei Regeln bekaeme
   der Rechtstext im Inneren der Sektionen die Staffelung des Fliesstextes aus
   base.css (`--space-m`) statt seine eigene. Die Werte sind die der drei
   Regeln darueber, Zeichen fuer Zeichen. */
.legal.flow > section > * + * {
	--flow: var(--space-s);
}

.legal.flow > section > * + h2 {
	--flow: var(--space-xl);
}

.legal.flow > section > * + h3 {
	--flow: var(--space-m);
}

/* Dasselbe im Rechtstext (ROC-371) — hier noetig, weil
   `.legal.flow > * + *` noch enger steht als draussen (`--space-s`).
   Gemessen: `/impressum/` gibt seinen Abschnittsueberschriften 16 px Luft,
   `/datenschutz/` denselben Ueberschriften 48 px. Derselbe Rhythmus, der
   Unterschied kommt allein von den `<section>` auf `/impressum/`. Mit dieser
   Regel stimmen die zwei Pflichtseiten wieder ueberein. */
.legal.flow > * + section:has(> :first-child:is(h2)) {
	--flow: var(--space-xl);
}

.legal.flow > * + section:has(> :first-child:is(h3)) {
	--flow: var(--space-m);
}

/* === 9 — Fuss ============================================================ */

.site-footer {
	margin-top: var(--space-3xl);
	background: var(--ink-900);
	color: var(--white);
	padding-block: var(--space-xl);
	font-size: var(--step--1);
}

.site-footer__inner {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
	gap: var(--space-m) var(--space-l);
}

.site-footer p,
.site-footer li {
	max-width: none;
}

.site-footer a {
	color: var(--white);
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.site-footer a:hover {
	color: var(--border-200);
}

.site-footer__name {
	font-weight: 600;
	letter-spacing: var(--tracking-eyebrow);
	text-transform: uppercase;
}

.site-footer__legal ul {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-3xs) var(--space-m);
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-footer__legal li {
	margin: 0;
}

/* D4 gilt auch im Fuss: die Pflichtseitenverweise sind Navigation. */
.site-footer__legal a {
	display: flex;
	align-items: center;
	min-height: var(--target-min);
}

/* === 404 ================================================================= */

.notfound {
	max-width: var(--measure-body);
}

.notfound ul {
	margin-top: var(--space-s);
}
