/* Pizza Buddies – gemeinsame Bausteine aller Blöcke */

:where(body) {
	--pb-ink: var(--wp--preset--color--ink, #1f5a87);
	/* Schatten, Verläufe und Platzhalter: immer Dunkelblau (Design nur mit Hellblau, Dunkelblau, Creme, Weiss) */
	--pb-deep: var(--pb-ink);
	--pb-sky: var(--wp--preset--color--sky, #a9d6f4);
	--pb-cream: var(--wp--preset--color--cream, #f5efe9);
	/* Nur eine Creme im Design: «Papier» ist dieselbe Farbe wie Creme */
	--pb-paper: var(--pb-cream);
	--pb-tomato: var(--pb-ink);
	/* Bildplatzhalter bleiben dunkel (fast schwarz), bis ein Foto drin ist */
	--pb-photo: #2a2521;
	--pb-ember: #3a2418;
	--pb-night: #183043;
	--pb-font-display: var(--wp--preset--font-family--display, "Neue Kalimat", "Arial Narrow", Impact, sans-serif);
	--pb-font-accent: var(--pb-font-body);
	--pb-font-serif: var(--pb-font-accent);
	--pb-font-shop: var(--wp--preset--font-family--shop, "ABC ROM Compressed", "Arial Narrow", Impact, sans-serif);
	--pb-font-title: var(--pb-font-display);
	--pb-font-body: var(--wp--preset--font-family--body, Montserrat, "Helvetica Neue", Arial, sans-serif);
	/* Grössenfaktor der Titelschrift: Neue Kalimat ist sehr schmal, deshalb grösser gesetzt */
	--pb-display-scale: 1.25;
	/* Zusätzliche Grösse für die Haupttitel (H1) und Sektionstitel (H2) */
	--pb-h1-scale: 1.1;
	--pb-h2-scale: 1.1;
	/* Titelgrössen als Variablen: Sektionen können sie überschreiben, die Dachzeile rechnet damit */
	--pb-h1-size: calc(clamp(56px, 15.5vw, 120px) * var(--pb-display-scale) * var(--pb-h1-scale));
	/* Foto-Hero der Startseite und Zitat «Der Teig …»: grösser als die Seitentitel
	   (Handy: so gross, dass «Trailer.» und «Unterschied.» noch auf eine Zeile passen) */
	--pb-hero-size: calc(clamp(56px, 20vw, 120px) * var(--pb-display-scale) * var(--pb-h1-scale));
	--pb-h2-size: calc(clamp(44px, 6.4vw, 96px) * var(--pb-display-scale) * var(--pb-h2-scale));
	/* Zeilenhöhe aller Titel in Neue Kalimat (mehrzeilige Titel sitzen kompakt) */
	--pb-title-lh: 0.72;
	/* Kartentitel in der Shop-Schrift (Vorteile, Schritte, Ideen …) */
	--pb-card-title-size: calc(28px * var(--pb-shop-scale));
	/* Faktor für die Karte, deren Grössen aus dem alten Shop stammen (gleiche Versalhöhe wie dort) */
	--pb-shop-scale: 1;
	--pb-gutter: clamp(20px, 4vw, 56px);
	/* Weicher Schatten für Karten und Buttons der Karte */
	--pb-card-shadow: 0 12px 32px color-mix(in srgb, var(--pb-deep) 8%, transparent), 0 2px 6px color-mix(in srgb, var(--pb-deep) 4%, transparent);
	--pb-section: clamp(56px, 7vw, 96px);
	--pb-max: 1328px;
}

/* Abstände zwischen den Sektionen kommen aus den Blöcken selbst */
body [class*="wp-block-pizzabuddies-"],
body .pb-duo {
	margin-block: 0;
}

/* Ein leerer Absatz zwischen zwei Sektionen (oder vor dem Footer) gibt keinen cremefarbenen Streifen */
.wp-block-post-content > p:empty {
	display: none;
}

[class*="wp-block-pizzabuddies-"] {
	font-family: var(--pb-font-body);
	box-sizing: border-box;
}

/* Alle Absätze in Montserrat (schwache Spezifität, damit Titel-Klassen Vorrang behalten) */
:where([class*="wp-block-pizzabuddies-"]) :where(p, li, blockquote, figcaption) {
	font-family: var(--pb-font-body);
}

/* Die Titelschrift hat nur einen Schnitt: kein künstliches Fett oder Kursiv rechnen lassen */
.pb-h1,
.pb-h2,
.pb-hero__title,
.pb-tile__title,
.pb-dish__name,
.pb-stat__value,
.pb-steps__title,
.pb-steps__num,
.pb-footer__mark,
.pb-footer__nav a,
.pb-jobs__title,
.pb-quick__sentence,
.pb-stepper input,
.pb-header__brand,
.pb-menu__brand,
.pb-menu__list a {
	font-weight: 400;
	font-synthesis: none;
	letter-spacing: 0.01em;
}

/* Kleine Titel-Schriftzüge brauchen etwas mehr Luft */
.pb-header__brand,
.pb-menu__brand,
.pb-stat__value,
.pb-steps__title,
.pb-quick__sentence {
	letter-spacing: 0.03em;
}

[class*="wp-block-pizzabuddies-"] *,
[class*="wp-block-pizzabuddies-"] *::before,
[class*="wp-block-pizzabuddies-"] *::after {
	box-sizing: border-box;
}

.pb-wrap {
	width: 100%;
	max-width: calc(var(--pb-max) + 2 * var(--pb-gutter));
	margin-inline: auto;
	padding-inline: var(--pb-gutter);
}

.pb-i {
	display: block;
	flex-shrink: 0;
}

/* Typografie */
/* Dachzeile: Montserrat, klein im Verhältnis zum Titel darunter */
.pb-eyebrow {
	margin: 0;
	font-family: var(--pb-font-accent);
	font-style: normal;
	font-weight: 600;
	text-transform: uppercase;
	font-size: max(14px, calc(var(--pb-h2-size) / 6));
	line-height: 1.1;
	letter-spacing: 0.03em;
	color: var(--pb-sky);
}

.pb-h1,
.pb-h2 {
	margin: 0;
	font-family: var(--pb-font-display);
	font-weight: 400;
	font-size: var(--pb-h2-size);
	line-height: var(--pb-title-lh);
	letter-spacing: 0;
	text-transform: uppercase;
	color: inherit;
	text-wrap: balance;
}

/* Seitentitel (H1) */
.pb-h1 {
	font-size: var(--pb-h1-size);
}

/* Kleine Überschrift: immer gleich, auch wenn sie als h3 o. ä. ausgegeben wird */
.pb-kicker {
	display: block;
	margin: 0;
	font-family: var(--pb-font-body);
	font-size: 11px;
	font-style: normal;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

/* Buttons */
.pb-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 56px;
	padding: 0 24px;
	border: 1.5px solid transparent;
	border-radius: 16px;
	font-family: var(--pb-font-body);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.1;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.pb-btn:hover {
	transform: translateY(-2px);
}

.pb-btn--ink,
.pb-btn--ink:visited {
	background: var(--pb-ink);
	color: var(--pb-paper);
}

.pb-btn--ink:hover {
	background: var(--pb-sky);
	color: var(--pb-ink);
}

.pb-btn--sky,
.pb-btn--sky:visited {
	background: var(--pb-sky);
	color: #fff;
}

.pb-btn--sky:hover {
	background: var(--pb-paper);
	color: var(--pb-ink);
}

.pb-btn--outline,
.pb-btn--outline:visited {
	background: transparent;
	border-color: var(--pb-ink);
	color: var(--pb-ink);
}

.pb-btn--outline:hover {
	background: var(--pb-ink);
	color: var(--pb-paper);
}

.pb-btn--ghost,
.pb-btn--ghost:visited {
	background: transparent;
	border-color: rgba(255, 255, 255, 0.6);
	color: var(--pb-paper);
}

.pb-btn--ghost:hover {
	border-color: var(--pb-paper);
	color: var(--pb-paper);
}

.pb-link,
.pb-link:visited {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	font-size: 15px;
	font-weight: 700;
	color: var(--pb-ink);
	text-decoration: none;
	transition: gap 0.2s ease;
}

.pb-link:hover {
	gap: 12px;
	color: var(--pb-ink);
}

.pb-circle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 44px;
	height: 44px;
	border-radius: 11px;
	background: var(--pb-sky);
	color: #fff;
}

/* Fokus gut sichtbar */
[class*="wp-block-pizzabuddies-"] a:focus-visible,
[class*="wp-block-pizzabuddies-"] button:focus-visible,
[class*="wp-block-pizzabuddies-"] input:focus-visible,
[class*="wp-block-pizzabuddies-"] select:focus-visible,
[class*="wp-block-pizzabuddies-"] summary:focus-visible {
	outline: 3px solid var(--pb-ink);
	outline-offset: 3px;
}

/* Auf dunklen Flächen hellblauer Fokusrahmen */
:is(.pb-header, .pb-menu, .pb-hero, .pb-event, .pb-footer, .pb-actionbar) :is(a, button, input, select, summary):focus-visible {
	outline-color: var(--pb-sky);
}

/* Foto-Flächen und Platzhalter */
.pb-media {
	position: relative;
	margin: 0;
	overflow: hidden;
	background: var(--pb-photo);
}

.pb-media img,
.pb-cover img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.pb-cover {
	position: absolute;
	inset: 0;
	z-index: -2;
	margin: 0;
}

.pb-cover picture {
	display: block;
	width: 100%;
	height: 100%;
}

.pb-tone-ember {
	background-color: var(--pb-ember);
}

.pb-tone-night {
	background-color: var(--pb-night);
}

.pb-tone-warm {
	background-color: var(--pb-photo);
}

.pb-ph-label {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	max-width: calc(100% - 24px);
	padding: 6px 10px;
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.1);
	color: rgba(255, 255, 255, 0.82);
	font-family: var(--pb-font-body);
	font-size: 11px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: 0.03em;
	pointer-events: none;
}

.pb-editor-note {
	margin: 8px 0 0;
	padding: 8px 12px;
	border-radius: 10px;
	background: var(--pb-sky);
	color: var(--pb-ink);
	font-family: var(--pb-font-body);
	font-size: 13px;
	line-height: 1.4;
}

/* Horizontale Wisch-Reihe (Mobile) */
.pb-track {
	display: flex;
	gap: 12px;
	margin: 0;
	padding: 0 var(--pb-gutter);
	list-style: none;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-padding-inline: var(--pb-gutter);
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.pb-track::-webkit-scrollbar {
	display: none;
}

.pb-track > * {
	scroll-snap-align: start;
}

/* Körnungseffekt über der ganzen Seite (Stärke unter Pizza Buddies › Einstellungen) */
.pb-grain {
	position: fixed;
	inset: 0;
	z-index: 9999;
	pointer-events: none;
	background: url("img/grain.gif") 0 0 / 480px auto repeat;
	opacity: 0.025;
}

.pb-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Fliesstext der Rechtstexte (Impressum, Datenschutz & AGB) */
.pb-legaltext p,
.pb-legaltext ul {
	margin: 0 0 12px;
	font-size: 15px;
	line-height: 1.7;
}

.pb-legaltext ul {
	padding-left: 20px;
}

.pb-legaltext li + li {
	margin-top: 4px;
}

.pb-legaltext > :last-child {
	margin-bottom: 0;
}

.pb-legaltext a,
.pb-legaltext a:visited {
	color: var(--pb-ink);
	font-weight: 700;
	text-decoration: underline;
	text-decoration-color: var(--pb-sky);
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
	overflow-wrap: anywhere;
}

@media (min-width: 900px) {
	:where(body) {
		/* Seitentitel: gleich gross auf allen Seiten, passt auch neben ein Foto */
		--pb-h1-size: calc(clamp(96px, 8.6vw, 140px) * var(--pb-display-scale) * var(--pb-h1-scale));
		--pb-hero-size: calc(clamp(96px, 11vw, 176px) * var(--pb-display-scale) * var(--pb-h1-scale));
	}
}

@media (prefers-reduced-motion: reduce) {
	[class*="wp-block-pizzabuddies-"] *,
	[class*="wp-block-pizzabuddies-"] *::before,
	[class*="wp-block-pizzabuddies-"] *::after {
		transition: none !important;
		animation: none !important;
	}
}

/* Nur für Screenreader: WordPress-Standardklasse. Kam bisher aus dem
   WooCommerce-CSS, das jetzt nur noch auf Shop-Seiten lädt. */
.screen-reader-text:not(:focus):not(:focus-within) {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
	word-wrap: normal !important;
}
