/* Webux Fullscreen-Hero (field block) - frontend.
   Pixel-ported from the Figma frame "01 Startseite - Header Alt" (324:1132). */

.webux-fullscreen-hero {
	/* Height of the site header, subtracted when the block's "Header-Höhe
	   abziehen" toggle is on, so the hero ends exactly at the first fold. */
	--webux-fshero-headerh: 77px;

	position: relative;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	/* vh first as the fallback: if a browser cannot parse the svh calc below,
	   the whole declaration is dropped and this one still applies. */
	min-height: 100vh;
	min-height: var(--webux-fshero-minh, 100svh);
	padding-block: 96px 30px;
	padding-inline: 24px;
}

/* Placeholder behind the photo. Every piece of copy in this block is hard-coded
   white, so on a slow connection the H1 spends the whole download sitting white
   on the white page background - the text is present and readable by machines,
   invisible to the person waiting. A dark ground removes that window entirely.
   The photo covers this completely, so it is only ever seen before first paint.
   Set by render.php ONLY when an image or a video is configured, so a hero
   without media keeps its previous background. */
.webux-fullscreen-hero--has-media {
	background-color: var(--wp--preset--color--contrast, #1a1a1a);
}

/* ---- Layers ---- */
.webux-fullscreen-hero__bg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	z-index: 0;
}

/* Optional background video, layered directly over the still image (same
   .webux-fullscreen-hero__bg geometry, one step up in the stack). It starts
   fully transparent and is only revealed once frames exist - see
   assets/js/webux-hero-video.js, which sets data-webux-hero-video-state.

   Every state other than "ready" leaves the element invisible, so a blocked
   autoplay, an unsupported codec or a failed request all resolve to the same
   thing: the poster image stays on screen and nothing flickers. */
.webux-fullscreen-hero__video {
	z-index: 0;
	opacity: 0;
	/* The video carries no information, so it must never intercept a click or a
	   drag meant for the copy above it. */
	pointer-events: none;
}

.webux-fullscreen-hero__video[data-webux-hero-video-state="ready"] {
	opacity: 1;
	/* Long and slow on purpose: the cut from a sharp still to the first video
	   frame is the one moment where the swap becomes visible, and a fast fade
	   reads as a glitch rather than as a transition. */
	transition: opacity 900ms ease;
}

/* The script does not load the video at all under reduced motion. This rule is
   the belt to that braces: it also covers a preference switched on AFTER the
   video started, where the element is already visible and playing. */
@media (prefers-reduced-motion: reduce) {
	.webux-fullscreen-hero__video {
		display: none;
	}
}

/* A printed page gets the still image; a video element prints as a black or
   empty box and would swallow the whole first sheet. */
@media print {
	.webux-fullscreen-hero__video {
		display: none;
	}
}

.webux-fullscreen-hero__overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
	background: var(--wp--preset--color--contrast, #1a1a1a);
	opacity: var(--webux-fshero-dim, 0.28);
}

/* Directional scrim: darker at the bottom and on the left, so the copy keeps
   contrast while the middle of the photo stays open. */
.webux-fullscreen-hero--gradient .webux-fullscreen-hero__gradient {
	position: absolute;
	inset: 0;
	z-index: 1;
	background:
		linear-gradient(180deg, rgba(26, 26, 26, 0.38) 0%, rgba(26, 26, 26, 0) 40%, rgba(26, 26, 26, 0.5) 100%),
		linear-gradient(90deg, rgba(26, 26, 26, 0.74) 0%, rgba(26, 26, 26, 0.3) 42%, rgba(26, 26, 26, 0) 70%);
}

/* The directional scrim is dark on the LEFT. With right-aligned content the copy
   would sit on the bright side, so mirror it - scaleX only flips the horizontal
   gradient, the vertical one is symmetric and stays put. */
.webux-fullscreen-hero--gradient.webux-fullscreen-hero--x-right .webux-fullscreen-hero__gradient {
	transform: scaleX(-1);
}

