/*
Theme Name: IVG Immobilien Verwaltung
Theme URI: https://ivg-pd.de
Author: IVG Immobilien Verwaltung GmbH
Description: Schlankes Block-Theme für die IVG Immobilien Verwaltung GmbH. Markenfarben, Schriften (lokal, ohne Google-Server) und alle Seitenbausteine als Muster für den Blockeditor.
Version: 1.4.2
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ivg
*/

/* ---------- Grundlagen ---------- */
body { -webkit-font-smoothing: antialiased; }
.wp-block-post-content > .alignfull,
.wp-block-post-content > * + .alignfull,
main > .alignfull { margin-block-start: 0; }
.wp-site-blocks > * + * { margin-block-start: 0; }

.ivg-section { padding-block: var(--wp--preset--spacing--xl); }
.ivg-section--klein { padding-block: var(--wp--preset--spacing--l); }

/* Dunkle Abschnitte: Links und Texte hell */
.ivg-dunkel a:not(.wp-element-button) { color: #FFFFFF; }
.ivg-dunkel .is-style-ivg-lead { color: #E3F1EE; }
.ivg-dunkel .is-style-ivg-eyebrow { color: inherit; }
.ivg-dunkel .ivg-gedaempft { color: #C9E2DE; }

/* Gedämpfter Text */
.ivg-gedaempft { color: var(--wp--preset--color--grau); }

/* ---------- Absatz-Stile ---------- */
.is-style-ivg-eyebrow {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--mint);
}
.is-style-ivg-eyebrow::before {
	content: "";
	flex: none;
	width: 28px;
	height: 3px;
	border-radius: 2px;
	background: var(--wp--preset--color--orange);
}
.is-style-ivg-lead {
	font-size: var(--wp--preset--font-size--einleitung);
	font-weight: 300;
	max-width: 44rem;
}
.ivg-nummer {
	margin: 0;
	font-family: var(--wp--preset--font-family--barlow);
	font-size: 2.25rem;
	font-weight: 700;
	line-height: 1;
	color: var(--wp--preset--color--mint);
}
.ivg-label {
	display: inline-block;
	padding: 0.25rem 0.7rem;
	border-radius: 99px;
	background: var(--wp--preset--color--eisgruen);
	color: #0C3B33;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

/* ---------- Karten (Gruppen-Stile) ---------- */
.is-style-ivg-karte,
.is-style-ivg-karte-akzent {
	background: #FFFFFF;
	border: 1px solid var(--wp--preset--color--linie);
	border-radius: 14px;
	padding: clamp(1.25rem, 2.5vw, 1.75rem);
}
.is-style-ivg-karte-akzent { border-top: 4px solid var(--wp--preset--color--eisgruen); }
.is-style-ivg-karte-dunkel,
.is-style-ivg-karte-mint {
	color: #FFFFFF;
	border-radius: 16px;
	padding: clamp(1.25rem, 2.5vw, 1.75rem);
}
.is-style-ivg-karte-dunkel { background: var(--wp--preset--color--mint-dunkel); }
.is-style-ivg-karte-mint { background: var(--wp--preset--color--mint); }
.is-style-ivg-karte-dunkel a:not(.wp-element-button),
.is-style-ivg-karte-mint a:not(.wp-element-button) { color: #FFFFFF; }
.is-style-ivg-karte-orange {
	background: var(--wp--preset--color--orange);
	color: var(--wp--preset--color--schrift);
	border-radius: 14px;
	padding: clamp(1.25rem, 2.5vw, 1.75rem);
}
.is-style-ivg-hinweis {
	background: var(--wp--preset--color--eisgruen-hell);
	color: var(--wp--preset--color--schrift);
	border-radius: 12px;
	padding: 1.1rem 1.25rem;
	font-size: 0.9375rem;
}
.is-style-ivg-karte > :first-child, .is-style-ivg-karte-akzent > :first-child,
.is-style-ivg-karte-dunkel > :first-child, .is-style-ivg-karte-mint > :first-child,
.is-style-ivg-karte-orange > :first-child, .is-style-ivg-hinweis > :first-child { margin-top: 0; }
.is-style-ivg-karte > :last-child, .is-style-ivg-karte-akzent > :last-child,
.is-style-ivg-karte-dunkel > :last-child, .is-style-ivg-karte-mint > :last-child,
.is-style-ivg-karte-orange > :last-child, .is-style-ivg-hinweis > :last-child { margin-bottom: 0; }
.ivg-karte-fuss { margin-top: auto !important; padding-top: 0.5rem; }

/* Gleich hohe Karten im Raster */
.ivg-raster > * { display: flex; flex-direction: column; }

/* ---------- Schritte und Zeitleiste ---------- */
.ivg-schritt { border-top: 4px solid var(--wp--preset--color--orange); padding-top: 1.1rem; }
.ivg-zeit { border-left: 3px solid var(--wp--preset--color--eisgruen); padding-left: 1rem; }
.ivg-zeit > * { margin: 0; }

/* ---------- Häkchen-Liste ---------- */
.is-style-ivg-haken { list-style: none; padding-left: 0; --ivg-haken: var(--wp--preset--color--mint); }
.is-style-ivg-haken li { position: relative; padding-left: 2rem; }
.is-style-ivg-haken li + li { margin-top: 0.85rem; }
.is-style-ivg-haken li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.15em;
	width: 1.3rem;
	height: 1.3rem;
	background: var(--ivg-haken);
	-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='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-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='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ivg-dunkel .is-style-ivg-haken,
.is-style-ivg-karte-dunkel .is-style-ivg-haken,
.is-style-ivg-karte-mint .is-style-ivg-haken { --ivg-haken: var(--wp--preset--color--eisgruen); }
.is-style-ivg-haken li strong { font-family: var(--wp--preset--font-family--barlow); font-size: 1.1875rem; font-weight: 700; }

/* ---------- Kundenstimmen ---------- */
.ivg-stimmen { columns: 3 19rem; column-gap: 1.25rem; }
.ivg-stimmen > * { break-inside: avoid; margin: 0 0 1.25rem !important; }
.wp-block-quote.is-style-ivg-stimme {
	background: #FFFFFF;
	border: 1px solid var(--wp--preset--color--linie);
	border-radius: 14px;
	padding: 1.75rem;
	margin: 0;
	font-size: 1rem;
}
.wp-block-quote.is-style-ivg-stimme::before {
	content: "";
	display: block;
	width: 28px;
	height: 22px;
	margin-bottom: 0.9rem;
	background: var(--wp--preset--color--orange);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 22'%3E%3Cpath d='M0 22V12C0 5 4 1 11 0l1 3c-4 1-6 4-6 7h5v12H0zm16 0V12c0-7 4-11 11-12l1 3c-4 1-6 4-6 7h5v12H16z'/%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 28 22'%3E%3Cpath d='M0 22V12C0 5 4 1 11 0l1 3c-4 1-6 4-6 7h5v12H0zm16 0V12c0-7 4-11 11-12l1 3c-4 1-6 4-6 7h5v12H16z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.wp-block-quote.is-style-ivg-stimme p { margin: 0 0 0.75rem; }
.wp-block-quote.is-style-ivg-stimme cite {
	display: block;
	margin-top: 1rem;
	font-style: normal;
	font-size: 0.875rem;
	color: var(--wp--preset--color--grau);
}
.wp-block-quote.is-style-ivg-stimme cite strong { color: var(--wp--preset--color--schrift); font-weight: 600; }

/* ---------- FAQ (Details) ---------- */
.wp-block-details.is-style-ivg-faq {
	background: #FFFFFF;
	border: 1px solid var(--wp--preset--color--linie);
	border-radius: 12px;
	padding: 0 1.25rem;
}
.wp-block-details.is-style-ivg-faq + .wp-block-details.is-style-ivg-faq { margin-top: 0.6rem; }
.wp-block-details.is-style-ivg-faq summary {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: 1.1rem 0;
	cursor: pointer;
	list-style: none;
	font-family: var(--wp--preset--font-family--barlow);
	font-size: 1.1875rem;
	font-weight: 700;
}
.wp-block-details.is-style-ivg-faq summary::-webkit-details-marker { display: none; }
.wp-block-details.is-style-ivg-faq summary::after { content: "+"; color: var(--wp--preset--color--mint); font-size: 1.5rem; line-height: 1; }
.wp-block-details.is-style-ivg-faq[open] summary::after { content: "–"; }
.wp-block-details.is-style-ivg-faq > :last-child { margin-bottom: 1.1rem; }
.wp-block-details.is-style-ivg-faq p { color: var(--wp--preset--color--grau); font-size: 0.9375rem; }

/* ---------- Buttons ---------- */
.wp-block-button__link { display: inline-flex; align-items: center; min-height: 48px; }
.is-style-ivg-mint .wp-block-button__link { background: var(--wp--preset--color--mint); color: #FFFFFF; }
.is-style-ivg-mint .wp-block-button__link:hover { background: var(--wp--preset--color--mint-dunkel); color: #FFFFFF; }
.is-style-ivg-kontur .wp-block-button__link {
	background: transparent;
	color: inherit;
	border: 1px solid #9FB5AD;
	font-weight: 600;
}
.is-style-ivg-kontur .wp-block-button__link:hover { background: rgba(17, 98, 109, 0.08); color: inherit; }
.ivg-dunkel .is-style-ivg-kontur .wp-block-button__link,
.is-style-ivg-karte-dunkel .is-style-ivg-kontur .wp-block-button__link,
.is-style-ivg-karte-mint .is-style-ivg-kontur .wp-block-button__link { border-color: #7FB3B9; color: #FFFFFF; }
.ivg-dunkel .is-style-ivg-kontur .wp-block-button__link:hover,
.is-style-ivg-karte-dunkel .is-style-ivg-kontur .wp-block-button__link:hover,
.is-style-ivg-karte-mint .is-style-ivg-kontur .wp-block-button__link:hover { background: rgba(255, 255, 255, 0.1); color: #FFFFFF; }
.is-style-ivg-karte-mint .is-style-ivg-lead,
.is-style-ivg-karte-dunkel .is-style-ivg-lead { color: #E3F1EE; }
.is-style-ivg-karte-mint .ivg-gedaempft,
.is-style-ivg-karte-dunkel .ivg-gedaempft { color: #C9E2DE; }

/* ---------- Kopfbereich (Minttürkis, helle Schrift) ---------- */
.ivg-header {
	background: var(--wp--preset--color--mint);
	color: #FFFFFF;
	border-bottom: 1px solid #1A7480;
	padding-block: 0.75rem;
}
/* Logo: Höhe fest, Breite automatisch (Querformat-Logo) */
.ivg-header .wp-block-site-logo img { width: auto !important; height: 44px !important; max-width: 70vw; object-fit: contain; }
@media (max-width: 600px) { .ivg-header .wp-block-site-logo img { height: 36px !important; } }
/* Ist ein Logo hinterlegt, enthält es den Firmennamen: Titel und Untertitel nur für Screenreader und Suchmaschinen */
.ivg-header .wp-block-site-logo + .wp-block-group {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}
.ivg-header .wp-block-site-title { margin: 0; font-family: var(--wp--preset--font-family--barlow); font-size: 1.125rem; font-weight: 700; line-height: 1.15; }
.ivg-header .wp-block-site-title a { color: #FFFFFF; text-decoration: none; }
.ivg-header .wp-block-site-tagline { margin: 0; font-size: 0.8125rem; color: #C9E2DE; }
.ivg-header .wp-block-navigation { font-size: 0.9375rem; font-weight: 600; color: #FFFFFF; }
.ivg-header .wp-block-navigation a { color: #FFFFFF; text-decoration: none; }
.ivg-header .wp-block-navigation a:hover { color: #FFFFFF; box-shadow: inset 0 -2px 0 rgba(255, 255, 255, 0.5); }
.ivg-header .wp-block-navigation .current-menu-item > a { color: #FFFFFF; box-shadow: inset 0 -3px 0 var(--wp--preset--color--orange); }
.ivg-header .wp-block-navigation__responsive-container-open,
.ivg-header .wp-block-navigation__responsive-container-close { color: #FFFFFF; }
/* Menü auf dem Smartphone: aufgeklappt ebenfalls Minttürkis */
.ivg-header .wp-block-navigation__responsive-container.is-menu-open {
	background-color: var(--wp--preset--color--mint) !important;
	color: #FFFFFF !important;
	padding: 1.5rem clamp(16px, 4vw, 40px);
}
.ivg-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content { font-size: 1.25rem; padding-block: 0.5rem; }
.ivg-header .wp-block-button__link { min-height: 44px; padding: 0.5rem 1rem; font-family: var(--wp--preset--font-family--montserrat); font-size: 0.875rem; font-weight: 600; }
.ivg-header .is-style-ivg-kontur .wp-block-button__link { border-color: #7FB3B9; color: #FFFFFF; }
.ivg-header .is-style-ivg-kontur .wp-block-button__link:hover { background: rgba(255, 255, 255, 0.1); color: #FFFFFF; }
.ivg-header .is-style-ivg-mint .wp-block-button__link { background: var(--wp--preset--color--orange); color: var(--wp--preset--color--schrift); }
.ivg-header .is-style-ivg-mint .wp-block-button__link:hover { background: #EE7D58; color: var(--wp--preset--color--schrift); }
.ivg-header :where(a, button):focus-visible { outline-color: #FFFFFF; }

/* ---------- Kundenstimmen: Kurzfassung + aufklappbares Original ---------- */
.ivg-stimme { gap: 0.75rem; }
.ivg-stimme::before {
	content: "";
	display: block;
	width: 24px;
	height: 19px;
	background: var(--wp--preset--color--orange);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 22'%3E%3Cpath d='M0 22V12C0 5 4 1 11 0l1 3c-4 1-6 4-6 7h5v12H0zm16 0V12c0-7 4-11 11-12l1 3c-4 1-6 4-6 7h5v12H16z'/%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 28 22'%3E%3Cpath d='M0 22V12C0 5 4 1 11 0l1 3c-4 1-6 4-6 7h5v12H0zm16 0V12c0-7 4-11 11-12l1 3c-4 1-6 4-6 7h5v12H16z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ivg-stimme .wp-block-quote { border: 0; margin: 0; padding: 0; font-size: 1rem; font-style: normal; }
.ivg-stimme .wp-block-quote p { margin: 0; }
.ivg-stimme .wp-block-quote cite { display: block; margin-top: 0.75rem; font-style: normal; font-size: 0.875rem; color: var(--wp--preset--color--grau); }
.ivg-stimme .wp-block-quote cite strong { color: var(--wp--preset--color--schrift); font-weight: 600; }
.ivg-stimme .wp-block-details { margin-top: auto !important; border-top: 1px solid #E6EFEC; padding-top: 0.25rem; }
.ivg-stimme .wp-block-details summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 44px;
	cursor: pointer;
	list-style: none;
	color: var(--wp--preset--color--mint);
	font-size: 0.875rem;
	font-weight: 600;
}
.ivg-stimme .wp-block-details summary::-webkit-details-marker { display: none; }
.ivg-stimme .wp-block-details summary::after { content: "+"; font-size: 1.25rem; line-height: 1; }
.ivg-stimme .wp-block-details[open] summary::after { content: "–"; }
.ivg-stimme .wp-block-details p { margin: 0.25rem 0 0; color: var(--wp--preset--color--grau); font-size: 0.875rem; }

/* ---------- Kurzprofil (Über uns) ---------- */
.ivg-fakt p { margin: 0; }
.ivg-fakt p + p { margin-top: 0.25rem; font-weight: 600; }

/* ---------- Fußbereich ---------- */
.ivg-footer { font-size: 0.875rem; color: #C9E2DE; }
.ivg-footer h2, .ivg-footer h3, .ivg-footer strong { color: #FFFFFF; }
.ivg-footer a { color: #C9E2DE; font-weight: 400; }
.ivg-footer a:hover { color: #FFFFFF; }
.ivg-footer .wp-block-navigation a { min-height: 44px; display: inline-flex; align-items: center; }

/* ---------- Bilder ---------- */
.wp-block-image.ivg-foto img { width: 100%; height: auto; border-radius: 14px; object-fit: cover; }
.wp-block-image.ivg-foto-quadrat img { aspect-ratio: 1 / 1; object-fit: cover; }
/* Bildblöcke ohne Bild werden auf der Website nicht angezeigt */
.wp-site-blocks .wp-block-image:not(:has(img[src])) { display: none; }

/* ---------- Barrierefreiheit ---------- */
:where(a, button, summary, input, select, textarea):focus-visible { outline: 2px solid var(--wp--preset--color--schrift); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
html { scroll-behavior: smooth; scroll-padding-top: 1rem; }

/* ---------- Leistungen: 4 Kacheln in einer Spalte immer 2 + 2 (wirkt auch auf bereits angelegte Seiten) ---------- */
.wp-block-column > .wp-block-group.is-layout-grid:has(> :nth-child(4):last-child) {
	grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}
@media (max-width: 600px) {
	.wp-block-column > .wp-block-group.is-layout-grid:has(> :nth-child(4):last-child) {
		grid-template-columns: minmax(0, 1fr) !important;
	}
}

/* ---------- Einleitung linksbündig zur Überschrift (statt mittig eingerückt) ---------- */
.is-layout-constrained > .is-style-ivg-lead {
	margin-left: max(0px, calc((100% - var(--wp--style--global--content-size)) / 2)) !important;
	margin-right: auto !important;
}

/* ---------- Zurück-Link ---------- */
.ivg-zurueck { margin: 0 0 0.5rem; font-size: 0.9375rem; }
.ivg-zurueck a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; font-weight: 600; }
.ivg-zurueck a:hover { text-decoration: underline; }

/* ---------- Karriere: Stimmen aus dem Team ---------- */
.ivg-teamstimme { gap: 1.25rem; }
.ivg-teamstimme .wp-block-quote.is-style-ivg-stimme { border: 0; padding: 0; background: none; }
.wp-block-image.ivg-foto-rund { flex: none; margin: 0; }
.wp-block-image.ivg-foto-rund img { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; }
@media (max-width: 480px) { .ivg-teamstimme { flex-wrap: wrap !important; } }
.ivg-teamstimme > .ivg-stimme { flex: 1 1 auto; min-width: 0; }

/* ---------- Zurück-Leiste am Ende von Unterseiten ---------- */
.ivg-zurueck-leiste { padding-block: 0 var(--wp--preset--spacing--xl); }
.ivg-zurueck-leiste > .wp-block-buttons { border-top: 1px solid var(--wp--preset--color--linie); padding-top: 1.75rem; }
.ivg-zurueck-leiste .wp-block-button__link { font-family: var(--wp--preset--font-family--montserrat); font-size: 0.9375rem; font-weight: 600; }

/* ---------- Karriere: Stellen zum Aufklappen ---------- */
.ivg-stelle .wp-block-details { border-top: 1px solid #E6EFEC; padding-top: 0.25rem; margin-top: 0.75rem; }
.ivg-stelle .wp-block-details summary {
	display: flex; align-items: center; justify-content: space-between;
	min-height: 44px; cursor: pointer; list-style: none;
	color: var(--wp--preset--color--mint); font-size: 0.9375rem; font-weight: 600;
}
.ivg-stelle .wp-block-details summary::-webkit-details-marker { display: none; }
.ivg-stelle .wp-block-details summary::after { content: "+"; font-size: 1.25rem; line-height: 1; }
.ivg-stelle .wp-block-details[open] summary::after { content: "–"; }
.ivg-stelle .wp-block-details h4 { margin: 0.75rem 0 0.4rem; font-size: 1.125rem; }
.ivg-stelle .wp-block-details ul { margin: 0; font-size: 0.9375rem; }
.ivg-stelle .wp-block-details li + li { margin-top: 0.25rem; }
.ivg-stelle .wp-block-details p { font-size: 0.9375rem; margin: 0.75rem 0 0; }
