/*
 * Ergaenzungen zu theme.json: nur, was sich dort nicht ausdruecken laesst.
 * Farben, Schriften und Abstaende immer ueber die Presets (var(--wp--preset--...)).
 */

:root {
	--immohof-uebergang: 180ms ease;
}

a {
	text-underline-offset: 0.18em;
	text-decoration-thickness: 1px;
}

:where(a, button, input, select, textarea):focus-visible {
	outline: 2px solid var(--wp--preset--color--blau);
	outline-offset: 3px;
}

/* --- Kopfbereich -------------------------------------------------------- */

.immohof-kopfbereich {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 50;
}

.immohof-kopf {
	border-bottom: 1px solid var(--wp--preset--color--linie);
}

.immohof-infozeile a {
	color: inherit;
	text-decoration: none;
}

.immohof-infozeile a:hover {
	text-decoration: underline;
}

.immohof-kopf .wp-block-site-logo img {
	display: block;
}

.immohof-kopf .wp-block-navigation a {
	text-decoration: none;
}

.immohof-kopf .wp-block-navigation-item__content:hover,
.immohof-kopf .wp-block-navigation .current-menu-item > .wp-block-navigation-item__content {
	color: var(--wp--preset--color--blau);
}

.immohof-kopf .wp-block-navigation .current-menu-item > .wp-block-navigation-item__content {
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 0.5em;
}

.immohof-kopf .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	font-size: var(--wp--preset--font-size--mittel);
}

@media (max-width: 781px) {
	.wp-block-buttons.immohof-kopf-knopf {
		display: none;
	}

	.immohof-kopf .wp-block-site-logo img {
		width: 120px;
	}
}

/* --- Schaltflaechen ----------------------------------------------------- */

.wp-element-button {
	transition: background-color var(--immohof-uebergang), color var(--immohof-uebergang), border-color var(--immohof-uebergang);
}

.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--blau);
	border: 2px solid currentColor;
	padding: calc(0.85em - 2px) calc(1.6em - 2px);
}

.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--blau);
	border-color: var(--wp--preset--color--blau);
	color: var(--wp--preset--color--weiss);
}

:is(.wp-block-cover, .is-style-abschnitt-blau, .is-style-abschnitt-graphit) .wp-block-button.is-style-outline > .wp-block-button__link {
	color: var(--wp--preset--color--weiss);
}

:is(.wp-block-cover, .is-style-abschnitt-blau, .is-style-abschnitt-graphit) .wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--weiss);
	border-color: var(--wp--preset--color--weiss);
	color: var(--wp--preset--color--blau-dunkel);
}

/* --- Blockstile --------------------------------------------------------- */

.is-style-dachzeile {
	font-family: var(--wp--preset--font-family--ueberschrift);
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--wp--preset--color--blau);
}

:is(.wp-block-cover, .is-style-abschnitt-blau, .is-style-abschnitt-graphit) .is-style-dachzeile {
	color: var(--wp--preset--color--blau-hell);
}

.wp-block-image.is-style-symbol img {
	box-sizing: content-box;
	padding: 1rem;
	border-radius: 50%;
	background: var(--wp--preset--color--blau-hell);
}

.wp-block-list.is-style-haken {
	list-style: none;
	padding-left: 0;
}

.wp-block-list.is-style-haken li {
	position: relative;
	padding-left: 1.9rem;
	margin-bottom: 0.4rem;
}

.wp-block-list.is-style-haken li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.3em;
	width: 1.15rem;
	height: 1.15rem;
	background: var(--wp--preset--color--blau);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12.5l5 5L20 6.5'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12.5l5 5L20 6.5'/%3E%3C/svg%3E") center / contain no-repeat;
}

:is(.is-style-abschnitt-blau, .is-style-abschnitt-graphit) .wp-block-list.is-style-haken li::before {
	background: currentColor;
}