/* ---- Content column ---- */
.webux-fullscreen-hero__inner {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: var(--wp--style--global--wide-size, 1200px);
	margin-inline: auto;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 24px;
	text-align: left;
}

.webux-fullscreen-hero__inner > * {
	margin: 0;
}

/* ---- Ausrichtung: two independent axes (block fields "Ausrichtung
   vertikal" / "horizontal"), so all nine combinations are reachable. ---- */

/* Vertical: the hero itself is the flex column. */
.webux-fullscreen-hero--y-top {
	justify-content: flex-start;
}

.webux-fullscreen-hero--y-middle {
	justify-content: center;
	/* Symmetric padding, otherwise the 96/30 split would push "middle"
	   content visibly below the true centre. */
	padding-block: 96px;
}

.webux-fullscreen-hero--y-bottom {
	justify-content: flex-end;
}

/* Horizontal: the content column aligns its own children. */
.webux-fullscreen-hero--x-left .webux-fullscreen-hero__inner {
	align-items: flex-start;
	text-align: left;
}

.webux-fullscreen-hero--x-center .webux-fullscreen-hero__inner {
	align-items: center;
	text-align: center;
}

.webux-fullscreen-hero--x-right .webux-fullscreen-hero__inner {
	align-items: flex-end;
	text-align: right;
}

.webux-fullscreen-hero--x-center .webux-fullscreen-hero__buttons,
.webux-fullscreen-hero--x-center .webux-fullscreen-hero__badges {
	justify-content: center;
}

.webux-fullscreen-hero--x-right .webux-fullscreen-hero__buttons,
.webux-fullscreen-hero--x-right .webux-fullscreen-hero__badges {
	justify-content: flex-end;
}

/* ---- Brand mark ---- */
/* Width lives on the wrapper (block field "Logo-Breite"), so the built-in SVG and
   an uploaded logo are sized identically and the phone cap below still applies. */
.webux-fullscreen-hero__mark {
	display: block;
	color: #fff;
	width: var(--webux-fshero-markw, 45px);
	max-width: 100%;
}

.webux-fullscreen-hero__mark svg,
.webux-fullscreen-hero__mark-img {
	display: block;
	width: 100%;
	height: auto;
}

/* ---- Copy ---- */
.webux-fullscreen-hero__overline {
	font-size: 13px;
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: 2.34px;
	text-transform: uppercase;
	color: #d6c7a8;
}

.webux-fullscreen-hero__title {
	max-width: 620px;
	font-size: 60px;
	font-weight: 600;
	line-height: 1.08;
	letter-spacing: -0.9px;
	color: #fff;
	overflow-wrap: break-word;
}

.webux-fullscreen-hero__lead {
	max-width: 476px;
	font-size: 18px;
	font-weight: 400;
	line-height: 1.65;
	color: rgba(244, 239, 227, 0.92);
	overflow-wrap: break-word;
}

.webux-fullscreen-hero__lead p {
	margin: 0;
}

.webux-fullscreen-hero__lead p + p {
	margin-top: 14px;
}

/* ---- Buttons ----
   The .wp-block-button class is repeated in these selectors on purpose: the
   global assets/css/site.css loads AFTER this block stylesheet, so a selector
   that only ties on specificity would lose the cascade. */
.webux-fullscreen-hero__buttons {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 28px;
	padding-top: 12px;
}

.webux-fullscreen-hero .wp-block-button:not(.is-style-outline) .wp-element-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 52px;
	padding: 0 30px;
	border: 0;
	border-radius: 999px;
	background: var(--wp--preset--color--primary, #8b8178);
	color: #fff;
	font-size: 16px;
	font-weight: 500;
	letter-spacing: 0.16px;
	text-decoration: none;
}

.webux-fullscreen-hero .wp-block-button:not(.is-style-outline) .wp-element-button:hover,
.webux-fullscreen-hero .wp-block-button:not(.is-style-outline) .wp-element-button:focus {
	background: var(--wp--preset--color--primary-dark, #6f665e);
	color: #fff;
}

.webux-fullscreen-hero .wp-block-button.is-style-outline .wp-element-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 52px;
	padding: 0 26px;
	border: 1.5px solid rgba(255, 255, 255, 0.7);
	border-radius: 999px;
	background: transparent;
	color: #fff;
	font-size: 16px;
	font-weight: 500;
	letter-spacing: 0.16px;
	text-decoration: none;
}

