/*
Theme Name: Wolfgang Eißler
Theme URI: https://wolfgangeissler.de
Author: Wolfgang Eißler
Author URI: https://wolfgangeissler.de
Description: Modernes Block-Theme (FSE) für den Regisseur Wolfgang Eißler. Onepager mit Detailseiten, perfekt responsive und SEO-orientiert.
Version: 0.9.33

Requires at least: 6.5
Tested up to: 6.7
Requires PHP: 8.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: wolfgang-eissler
*/

/* -------------------------------------------------------------------------
 * Anchor-Links: sanftes Scrollen (Nav #projekte, #kontakt, …)
 * ---------------------------------------------------------------------- */

html {
	scroll-behavior: smooth;
	overflow-x: hidden;
	max-width: 100%;
	/* Root-Padding-Vars für alignfull-Breakout (useRootPaddingAwareAlignments). */
	--wp--style--root--padding-left: var(--wp--preset--spacing--40);
	--wp--style--root--padding-right: var(--wp--preset--spacing--40);
	--wp--style--root--padding-top: 0;
	--wp--style--root--padding-bottom: 0;
	/*
	 * Upper letterbox / navbar share one height site-wide.
	 * Home: hero paints both bars; subpages: header chrome is the top bar.
	 */
	--we-hero-letterbox: clamp(3.65rem, 10vh, 7rem);
	--we-header-height: var(--we-hero-letterbox);
	/* Anthracite page wash (filmic). */
	--we-bg-deep: #1a1a1a;
	--we-bg-mid: #1f1f1f;
	--we-bg-lift: #2a2a2a;
	background-color: var(--we-bg-deep);
}

body {
	overflow-x: hidden;
	max-width: 100%;
	position: relative;
	/* Cinematic anthracite: soft lift at top, deeper toward the bottom. */
	background-color: var(--wp--preset--color--base, var(--we-bg-deep));
	background-image:
		radial-gradient(
			ellipse 130% 70% at 50% -15%,
			var(--we-bg-lift) 0%,
			transparent 58%
		),
		linear-gradient(
			180deg,
			var(--we-bg-mid) 0%,
			var(--we-bg-deep) 42%,
			#161616 100%
		);
	background-attachment: fixed;
	background-repeat: no-repeat;
	min-height: 100%;
}

/* Inhalt begrenzen — Header/Nav-Overlay bleibt außerhalb (fixed). */
.wp-site-blocks > main {
	overflow-x: clip;
	max-width: 100%;
}

/* Global: Hover/Focus unterstreicht Schrift nicht */
a:hover,
a:focus {
	text-decoration: none;
}

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

/* -------------------------------------------------------------------------
 * Startseite: Header transparent über dem Fullscreen-Hero (Overlay)
 * ---------------------------------------------------------------------- */

/* Bezugsrahmen für den absoluten Header. overflow-x bewusst NICHT hier:
 * sonst wird das fixe Mobile-Nav-Overlay mit abgeschnitten. */
.home .wp-site-blocks {
	position: relative;
}

/* Block-Gap zwischen (absolutem) Header und Main entfernen -> Hero bündig oben. */
.home .wp-site-blocks > main {
	margin-block-start: 0;
}

/* Startseite: Post-Content und Cinematic-Blöcke randlos (alignfull). */
.home .wp-block-post-content.alignfull {
	max-width: none !important;
	width: auto;
}

.home .wp-block-post-content > .alignfull.wp-block-we-hero,
.home .wp-block-post-content > .alignfull.wp-block-we-project-rows,
.home .wp-block-post-content > .alignfull.wp-block-we-about-preview {
	max-width: none !important;
	width: auto;
}

/* Projekt-Detail u. a.: alignfull-Kinder von main ohne Breiten-Cap. */
.wp-site-blocks > main > .alignfull {
	max-width: none !important;
	width: auto !important;
}

.home header.wp-block-template-part {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 100;
	background: transparent;
}

/* Sektions-Abstände (spacing-70): auf großen Screens mehr Luft zwischen den Blöcken.
 * Inline-Styles nutzen das Token — Variable überschreiben reicht. */
@media (min-width: 1200px) {
	.home {
		--wp--preset--spacing--70: 8.5rem;
	}
}

@media (min-width: 1600px) {
	.home {
		--wp--preset--spacing--70: 11rem;
	}
}

/* -------------------------------------------------------------------------
 * Header / Nav — Rand zu Rand (mit Abstand), Wix-Madefor-Look
 * ---------------------------------------------------------------------- */

header.wp-block-template-part {
	width: 100%;
}

/*
 * Subpages: sticky solid upper letterbox (= header chrome).
 * Homepage keeps a transparent overlay; .we-hero paints its own top bar.
 */
body:not(.home) header.wp-block-template-part {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 100;
	background-color: #000;
}

/* Flush letterbox to content (kill block-gap under header). */
body:not(.home) .wp-site-blocks > main {
	margin-block-start: 0;
}

