/*
Theme Name: ERSTex
Description: Eigenständiges ERSTex-Block-Theme mit der Startseite und zentralen Vorlagenteilen.
Version: 0.1.0
Requires at least: 6.6
Requires PHP: 7.4
Text Domain: erstex
*/

:root {
	--erstex-blue: var(--wp--preset--color--marine, #1b3a66);
	--erstex-green: var(--wp--preset--color--gruen, #8ebe3f);
	--erstex-warm: var(--wp--preset--color--hell, #faf8f6);
	--erstex-gray: var(--wp--preset--color--grau, #e7e7e5);
	--erstex-gutter: clamp(20px, 4vw, 46px);
}

.erstex-header-wrap {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 20;
}

.erstex-header {
	display: flex;
	align-items: center;
	gap: clamp(16px, 2.1vw, 32px);
	min-height: 59px;
	padding-inline-start: clamp(16px, 2.9vw, 42px);
	background: var(--erstex-warm);
	box-shadow: 0 1px 7px rgb(0 0 0 / 18%);
}

.erstex-header > * { margin-block: 0; }
.erstex-header .erstex-logo { margin-inline-end: auto; flex: 0 1 152px; }
.erstex-logo a { display: block; }
.erstex-logo img { display: block; width: 100%; }
.erstex-header-phone { font-weight: 700; white-space: nowrap; }

.erstex-header a,
.erstex-footer a,
.erstex-card a,
.erstex-contact-details a { text-decoration: none; }

.erstex-header a:hover,
.erstex-footer a:hover,
.erstex-card a:hover,
.erstex-contact-details a:hover { text-decoration: underline; text-underline-offset: .2em; }

.erstex-navigation {
	gap: clamp(14px, 2.25vw, 34px);
	font-size: 16px;
	font-weight: 300;
}

.erstex-navigation .erstex-nav-contact > a {
	display: flex;
	min-height: 59px;
	align-items: center;
	padding-inline: 34px 38px;
	background: var(--erstex-green);
	color: #152d4d;
	clip-path: polygon(15% 0, 100% 0, 100% 100%, 0 100%);
}

.erstex-shell {
	box-sizing: border-box;
	max-width: 1072px;
	margin-inline: auto;
	padding-inline: var(--erstex-gutter);
}

.erstex-home .erstex-section {
	padding-block: clamp(42px, 6vw, 82px);
}

.erstex-section h2 {
	margin-block: 0 14px;
	font-size: clamp(25px, 3vw, 38px);
	letter-spacing: -.025em;
}

.erstex-home p { margin-block: 0 12px; }
.erstex-home .wp-block-image { margin-block: 0; }

.erstex-home a:focus-visible,
.erstex-header a:focus-visible,
.erstex-footer a:focus-visible,
.erstex-navigation button:focus-visible,
.erstex-carousel button:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.erstex-hero {
	display: grid;
	position: relative;
	min-height: clamp(445px, 49vw, 568px);
	isolation: isolate;
	overflow: hidden;
	background: var(--erstex-blue);
	color: #fff;
}

.erstex-hero-images,
.erstex-hero-copy { grid-area: 1 / 1; }

.erstex-hero-images { position: relative; }
.erstex-hero-images > .erstex-slide {
	position: absolute;
	inset: 0;
}
.erstex-hero-images img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.erstex-hero-images > .erstex-slide::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, rgb(0 0 0 / 52%), rgb(0 0 0 / 16%) 74%);
}

.erstex-hero-copy {
	display: flex;
	align-items: center;
	width: 100%;
	position: relative;
	z-index: 1;
	pointer-events: none;
}
.erstex-hero h1 {
	margin: 0;
	color: #fff;
	font-size: clamp(44px, 4.8vw, 66px);
	font-weight: 900;
	line-height: .99;
	transform: translateY(21px);
}
.erstex-hero h1 span {
	display: inline-block;
	font-size: .75em;
	line-height: 1.08;
}
.erstex-carousel:not(.erstex-carousel-ready) > .erstex-slide ~ .erstex-slide,
.erstex-carousel > .erstex-slide[hidden] { display: none; }
.erstex-carousel-controls {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 1px;
}
.erstex-hero-images .erstex-carousel-controls {
	position: absolute;
	inset: 0;
	z-index: 2;
	align-items: flex-end;
	padding-bottom: clamp(18px, 3vw, 40px);
	pointer-events: none;
}
.erstex-carousel-controls button {
	display: grid;
	place-items: center;
	padding: 0;
	color: inherit;
	background: transparent;
	border: 0;
	cursor: pointer;
	pointer-events: auto;
}
.erstex-carousel-controls .erstex-prev,
.erstex-carousel-controls .erstex-next {
	width: 42px;
	height: 46px;
	font: 300 49px / .8 Lato, sans-serif;
}
.erstex-hero-images .erstex-prev,
.erstex-hero-images .erstex-next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
}
.erstex-hero-images .erstex-prev { left: clamp(6px, 6.9vw, 95px); }
.erstex-hero-images .erstex-next { right: clamp(6px, 6.9vw, 95px); }
.erstex-carousel-controls .erstex-dot { width: 24px; height: 26px; }
.erstex-dot::before {
	content: "";
	width: 7px;
	height: 7px;
	border: 1px solid currentColor;
	border-radius: 50%;
	background: currentColor;
}
.erstex-dot[aria-current]::before { background: transparent; box-shadow: 0 0 0 1px currentColor; }
.erstex-hero-images .erstex-prev,
.erstex-hero-images .erstex-next { text-shadow: 0 1px 4px #000; }

.erstex-intro {
	padding-block: clamp(36px, 5vw, 65px);
	background: var(--erstex-blue);
	color: #fff;
}
.erstex-intro-grid, .erstex-contact-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
	align-items: start;
	gap: clamp(26px, 4vw, 58px);
}
.erstex-intro-copy { font-size: 18px; font-weight: 300; }
.erstex-stats {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px;
	text-align: center;
}
.erstex-stat strong { font-size: clamp(38px, 5.5vw, 70px); line-height: 1; font-weight: 900; }
.erstex-guarantee img { width: min(100%, 210px); height: auto; }
.erstex-home .erstex-guarantee p { margin-top: 3px; }
.erstex-stat sup { font-size: .42em; vertical-align: super; }

.erstex-button > .wp-block-button__link {
	border-radius: 0;
	color: #142c4d;
	background: var(--erstex-green);
	font-weight: 700;
	padding: .72em 1.4em;
}
.erstex-intro .erstex-button { margin-top: 6px; }

.erstex-services,
.erstex-projects,
.erstex-library,
.erstex-certificates { text-align: center; }
.erstex-services > .erstex-shell > p,
.erstex-projects > .erstex-shell > p {
	max-width: 760px;
	margin-inline: auto;
	font-size: 17px;
}
.erstex-services .erstex-analysis { margin-block: 32px; }
.erstex-analysis {
	display: grid;
	grid-template-columns: 1.15fr 1fr;
	background: var(--erstex-gray);
	text-align: left;
}
.erstex-analysis-copy { padding: clamp(20px, 3vw, 35px); }
.erstex-analysis h3 { margin: 0 0 10px; font-size: clamp(22px, 3vw, 30px); }
.erstex-analysis img { display: block; width: 100%; height: 100%; object-fit: cover; }
.erstex-grid {
	display: grid;
	gap: clamp(14px, 2.5vw, 30px);
	margin-block-start: 28px;
}
.erstex-grid-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.erstex-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.erstex-card { background: #fff; min-width: 0; overflow-wrap: break-word; }
.erstex-card-image img { display: block; width: 100%; aspect-ratio: 10 / 7; object-fit: cover; }
.erstex-card h3 { margin: 13px 10px 7px; font-size: clamp(17px, 1.7vw, 23px); }
.erstex-card p { margin-inline: 10px; }
.erstex-services .erstex-card-image img { aspect-ratio: 1; }
.erstex-services { background: var(--erstex-warm); }
.erstex-services .erstex-card { position: relative; text-align: left; }
.erstex-services .erstex-card-image::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(transparent 36%, rgb(0 0 0 / 70%));
	pointer-events: none;
}
.erstex-services .erstex-card h3 {
	position: absolute;
	inset-inline: 10px;
	bottom: 34px;
	margin: 0;
	color: #fff;
	hyphens: auto;
	font-size: clamp(15px, 1.65vw, 21px);
}
.erstex-card-actions { position: absolute; right: 0; bottom: 0; }
.erstex-card-actions:focus-within { outline: 2px solid white; outline-offset: 2px; }
.erstex-card-actions .wp-block-button__link {
	padding: .35em .8em .35em 1em;
	clip-path: polygon(10% 0, 100% 0, 100% 100%, 0 100%);
	font-size: 14px;
}
.erstex-projects .erstex-card { position: relative; }
.erstex-home .erstex-project-label {
	position: absolute;
	top: 12px;
	left: 0;
	margin: 0;
	padding: .35em 1.3em .35em .8em;
	background: var(--erstex-blue);
	color: #fff;
	clip-path: polygon(0 0, 100% 0, 93% 100%, 0 100%);
}

.erstex-reviews { background: var(--erstex-blue); color: #fff; text-align: center; }
.erstex-review-carousel blockquote {
	display: grid;
	place-content: center;
	min-height: 220px;
	box-sizing: border-box;
	max-width: 760px;
	margin: 0 auto;
	padding: clamp(18px, 4vw, 50px);
	border: 0;
	background: var(--erstex-warm);
	color: var(--erstex-blue);
	font-size: clamp(17px, 1.6vw, 21px);
	font-weight: 300;
}
.erstex-review-carousel cite { font-size: 16px; font-style: normal; font-weight: 700; }
.erstex-review-carousel cite::before {
	content: "★★★★★" / "";
	display: block;
	margin-block: 9px;
	color: #8a6200;
	letter-spacing: .3em;
}
.erstex-review-carousel .erstex-carousel-controls { gap: 8px; margin-top: 10px; }
.erstex-review-carousel .erstex-prev { order: -1; }
.erstex-review-carousel .erstex-next { order: 1; }
.erstex-projects { background: var(--erstex-warm); }
.erstex-library, .erstex-contact { background: var(--erstex-gray); }
.erstex-library .erstex-card { text-align: left; padding-bottom: 16px; }
.erstex-library .erstex-card h3, .erstex-library .erstex-card p { margin-inline: 18px; }
.erstex-accent { color: #4c6d19; }
.erstex-footer .erstex-accent { color: var(--erstex-green); }

.erstex-certificate-grid {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: clamp(16px, 5vw, 58px);
	margin-top: 30px;
}
.erstex-certificate-grid img {
	display: block;
	width: clamp(59px, 7vw, 86px);
	height: auto;
}
.erstex-contact-card {
	background: var(--erstex-warm);
	padding: clamp(23px, 4vw, 50px);
	border-left: 4px solid var(--erstex-green);
}
.erstex-contact-details > p { font-size: 17px; }
.erstex-contact-details > p:nth-of-type(2) { margin-top: 19px; }

.erstex-footer {
	background: var(--erstex-blue);
	color: #fff;
	padding-block: 46px;
	font-size: 15px;
}
.erstex-footer-grid {
	max-width: 950px;
	display: grid;
	grid-template-columns: .9fr 1.2fr 1fr 1.15fr;
	gap: clamp(16px, 3vw, 42px);
}
.erstex-footer h2 {
	display: table;
	padding-bottom: 5px;
	margin-block: 0 11px;
	border-bottom: 1px solid var(--erstex-green);
	font-size: 20px;
}
.erstex-footer p { margin-block: 0 5px; color: #e3ebf5; }
.erstex-footer .erstex-social { margin-block: 0 12px; gap: 7px; }
.erstex-social .wp-social-link {
	border: 1px solid rgb(255 255 255 / 55%);
	color: #fff !important;
}
.erstex-footer .erstex-legal a { text-decoration: underline; }

@media (max-width: 900px) {
	.erstex-header { padding-inline: var(--erstex-gutter); }
	.erstex-header .wp-block-navigation__responsive-container-open { display: flex; }
	.erstex-header .wp-block-navigation__responsive-container:not(.is-menu-open) { display: none; }
	.erstex-navigation .wp-block-navigation__responsive-container.is-menu-open {
		padding: 26px;
		color: var(--erstex-blue);
		background-color: var(--erstex-warm);
	}
	.erstex-navigation .is-menu-open .wp-block-navigation__container { gap: 8px; }
	.erstex-navigation .is-menu-open .wp-block-navigation-item__content {
		display: flex;
		align-items: center;
		min-height: 44px;
		font-size: 19px;
	}
	.erstex-navigation .is-menu-open .erstex-nav-contact > a {
		min-height: auto;
		padding: 8px 16px;
		clip-path: none;
	}
	.erstex-hero-images .erstex-prev { left: 2px; }
	.erstex-hero-images .erstex-next { right: 2px; }
	.erstex-hero-copy { padding-inline: max(46px, var(--erstex-gutter)); }
}

@media (max-width: 650px) {
	.erstex-header { gap: 13px; padding-inline: 16px; }
	.erstex-header .erstex-logo { flex-basis: 115px; }
	.erstex-header-phone { font-size: clamp(12px, 3.35vw, 15px); }
	.erstex-hero { min-height: clamp(380px, 72vh, 505px); }
	.erstex-hero h1 { font-size: clamp(38px, 11vw, 55px); transform: none; }
	.erstex-hero h1 span { font-size: .72em; }
	.erstex-hero-images img { object-position: 63% 50%; }
	.erstex-intro-grid, .erstex-contact-grid, .erstex-grid-three, .erstex-analysis { grid-template-columns: 1fr; }
	.erstex-analysis img { max-height: 150px; }
	.erstex-grid-four, .erstex-footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.erstex-library .erstex-card { max-width: 460px; width: 100%; margin-inline: auto; }
	.erstex-footer h2 { font-size: 17px; }
}

.editor-styles-wrapper .erstex-header-wrap { position: static; }
.editor-styles-wrapper .erstex-hero { display: block; min-height: 0; }
.editor-styles-wrapper .erstex-hero-copy { padding-block: 36px; pointer-events: auto; }
.editor-styles-wrapper .erstex-hero-images {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
}
.editor-styles-wrapper .erstex-hero-images > .erstex-slide {
	display: block;
	position: relative;
}
.editor-styles-wrapper .erstex-hero-images > .erstex-slide::after { display: none; }
.editor-styles-wrapper .erstex-review-carousel > .erstex-slide { display: block; }
