/* BetterCallBenny – ergänzende Styles, die theme.json nicht abdeckt. */

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

:where(h1, h2, h3, [id]) { scroll-margin-top: 6rem; }

/* Kopfbereich: klebend, leicht transparent */
.bcb-header {
	position: sticky;
	top: 0;
	z-index: 50;
	backdrop-filter: saturate(180%) blur(12px);
	-webkit-backdrop-filter: saturate(180%) blur(12px);
	background-color: rgba(255, 255, 255, 0.85) !important;
	border-bottom: 1px solid var(--wp--preset--color--border);
}
.admin-bar .bcb-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .bcb-header { top: 46px; } }

/* Logo im Header: Ist ein Logo gesetzt, bleibt der Seitentitel nur für Screenreader. */
.bcb-header .wp-block-site-logo img { height: auto; }
.bcb-header .wp-block-site-logo + .wp-block-site-title {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}
/* Logogröße im Header fest vorgeben (unabhängig von der Breite im Editor). */
.bcb-header .wp-block-site-logo { flex-shrink: 0; }
.bcb-header .wp-block-site-logo img { width: 300px !important; max-width: none; }
@media (max-width: 1100px) {
	.bcb-header .wp-block-site-logo img { width: 240px !important; }
}
@media (max-width: 900px) {
	.bcb-header .wp-block-site-logo img { width: 180px !important; }
}
@media (max-width: 600px) {
	.bcb-header .wp-block-site-logo img { width: 165px !important; }
}

/* Logo im Footer */
.bcb-footer-logo img { width: 240px; height: auto; }

/* Dachzeile über Überschriften */
.is-style-bcb-eyebrow,
.bcb-eyebrow {
	font-size: var(--wp--preset--font-size--small) !important;
	font-weight: 700 !important;
	letter-spacing: 0.12em !important;
	text-transform: uppercase;
	color: var(--wp--preset--color--primary);
}
.has-contrast-background-color .is-style-bcb-eyebrow,
.bcb-dark .bcb-eyebrow,
.bcb-dark .is-style-bcb-eyebrow { color: var(--wp--preset--color--accent); }

/* Karten */
.is-style-bcb-card {
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 20px;
	padding: var(--wp--preset--spacing--40);
	box-shadow: var(--wp--preset--shadow--soft);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.is-style-bcb-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--wp--preset--shadow--lifted);
}
@media (prefers-reduced-motion: reduce) {
	.is-style-bcb-card, .is-style-bcb-card:hover { transition: none; transform: none; }
}

/* Spalten mit Karten gleich hoch */
.wp-block-columns.bcb-equal > .wp-block-column { display: flex; flex-direction: column; }
.wp-block-columns.bcb-equal > .wp-block-column > .is-style-bcb-card { flex: 1; }

/* Icon-Kachel in Leistungskarten */
.bcb-icon {
	display: inline-grid;
	place-items: center;
	width: 3rem;
	height: 3rem;
	border-radius: 14px;
	font-size: 1.5rem;
	line-height: 1;
	background: rgba(168, 75, 42, 0.1);
	margin: 0 !important;
}

/* Sekundär-Button (Kontur) */
.wp-block-button.is-style-outline > .wp-block-button__link {
	border: 2px solid currentColor;
	background: transparent;
	color: inherit;
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: rgba(255, 255, 255, 0.08);
}

/* Akzent-Hervorhebung in Überschriften: <mark class="bcb-highlight"> */
mark.bcb-highlight {
	background: linear-gradient(transparent 62%, rgba(242, 181, 58, 0.55) 62%);
	color: inherit;
	padding: 0 0.1em;
}
.has-contrast-background-color mark.bcb-highlight,
.bcb-dark mark.bcb-highlight {
	background: none;
	color: var(--wp--preset--color--accent);
	padding: 0;
}

/* Kennzahlen */
.bcb-stat-number {
	font-size: var(--wp--preset--font-size--xx-large);
	font-weight: 800;
	letter-spacing: -0.03em;
	line-height: 1;
	margin: 0 !important;
}

