/*
 * Rezepte (/rezepte/): Übersicht mit Karten, Rezeptarten als Filter, einzelnes Rezept mit Zutaten, Zubereitung und
 * Sansibar-Tipp. Lädt nur auf den Rezeptseiten (inc/rezepte.php) und im Editor; nach bausteine.css.
 * Die Klassen im Rezept (sb-rezept-eckdaten, -raster, -zutaten, -zubereitung, -tipp) setzt das Gerüst neuer Rezepte.
 */

/* ---------- Übersicht ---------- */

.sb.sb-rezepte-kopf {
	padding-block: clamp(3.5rem, 7vw, 6rem) clamp(2rem, 4vw, 3rem);
}

.sb-rezepte-kopf .sb__inner {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.sb.sb-rezepte-kopf + .sb.sb-rezepte-liste::before {
	content: none;
}

.sb.sb-rezepte-liste {
	padding-top: 0;
}

/* Rezeptarten als Knöpfe zum Filtern (aktuelle in Gold) */
.sb .sb-rezepte-arten {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 8px 0 0;
	padding: 0;
	list-style: none;
}

.sb-rezepte-arten li {
	margin: 0;
}

.sb-rezepte-arten a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 18px;
	border: 1px solid var(--sb-linie);
	border-radius: 2px;
	color: var(--wp--preset--color--text);
	font-size: var(--sb-fs-label);
	font-weight: 600;
	letter-spacing: 0.02em;
	text-decoration: none;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.sb-rezepte-arten a:hover {
	border-color: var(--wp--preset--color--text);
}

.sb-rezepte-arten .current-cat a {
	border-color: var(--wp--preset--color--gold);
	background: var(--wp--preset--color--gold);
	color: var(--wp--preset--color--tinte);
}

.sb-rezepte-zurueck a {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	color: var(--wp--preset--color--gold-text);
	font-size: var(--sb-fs-label);
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-decoration: none;
}

.sb-rezepte-zurueck a::before {
	content: "";
	width: 18px;
	height: 18px;
	background: currentColor;
	-webkit-mask: var(--sb-icon-pfeil) center / contain no-repeat;
	mask: var(--sb-icon-pfeil) center / contain no-repeat;
	transform: rotate(180deg);
}

.sb-rezepte-zurueck a:hover {
	color: var(--wp--preset--color--text);
}

/* Karten */
.sb .sb-rezepte-raster {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(20px, 2.4vw, 32px);
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (max-width: 989px) {
	.sb .sb-rezepte-raster {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 599px) {
	.sb .sb-rezepte-raster {
		grid-template-columns: minmax(0, 1fr);
	}
}

.sb-rezepte-raster > li {
	margin: 0;
}

.sb .sb-rezept-karte {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	background: var(--wp--preset--color--anthrazit-hell);
	border-top: 2px solid var(--wp--preset--color--gold);
}

.sb .sb-rezept-karte__bild {
	margin: 0;
	overflow: hidden;
	background: var(--wp--preset--color--flaeche);
}

.sb-rezept-karte__bild img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease;
}

.sb-rezept-karte:hover .sb-rezept-karte__bild img {
	transform: scale(1.04);
}

/* Ohne Rezeptbild: Säbel auf dunklem Grund statt einer Lücke */
.sb-rezept-karte:not(:has(.sb-rezept-karte__bild))::before {
	content: "";
	display: block;
	aspect-ratio: 47 / 22; /* Querformat wie die Rezeptbilder in Shopify (sansibar.de, 470 × 220) */
	background: var(--wp--preset--color--anthrazit-dunkel) url("../images/sansibar-saebel-gold.png") center / 22% auto no-repeat;
}

.sb .sb-rezept-karte__text {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 10px;
	padding: 22px 24px 26px;
}

.sb-rezept-karte__art,
.sb-rezept-kopf__art {
	font-size: var(--sb-fs-label);
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--wp--preset--color--gold-text);
}

.sb-rezept-karte__art a,
.sb-rezept-kopf__art a {
	position: relative;
	z-index: 1; /* über dem Link der ganzen Karte */
	color: inherit;
	text-decoration: none;
}

.sb-rezept-karte__art a:hover,
.sb-rezept-kopf__art a:hover {
	color: var(--wp--preset--color--text);
}

.sb .sb-rezept-karte__titel {
	margin: 0;
	font-size: clamp(1.375rem, 2vw, 1.75rem);
	font-weight: 600;
	line-height: 1.2;
	text-wrap: balance;
}

.sb-rezept-karte__titel a {
	color: var(--wp--preset--color--text);
	text-decoration: none;
}

/* Die ganze Karte ist klickbar */
.sb-rezept-karte__titel a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.sb-rezept-karte:hover .sb-rezept-karte__titel a {
	color: var(--wp--preset--color--gold-text);
}

.sb-rezept-karte__titel a:focus-visible {
	outline: none;
}

.sb-rezept-karte:has(.sb-rezept-karte__titel a:focus-visible) {
	outline: 2px solid var(--wp--preset--color--gold);
	outline-offset: 3px;
}

.sb .sb-rezept-karte__auszug,
.sb .sb-rezept-karte__auszug p {
	margin: 0;
	font-size: var(--sb-fs-klein);
	line-height: 1.5;
	color: var(--wp--preset--color--text-gedaempft);
}

.sb-rezepte-seiten {
	margin-top: clamp(28px, 3vw, 40px);
	gap: 16px;
	font-size: var(--sb-fs-label);
}

.sb-rezepte-seiten a {
	color: var(--wp--preset--color--gold-text);
}

/* ---------- Einzelnes Rezept: Kopf ---------- */

.sb.sb-rezept-kopf {
	padding-block: clamp(2.5rem, 5vw, 4.5rem);
}

.sb .sb-rezept-kopf__raster {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	align-items: center;
	gap: clamp(32px, 5vw, 80px);
}

.sb-rezept-kopf:not(:has(.sb-rezept-kopf__bild)) .sb-rezept-kopf__raster {
	grid-template-columns: minmax(0, 1fr);
}

.sb .sb-rezept-kopf__text {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.sb .sb-rezept-kopf__auszug,
.sb .sb-rezept-kopf__auszug p {
	margin: 0;
	max-width: 34em;
	font-size: var(--sb-fs-text);
	line-height: 1.6;
}

.sb .sb-rezept-kopf__bild {
	margin: 0;
	overflow: hidden;
	background: var(--wp--preset--color--flaeche);
}

.sb-rezept-kopf__bild img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

@media (max-width: 989px) {
	.sb .sb-rezept-kopf__raster {
		grid-template-columns: minmax(0, 1fr);
	}

	.sb .sb-rezept-kopf__bild {
		order: -1;
	}
}

/* ---------- Einzelnes Rezept: Inhalt (gilt auch im Editor) ---------- */

.sb.sb-rezept-inhalt {
	padding-top: clamp(1.5rem, 3vw, 2.5rem);
}

.sb.sb-rezept-kopf + .sb.sb-rezept-inhalt::before {
	content: none;
}

.sb .sb-rezept-text {
	display: flex;
	flex-direction: column;
	gap: clamp(28px, 4vw, 48px);
}

.sb .sb-rezept-text > * {
	margin-block: 0;
}

.sb-rezept-eckdaten {
	align-self: flex-start;
	padding: 12px 0;
	border-block: 1px solid var(--sb-linie, rgba(242, 240, 235, 0.22));
	font-size: var(--sb-fs-label, 1.125rem);
	font-weight: 600;
	letter-spacing: 0.02em;
	color: var(--wp--preset--color--gold-text);
}

.sb-rezept-einleitung {
	max-width: 40em;
	font-size: var(--sb-fs-text, 1.375rem);
	line-height: 1.6;
}

.sb-rezept-raster {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	align-items: start;
	gap: clamp(32px, 5vw, 72px);
}

@media (max-width: 989px) {
	.sb-rezept-raster {
		grid-template-columns: minmax(0, 1fr);
	}
}

.sb-rezept-zutaten,
.sb-rezept-tipp {
	padding: clamp(24px, 3vw, 36px);
	background: var(--wp--preset--color--anthrazit-hell);
	border-top: 2px solid var(--wp--preset--color--gold);
}

/* :is(.sb, Editor) – sonst setzt bausteine.css (.sb .wp-block-group > *) die Abstände auf 0 */
:is(.sb, .editor-styles-wrapper) :is(.sb-rezept-zutaten, .sb-rezept-zubereitung, .sb-rezept-tipp) > * {
	margin-block: 0;
}

:is(.sb, .editor-styles-wrapper) :is(.sb-rezept-zutaten, .sb-rezept-zubereitung) > h2 {
	margin: 0 0 18px;
	font-size: clamp(1.75rem, 2.8vw, 2.5rem);
	font-weight: 600;
	line-height: 1.12;
	letter-spacing: -0.01em;
}

:is(.sb, .editor-styles-wrapper) .sb-rezept-zubereitung > h2:not(:first-child) {
	margin-top: 36px;
}

:is(.sb, .editor-styles-wrapper) .sb-rezept-zutaten > h3 {
	margin: 26px 0 4px;
	font-size: var(--sb-fs-label, 1.125rem);
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--wp--preset--color--gold-text);
}

:is(.sb, .editor-styles-wrapper) .sb-rezept-zutaten > h2 + h3 {
	margin-top: 4px;
}

.sb-rezept-zutaten ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.sb-rezept-zutaten li {
	margin: 0;
	padding: 11px 0;
	border-bottom: 1px solid var(--sb-linie, rgba(242, 240, 235, 0.22));
	font-size: var(--sb-fs-klein, 1.25rem);
	line-height: 1.45;
}

.sb-rezept-zutaten li:last-child {
	border-bottom: 0;
}

/* Arbeitsschritte mit Nummer im goldenen Kreis */
.sb-rezept-zubereitung ol {
	display: flex;
	flex-direction: column;
	gap: 24px;
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: schritt;
}

.sb-rezept-zubereitung ol li {
	position: relative;
	margin: 0;
	min-height: 44px;
	padding-left: 64px;
	font-size: var(--sb-fs-text, 1.375rem);
	line-height: 1.6;
	counter-increment: schritt;
}

.sb-rezept-zubereitung ol li::before {
	content: counter(schritt);
	position: absolute;
	top: -2px;
	left: 0;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border: 2px solid var(--wp--preset--color--gold);
	border-radius: 50%;
	color: var(--wp--preset--color--gold-text);
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 1;
	font-variant-numeric: lining-nums;
}

.sb-rezept-zubereitung p {
	font-size: var(--sb-fs-text, 1.375rem);
	line-height: 1.6;
}

.sb-rezept-tipp {
	display: flex;
	flex-direction: column;
	gap: 12px;
	max-width: 54rem;
}

.sb-rezept-tipp h2 {
	margin: 0;
	font-size: var(--sb-fs-label, 1.125rem);
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--wp--preset--color--gold-text);
}

.sb-rezept-tipp p {
	margin: 0;
	font-size: var(--sb-fs-text, 1.375rem);
	line-height: 1.6;
}

/* ---------- Weitere Rezepte ---------- */

.sb-rezepte-weitere .sb-kopfzeile {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px 32px;
	margin-bottom: clamp(28px, 3vw, 40px);
}
