/**
 * FlexWork Premium Blocks – frontend compatibility layer.
 *
 * These rules intentionally contain only structural safeguards. They load
 * after generated block styles and therefore also protect installations whose
 * persistent cache still contains an older block stylesheet.
 */

.wp-block-flexwork-hero.fw-block-hero,
.wp-block-flexwork-section.fw-block-section,
.wp-block-flexwork-cta.fw-block-cta,
.wp-block-flexwork-matterport-demo.fw-block-matterport,
.fw-block-hero__inner,
.fw-block-section__inner,
.fw-block-cta__inner,
.fw-block-matterport__inner,
.fw-block-matterport__stage,
.fw-block-hero__buttons,
.fw-block-cta__buttons {
	box-sizing: border-box;
	min-width: 0;
	max-width: 100%;
}

.wp-block-flexwork-hero.alignfull,
.wp-block-flexwork-section.alignfull,
.wp-block-flexwork-matterport-demo.alignfull {
	width: 100%;
	max-width: 100%;
	margin-inline: 0;
}

.fw-block-hero__button,
.fw-block-cta__button,
.fw-block-contact__button,
.fw-block-matterport__load,
.fw-block-matterport__contact {
	box-sizing: border-box;
	max-width: 100%;
}

.fw-block-cards__grid,
.fw-block-process__grid,
.fw-block-contact__grid {
	min-width: 0;
	max-width: 100%;
}

.fw-block-cards__card,
.fw-block-process__item,
.fw-block-contact__content,
.fw-block-contact__form {
	box-sizing: border-box;
	min-width: 0;
}

/* Shared typography guard for every compact FlexWork tile. Natural German
 * hyphenation takes priority over emergency character-by-character wrapping.
 * This late-loading rule also corrects hosts that still serve an older cached
 * block stylesheet. */
.fw-block-cards__title,
.fw-block-industry__title,
.fw-block-process__title,
.fw-block-reference__title,
.fwpb-metric__value {
	box-sizing: border-box;
	min-width: 0;
	max-width: 100%;
	-webkit-hyphens: auto;
	hyphens: auto;
	hyphenate-limit-chars: 10 5 4;
	overflow-wrap: break-word;
	text-wrap: balance;
	white-space: normal;
	word-break: normal;
}

/*
 * Keep keyboard focus visible on every interactive element rendered inside a
 * FlexWork block, including embedded form controls.
 */
[class*="wp-block-flexwork-"] :where(a, button, summary, input, select, textarea):focus-visible {
	outline: 3px solid var(--fw-color-petrol, #0aa89a);
	outline-offset: 4px;
}

.fw-block-hero__button,
.fw-block-cta__button,
.fw-block-contact__button {
	min-height: 44px;
}

.fw-block-faq summary {
	cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
	[class*="wp-block-flexwork-"],
	[class*="wp-block-flexwork-"] *,
	[class*="wp-block-flexwork-"] *::before,
	[class*="wp-block-flexwork-"] *::after {
		scroll-behavior: auto !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

@media (forced-colors: active) {
	[class*="wp-block-flexwork-"] :where(a, button, summary, input, select, textarea):focus-visible {
		outline-color: Highlight;
	}

	.fw-block-hero__button,
	.fw-block-cta__button,
	.fw-block-contact__button {
		border: 1px solid ButtonText;
	}
}

@media (max-width: 640px) {
	.wp-block-flexwork-cta.fw-block-cta {
		box-sizing: border-box;
		width: 100%;
		max-width: 100%;
	}

	.fw-block-hero__button,
	.fw-block-cta__button,
	.fw-block-contact__button,
	.fw-block-matterport__load,
	.fw-block-matterport__contact {
		width: 100%;
	}

	/* The glow is purely decorative. Hiding it on narrow screens prevents the
	 * absolutely positioned circle from enlarging the document scroll area in
	 * WebKit while the visible CTA remains unchanged. */
	.fw-block-cta__glow {
		display: none;
	}

	.fw-block-hero__title,
	.fw-block-section__heading,
	.fw-block-industries__heading,
	.fw-block-advisor__heading,
	.fw-block-contact__heading,
	.fw-block-matterport__heading,
	.fw-block-cta__heading {
		overflow-wrap: anywhere;
		word-break: normal;
	}
}