header.wp-block-template-part > .we-header-bar.wp-block-group,
header.wp-block-template-part > .wp-block-group.we-header-bar {
	width: 100%;
	max-width: none !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	box-sizing: border-box;
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	height: var(--we-header-height);
	min-height: var(--we-header-height);
	max-height: var(--we-header-height);
	padding-block: 0;
	padding-inline: clamp(1rem, 3vw, 2.5rem);
}

header.wp-block-template-part .wp-block-site-title {
	margin: 0;
	flex: 0 1 auto;
	min-width: 0;
}

header.wp-block-template-part .wp-block-navigation {
	flex: 0 0 auto;
	justify-content: flex-end;
	gap: clamp(1rem, 2.2vw, 2rem);
	min-width: 0;
}

/* Vorlage: Madefor, leicht wirkend (Regular + Tracking), Caps */
header.wp-block-template-part .wp-block-site-title a,
header.wp-block-template-part .wp-block-navigation a,
header.wp-block-template-part .wp-block-navigation .wp-block-navigation-item__content,
header.wp-block-template-part .wp-block-navigation-link__label {
	font-family: var(--wp--preset--font-family--madefor);
	font-weight: 400;
	font-size: clamp(0.8rem, 0.72rem + 0.35vw, 1.05rem);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
	line-height: 1.3;
}

/* Site-Title: etwas größer + Logo-Gold */
header.wp-block-template-part .wp-block-site-title a {
	font-size: clamp(0.85rem, 0.78rem + 0.4vw, 1.2rem);
	color: var(--wp--preset--color--gold);
	overflow-wrap: anywhere;
}

@media (min-width: 782px) {
	header.wp-block-template-part .wp-block-site-title a,
	header.wp-block-template-part .wp-block-navigation a,
	header.wp-block-template-part .wp-block-navigation .wp-block-navigation-item__content,
	header.wp-block-template-part .wp-block-navigation-link__label {
		letter-spacing: 0.16em;
	}
}

.home header.wp-block-template-part .wp-block-navigation a,
.home header.wp-block-template-part .wp-block-navigation .wp-block-navigation-item__content,
.home header.wp-block-template-part .wp-block-navigation-link__label,
.home header.wp-block-template-part .wp-block-navigation__responsive-container-open {
	color: #e8e8e8;
}

.home header.wp-block-template-part .wp-block-site-title a {
	color: var(--wp--preset--color--gold);
}

header.wp-block-template-part .wp-block-navigation__responsive-container-open,
header.wp-block-template-part .wp-block-navigation__responsive-container-close {
	background: transparent;
	border: 0;
	padding: 0.4rem;
	margin: 0;
	color: inherit;
	cursor: pointer;
	line-height: 0;
}

header.wp-block-template-part .wp-block-navigation__responsive-container-open svg,
header.wp-block-template-part .wp-block-navigation__responsive-container-close svg {
	fill: currentColor;
	display: block;
	width: 1.5rem;
	height: 1.5rem;
}

