/*
Theme Name: Hafen
Author: hafenstudios
Author URI: https://hafenstudios.com/
Description: Hafen is a block theme for content-led websites. It supports full site editing and includes block patterns for landing pages, posts, timelines and statistics, a magazine-style blog layout, 38 style variations that change colors, typography, shapes and density, a self-hosted variable font, custom colors and logo support, a sticky header with a skip link, and editor styles that match the front end.
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
Version: 1.1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hafen
Tags: blog, news, portfolio, one-column, grid-layout, block-styles, wide-blocks, full-site-editing, full-width-template, template-editing, custom-colors, custom-logo, custom-menu, editor-style, featured-images, threaded-comments, translation-ready, style-variations, block-patterns
*/

/* =========================================================
   HAFEN — Front-end + Editor supplemental styles.
   Das Meiste kommt aus theme.json. Hier nur, was theme.json
   (noch) nicht ausdrücken kann: Sticky-Header-Politur,
   Answer-Block-Styles, Reveal-Enhancement, Skip-Link.
   ========================================================= */

/* ---------- Grundlinie: box-sizing (Learning aus dem ersten Live-Einsatz:
   ohne border-box laufen Spalten mit Padding auf Mobilgeräten über) ---------- */
*, *::before, *::after { box-sizing: border-box; }

/* Defensiv gegen Fixbreiten aus Alt-Inhalten (typisch nach einem Umzug von
   einem Classic-Theme: .logo-container img{width:400px}). Ein solcher
   Overflow sprengte auf zwei Kundenseiten den Header samt Hamburger.
   clip statt hidden – hidden würde position:sticky im Header abschalten. */
html, body { overflow-x: clip; }

/* Embed-Airbag (Praxis-Befund 48, flirtuniversity.de): Core deckelt nur
   Bilder auf 100%, nicht iframe/embed/object/video. Alt-Inhalte mit fixen
   Embed-Breiten (560px-YouTube-Boxen) spannen sonst mobile Grids auf und
   der Überstand fällt dem overflow-clip oben zum Opfer. */
.wp-block-post-content :is(iframe, embed, object, video) { max-width: 100%; }

/* Vertikaler Rhythmus im Fließtext (Exzellenzrunde 1.0.0): Überschriften
   binden an den FOLGENDEN Absatz, nicht an den vorigen. Der uniforme
   blockGap kommt aus einer :where()-Regel ohne Spezifität, diese zwei
   Zeilen gewinnen sicher, und weil style.css auch Editor-Style ist,
   stimmt der Editor automatisch mit. */
.wp-block-post-content > :is(h2, h3, h4):not(:first-child) { margin-top: 2.75rem; }
.wp-block-post-content > :is(h2, h3, h4) + * { margin-top: 0.75rem; }
h1, h2, h3 { text-wrap: balance; }

/* Grundlinie fuer native Controls: hell ist der Standard, die 8 dunklen
   Looks setzen per styles.css ihrer Variation color-scheme: dark. */
:where(body) { color-scheme: light; }

/* Link- und Auswahl-Politur (Exzellenzrunde 1.0.0) */
a { text-underline-offset: 0.15em; }
::selection { background: var(--wp--preset--color--brand-light); }

/* Formulare (Exzellenzrunde 1.0.0): Kommentarformular und Suche waren
   die letzten ungestylten Flaechen. Rahmen bewusst muted statt border,
   dieselbe WCAG-1.4.11-Logik wie beim Menue-Button weiter unten. */
:root { accent-color: var(--wp--preset--color--brand-dark); }
.comment-form input:not([type="submit"]):not([type="checkbox"]),
.comment-form textarea,
.wp-block-search__input {
	width: 100%;
	padding: 0.7rem 0.9rem;
	border: 1px solid var(--wp--preset--color--muted);
	border-radius: var(--wp--custom--radius--small, 12px);
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	font: inherit;
}
.comment-form input:focus, .comment-form textarea:focus, .wp-block-search__input:focus {
	border-color: var(--wp--preset--color--brand-dark);
}

/* Taktile Rueckmeldung beim Klick */
.wp-element-button:active { transform: translateY(1px); }

/* Outline-Button-Hover: die :hover-Angabe einer Block-Style-Variation wird vom
   theme.json-Sanitizer verworfen, deshalb liegt der Hover hier. */
.wp-block-button.is-style-outline .wp-block-button__link:hover {
	background: var(--wp--preset--color--brand-light);
	color: var(--wp--preset--color--brand-dark);
}

/* Deep-Verlauf: Vollton-Rueckfall fuer Browser ohne color-mix, sonst stuende
   weisser CTA-Text auf weissem Grund. */
.has-deep-gradient-background { background-color: var(--wp--preset--color--deep); }

/* Header-CTA auf sehr schmalen Viewports ausblenden, der Menue-Button reicht. */
@media (max-width: 480px) {
	.hafen-header .hafen-header-cta { display: none; }
}

