/*
Theme Name: BAM Digital
Theme URI: https://bamdigital.de
Author: BAM Digital
Description: Block-Theme für bamdigital.de. Farben, Schrift und Abstände stehen in theme.json.
Version: 0.6.1
Requires at least: 6.6
Requires PHP: 8.1
Text Domain: bamdigital
*/

/* Nur was theme.json nicht abdeckt. */

:where(body) {
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

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

.has-schwarz-background-color :where(a):focus-visible,
.has-schwarz-background-color .wp-block-button__link:focus-visible {
	outline-color: var(--wp--preset--color--violett-hell);
}

/* Links auf dunklem Grund */
.has-schwarz-background-color a:where(:not(.wp-element-button)) {
	color: var(--wp--preset--color--violett-hell);
}

/* Header: auf dem Handy nur Logo und Menü, wie im Entwurf */
@media (max-width: 781px) {
	/* Doppelte Klasse, weil die Layout-Regel des Kerns später geladen wird. */
	.bam-header .bam-header-cta {
		display: none;
	}
}

.bam-header .wp-block-navigation a:where(:not(.wp-element-button)) {
	text-decoration: none;
}

.bam-header .wp-block-navigation a:where(:not(.wp-element-button)):hover {
	color: var(--wp--preset--color--violett);
}

/* Sprungziele nicht unter dem Rand verstecken */
:where([id]) {
	scroll-margin-top: 24px;
}

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

/* Abschnitte der Startseite stoßen ohne Lücke aneinander, Abstände tragen sie selbst. */
.wp-block-post-content > .alignfull {
	margin-block-start: 0;
}

/* Hero: Portrait mit Plakette */
.bam-portrait {
	position: relative;
}

.bam-portrait__bild img {
	width: 100%;
	aspect-ratio: 4 / 5;
	object-fit: cover;
}

.bam-portrait .bam-badge {
	position: absolute;
	left: -24px;
	bottom: 32px;
	margin: 0;
}

@media (max-width: 781px) {
	.bam-portrait .bam-badge {
		left: 12px;
		bottom: 12px;
	}
}

/* Referenzen: Namen statt Logos. #5f5b66 statt #8a8592 aus dem Entwurf, wegen Kontrast. */
.bam-referenzen .bam-referenz {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	color: var(--wp--preset--color--grau);
}

/* Große Ziffern bei Fällen und Ablauf */
.bam-ziffer {
	margin: 0;
	font-size: 64px;
	line-height: 1;
	font-weight: 700;
	color: var(--wp--preset--color--violett);
}

.bam-ziffer--klein {
	font-size: 40px;
	line-height: 1.2;
}

/* Gleiche Einrückung für 1 und 2 neben dem Text */
.bam-ziffer:not(.bam-ziffer--klein) {
	flex: 0 0 0.75em;
}

@media (max-width: 781px) {
	.bam-ziffer {
		font-size: 44px;
	}

	/* Kästen auf dem Handy: weniger Innenabstand, sonst wird der Text zu schmal */
	.wp-block-post-content .alignwide.has-background {
		padding: 28px 20px !important;
	}
	.bam-ziffer--klein {
		font-size: 28px;
	}
}

/* Schaubild: quer ab Tablet, senkrecht auf dem Handy */
.bam-schaubild svg {
	display: block;
	width: 100%;
	height: auto;
	font-family: var(--wp--preset--font-family--montserrat);
}

.bam-schaubild__hoch {
	display: none !important;
	max-width: 340px;
}

@media (max-width: 781px) {
	.bam-schaubild__quer {
		display: none !important;
	}
	.bam-schaubild__hoch {
		display: block !important;
	}
}

/* Musterseite Account-Check */
.bam-muster {
	background: var(--wp--preset--color--weiss);
	border: 1px solid var(--wp--preset--color--linie);
	border-radius: 8px;
	padding: clamp(24px, 3vw, 40px);
	box-shadow: 0 20px 56px rgba(24, 24, 24, 0.1);
	transform: rotate(1.5deg);
	font-size: 14px;
	line-height: 1.5;
}

.bam-muster p {
	margin: 0;
}

.bam-muster__kopf {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	margin-bottom: 28px;
	font-size: 12px;
	color: var(--wp--preset--color--grau);
}

.bam-muster__kopf img {
	height: 26px;
	width: auto;
}

.bam-muster__marke {
	font-size: 13px;
	font-weight: 600;
	color: var(--wp--preset--color--violett);
	margin-bottom: 6px !important;
}

.bam-muster__befund {
	font-size: 15px;
	font-weight: 600;
	margin-bottom: 20px !important;
}

.bam-muster__zeile {
	height: 8px;
	background: var(--wp--preset--color--linie);
	border-radius: 4px;
	margin-bottom: 8px;
}

.bam-muster__zeile + .bam-muster__marke,
.bam-muster__zeile + .bam-muster__lassen {
	margin-top: 24px;
}

.bam-muster__lassen {
	background: var(--wp--preset--color--flaeche);
	border-radius: 6px;
	padding: 16px;
}

@media (max-width: 781px) {
	.bam-muster {
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bam-muster {
		transform: none;
	}
}

/* Formular im dunklen Block */
.bam-form {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.bam-form label {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 14px;
	font-weight: 600;
}

.bam-form__optional {
	font-weight: 400;
	color: var(--wp--preset--color--text-hell);
}

.bam-form :is(input, select, textarea) {
	font: inherit;
	font-size: 16px;
	font-weight: 400;
	width: 100%;
	box-sizing: border-box;
	min-height: 48px;
	padding: 12px;
	border: 0;
	border-radius: 8px;
	background: var(--wp--preset--color--weiss);
	color: var(--wp--preset--color--schwarz);
}

.bam-form textarea {
	min-height: 96px;
	resize: vertical;
}

.bam-form__zeile {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
}

.bam-form__zeile label {
	flex: 1 1 160px;
}

.bam-form button {
	font: inherit;
	font-size: 17px;
	font-weight: 600;
	min-height: 52px;
	padding: 16px 24px;
	border: 0;
	border-radius: 999px;
	background: var(--wp--preset--color--violett);
	color: var(--wp--preset--color--weiss);
	cursor: pointer;
}

.bam-form button:hover {
	background: var(--wp--preset--color--weiss);
	color: var(--wp--preset--color--schwarz);
}

.bam-form :is(input, select, textarea, button):focus-visible {
	outline: 2px solid var(--wp--preset--color--violett-hell);
	outline-offset: 2px;
}

/* Formular: Falle für Bots und Rückmeldung nach dem Absenden */
.bam-form__falle {
	position: absolute;
	left: -10000px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.bam-form__meldung {
	margin: 0 0 20px;
	padding: 14px 16px;
	border-radius: 8px;
	background: var(--wp--preset--color--violett);
	color: var(--wp--preset--color--weiss);
	font-weight: 600;
}

.bam-form__meldung--fehler {
	background: var(--wp--preset--color--weiss);
	color: var(--wp--preset--color--schwarz);
}

/* Über mich: Namenslisten und Stationen */
.bam-namen {
	font-size: 18px;
	font-weight: 700;
	color: var(--wp--preset--color--grau);
}

.bam-stationen table {
	border-collapse: collapse;
	width: 100%;
}

.bam-stationen td {
	border: 0;
	border-bottom: 1px solid var(--wp--preset--color--linie);
	padding: 14px 16px 14px 0;
	vertical-align: top;
}

.bam-stationen td:first-child {
	width: 9em;
	color: var(--wp--preset--color--grau);
	white-space: nowrap;
}

/* Fließtext auf Unterseiten: bündig mit dem Hero, Zeilenlänge begrenzt */
.bam-text > * {
	max-width: 760px;
}

.bam-text > h3 {
	margin-top: 32px;
}