/* Prozess-Schritte */
.bcb-step-number {
	font-family: var(--wp--preset--font-family--mono);
	font-weight: 700;
	color: var(--wp--preset--color--primary);
}

/* Referenzbilder */
.bcb-reference img {
	aspect-ratio: 4 / 3;
	object-fit: cover;
	width: 100%;
}

/* Häkchenliste */
ul.bcb-checklist { list-style: none; padding-left: 0; }
ul.bcb-checklist li { position: relative; padding-left: 1.75rem; margin-bottom: 0.5rem; }
ul.bcb-checklist li::before {
	content: "✓";
	position: absolute;
	left: 0;
	font-weight: 800;
	color: var(--wp--preset--color--primary);
}
.bcb-dark ul.bcb-checklist li::before { color: var(--wp--preset--color--accent); }

/* Bilder in Karten-Listen (Referenzen, Suche) */
.wp-block-post-template .wp-block-post-featured-image img { border-radius: 16px; }

/* Fußbereich */
.bcb-footer a { color: inherit; text-decoration: none; opacity: 0.8; }
.bcb-footer a:hover { opacity: 1; text-decoration: underline; }
.bcb-footer-line { border-color: #4A3A2E !important; margin-top: var(--wp--preset--spacing--50) !important; margin-bottom: var(--wp--preset--spacing--30) !important; }

/* FAQ-Akkordeon */
.bcb-faq {
	border-bottom: 1px solid var(--wp--preset--color--border);
	padding: 1.25rem 0;
}
.bcb-faq summary {
	cursor: pointer;
	font-weight: 700;
	font-size: var(--wp--preset--font-size--large);
	list-style: none;
	position: relative;
	padding-right: 2rem;
}
.bcb-faq summary::-webkit-details-marker { display: none; }
.bcb-faq summary::after {
	content: "+";
	position: absolute;
	right: 0;
	top: 0;
	color: var(--wp--preset--color--primary);
	font-weight: 400;
	transition: transform 0.2s ease;
}
.bcb-faq[open] summary::after { transform: rotate(45deg); }
.bcb-faq > p { margin-top: 0.75rem; }

/* Karte auf dunklem Grund: Text dunkel halten */
.bcb-dark .is-style-bcb-card { color: var(--wp--preset--color--contrast); }
.bcb-dark .is-style-bcb-card ul.bcb-checklist li::before { color: var(--wp--preset--color--primary); }

/* Tablet und mobil: Header-Button ausblenden, "Kontakt" steht dann im Menü */
@media (max-width: 900px) {
	.bcb-header-cta { display: none !important; }
}

/* Button-Varianten */
.bcb-button-small > .wp-block-button__link {
	padding: 0.6rem 1.2rem;
	font-size: var(--wp--preset--font-size--small);
}
.wp-block-buttons > .bcb-button-full { width: 100%; }
.bcb-button-full > .wp-block-button__link { width: 100%; }

/* Navigationspunkt nur mobil (ersetzt dort den Header-Button) */
@media (min-width: 901px) {
	.bcb-nav-mobile-only { display: none !important; }
}
@media (min-width: 601px) and (max-width: 900px) {
	.bcb-header .wp-block-navigation { gap: 1.1rem !important; }
}
@media (min-width: 601px) and (max-width: 760px) {
	.bcb-header .wp-block-navigation { gap: 0.8rem !important; font-size: 0.9rem; }
	.bcb-header .wp-block-site-logo img { width: 160px !important; }
}

/* Rechtstexte: ruhigere Überschriften */
.bcb-legal h2 { font-size: var(--wp--preset--font-size--x-large); margin-top: var(--wp--preset--spacing--50); }
.bcb-legal h3 { font-size: var(--wp--preset--font-size--large); }

/* Formular-Karte: Standard-Formularfelder an das Theme angleichen */
.bcb-form-card input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
.bcb-form-card textarea,
.bcb-form-card select {
	box-sizing: border-box;
	width: 100%;
	padding: 0.75rem 1rem;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 12px;
	font: inherit;
	background: var(--wp--preset--color--surface);
}
.bcb-form-card input:focus,
.bcb-form-card textarea:focus {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 1px;
}
.bcb-form-card input[type="submit"],
.bcb-form-card button[type="submit"] {
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--base);
	border: 0;
	border-radius: 999px;
	padding: 0.85rem 1.6rem;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

/* Kontaktformular (Contact Form 7) */
.bcb-form-card .wpcf7 p { margin: 0 0 1rem; }
.bcb-form-card .wpcf7 label { display: block; font-weight: 600; font-size: var(--wp--preset--font-size--small); }
.bcb-form-card .wpcf7 label br { display: none; }
.bcb-form-card .wpcf7 label .wpcf7-form-control-wrap { display: block; margin-top: 0.35rem; font-weight: 400; font-size: var(--wp--preset--font-size--medium); }
.bcb-form-card .wpcf7 textarea { min-height: 9rem; resize: vertical; }
.bcb-cf7-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 600px) { .bcb-cf7-row { grid-template-columns: 1fr; } }
.bcb-form-card .bcb-cf7-consent { font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--muted); }
.bcb-form-card .bcb-cf7-consent .wpcf7-list-item { margin: 0; }
.bcb-form-card .bcb-cf7-consent .wpcf7-list-item label { display: flex; gap: 0.6rem; align-items: flex-start; }
.bcb-form-card .bcb-cf7-consent input[type="checkbox"] { width: 1.1rem; height: 1.1rem; margin-top: 0.15rem; accent-color: var(--wp--preset--color--primary); flex-shrink: 0; }
.bcb-form-card .bcb-cf7-consent label { font-weight: 400; font-size: inherit; }
.bcb-form-card input[type="submit"]:hover { background: var(--wp--preset--color--primary-dark); }
.bcb-form-card .wpcf7-spinner { vertical-align: middle; }
.bcb-form-card .wpcf7-not-valid { border-color: #C0392B !important; }
.bcb-form-card .wpcf7-not-valid-tip { color: #C0392B; font-size: var(--wp--preset--font-size--small); margin-top: 0.3rem; }
.bcb-form-card .wpcf7 form .wpcf7-response-output {
	margin: 1rem 0 0;
	padding: 0.85rem 1rem;
	border-radius: 12px;
	border-width: 1px;
	font-size: var(--wp--preset--font-size--small);
}
.bcb-form-fallback { color: var(--wp--preset--color--muted); }
.bcb-form-admin-hint { padding: 0.85rem 1rem; border: 1px dashed var(--wp--preset--color--border); border-radius: 12px; font-size: var(--wp--preset--font-size--small); }

/* "Mehr"-Links: Weiterführende Buttons nur auf der Startseite zeigen */
body:not(.home) .bcb-home-only { display: none !important; }

/* "Mehr erfahren" am Kartenende ausrichten */
.bcb-equal .is-style-bcb-card { display: flex; flex-direction: column; }
.bcb-more-link { margin-top: auto !important; padding-top: 0.75rem; font-weight: 600; }
.bcb-more-link a { text-decoration: none; }
.bcb-more-link a:hover { text-decoration: underline; }

/* Referenzen: Karten mit Logo */
.bcb-ref-query .wp-block-post-template > li { display: flex; }
.bcb-ref-card { display: flex; flex-direction: column; width: 100%; }
.bcb-ref-card .bcb-ref-logo {
	margin: 0 0 0.5rem;
	background: var(--wp--preset--color--surface);
	border-radius: 14px;
	overflow: hidden;
}
.bcb-ref-card .bcb-ref-logo img {
	padding: 1.5rem 2rem;
	box-sizing: border-box;
	transition: transform 0.25s ease;
}
.bcb-ref-card:hover .bcb-ref-logo img { transform: scale(1.04); }
/* Kachel mit Hintergrundbild: beim Hovern erscheint das Firmenlogo */
.bcb-ref-logo.has-bcb-bg {
	position: relative;
	border-radius: 16px;
	overflow: hidden;
	isolation: isolate;
	clip-path: inset(0 round 16px);
}
/* Rundung macht nur die Kachel selbst, damit Bild und Logo-Fläche bündig abschließen. */
.wp-block-post-template .bcb-ref-logo.has-bcb-bg img { border-radius: 0; }
.bcb-ref-logo.has-bcb-bg a { display: block; height: 100%; }
.bcb-ref-card .bcb-ref-logo img.bcb-ref-bg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	padding: 0;
	object-fit: cover;
	transition: transform 0.6s ease;
}
.bcb-ref-card .bcb-ref-logo.has-bcb-bg img:not(.bcb-ref-bg) {
	position: relative;
	z-index: 1;
	background: var(--wp--preset--color--surface);
	opacity: 0;
	transform: none;
	transition: opacity 0.35s ease;
}
.bcb-ref-card:hover .bcb-ref-logo.has-bcb-bg img:not(.bcb-ref-bg),
.bcb-ref-card:focus-within .bcb-ref-logo.has-bcb-bg img:not(.bcb-ref-bg) { opacity: 1; }
.bcb-ref-card:hover .bcb-ref-logo img.bcb-ref-bg { transform: scale(1.06); }
/* Geräte ohne Hover (Touch): Logo als Plakette unten links über dem Bild */
@media (hover: none) {
	.bcb-ref-card .bcb-ref-logo.has-bcb-bg img:not(.bcb-ref-bg) {
		position: absolute;
		left: 0.75rem;
		bottom: 0.75rem;
		width: 38% !important;
		height: auto !important;
		aspect-ratio: 3 / 2;
		padding: 0.5rem 0.75rem;
		border-radius: 10px;
		background: rgba(255, 255, 255, 0.94);
		object-fit: contain;
		opacity: 1;
	}
}
.bcb-ref-card .wp-block-post-title a { color: inherit; text-decoration: none; }
.bcb-ref-card .wp-block-post-title a:hover { color: var(--wp--preset--color--primary); }
.bcb-ref-card .bcb-more-link { text-decoration: none; }
.bcb-eyebrow a { color: inherit; text-decoration: none; }
.bcb-eyebrow a:hover { text-decoration: underline; }

/* Kategorie-Karten */
.bcb-cat-card .bcb-card-buttons { margin-top: auto !important; padding-top: 0.75rem; }

/* Logo auf der Detailseite */
.bcb-logo-card {
	background: var(--wp--preset--color--base);
	border-radius: 20px;
	box-shadow: var(--wp--preset--shadow--lifted);
	margin: 0;
	overflow: hidden;
}
.bcb-logo-card img { padding: 2rem 2.5rem; box-sizing: border-box; }

/* Zurück-Link im dunklen Kopfbereich */
.bcb-back-link a { color: #DCCFBF; text-decoration: none; }
.bcb-back-link a:hover { color: var(--wp--preset--color--base); text-decoration: underline; }

/* Galerie in Referenzen */
.bcb-ref-gallery img { border-radius: 14px; }
.bcb-ref-facts { margin-bottom: var(--wp--preset--spacing--50); }
@media (prefers-reduced-motion: reduce) {
	.bcb-ref-card .bcb-ref-logo img { transition: none !important; }
}

/* Nur für Screenreader sichtbarer Text */
.screen-reader-text {
	border: 0;
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}
.screen-reader-text:focus {
	clip-path: none;
	height: auto;
	width: auto;
	padding: 0.75rem 1rem;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	z-index: 100000;
}
.bcb-ref-gallery { margin-top: var(--wp--preset--spacing--40) !important; margin-bottom: var(--wp--preset--spacing--50) !important; }

/* Seiteninhalte aus inhalte/*.html: Abschnitte über die volle Breite schließen ohne Lücke aneinander an. */
.wp-block-post-content.bcb-seite > .alignfull { margin-block: 0; }