/* ---------- Skip-Link (a11y) ---------- */
.hafen-skip-link {
	position: absolute; left: -9999px; top: 12px; z-index: 300;
	background: var(--wp--preset--color--brand-dark); color: var(--wp--preset--color--base);
	padding: 11px 18px; border-radius: var(--wp--custom--radius--small, 12px); font-weight: 700; text-decoration: none;
}
.hafen-skip-link:focus { left: 12px; }

/* ---------- Sichtbarer Tastaturfokus ----------
   Der Browser-Default verschwindet auf farbigen Flächen. Zwei Ringe
   (Farbe + heller Absatz) sitzen auf hellem wie dunklem Grund.
   :is() statt :where(), damit die Regel Spezifität hat und nicht von
   der erstbesten Block-Regel ausgehebelt wird — ein Fokusring, den
   Core-CSS überschreiben kann, ist keine Grundlinie. */
:is(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--wp--preset--color--brand-dark);
	outline-offset: 2px;
	box-shadow: 0 0 0 4px var(--wp--preset--color--base);
}

/* ---------- Sticky header ---------- */
.hafen-header {
	position: sticky; top: 0; z-index: 60;
	background: color-mix(in srgb, var(--wp--preset--color--base) 80%, transparent);
	border-bottom: 1px solid transparent;
	transition: border-color .25s ease, box-shadow .25s ease;
}
/* Der Weichzeichner nur dort, wo :has() den Notausgang unten kennt.
   Ohne :has()-Unterstützung bleibt der Header ungefiltert — dann ist er
   auch nie Containing Block und das Mobilmenü kann gar nicht klemmen.
   Die Fläche ist zu 80 % deckend, der Verlust ist rein kosmetisch. */
@supports selector(:has(*)) {
	.hafen-header {
		-webkit-backdrop-filter: saturate(180%) blur(16px);
		backdrop-filter: saturate(180%) blur(16px);
	}
}
.hafen-header.is-scrolled {
	border-bottom-color: var(--wp--preset--color--border);
	box-shadow: var(--wp--preset--shadow--card);
}
.hafen-header { padding-block: 0.85rem; }
/* Der Kopf klebt am Core-Wrapper, nicht an sich selbst: Core rendert jeden
   Template-Part in <header class="wp-block-template-part">, und der ist im
   Standard genau so hoch wie .hafen-header. position:sticky kann ein
   Element nie aus seinem Containing Block schieben, also scrollte der Kopf
   bis 1.0.0 schlicht mit. Deshalb klebt der Wrapper, aber nur, wenn er
   nichts als den Theme-Kopf enthält (:only-child): Websites mit eigenem
   Kopfaufbau (Förderleiste, Navigationsband) behalten ihr Verhalten.
   Eingeloggt sitzt die Admin-Leiste fest oben; darunter kleben. Unter
   600 px scrollt die Leiste mit (Core setzt sie absolut), dann top:0. */
.wp-site-blocks > header.wp-block-template-part:has(> .hafen-header:only-child) { position: sticky; top: 0; z-index: 60; }
.admin-bar .wp-site-blocks > header.wp-block-template-part:has(> .hafen-header:only-child) { top: var(--wp-admin--admin-bar--height, 32px); }
@media (max-width: 600px) { .admin-bar .wp-site-blocks > header.wp-block-template-part:has(> .hafen-header:only-child) { top: 0; } }

/* ---------- Sprungziele nicht unter dem Kopfbereich parken ----------
   Ohne scroll-padding-top landet jeder Ankersprung hinter dem klebenden
   Header, auch der Skip-Link, also ausgerechnet die erste Handlung von
   Tastatur- und Screenreader-Nutzenden.
   Die Höhe ist je Website verschieden, weil sie am hochgeladenen Logo
   hängt (gemessen: Theme-Standard mit 56px-Logo rund 84px, eine Website
   mit 156x52-Logo rund 80px). Deshalb misst hafen.js den Header und
   schreibt den Ist-Wert nach --hafen-header-h; die Zahl hier ist nur der
   Rückfall ohne JavaScript. Ist der Header nicht klebend (per eigenem CSS
   auf position:static gesetzt, eine Theme-Option dafür gibt es nicht),
   setzt hafen.js die Variable auf 0 und die Regel ist wirkungslos.
   --hafen-scroll-offset (seit 0.9.1, auf :root setzen) ersetzt den Wert
   komplett. Bis 1.0.0 lag er zusätzlich als scroll-margin-top auf jedem
   [id]-Ziel im Inhalt, beides addierte sich zu rund 190 px.
   Eingeloggt kommt die Admin-Leiste dazu (Core setzt die Variable nur
   dann, sonst 0). style.css ist auch Editor-Style: im Editor-iframe gibt
   es keinen klebenden Kopf, dort bleibt der Wert aus. */
html:not(.block-editor-iframe__html) { scroll-padding-top: var(--hafen-scroll-offset, calc(var(--hafen-header-h, 84px) + var(--wp-admin--admin-bar--height, 0px) + 1rem)); }

.hafen-header .hafen-brand { gap: 0.6rem; }
.hafen-header .wp-block-site-title { margin: 0; }
.hafen-header .wp-block-site-title a { font-weight: 900; letter-spacing: -.03em; text-decoration: none; color: var(--wp--preset--color--contrast); }