.wp-block-table.is-style-eckdaten table {
	border-collapse: collapse;
	width: 100%;
}

.wp-block-table.is-style-eckdaten :is(th, td) {
	border: 0;
	border-bottom: 1px solid var(--wp--preset--color--linie);
	padding: 0.7rem 0;
	text-align: left;
	vertical-align: top;
}

.wp-block-table.is-style-eckdaten th {
	width: 40%;
	padding-right: 1.5rem;
	font-weight: 600;
	color: var(--wp--preset--color--grau);
}

.wp-block-table.is-style-eckdaten tr:first-child :is(th, td) {
	border-top: 1px solid var(--wp--preset--color--linie);
}

/* --- Aufmacher ---------------------------------------------------------- */

.immohof-aufmacher :is(h1, h2, p) {
	color: var(--wp--preset--color--weiss);
}

.immohof-aufmacher h1 {
	margin-top: 0.5rem;
	text-wrap: balance;
}

/* --- Titelband ---------------------------------------------------------- */

.immohof-titelband .wp-block-post-title,
.immohof-titelband .wp-block-query-title {
	margin: 0;
	text-wrap: balance;
}

.immohof-zurueck a {
	font-family: var(--wp--preset--font-family--ueberschrift);
	font-weight: 600;
	text-decoration: none;
}

.immohof-zurueck a::before {
	content: "← ";
}

/* --- Angebotskarten ----------------------------------------------------- */

.immohof-angebotskarten > li {
	display: flex;
}

.immohof-angebotskarte {
	display: flex;
	flex-direction: column;
	width: 100%;
	overflow: hidden;
	background: var(--wp--preset--color--weiss);
	border: 1px solid var(--wp--preset--color--linie);
	border-radius: var(--wp--custom--radius--gross);
	box-shadow: var(--wp--preset--shadow--karte);
	transition: transform var(--immohof-uebergang), box-shadow var(--immohof-uebergang);
}

.immohof-angebotskarte:hover {
	transform: translateY(-3px);
	box-shadow: var(--wp--preset--shadow--schwebend);
}

.immohof-angebotskarte > .wp-block-group {
	display: flex;
	flex-direction: column;
	flex: 1;
}

.immohof-angebotskarte .wp-block-post-featured-image {
	margin: 0;
	border-radius: 0;
}

.immohof-angebotskarte .wp-block-post-featured-image img {
	border-radius: 0;
}

.immohof-angebotskarte .wp-block-post-title a {
	color: var(--wp--preset--color--graphit);
	text-decoration: none;
}

.immohof-angebotskarte .wp-block-post-title a:hover {
	color: var(--wp--preset--color--blau);
}

.immohof-angebotskarte .wp-block-post-excerpt__excerpt {
	margin: 0;
}

.immohof-angebotskarte .wp-block-read-more {
	margin-top: auto;
	padding-top: 0.5rem;
	font-family: var(--wp--preset--font-family--ueberschrift);
	font-size: 0.95rem;
	font-weight: 600;
	text-decoration: none;
}

.immohof-angebotskarte .wp-block-read-more::after {
	content: " →";
}

.immohof-platzhalter img {
	object-fit: contain !important;
	padding: 2rem 3rem;
	box-sizing: border-box;
	background: var(--wp--preset--color--blau-hell);
}

/* --- Exposé ------------------------------------------------------------- */

@media (min-width: 782px) {
	.immohof-anfragebox {
		position: sticky;
		top: calc(var(--wp-admin--admin-bar--height, 0px) + 8.5rem);
	}
}

.immohof-expose .wp-block-post-content > h2 {
	margin-top: var(--wp--preset--spacing--40);
}

.immohof-hinweis {
	margin-top: var(--wp--preset--spacing--40);
	padding-top: var(--wp--preset--spacing--20);
	border-top: 1px solid var(--wp--preset--color--linie);
}

