/*
Theme Name: Partner-Portal-Theme
Theme URI: https://partner-portal.app
Author: IQ Process
Author URI: https://partner-portal.app
Description: FSE-Theme mit ruhigem Slate/Blau-Design, Plus Jakarta Sans, Portal-Sektion (Parallax), Landing-Mustern und Sticky-Header.
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 7.4
Version: 2.1.3
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: partner-portal-theme
Tags: full-site-editing, block-patterns, block-styles, wide-blocks, custom-colors, custom-logo, editor-style, translation-ready
*/

/*
 * Fallback-Stack falls Google Fonts blockiert sind (entspricht Kubio --kubio-system-fonts).
 */
:root {
	--kubio-system-fonts: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	--ppt-radius-card: 20px;
	--ppt-radius-inner: 12px;
	--ppt-radius-pill: 9999px;
	--ppt-transition: 0.22s cubic-bezier(0.25, 0.1, 0.25, 1);
	--pp-header-sticky-z: 120;
	--pp-cta-glow: 0 8px 28px -6px rgba(219, 23, 23, 0.35);
}

html {
	scroll-behavior: smooth;
	box-sizing: border-box;
}

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

body {
	margin: 0;
	font-family: "Plus Jakarta Sans", var(--kubio-system-fonts);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* Volle Breite: kein horizontales Scrollen durch alignfull-Verschiebung */
.wp-site-blocks,
.block-editor-block-list__layout.is-root-container {
	overflow-x: clip;
}

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

::selection {
	background: color-mix(in srgb, var(--wp--preset--color--accent, #db1717) 24%, transparent);
	color: var(--wp--preset--color--contrast, #0f172a);
}

/* Header: Topbar + Sticky-Zeile */
.pp-header-shell {
	position: relative;
	z-index: var(--pp-header-sticky-z);
}

.pp-header-topbar {
	border-bottom: 1px solid color-mix(in srgb, var(--wp--preset--color--base, #fff) 12%, transparent);
}

.pp-site-header {
	border-bottom: 1px solid var(--wp--preset--color--surface-alt, #e5e7eb);
	background-color: color-mix(in srgb, var(--wp--preset--color--base, #fff) 92%, transparent);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	box-shadow: var(--wp--preset--shadow--header, 0 1px 0 rgba(43, 45, 66, 0.06));
}

.pp-site-header--sticky {
	position: sticky;
	top: 0;
	z-index: calc(var(--pp-header-sticky-z) + 1);
}

@supports not (backdrop-filter: blur(12px)) {
	.pp-site-header {
		background-color: var(--wp--preset--color--base, #fff);
	}
}

/* Flex: keine Überlappung */
.pp-site-header .wp-block-group.is-layout-flex,
.pp-site-footer .wp-block-group.is-layout-flex {
	row-gap: 1rem;
	column-gap: 1.5rem;
}

.pp-site-header .wp-block-group.is-layout-flex > *,
.pp-site-footer .wp-block-group.is-layout-flex > * {
	min-width: 0;
}

/*
 * Karten: Rand + ausgewogener Schatten (theme.json Presets --card / --card-hover).
 * Layout-Fixes (gleiche Hoehen, overflow) bleiben; Schatten wirken, ohne zu „schmieren“.
 */
.pp-portal-card {
	border: 1px solid var(--wp--preset--color--surface-alt, #e5e7eb);
	border-radius: var(--ppt-radius-card);
	box-shadow: 0 4px 8px rgba(15, 23, 42, 0.06),
		var(--wp--preset--shadow--card, 0 12px 36px -12px rgba(43, 45, 66, 0.16));
	transition: border-color var(--ppt-transition), box-shadow var(--ppt-transition);
}

.pp-portal-card:hover {
	box-shadow: 0 8px 16px rgba(15, 23, 42, 0.08),
		var(--wp--preset--shadow--card-hover, 0 24px 48px -14px rgba(15, 23, 42, 0.18));
	border-color: color-mix(in srgb, var(--wp--preset--color--accent, #db1717) 22%, var(--wp--preset--color--surface-alt, #e2e8f0));
}

.pp-portal-card .wp-block-post-excerpt,
.pp-portal-card .wp-block-post-excerpt__excerpt {
	color: var(--wp--preset--color--contrast-muted, #6b7280);
}

/*
 * Kontrast-Fallbacks: „base“ in der Palette = Weiss (Kubio) — darf nicht Standard-Schrift auf hellem Grund sein.
 * elements.button in theme.json nutzt base fuer CTAs; Outline-Buttons ohne eigenes Preset waren dadurch unsichtbar.
 */
.has-base-background-color:not(.has-contrast-background-color),
.has-base-subtle-background-color,
.has-surface-background-color {
	color: var(--wp--preset--color--contrast, #0f172a);
}

.has-base-background-color:not(.has-contrast-background-color) .wp-block-button__link.has-primary-background-color,
.has-base-background-color:not(.has-contrast-background-color) .wp-block-button__link.has-contrast-background-color {
	color: var(--wp--preset--color--base, #fff) !important;
}

.has-contrast-background-color .wp-block-button.is-style-outline .wp-block-button__link,
.pp-section-cta .wp-block-button.is-style-outline .wp-block-button__link {
	color: var(--wp--preset--color--base, #fff) !important;
	border-color: color-mix(in srgb, var(--wp--preset--color--base, #fff) 92%, transparent) !important;
}

.pp-portal-card > .wp-block-separator.is-style-wide {
	margin-top: var(--wp--preset--spacing--40, 2rem);
	margin-bottom: var(--wp--preset--spacing--40, 2rem);
	color: var(--wp--preset--color--surface-alt, #e2e8f0);
}

/* Hero-Muster: Verlauf-Kachel leicht abheben (Rahmen nur in CSS — Block-JSON bleibt schlank) */
.pp-elevated-surface {
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: var(--wp--preset--shadow--card, 0 8px 24px -8px rgba(15, 23, 42, 0.08)),
		0 2px 6px rgba(15, 23, 42, 0.04);
	border: 1px solid var(--wp--preset--color--surface-alt, #e2e8f0);
	transition: box-shadow var(--ppt-transition);
}

.pp-elevated-surface:hover {
	box-shadow: var(--wp--preset--shadow--card-hover, 0 20px 40px -16px rgba(15, 23, 42, 0.12));
}

/*
 * Gleiche Kartenhoehe (pp-equal-height-cards, ggf. per PHP an Columns gehaengt).
 * - align-items:center auf Columns hebt Stretch auf → hier zurueck auf stretch.
 * - Karte direkt unter Spalte ODER in Zwischen-Group (Core layout).
 */
.wp-block-columns.is-layout-flex.pp-equal-height-cards,
.wp-block-columns.pp-equal-height-cards {
	display: flex !important;
	flex-wrap: wrap !important;
	align-items: stretch !important;
	align-content: stretch !important;
	/* Sichtbarer Abstand auch wenn blockGap im Editor nicht greift */
	gap: var(--pp-equal-cols-gap, clamp(1.25rem, 4vw, 2rem));
	width: 100%;
	box-sizing: border-box;
}

/* Vertikale Ausrichtung der Zeile (Editor) wuerde sonst Hoehen angleichen verhindern */
.wp-block-columns.pp-equal-height-cards.are-vertically-aligned-center,
.wp-block-columns.pp-equal-height-cards.are-vertically-aligned-bottom,
.wp-block-columns.pp-equal-height-cards.are-vertically-aligned-top,
.wp-block-columns.pp-equal-height-cards.is-vertically-aligned-center,
.wp-block-columns.pp-equal-height-cards.is-vertically-aligned-bottom,
.wp-block-columns.pp-equal-height-cards.is-vertically-aligned-top {
	align-items: stretch !important;
}

@media (min-width: 782px) {
	.wp-block-columns.pp-equal-height-cards {
		flex-wrap: nowrap !important;
	}

	.wp-block-columns.pp-equal-height-cards > .wp-block-column {
		flex: 1 1 0% !important;
		max-width: none !important;
		width: auto !important;
	}
}

.wp-block-columns.pp-equal-height-cards > .wp-block-column {
	display: flex !important;
	flex-direction: column !important;
	align-self: stretch !important;
	align-items: stretch !important;
	min-width: 0;
	box-sizing: border-box;
}

/* Einzel-Spalte mit vertikaler Ausrichtung wuerde sonst nicht mitstrecken */
.wp-block-columns.pp-equal-height-cards > .wp-block-column[class*='vertically-aligned'] {
	align-self: stretch !important;
}

/* Karte / KPI-Zelle direkt unter Spalte */
.wp-block-columns.pp-equal-height-cards > .wp-block-column > .wp-block-group.pp-portal-card,
.wp-block-columns.pp-equal-height-cards > .wp-block-column > .wp-block-group.pp-stat-cell {
	flex: 1 1 0% !important;
	display: flex !important;
	flex-direction: column !important;
	width: 100% !important;
	min-height: 100% !important;
	box-sizing: border-box !important;
}

/* Zwischen-Group (z. B. is-layout-constrained) fuellt Spalte, Karte darin waechst mit */
.wp-block-columns.pp-equal-height-cards
	> .wp-block-column
	> .wp-block-group:not(.pp-portal-card):not(.pp-stat-cell) {
	flex: 1 1 0% !important;
	display: flex !important;
	flex-direction: column !important;
	min-height: 0 !important;
	width: 100% !important;
	box-sizing: border-box !important;
}

.wp-block-columns.pp-equal-height-cards
	> .wp-block-column
	> .wp-block-group:not(.pp-portal-card):not(.pp-stat-cell)
	.wp-block-group.pp-portal-card,
.wp-block-columns.pp-equal-height-cards
	> .wp-block-column
	> .wp-block-group:not(.pp-portal-card):not(.pp-stat-cell)
	.wp-block-group.pp-stat-cell {
	flex: 1 1 auto !important;
	display: flex !important;
	flex-direction: column !important;
	width: 100% !important;
	min-height: 100% !important;
	box-sizing: border-box !important;
}

/* App-Vorlagen (Patterns): hervorgehobene Preis-Karte, optionaler Login-Breiten-Container */
.pp-pricing-highlight {
	box-shadow: 0 0 0 2px var(--wp--preset--color--primary, #db1717),
		0 16px 48px -18px rgba(15, 23, 42, 0.22);
}

.pp-login-shell {
	max-width: 420px;
	margin-left: auto;
	margin-right: auto;
}

/* Navigation: dezente aktive Nähe */
.pp-site-header .wp-block-navigation .wp-block-navigation-item__content {
	border-radius: 8px;
	padding: 0.35rem 0.5rem;
	transition: color var(--ppt-transition), background-color var(--ppt-transition);
}

.pp-site-header .wp-block-navigation .wp-block-navigation-item__content:hover {
	background-color: var(--wp--preset--color--primary-soft, #fff1f1);
}

/* Parallax-Sektionen (Hintergrund per assets/parallax.js verschoben) */
.pp-parallax {
	position: relative;
	overflow: hidden;
	isolation: isolate;
	box-sizing: border-box;
	width: 100%;
}

.pp-parallax--hero {
	min-height: clamp(22rem, 70vh, 40rem);
}

.pp-parallax--band {
	min-height: clamp(14rem, 36vh, 22rem);
}

.pp-parallax__bg {
	position: absolute;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	background-repeat: no-repeat;
	background-size: cover;
	background-position: center center;
	will-change: transform;
	backface-visibility: hidden;
	transform: translateZ(0);
}

.pp-parallax__bg--mesh-a {
	background-color: #f1f5f9;
	background-image:
		radial-gradient(ellipse 100% 85% at 14% 18%, rgba(219, 23, 23, 0.08), transparent 58%),
		radial-gradient(ellipse 80% 70% at 88% 42%, rgba(120, 113, 108, 0.07), transparent 52%),
		linear-gradient(168deg, #f8fafc 0%, #e2e8f0 100%);
}

.pp-parallax__bg--mesh-b {
	background-color: #e2e8f0;
	background-image:
		radial-gradient(ellipse 90% 65% at 72% 28%, rgba(219, 23, 23, 0.07), transparent 52%),
		linear-gradient(152deg, #f1f5f9 0%, #cbd5e1 100%);
}

/*
 * Muster (Gruppe + HTML-Block): gleicher „Ueberhang“ wie Portal-Sektion,
 * sonst bleibt die Bewegung hinter overflow:hidden praktisch unsichtbar.
 */
.pp-parallax:not(.pp-portal-section) > .wp-block-html {
	position: absolute;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	overflow: hidden;
	margin: 0;
	max-width: none;
	width: 100%;
	height: 100%;
}

.pp-parallax:not(.pp-portal-section) .pp-parallax__bg {
	inset: auto;
	top: -18%;
	left: -6%;
	right: -6%;
	bottom: -18%;
	min-height: 136%;
	width: auto;
	height: auto;
}

/*
 * Innenbereich: Core-Layout (is-layout-flow / constrained) setzt oft flow-root —
 * dann greift keine vertikale Zentrierung. Flex + flex:1 fuellen die Hero-Hoehe.
 */
.pp-parallax--hero > .pp-parallax__inner,
.pp-parallax--band > .pp-parallax__inner {
	align-self: stretch;
	justify-self: stretch;
	width: 100%;
	min-height: 0;
}

.pp-parallax__inner {
	position: relative;
	z-index: 1;
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
}

.wp-block-group.pp-parallax__inner,
.wp-block-group.pp-parallax__inner.is-layout-flow,
.wp-block-group.pp-parallax__inner.is-layout-constrained,
.wp-block-group.pp-parallax__inner.wp-block-group-is-layout-flow,
.wp-block-group.pp-parallax__inner.wp-block-group-is-layout-constrained {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.pp-parallax__panel {
	box-shadow: var(--wp--preset--shadow--card-hover, 0 20px 40px -16px rgba(15, 23, 42, 0.14)),
		0 2px 8px rgba(15, 23, 42, 0.06);
	max-width: min(100%, 42rem);
	margin-left: auto;
	margin-right: auto;
	flex-shrink: 0;
	transition: box-shadow var(--ppt-transition);
}

.pp-parallax__panel:hover {
	box-shadow: var(--wp--preset--shadow--card-hover, 0 24px 48px -18px rgba(15, 23, 42, 0.18)),
		0 4px 14px rgba(15, 23, 42, 0.08);
}

.wp-block-group.pp-parallax__panel.is-layout-flow,
.wp-block-group.pp-parallax__panel.wp-block-group-is-layout-flow {
	width: 100%;
	max-width: min(100%, 42rem);
}

/* Aeltere Core-Wrapper zwischen inner und Panel */
.pp-parallax__inner > .wp-block-group__inner-container {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 0;
	box-sizing: border-box;
}

/* Outline-Button auf hellem Parallax-Panel: sichtbarer Rand */
.pp-parallax__panel .wp-block-button.is-style-outline .wp-block-button__link {
	color: var(--wp--preset--color--contrast, #0f172a);
	border-color: currentColor;
}

.pp-quote-strip {
	border-left: 3px solid var(--wp--preset--color--accent, #db1717);
	border-radius: 0 var(--ppt-radius-inner, 12px) var(--ppt-radius-inner, 12px) 0;
	box-shadow: 0 4px 20px -8px rgba(15, 23, 42, 0.1);
}

/* SaaS-Landing: dezente Lichtflecke statt flacher Weissflaeche */
.pp-hero-saas {
	position: relative;
	border-bottom: 1px solid var(--wp--preset--color--surface-alt, #e2e8f0);
	overflow: hidden;
}

.pp-hero-saas::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	background: radial-gradient(ellipse 140% 90% at 10% -10%, rgba(219, 23, 23, 0.06), transparent 55%),
		radial-gradient(ellipse 100% 70% at 100% 0%, rgba(120, 113, 108, 0.05), transparent 45%);
}

.pp-hero-saas > .wp-block-group {
	position: relative;
	z-index: 1;
}

.pp-trust-strip {
	border-top: 1px solid var(--wp--preset--color--surface-alt, #e5e7eb);
	border-bottom: 1px solid var(--wp--preset--color--surface-alt, #e5e7eb);
}

.pp-stat-cell {
	border: 1px solid var(--wp--preset--color--surface-alt, #e5e7eb);
	border-radius: var(--ppt-radius-inner, 12px);
	box-shadow: var(--wp--preset--shadow--card, 0 8px 30px -10px rgba(43, 45, 66, 0.12));
	transition: box-shadow var(--ppt-transition), border-color var(--ppt-transition);
}

.pp-stat-cell:hover {
	box-shadow: var(--wp--preset--shadow--card-hover, 0 20px 40px -16px rgba(15, 23, 42, 0.12));
	border-color: color-mix(in srgb, var(--wp--preset--color--accent, #db1717) 18%, var(--wp--preset--color--surface-alt, #e5e7eb));
}

.wp-block-list.pp-check-list,
ul.wp-block-list.pp-check-list {
	list-style: none;
	padding-left: 0;
	margin-top: 0;
	margin-bottom: 0;
}

.wp-block-list.pp-check-list li {
	position: relative;
	padding-left: 1.6rem;
	margin-bottom: 0.6rem;
	color: var(--wp--preset--color--contrast-muted, #69768b);
	font-size: 0.9375rem;
	line-height: 1.45;
}

.wp-block-list.pp-check-list li:last-child {
	margin-bottom: 0;
}

.wp-block-list.pp-check-list li::before {
	content: "\2713";
	position: absolute;
	left: 0;
	top: 0.05em;
	font-size: 0.85em;
	font-weight: 700;
	color: var(--wp--preset--color--accent-teal, #901010);
}

/* Unterseiten-Kopf / CTA-Muster */
.pp-page-hero-inner {
	border-bottom: 1px solid var(--wp--preset--color--surface-alt, #e5e7eb);
}

.pp-section-cta .wp-block-heading {
	max-width: 40rem;
	margin-left: auto;
	margin-right: auto;
}

.pp-section-cta .wp-block-paragraph {
	max-width: 36rem;
	margin-left: auto;
	margin-right: auto;
}

.pp-section-cta--premium {
	position: relative;
	overflow: hidden;
}

.pp-section-cta--premium::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: radial-gradient(ellipse 80% 55% at 50% -30%, rgba(219, 23, 23, 0.14), transparent 65%),
		radial-gradient(ellipse 60% 40% at 100% 100%, rgba(120, 113, 108, 0.1), transparent 55%);
}

.pp-section-cta--premium > * {
	position: relative;
	z-index: 1;
}

/*
 * Reduced motion: statischer Halt. Live-Parallax setzt per JS setProperty(..., 'important'),
 * damit fremde !important-Resets (andere Themes/Customizer) die Bewegung nicht killen.
 */
@media (prefers-reduced-motion: reduce) {
	.pp-parallax__bg {
		transform: translate3d(0, 0, 0) scale(1.26) !important;
	}
}

/*
 * Fade-in / pp-box-elevated: assets/theme-effects.css (per PHP nach global-styles geladen).
 */

/* Buttons: Pill-Form, ruhiger Schatten (theme.json radius 9999px) */
.wp-block-button__link {
	padding: 0.7rem 1.5rem;
	border-radius: var(--ppt-radius-pill);
	transition: background-color var(--ppt-transition), color var(--ppt-transition), transform var(--ppt-transition), box-shadow var(--ppt-transition);
}

.wp-block-button:not(.is-style-outline) .wp-block-button__link:hover {
	box-shadow: var(--pp-cta-glow);
	transform: translateY(-1px);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
	transform: translateY(-1px);
}

/* Fokus */
a:focus-visible,
button:focus-visible,
.wp-block-button__link:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent, #db1717);
	outline-offset: 2px;
}