/* --- Mobile / Tablet: Burger statt horizontaler Linkliste --- */
@media (max-width: 781px) {
	header.wp-block-template-part .wp-block-navigation__responsive-container-open {
		display: flex !important;
		align-items: center;
		justify-content: center;
	}

	header.wp-block-template-part
		.wp-block-navigation__responsive-container:not(.is-menu-open) {
		display: none !important;
	}

	/* WP setzt background-color: inherit → sonst weiß von der Seite. */
	header.wp-block-template-part
		.wp-block-navigation__responsive-container.is-menu-open {
		display: flex !important;
		position: fixed;
		inset: 0;
		z-index: 100000;
		width: 100%;
		max-width: none;
		box-sizing: border-box;
		background: var(--wp--preset--color--base, #1a1a1a) !important;
		background-color: var(--wp--preset--color--base, #1a1a1a) !important;
		color: #e8e8e8 !important;
		padding: 1.25rem clamp(1rem, 3vw, 2.5rem);
		flex-direction: column;
		align-items: stretch;
	}

	header.wp-block-template-part
		.wp-block-navigation__responsive-container.is-menu-open
		.wp-block-navigation__responsive-container-content,
	header.wp-block-template-part
		.wp-block-navigation__responsive-container.is-menu-open
		.wp-block-navigation__container,
	header.wp-block-template-part
		.wp-block-navigation__responsive-container.is-menu-open
		.wp-block-navigation-item {
		background: transparent !important;
		background-color: transparent !important;
		color: inherit !important;
	}

	header.wp-block-template-part
		.wp-block-navigation__responsive-container.is-menu-open
		.wp-block-navigation__responsive-container-content {
		padding: 3.25rem 0 1.5rem;
		box-sizing: border-box;
		max-width: 100%;
	}

	header.wp-block-template-part
		.wp-block-navigation__responsive-container.is-menu-open
		.wp-block-navigation__container {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		width: 100%;
	}

	header.wp-block-template-part
		.wp-block-navigation__responsive-container.is-menu-open
		.wp-block-navigation-item {
		width: 100%;
	}

	header.wp-block-template-part
		.wp-block-navigation__responsive-container.is-menu-open
		a,
	header.wp-block-template-part
		.wp-block-navigation__responsive-container.is-menu-open
		.wp-block-navigation-item__content,
	header.wp-block-template-part
		.wp-block-navigation__responsive-container.is-menu-open
		.current-menu-item > a,
	header.wp-block-template-part
		.wp-block-navigation__responsive-container.is-menu-open
		.current-menu-item .wp-block-navigation-item__content {
		display: block;
		width: 100%;
		box-sizing: border-box;
		color: #e8e8e8 !important;
		font-size: clamp(0.95rem, 0.85rem + 0.8vw, 1.15rem);
		letter-spacing: 0.16em;
		padding: 1rem 0;
		border-bottom: 1px solid color-mix(in srgb, var(--wp--preset--color--gold) 55%, transparent);
		text-decoration: none;
		outline: none;
		box-shadow: none;
	}

	/* Nur Hover in Gold — nicht :focus (WP fokussiert oft den ersten Link beim Öffnen). */
	header.wp-block-template-part
		.wp-block-navigation__responsive-container.is-menu-open
		a:hover {
		color: var(--wp--preset--color--gold) !important;
		border-bottom-color: var(--wp--preset--color--gold);
	}

	header.wp-block-template-part
		.wp-block-navigation__responsive-container.is-menu-open
		a:focus-visible {
		color: #e8e8e8 !important;
		outline: 1px solid var(--wp--preset--color--gold);
		outline-offset: 4px;
	}

	header.wp-block-template-part
		.wp-block-navigation__responsive-container.is-menu-open
		.wp-block-navigation__responsive-container-close {
		position: absolute;
		top: 1.1rem;
		right: clamp(1rem, 3vw, 2.5rem);
		color: var(--wp--preset--color--gold) !important;
	}
}

@media (min-width: 782px) {
	header.wp-block-template-part .wp-block-navigation__responsive-container-open {
		display: none !important;
	}

	header.wp-block-template-part
		.wp-block-navigation__responsive-container:not(.hidden-by-default) {
		display: block;
		position: static;
		width: auto;
		background: transparent;
		padding: 0;
	}
}

/* -------------------------------------------------------------------------
 * Buttons — Outline: hell = schwarz, dunkel = weiß
 * ---------------------------------------------------------------------- */

.wp-element-button,
.wp-block-button__link {
	background-color: transparent !important;
	color: var(--wp--preset--color--contrast) !important;
	border: 1px solid var(--wp--preset--color--contrast) !important;
	border-radius: 0 !important;
}

.wp-element-button:hover,
.wp-element-button:focus,
.wp-block-button__link:hover,
.wp-block-button__link:focus {
	background-color: color-mix(in srgb, var(--wp--preset--color--contrast) 50%, transparent) !important;
	color: var(--wp--preset--color--contrast) !important;
}

/* Auf dunklem Grund (Night-Flächen) */
.has-night-background .wp-element-button,
.has-night-background .wp-block-button__link {
	background-color: transparent !important;
	color: #fff !important;
	border-color: #fff !important;
}

.has-night-background .wp-element-button:hover,
.has-night-background .wp-element-button:focus,
.has-night-background .wp-block-button__link:hover,
.has-night-background .wp-block-button__link:focus {
	background-color: color-mix(in srgb, #fff 50%, transparent) !important;
	color: #fff !important;
	border-color: #fff !important;
}

/* Projekt-Detail: Hero bündig unter dem Header, kein Block-Gap darüber. */
.single-project .wp-site-blocks > main {
	margin-block-start: 0;
}

/* Zurück-Link oben auf Unter-/Detailseiten */
.we-back-link {
	margin-block: 0 0.75rem;
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.4;
}

.we-back-link a {
	color: var(--wp--preset--color--muted);
	text-decoration: none;
}

.we-back-link a:hover,
.we-back-link a:focus {
	color: var(--wp--preset--color--accent);
	text-decoration: none;
}

/* Neuigkeiten-Archiv */
.we-news-archive__title {
	font-family: var(--wp--preset--font-family--madefor) !important;
	font-weight: 400 !important;
	font-size: clamp(1.35rem, 1rem + 2vw, 2.5rem) !important;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--wp--preset--color--contrast);
	margin: 0;
}

.we-news-archive-link a {
	font-family: var(--wp--preset--font-family--madefor);
	font-size: clamp(0.75rem, 0.7rem + 0.2vw, 0.9rem);
	letter-spacing: 0.14em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--wp--preset--color--contrast);
	border-bottom: 1px solid var(--wp--preset--color--gold);
	padding-bottom: 0.15rem;
}

.we-news-archive-link a:hover,
.we-news-archive-link a:focus {
	color: var(--wp--preset--color--gold);
	text-decoration: none;
}

/* Über mich: Portrait im linken Platzhalter (Querformat wird beschnitten). */
.we-about-portrait {
	margin: 0;
	width: 100%;
}

.we-about-portrait img {
	display: block;
	width: 100%;
	height: auto;
	max-width: 100%;
	aspect-ratio: 3 / 4;
	object-fit: cover;
	object-position: center top;
}