.wp-block-gallery.is-cropped .wp-block-image img {
	aspect-ratio: 4 / 3;
	border-radius: var(--wp--custom--radius--klein);
}

/* --- Fussbereich -------------------------------------------------------- */

.immohof-fuss a {
	color: inherit;
	text-decoration: none;
}

.immohof-fuss a:hover {
	text-decoration: underline;
}

.immohof-fuss .immohof-fuss-titel {
	margin-bottom: 0.75rem;
	font-size: 0.8rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--wp--preset--color--blau-hell);
}

.immohof-fuss .wp-block-column > p {
	margin-top: 0;
	opacity: 0.85;
}

.immohof-fuss-links {
	list-style: none;
	padding-left: 0;
	margin-top: 0;
}

.immohof-fuss-links li {
	margin-bottom: 0.25rem;
}

.immohof-fuss-linie {
	opacity: 0.2;
	margin-top: var(--wp--preset--spacing--40);
}

.immohof-copyright {
	opacity: 0.7;
}

/* --- Kontaktformular (Fluent Forms) ------------------------------------- */

.fluentform .ff-el-form-control {
	background-color: var(--wp--preset--color--weiss);
	border: 1px solid var(--wp--preset--color--linie);
	border-radius: var(--wp--custom--radius--klein);
	padding: 0.7rem 0.85rem;
	font: inherit;
}

.fluentform .ff-el-form-control:focus {
	border-color: var(--wp--preset--color--blau);
	box-shadow: 0 0 0 3px var(--wp--preset--color--blau-hell);
}

.fluentform .ff-el-input--label label {
	font-weight: 600;
}

.fluentform .ff-btn-submit {
	border-radius: var(--wp--custom--radius--klein) !important;
	font-family: var(--wp--preset--font-family--ueberschrift);
	font-weight: 600;
	padding: 0.85em 1.6em !important;
}

/* Vollbreite Abschnitte liegen buendig aneinander statt mit Blockabstand. */
.immohof-volle-breite > .alignfull {
	margin-block: 0;
}

.wp-site-blocks > footer {
	margin-block-start: 0;
}

/* --- Bewegung (assets/js/effekte.js setzt --maus-x/-y und --scroll) ----- */

.immohof-aufmacher {
	background-color: var(--wp--preset--color--graphit);
}

.immohof-aufmacher .wp-block-cover__image-background,
body:not(.editor-styles-wrapper) .immohof-aufmacher .wp-block-gallery.is-style-diashow {
	transform: scale(1.12) translate3d(calc(var(--maus-x, 0) * -2.5%), calc(var(--maus-y, 0) * -2.5% + var(--scroll, 0) * 10%), 0);
	will-change: transform;
}

/* Diashow: die Galerie liegt im Inhalt des Aufmachers (dort pflegt sie die
   Redaktion), wird aber unter die Ueberlagerung gehoben. Dafuer darf der
   Inhaltscontainer keinen eigenen Stapelkontext bilden. Im Editor bleibt sie
   eine normale Galerie. */
/* z-index: auto, weil ein Flex-Element mit z-index auch statisch einen Stapelkontext bildet. */
body:not(.editor-styles-wrapper) .immohof-aufmacher .wp-block-cover__inner-container {
	position: static;
	z-index: auto;
}

/* Ohne Coverbild setzt der Kern keinen z-index auf die Ueberlagerung. */
body:not(.editor-styles-wrapper) .immohof-aufmacher .wp-block-cover__background {
	z-index: 1;
}

body:not(.editor-styles-wrapper) .immohof-aufmacher .wp-block-cover__inner-container > :not(.is-style-diashow) {
	position: relative;
	z-index: 2;
}

body:not(.editor-styles-wrapper) .immohof-aufmacher .wp-block-gallery.is-style-diashow {
	position: absolute;
	inset: 0;
	z-index: 0;
	max-width: none;
	margin: 0;
}