.webux-fullscreen-hero .wp-block-button.is-style-outline .wp-element-button:hover {
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
}

/* Opt-in size step ("Grösse: Gross") for the primary call to action, so it can
   outweigh a neighbouring text link. Two class steps (0,4,0) so it wins over the
   base button rules above regardless of stylesheet order. */
.webux-fullscreen-hero .wp-block-button.webux-fullscreen-hero__btn--lg .wp-element-button {
	height: 64px;
	padding: 0 40px;
	font-size: 18px;
	font-weight: 600;
}

@media (max-width: 599px) {
	/* Keep the pill inside the viewport on small screens - the bigger padding
	   would otherwise push it past the content column. */
	.webux-fullscreen-hero .wp-block-button.webux-fullscreen-hero__btn--lg .wp-element-button {
		height: 58px;
		padding: 0 30px;
		font-size: 17px;
	}
}

/* Trust badges under the buttons: small, quiet chips that must stay readable on
   a photo, hence the translucent fill plus a hairline border rather than a solid
   colour - a solid chip would compete with the call to action. */
.webux-fullscreen-hero__badges {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 18px 0 0;
	padding: 0;
	list-style: none;
}

.webux-fullscreen-hero__badge {
	display: inline-flex;
	align-items: center;
	padding: 6px 14px;
	border: 1px solid rgba(255, 255, 255, 0.38);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.26px;
	line-height: 1.25;
}

@media (max-width: 599px) {
	.webux-fullscreen-hero__badges {
		gap: 8px;
		margin-top: 14px;
	}

	.webux-fullscreen-hero__badge {
		padding: 5px 12px;
		font-size: 12px;
	}
}

/* Plain text link with a trailing arrow (Figma: "Objekte entdecken →"). */
.webux-fullscreen-hero__link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: #fff;
	font-size: 15px;
	font-weight: 500;
	letter-spacing: 0.15px;
	text-decoration: none;
}

.webux-fullscreen-hero__link::after {
	content: "\2192";
	font-size: 1.05em;
	line-height: 1;
	transition: transform 0.2s ease;
}

.webux-fullscreen-hero__link:hover {
	color: #fff;
	text-decoration: underline;
}

.webux-fullscreen-hero__link:hover::after {
	transform: translateX(3px);
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
	.webux-fullscreen-hero__title {
		font-size: 44px;
		letter-spacing: -0.66px;
	}
	.webux-fullscreen-hero__lead {
		font-size: 17px;
	}
}

@media (max-width: 600px) {
	.webux-fullscreen-hero {
		padding-block: 72px 28px;
		/* Follow the site gutter instead of a hard 20px: the hero is the first
		   thing on the page and its headline sat 4px left of every section
		   below it. The fallback keeps the previous behaviour for a site that
		   does not use root-padding-aware alignments. */
		padding-inline: var(--wp--style--root--padding-left, 20px);
	}
	.webux-fullscreen-hero--y-middle {
		padding-block: 72px;
	}
	.webux-fullscreen-hero__inner {
		gap: 18px;
	}
	.webux-fullscreen-hero__title {
		font-size: 34px;
		letter-spacing: -0.51px;
	}
	/* Cap the mark on phones without overriding a deliberately smaller setting. */
	.webux-fullscreen-hero__mark {
		width: min(var(--webux-fshero-markw, 45px), 38px);
	}
	.webux-fullscreen-hero__buttons {
		gap: 16px;
	}
	/* Paired CTAs stack full-width so they read as one equal-width pair. */
	.webux-fullscreen-hero__buttons .wp-block-button {
		flex: 1 1 100%;
	}
	.webux-fullscreen-hero__buttons .wp-block-button__link {
		display: flex;
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.webux-fullscreen-hero__link::after {
		transition: none;
	}
}