/* ---------- Footer (neutral, per CSS gestylt) ---------- */
.hafen-footer {
	background: var(--wp--preset--color--deep); color: #b9c7cf;
	padding-block: var(--wp--preset--spacing--60) var(--wp--preset--spacing--50);
}
.hafen-footer .hafen-brand { gap: 0.6rem; margin-bottom: 0.9rem; }
.hafen-footer .wp-block-site-title { margin: 0; }
.hafen-footer .wp-block-site-title a { color: #fff; font-weight: 900; letter-spacing: -.03em; text-decoration: none; }
.hafen-footer .wp-block-site-tagline { color: #8ea3ad; font-size: 0.95rem; margin: 0 0 1.5rem; max-width: 340px; }
/* Kontrast: #7c9099 hielt 4,5:1 nur gegen sehr dunkle Fußzeilen (gegen den
   Preset-Standard #061620 sind es 5,52:1). Sobald jemand die Farbe "Deep"
   umfärbt, kippt der Wert: bei #223528 auf 3,92:1, also unter die Grenze
   von WCAG 1.4.3. #93a5ac hält denselben Blaugrau-Ton (Farbwinkel 197°
   statt 199°) und liegt gegen #223528 bei 5,11:1, gegen #061620 bei
   7,19:1, gegen alle mitgelieferten Variationen bei 6,85:1 oder besser.
   Nachrechnen: launch-paket/theme-aenderungen/kontrast-nachrechnen.php */
.hafen-footer .hafen-footer-copy { margin: 0; padding-top: 1.4rem; border-top: 1px solid rgba(255,255,255,.1); color: #93a5ac; font-size: 0.85rem; }
/* Der Credit ist sichtbar. Er stand bis 0.4.0 auf display:none — das Markup
   war da, der Absatz nicht, und wer ihn zeigen wollte, suchte lange.
   Wer ihn nicht will, löscht den Absatz unter Design > Editor > Fußbereich.
   Farben werden geerbt statt festgelegt, damit der Credit auch in einem
   hellen oder umgefärbten Fußbereich lesbar bleibt. */
.hafen-footer .hafen-footer-credit { margin: 0.4rem 0 0; color: inherit; opacity: .75; font-size: 0.8rem; }
.hafen-footer .hafen-footer-credit a { color: inherit; text-decoration: underline; }
.hafen-footer .hafen-footer-credit a:hover { opacity: 1; }
.hafen-footer a { color: #cfe0e6; }
.hafen-footer a:hover { color: #fff; }

/* ---------- Mobile-Menü ----------
   KRITISCH (zwei Kundenseiten): Ein backdrop-filter macht das Element zum
   Containing Block für position:fixed-Nachfahren. Das Core-Overlay
   (position:fixed; inset:0) richtete sich dadurch an der ~72px hohen
   Headerbox aus statt am Viewport — Menü unbenutzbar, Inhalt schien durch.
   Solange das Overlay offen ist, fällt der Filter deshalb weg und der
   Header verlässt seinen eigenen Stacking-Context.
   Die Hintergrundfarbe des Overlays selbst setzt der Navigation-Block
   (overlayBackgroundColor/overlayTextColor in parts/header.html) — ohne
   sie erbt Core "transparent". ---------- */
.hafen-header:has(.wp-block-navigation__responsive-container.is-menu-open) {
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
	z-index: 100000;
}
.wp-site-blocks > header.wp-block-template-part:has(.wp-block-navigation__responsive-container.is-menu-open) { z-index: 100000; }

/* Gurt dazu (Praxis-Befund 9b/49): Ohne eigene Overlay-Farbe malt Core das
   offene Menü fest WEISS mit schwarzem Text (spezifischere Core-Regel als
   jede simple Fallback-Zeile). Auf dunklen Stilvarianten wie Nachtfahrt
   blitzt dann ein weißes Menü auf. Der Selektor spiegelt Cores Form, damit
   die Theme-Farben genau dort gewinnen, wo Cores Weiß-Default gilt, und
   nirgendwo sonst: Navigationen mit eigener Hintergrund- oder Overlay-Farbe
   (auch per Header-Part-Attribut) bleiben unberührt, ebenso Cores
   background-color:inherit für eingefärbte Navigationen. */
.wp-block-navigation:not(.has-background) .wp-block-navigation__responsive-container.is-menu-open:not(.has-background):not(.disable-default-overlay) {
	background-color: var(--wp--preset--color--base, #fff);
}
.wp-block-navigation:not(.has-text-color) .wp-block-navigation__responsive-container.is-menu-open:not(.has-text-color):not(.disable-default-overlay) {
	color: var(--wp--preset--color--contrast, #000);
}

/* ---------- Menüsystem (1.1.0) ----------
   Jede der acht bekannten Live-Installationen hatte das Overlay per
   eigenem CSS nachgebaut. Das hier ist der gemeinsame Nenner, gegen das
   Core-CSS von WP 7.1 nachgerechnet: kein !important, Spezifität so
   niedrig wie möglich (:where), damit Site-CSS mit einer Klasse mehr
   weiter gewinnt. Nur die Kinder-Liste braucht Cores (0,5,0). */

/* 1. Bruchkante 782 px statt Cores 600 px, nur im Kopf. Menüs mit fünf
   Punkten laufen sonst zwischen 600 und rund 1000 px über. Core zeigt ab
   600 px das Desktop-Menü (0,3,0) und versteckt den Knopf (0,2,0), hier je
   eine Klasse mehr. overlayMenu "always" (hidden-by-default/always-shown)
   und "never" bleiben unberührt. */
@media (max-width: 781px) {
	.hafen-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none; }
	.hafen-header .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex; }
}

/* 2. Menüknopf als beschriftete Pille, wo immer Core ihn zeigt (auch bei
   overlayMenu "always"). Kein display hier, sonst stünde er ab 782 px
   wieder da. Rand brand-dark auf base: mindestens 5:1 in allen Looks
   (WCAG 1.4.11 verlangt 3:1). Label über --hafen-menu-label (functions.php). */
.hafen-header .wp-block-navigation__responsive-container-open {
	align-items: center; gap: 0.45rem; min-height: 44px; padding: 0.35rem 0.8rem;
	border: 1.5px solid var(--wp--preset--color--brand-dark); border-radius: var(--wp--custom--radius--pill, 999px);
	background: var(--wp--preset--color--base); color: var(--wp--preset--color--brand-dark);
	transition: background-color .2s ease;
}
.hafen-header .wp-block-navigation__responsive-container-open:hover { background: color-mix(in srgb, var(--wp--preset--color--brand-dark) 10%, var(--wp--preset--color--base)); }
/* Label nur neben dem Icon: bei "Icon anzeigen: aus" schreibt Core selbst
   ein Text-Label in den Knopf, sonst stünde dort "Menu Menu". */
.hafen-header .wp-block-navigation__responsive-container-open:has(svg)::after {
	content: var(--hafen-menu-label, "Menu"); font-size: 1rem; font-weight: 700; letter-spacing: -0.01em;
}
.hafen-header .wp-block-navigation__responsive-container-open svg { width: 22px; height: 22px; }

/* 3. Offenes Overlay: Zeilen über die volle Breite mit Haarlinie, große
   Labels, Kinder eingerückt an einer Linie, Schließen als 44-px-Kreis.
   Farben kommen vom Block (overlayBackgroundColor/overlayTextColor) oder
   aus dem Rückfall oben; alle Linien aus currentColor, damit sie auf
   jedem Look und auch bei fremden Overlay-Farben stimmen.
   Core liest --navigation-layout-justification-setting für align-items;
   "stretch" zieht die Zeilen auf volle Breite, auch bei rechts
   ausgerichteter Navigation (die ul setzt den Wert selbst, darum zweimal). */
.wp-block-navigation__responsive-container.is-menu-open,
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container { --navigation-layout-justification-setting: stretch; }
.wp-block-navigation__responsive-container.is-menu-open { gap: 0; }
.wp-block-navigation__responsive-container.is-menu-open :where(.wp-block-navigation__container > .wp-block-navigation-item + .wp-block-navigation-item) {
	border-top: 1px solid color-mix(in srgb, currentColor 28%, transparent);
}
/* Tippziel über min-height, nicht über padding: Cores padding:0 im Overlay hat (0,4,0). */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content { display: flex; align-items: center; min-height: 52px; }
.wp-block-navigation__responsive-container.is-menu-open :where(.wp-block-navigation__container > .wp-block-navigation-item) > .wp-block-navigation-item__content {
	font-size: 1.35rem; font-weight: 700; letter-spacing: -0.015em; line-height: 1.2;
}
/* Elternpunkt ohne eigenes Ziel als Eyebrow. Core rendert ihn im
   Hover-Modus als <a> ohne href, im Klick-Modus ("Untermenüs per Klick")
   als <button>. Eltern mit Link bleiben normale Zeile: ein Link darf nicht
   wie eine Überschrift aussehen. margin statt padding, siehe oben; 44 px
   und 14 px Schrift, weil der Button im Klick-Modus ein Tab-Stopp ist. */
.wp-block-navigation__responsive-container.is-menu-open :where(.wp-block-navigation__container > .has-child) > :is(button, a:not([href])).wp-block-navigation-item__content {
	min-height: 44px; margin-top: 0.75rem; font-size: 0.875rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase;
}
/* Kinder-Liste: Cores Overlay-Selektor ohne :where (0,5,0), die einzige
   Stelle, an der das Theme so hoch muss (Core: padding 2rem, border:none,
   min-width 200). Der Einzug ist Linie plus Cores 1em Kind-Padding. */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .has-child .wp-block-navigation__submenu-container {
	margin: 0 0 0.25rem 0.25rem; padding: 0 0 0.5rem; min-width: 0;
	border-left: 2px solid color-mix(in srgb, currentColor 28%, transparent);
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container :where(.wp-block-navigation-item__content) {
	min-height: 44px; font-size: 1.05rem; font-weight: 500;
}
/* Schließen: bewusst (0,1,0) wie Cores Grundregel, gewinnt nur durch die
   spätere Quelle; Site-CSS mit einer Klasse mehr gewinnt weiter. */
:where(.wp-block-navigation__responsive-container.is-menu-open) .wp-block-navigation__responsive-container-close {
	width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%;
	border: 1px solid color-mix(in srgb, currentColor 50%, transparent);
	background: color-mix(in srgb, currentColor 8%, transparent);
}
.wp-block-navigation__responsive-container.is-menu-open :where(.wp-block-navigation-item__content[aria-current]) {
	text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 0.25em; text-decoration-color: var(--wp--preset--color--brand-dark);
}

/* 4. Desktop-Dropdown ab 782 px: Cores Weiß/Schwarz-Regeln 1:1 gespiegelt
   (0,3,0, spätere Quelle), greift wie bei Core nur für Navigationen ohne
   eigene Farben. Politur nur für das echte Dropdown: nicht im offenen
   Overlay und nicht bei open-always (statisch, transparent). */
.wp-block-navigation:not(.has-background) .wp-block-navigation__submenu-container { background-color: var(--wp--preset--color--base); border-color: var(--wp--preset--color--border); }
.wp-block-navigation:not(.has-text-color) .wp-block-navigation__submenu-container { color: var(--wp--preset--color--contrast); }
:where(.wp-block-navigation__responsive-container:not(.is-menu-open), .wp-block-navigation > .wp-block-navigation__container) .has-child:not(.open-always) > .wp-block-navigation__submenu-container {
	border-radius: var(--wp--custom--radius--small, 12px); box-shadow: var(--wp--preset--shadow--lift); padding: 0.4rem 0;
}

/* Brand-Zeile mobil: Logo + langer Site-Title brechen nebeneinander
   unschön um. Gibt es ein Logo, trägt es unter 640px die Marke allein;
   ohne Logo bleibt der Titel selbstverständlich stehen. */
@media (max-width: 640px) {
	.hafen-brand:has(.wp-block-site-logo) .wp-block-site-title { display: none; }
}
/* Part "Header (logo only)": der Titel bleibt im Markup und erscheint nur,
   solange kein Logo hochgeladen ist (sonst stünde links nichts, auch kein
   Link zur Startseite). */
.hafen-brand-logo-only:has(.wp-block-site-logo) .wp-block-site-title { display: none; }

/* ---------- Tabelle und Zitatquelle ----------
   Zellabstände und Rahmenfarbe hier statt in theme.json: Core kompiliert
   dort "& td, & th" falsch (nur th kommt an) und :root :where() verliert
   gegen Cores .wp-block-table td (0,1,1). cite: Cores quote/theme.css setzt
   color:currentColor und font-size mit (0,1,1), theme.json käme nicht an. */
.wp-block-table table :is(td, th) { border-color: var(--wp--preset--color--border); padding: 0.6rem 0.8rem; }
.wp-block-quote cite { color: var(--wp--preset--color--muted); font-size: var(--wp--preset--font-size--small); font-style: normal; }

/* ---------- Bild-Stil Passepartout (GitHub-Issue #5, horstwenzel.com) ----------
   Dünner Rahmen in Markenfarbe mit Abstand zum Bild, Bildunterschrift als
   Kicker. outline zählt nicht zum Layout, deshalb das Padding auf der figure. */
.wp-block-image.is-style-hafen-passepartout { padding: 15px; }
.wp-block-image.is-style-hafen-passepartout img {
	outline: 1px solid color-mix(in srgb, var(--wp--preset--color--brand) 55%, transparent);
	outline-offset: 14px;
	border-radius: 0;
}
.wp-block-image.is-style-hafen-passepartout figcaption {
	margin-top: 1.6rem; text-align: center; text-transform: uppercase;
	letter-spacing: 0.2em; font-size: 0.75rem; font-weight: 700;
}

/* ---------- Brand mark ---------- */
.hafen-brand-mark {
	display: inline-grid; place-items: center; width: 40px; height: 40px;
	border-radius: var(--wp--custom--radius--small, 12px); color: #fff;
	background: var(--wp--preset--gradient--brand);
	box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--wp--preset--color--brand) 70%, transparent);
}
.hafen-tag {
	font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
	color: var(--wp--preset--color--ai-dark); background: var(--wp--preset--color--ai-light);
	padding: 4px 8px; border-radius: var(--wp--custom--radius--small, 12px);
}

/* ---------- Eyebrow ---------- */
.hafen-eyebrow {
	display: inline-flex; align-items: center; gap: 9px;
	font-size: 13px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
	color: var(--wp--preset--color--brand-dark);
}
.hafen-eyebrow.is-ai { color: var(--wp--preset--color--ai-dark); }
.hafen-eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 18%, transparent); }

/* =========================================================
   Answer-engine block styles (rein visuell, aus Core-Blöcken).
   Die echten schema-emittierenden Custom-Blöcke kommen in
   "Hafen Core". Hier: Gruppen-/Details-Styles für denselben Look.
   ========================================================= */
.wp-block-group.is-style-hafen-tldr,
.wp-block-group.is-style-hafen-definition,
.wp-block-group.is-style-hafen-steps {
	border: 1px solid var(--wp--preset--color--border);
	border-left: 4px solid var(--wp--preset--color--brand);
	border-radius: var(--wp--custom--radius--card, 18px);
	padding: clamp(1.1rem, 3vw, 1.5rem);
	/* base statt #fff: sonst steht in der dunklen Variation "Nachtfahrt"
	   heller Text auf einer weißen Karte (gemessen 1.12:1). */
	background: var(--wp--preset--color--base);
	box-shadow: var(--wp--preset--shadow--card);
}
.wp-block-group.is-style-hafen-definition { border-left-color: var(--wp--preset--color--ai); }
.wp-block-group.is-style-hafen-steps { border-left-color: var(--wp--preset--color--accent-3); }

.wp-block-group.is-style-hafen-card {
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--card, 18px);
	padding: clamp(1.4rem, 3vw, 1.9rem);
	background: var(--wp--preset--color--base);
	box-shadow: var(--wp--preset--shadow--card);
	height: 100%;
	/* Ohne overflow schneidet der Radius nichts ab — ein Bild ragte
	   sichtbar über Rand und Ecken hinaus. */
	overflow: hidden;
	transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.wp-block-group.is-style-hafen-card:hover {
	transform: translateY(-6px);
	box-shadow: var(--wp--preset--shadow--lift);
	border-color: color-mix(in srgb, var(--wp--preset--color--brand) 40%, var(--wp--preset--color--border));
}
/* Die Karte ist ein Flex-Container mit align-items:flex-start. Medien darin
   werden dadurch nicht auf Kartenbreite gestreckt, sondern auf ihre
   intrinsische Breite (auf einer Kundenseite 1500px) — das Bild hing aus der
   Karte heraus. Gilt für jedes Medium in der Karte, nicht nur Beitragsbilder. */
.wp-block-group.is-style-hafen-card > * { max-width: 100%; }
.wp-block-group.is-style-hafen-card :where(.wp-block-post-featured-image, .wp-block-image, figure) {
	align-self: stretch; width: 100%; margin: 0;
}
.wp-block-group.is-style-hafen-card :where(.wp-block-post-featured-image, .wp-block-image, figure) img {
	display: block; width: 100%; height: 100%; object-fit: cover;
}

/* ---------- Magazin-Liste (Blog, Archiv, Suche) — neu in 0.9.0 ----------
   Zwei Spalten statt drei, der erste Beitrag der Seite als Aufmacher über
   beide Spalten. Ein 3er-Raster quetscht Titel und Excerpt und macht lange
   Archive monoton (Praxis-Befund 44, flirtuniversity.de). */
.hafen-magazin { row-gap: var(--wp--preset--spacing--50); }
.hafen-magazin > li { min-width: 0; }
.hafen-magazin .is-style-hafen-card { padding: 0 0 1.25rem; }
.hafen-magazin .is-style-hafen-card > :not(.wp-block-post-featured-image) {
	padding-left: 1.25rem;
	padding-right: 1.25rem;
}
.hafen-magazin .wp-block-post-featured-image { margin-bottom: 0.9rem; }
/* Karten ohne Beitragsbild: Markenbanderole statt Loch im Raster (Befund 46) */
.hafen-magazin .is-style-hafen-card:not(:has(.wp-block-post-featured-image))::before {
	content: "";
	display: block;
	align-self: stretch;
	height: 10px;
	margin-bottom: 1.1rem;
	background: linear-gradient(90deg, var(--wp--preset--color--brand), var(--wp--preset--color--brand-light));
}
/* Ruhige Titel, Markenfarbe erst beim Hover */
.hafen-magazin .wp-block-post-title a {
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
}
.hafen-magazin .wp-block-post-title a:hover { color: var(--wp--preset--color--brand); }
/* Aufmacher: erster Beitrag über beide Spalten, Bild links */
@media (min-width: 782px) {
	.hafen-magazin > li:first-child { grid-column: 1 / -1; }
	.hafen-magazin > li:first-child .is-style-hafen-card {
		display: grid;
		grid-template-columns: 1.15fr 1fr;
		column-gap: clamp(1.2rem, 3vw, 2rem);
		align-items: center;
		padding: 0;
	}
	.hafen-magazin > li:first-child .wp-block-post-featured-image {
		grid-row: 1 / span 4;
		height: 100%;
		margin: 0;
	}
	.hafen-magazin > li:first-child .is-style-hafen-card > :not(.wp-block-post-featured-image) {
		grid-column: 2;
		padding-left: 0;
		padding-right: clamp(1.2rem, 3vw, 2rem);
	}
	.hafen-magazin > li:first-child .is-style-hafen-card:not(:has(.wp-block-post-featured-image)) {
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		text-align: left;
		padding: 0 0 1.4rem;
	}
	.hafen-magazin > li:first-child .is-style-hafen-card:not(:has(.wp-block-post-featured-image)) > * {
		padding-left: 1.4rem;
		padding-right: 1.4rem;
	}
	.hafen-magazin > li:first-child .wp-block-post-title { font-size: clamp(1.5rem, 2.6vw, 2rem); }
	.hafen-magazin > li:first-child .wp-block-post-excerpt { font-size: 1.05rem; }
}
@media (max-width: 781px) {
	.hafen-magazin > li:first-child .wp-block-post-title { font-size: 1.35rem; }
}
/* Pagination: echte Tippziele, aktuelle Seite markiert */
.wp-block-query-pagination .page-numbers,
.wp-block-query-pagination-previous,
.wp-block-query-pagination-next {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 12px;
	border-radius: var(--wp--custom--radius--small, 12px);
}
.wp-block-query-pagination .page-numbers.current {
	background: var(--wp--preset--color--brand-light);
	color: var(--wp--preset--color--brand-dark);
	font-weight: 700;
}

/* Details block styled as FAQ item */
.wp-block-details.is-style-hafen-faq {
	border-bottom: 1px solid var(--wp--preset--color--border);
	padding: 4px 0;
}
.wp-block-details.is-style-hafen-faq summary { font-weight: 700; cursor: pointer; padding: 10px 0; }

/* ---------- Reveal enhancement (progressive) ----------
   Default: sichtbar. Erst wenn JS die Klasse .hafen-anim setzt,
   wird versteckt + animiert. So bleibt der Inhalt ohne JS da. */
.hafen-reveal { transition: opacity .7s cubic-bezier(.16,.8,.3,1), transform .7s cubic-bezier(.16,.8,.3,1); }
.hafen-anim .hafen-reveal { opacity: 0; transform: translateY(24px); }
.hafen-anim .hafen-reveal.is-in { opacity: 1; transform: none; }

/* ---------- Icon-ish list markers for feature lists ----------
   Beide Selektoren: .is-style-hafen-checklist ist der registrierte
   Block-Style (Inserter), .hafen-checklist bleibt für Bestandsinhalte
   erhalten, die die Klasse direkt gesetzt haben. */
.hafen-checklist,
.is-style-hafen-checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.hafen-checklist li,
.is-style-hafen-checklist li { position: relative; padding-left: 30px; }
.hafen-checklist li::before,
.is-style-hafen-checklist li::before {
	content: ""; position: absolute; left: 0; top: .35em; width: 18px; height: 18px;
	border-radius: var(--wp--custom--radius--small, 12px); background: var(--wp--preset--color--brand-light);
}
/* Der Haken als Maske statt als eingefärbtes SVG: so nimmt er die
   Markenfarbe der jeweiligen Style-Variation an. Fest kodiertes Petrol
   war in der dunklen Variation auf dunkelgrünem Grund kaum zu sehen. */
.hafen-checklist li::after,
.is-style-hafen-checklist li::after {
	content: ""; position: absolute; left: 0; top: .35em; width: 18px; height: 18px;
	background-color: var(--wp--preset--color--brand-dark);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 13px no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 13px no-repeat;
}

/* ---------- Zeitstrahl (Pattern hafen/timeline) ----------
   Vertikale Linie + Punkte für Projekthistorien. Aufbau aus
   Core-Blöcken, hier nur die Linie/Punkte, die Core nicht kann.
   Farben ausschließlich über Theme-Presets. ---------- */
.hafen-timeline { position: relative; max-width: 760px; margin-left: auto; margin-right: auto; padding-left: 34px; }
.hafen-timeline::before {
	content: ""; position: absolute; left: 9px; top: 8px; bottom: 8px; width: 2px;
	background: var(--wp--preset--color--border);
}
.hafen-timeline-item { position: relative; padding: 0 0 2.5rem 26px; }
.hafen-timeline-item:last-child { padding-bottom: 0; }
.hafen-timeline-item::before {
	content: ""; position: absolute; left: -33px; top: 7px; width: 18px; height: 18px;
	border-radius: 50%; background: var(--wp--preset--color--surface);
	border: 3px solid var(--wp--preset--color--brand);
}
.hafen-timeline-item.is-highlight::before {
	background: var(--wp--preset--color--ai);
	border-color: var(--wp--preset--color--ai);
	box-shadow: 0 0 0 4px var(--wp--preset--color--ai-light);
}
.hafen-timeline-year {
	/* brand-dark statt brand: die Jahreszahl ist Text in 22px/400 und
	   braucht 4,5:1. brand liegt im Standard bei 2,66:1 auf Weiss. */
	font-family: var(--wp--preset--font-family--serif);
	font-size: 1.375rem; line-height: 1.2;
	color: var(--wp--preset--color--brand-dark);
}
.hafen-timeline-item.is-highlight .hafen-timeline-year { color: var(--wp--preset--color--ai-dark); }

/* =========================================================
   Utility-Klassen für die Patterns (was Core-Blöcke nicht können)
   ========================================================= */

/* Gradient-Text für Headline-Akzente */
.hafen-grad-text {
	background: linear-gradient(115deg, var(--wp--preset--color--brand) 10%, var(--wp--preset--color--ai) 90%);
	-webkit-background-clip: text; background-clip: text;
	-webkit-text-fill-color: transparent; color: transparent;
}

/* Hero-Hintergrund: sanftes Mesh + feines Raster */
.hafen-hero { position: relative; isolation: isolate; overflow: hidden; }
.hafen-hero::before {
	content: ""; position: absolute; inset: 0; z-index: -2;
	background:
		radial-gradient(1100px 540px at 82% -14%, color-mix(in srgb, var(--wp--preset--color--brand) 16%, transparent), transparent 60%),
		radial-gradient(780px 500px at 4% 8%, color-mix(in srgb, var(--wp--preset--color--ai) 13%, transparent), transparent 58%);
}
.hafen-hero::after {
	content: ""; position: absolute; inset: 0; z-index: -2; opacity: .5;
	background-image: linear-gradient(color-mix(in srgb, var(--wp--preset--color--contrast) 4%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--wp--preset--color--contrast) 4%, transparent) 1px, transparent 1px);
	background-size: 34px 34px;
	-webkit-mask-image: radial-gradient(860px 520px at 60% 18%, #000, transparent 75%);
	mask-image: radial-gradient(860px 520px at 60% 18%, #000, transparent 75%);
}

/* Badge-Pille (Hero-Eyebrow als Chip) */
.hafen-chip {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 7px 15px; border-radius: var(--wp--custom--radius--pill, 999px); font-size: 0.85rem; font-weight: 700;
	background: var(--wp--preset--color--base); border: 1px solid var(--wp--preset--color--border);
	box-shadow: var(--wp--preset--shadow--card);
	color: var(--wp--preset--color--text-soft);
}

/* Zitat-Pille im AI-Panel */
.hafen-cited {
	display: inline; font-weight: 700; color: var(--wp--preset--color--ai-dark);
	background: var(--wp--preset--color--ai-light); padding: 1px 8px; border-radius: var(--wp--custom--radius--small, 12px);
	box-decoration-break: clone; -webkit-box-decoration-break: clone;
}

/* Kleiner Marker-Punkt für Panel-Kopfzeilen */
.hafen-panel-tag {
	font-size: 0.75rem; font-weight: 700; color: var(--wp--preset--color--brand-dark);
	background: var(--wp--preset--color--brand-light); padding: 4px 10px; border-radius: var(--wp--custom--radius--pill, 999px);
}

/* Feature-/Panel-Icon-Box */
.hafen-ic {
	display: inline-grid; place-items: center; width: 48px; height: 48px; flex: none;
	border-radius: var(--wp--custom--radius--small, 12px); color: #fff; background: var(--wp--preset--gradient--brand);
}
.hafen-ic svg { width: 24px; height: 24px; }
.hafen-ic.is-ai { background: var(--wp--preset--gradient--ai); }
.hafen-ic.is-accent-3 { background: var(--wp--preset--gradient--accent-3); }
.hafen-ic.is-accent-2 { background: var(--wp--preset--gradient--accent-2); }

/* Große Kennzahl (Performance) */
.hafen-stat { font-size: clamp(2.75rem, 6vw, 3.75rem); font-weight: 900; letter-spacing: -.03em; line-height: 1; }

/* Hero-Trust-Zeile */
.hafen-trust { color: var(--wp--preset--color--muted); font-size: 0.9rem; font-weight: 600; }
.hafen-trust p { margin: 0; }

/* Hero-KI-Panel (Boxen per Klasse, damit das Block-Markup gültig bleibt) */
.hafen-ml-auto { margin-left: auto; }
.hafen-qbubble { background: var(--wp--preset--color--surface); border-radius: var(--wp--custom--radius--small, 12px); padding: 0.8rem 1rem; }
.hafen-qbubble p { margin: 0; }
.hafen-src { padding: 0.75rem 0.9rem; border: 1px dashed var(--wp--preset--color--brand); border-radius: var(--wp--custom--radius--small, 12px); background: var(--wp--preset--color--brand-light); }
.hafen-src-text p { margin: 0; }
.hafen-ic-sm { width: 34px; height: 34px; border-radius: var(--wp--custom--radius--small, 12px); }
.hafen-ic-sm svg { width: 18px; height: 18px; }

@media (prefers-reduced-motion: reduce) {
	.hafen-reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
	.hafen-header { transition: none; }
}

/* ponytail: Kompat für Alt-Inhalte (boeasy.de, Stand 0.5.0) — entfernen, sobald Inhalte migriert sind */
:root {
	--wp--preset--color--memberjet: var(--wp--preset--color--accent-2);
	--wp--preset--color--adjet: var(--wp--preset--color--accent-3);
	--wp--preset--gradient--memberjet: var(--wp--preset--gradient--accent-2);
	--wp--preset--gradient--adjet: var(--wp--preset--gradient--accent-3);
}
.has-memberjet-color { color: var(--wp--preset--color--accent-2); }
.has-memberjet-background-color { background-color: var(--wp--preset--color--accent-2); }
.has-adjet-color { color: var(--wp--preset--color--accent-3); }
.has-adjet-background-color { background-color: var(--wp--preset--color--accent-3); }
.has-memberjet-gradient-background { background: var(--wp--preset--gradient--accent-2); }
.has-adjet-gradient-background { background: var(--wp--preset--gradient--accent-3); }
.hafen-ic.is-memberjet { background: var(--wp--preset--gradient--accent-2); }
.hafen-ic.is-adjet { background: var(--wp--preset--gradient--accent-3); }