/* :not(#individual-image) wie im Kern-CSS der Galerie, sonst gewinnt dessen Spaltenbreite. */
body:not(.editor-styles-wrapper) .immohof-aufmacher .is-style-diashow figure.wp-block-image:not(#individual-image) {
	position: absolute;
	inset: 0;
	width: auto;
	margin: 0;
	opacity: 0;
	transition: opacity 1.6s ease;
}

body:not(.editor-styles-wrapper) .immohof-aufmacher .is-style-diashow:not(:has(.ist-aktiv)) > figure.wp-block-image:first-child:not(#individual-image),
body:not(.editor-styles-wrapper) .immohof-aufmacher .is-style-diashow > figure.wp-block-image.ist-aktiv:not(#individual-image) {
	opacity: 1;
}

body:not(.editor-styles-wrapper) .immohof-aufmacher .is-style-diashow figure.wp-block-image:not(#individual-image) img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

body:not(.editor-styles-wrapper) .immohof-aufmacher .is-style-diashow figcaption {
	display: none;
}

/* Dachlinie aus dem Logo als zweite, naehere Ebene - wie der schwebende
   Logo-Layer der alten Startseite. */
.immohof-aufmacher::after {
	content: "";
	position: absolute;
	z-index: 1;
	right: -4%;
	bottom: 6%;
	width: min(52vw, 760px);
	aspect-ratio: 890 / 380;
	background: url("../images/dach.svg") center / contain no-repeat;
	opacity: 0.3;
	pointer-events: none;
	transform: translate3d(calc(var(--maus-x, 0) * 7%), calc(var(--maus-y, 0) * 9% - var(--scroll, 0) * 25%), 0);
	will-change: transform;
}

.immohof-aufmacher .wp-block-cover__inner-container {
	z-index: 2;
}

@media (max-width: 781px) {
	.immohof-aufmacher::after {
		width: 90vw;
		opacity: 0.14;
	}
}

@keyframes immohof-auftauchen {
	from { opacity: 0; transform: translateY(28px); }
	to { opacity: 1; transform: none; }
}

.immohof-effekte .immohof-aufmacher .wp-block-cover__inner-container > :not(.is-style-diashow) > * {
	animation: immohof-auftauchen 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.immohof-effekte .immohof-aufmacher .wp-block-cover__inner-container > * > :nth-child(2) { animation-delay: 0.12s; }
.immohof-effekte .immohof-aufmacher .wp-block-cover__inner-container > * > :nth-child(3) { animation-delay: 0.24s; }
.immohof-effekte .immohof-aufmacher .wp-block-cover__inner-container > * > :nth-child(4) { animation-delay: 0.36s; }

.einblenden {
	opacity: 0;
	transform: translateY(28px);
	transition: opacity 0.7s ease var(--verzoegerung, 0ms), transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) var(--verzoegerung, 0ms);
}

.einblenden.ist-sichtbar {
	opacity: 1;
	transform: none;
}

/* Feststehendes Foto hinter den Baendern ("Fester Hintergrund" am Cover-Block). */
.wp-block-cover.immohof-band {
	min-height: 0;
}

.wp-block-cover.immohof-band :is(h2, p) {
	color: var(--wp--preset--color--weiss);
}

.is-style-karte .wp-block-image.is-style-symbol img {
	transition: transform var(--immohof-uebergang), background-color var(--immohof-uebergang);
}

.is-style-karte:hover .wp-block-image.is-style-symbol img {
	transform: scale(1.08) rotate(-4deg);
}

.wp-block-cover.immohof-band .wp-block-button:not(.is-style-outline) > .wp-block-button__link {
	background: var(--wp--preset--color--weiss);
	color: var(--wp--preset--color--blau-dunkel);
}

.wp-block-cover.immohof-band .wp-block-button:not(.is-style-outline) > .wp-block-button__link:hover {
	background: var(--wp--preset--color--blau-hell);
}
