/* ============================================================
 * landfair/ab-vorteile — Frontend- und Editor-Styles
 * Präfix: av-
 *
 * Stil „leiste“: creme Fläche, Icon links neben Titel + Text.
 * Stil „kreise“: Icon im hellgoldenen Kreis oben, zentriert.
 * Trennlinien: jede Spalte hat links eine Linie; die Linie der ersten
 * Spalte jeder Zeile liegt außerhalb von __rahmen und wird abgeschnitten.
 *
 * Farben: CSS-Variablen nur gesetzt, wenn gewählt – sonst Theme/Entwurf.
 * ============================================================ */

.av-vorteile {
	--av-spalten:    4;
	--av-pad-v:      28px;
	--av-pad-h:      40px;
	--av-spalt:      24px;
	--av-zeile:      28px;
	--av-abst-dach:  26px;
	--av-abst-icon:  14px;
	--av-abst-titel: 6px;
	--av-titel:      0.98em;
	--av-textgr:     0.88em;
	--av-icon-gr:    34px;
	--av-kreis-gr:   64px;

	--av-gold-eff:   var( --wp--preset--color--primary, #c9973f );
	--av-icon-eff:   var( --av-icon, var( --av-gold-eff ) );
	--av-linie-eff:  var( --av-linie, #e8dfd2 );

	width: 100%;
	margin-left: auto;
	margin-right: auto;
	box-sizing: border-box;
	color: var( --av-text, var( --wp--preset--color--contrast, currentColor ) );
	hyphens: manual;
	-webkit-hyphens: manual;
	overflow-wrap: break-word;
}

.av-vorteile *,
.av-vorteile *::before,
.av-vorteile *::after {
	box-sizing: border-box;
}

.av-vorteile.av-vorteile--leiste {
	background: var( --av-bg, #f8f4ee );
}

.av-vorteile.av-vorteile--kreise {
	background: var( --av-bg, transparent );
}

.av-vorteile .av-vorteile__inner {
	max-width: var( --av-max, none );
	margin: 0 auto;
	padding: var( --av-pad-v ) var( --av-pad-h );
}

/* ---------- Dachzeile ---------- */
.av-vorteile .av-vorteile__dachzeile {
	margin: 0 0 var( --av-abst-dach );
	padding: 0;
	font-family: inherit;
	font-size: 0.78em;
	font-weight: 700;
	font-style: normal;
	line-height: 1.4;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var( --av-dachzeile, var( --av-gold-eff ) );
}

/* ---------- Liste / Raster ---------- */
.av-vorteile .av-vorteile__rahmen {
	overflow: hidden;
}

.av-vorteile .av-vorteile__liste,
.av-vorteile .av-vorteile__liste li {
	list-style: none;
	margin: 0;
	padding: 0;
}

.av-vorteile .av-vorteile__liste li::before,
.av-vorteile .av-vorteile__liste li::marker {
	content: none;
}

.av-vorteile .av-vorteile__liste {
	display: grid;
	grid-template-columns: repeat( var( --av-spalten ), minmax( 0, 1fr ) );
	row-gap: var( --av-zeile );
	column-gap: 0;
	margin: 0 calc( var( --av-spalt ) / -2 );
}

.av-vorteile .av-vorteile__liste .av-vorteile__eintrag {
	position: relative;
	display: flex;
	align-items: center;
	gap: var( --av-abst-icon );
	min-width: 0;
	padding: 0 calc( var( --av-spalt ) / 2 );
}

/* Trennlinie links (bei der ersten Spalte abgeschnitten) */
.av-vorteile.av-vorteile--linien .av-vorteile__liste .av-vorteile__eintrag::after {
	content: '';
	position: absolute;
	left: -1px;
	top: 8%;
	bottom: 8%;
	width: 1px;
	background: var( --av-linie-eff );
	pointer-events: none;
}

/* ---------- Icon ---------- */
.av-vorteile .av-vorteile__icon {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var( --av-icon-gr );
	height: var( --av-icon-gr );
	color: var( --av-icon-eff );
	transition: transform 0.25s ease;
}

.av-vorteile.av-vorteile--kreis .av-vorteile__icon {
	width: var( --av-kreis-gr );
	height: var( --av-kreis-gr );
	border-radius: 50%;
	background: var( --av-kreis, color-mix( in srgb, var( --av-gold-eff ) 14%, #fff ) );
}

.av-vorteile .av-vorteile__icon-svg {
	display: block;
	width: var( --av-icon-gr );
	height: var( --av-icon-gr );
	max-width: none;
	margin: 0;
}

/* ---------- Texte ---------- */
.av-vorteile .av-vorteile__inhalt {
	min-width: 0;
}

/* Eintrags-Titel: kleines Label im Entwurf (fett, Grundschrift) */
.av-vorteile .av-vorteile__titel {
	margin: 0 0 var( --av-abst-titel );
	padding: 0;
	font-family: inherit;
	font-size: var( --av-titel );
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0;
	text-transform: none;
}

.av-vorteile.av-vorteile--titel-farbe .av-vorteile__titel {
	color: var( --av-titel-farbe );
}

.av-vorteile .av-vorteile__text {
	margin: 0;
	padding: 0;
	font-size: var( --av-textgr );
	line-height: 1.55;
	color: var( --av-text, color-mix( in srgb, var( --wp--preset--color--contrast, currentColor ) 85%, transparent ) );
}

/* ---------- Link (ganzer Eintrag klickbar) ---------- */
.av-vorteile .av-vorteile__link,
.av-vorteile .av-vorteile__link:visited,
.av-vorteile .av-vorteile__link:hover,
.av-vorteile .av-vorteile__link:focus {
	color: inherit;
	text-decoration: none;
	background: none;
	box-shadow: none;
}

.av-vorteile .av-vorteile__link::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
}

.av-vorteile .av-vorteile__eintrag--link:hover .av-vorteile__link {
	text-decoration: underline;
	text-decoration-color: var( --av-gold-eff );
	text-underline-offset: 0.2em;
}

.av-vorteile .av-vorteile__eintrag--link:hover .av-vorteile__icon {
	transform: translateY( -2px );
}

.av-vorteile .av-vorteile__link:focus-visible {
	outline: 2px solid var( --av-gold-eff );
	outline-offset: 3px;
}

/* ---------- Stil „kreise“ ---------- */
.av-vorteile.av-vorteile--kreise .av-vorteile__eintrag {
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding-top: 4px;
	padding-bottom: 4px;
}

.av-vorteile.av-vorteile--kreise.av-vorteile--kreis .av-vorteile__icon {
	background: var( --av-kreis, #fff );
	border: 1px solid color-mix( in srgb, var( --av-icon-eff ) 55%, transparent );
	box-shadow: 0 0 0 6px color-mix( in srgb, var( --av-gold-eff ) 8%, transparent );
}

/* ---------- Responsive ---------- */
@media ( max-width: 900px ) {
	.av-vorteile:not( .av-vorteile--spalten-1 ) .av-vorteile__liste {
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	}
}

@media ( max-width: 600px ) {
	.av-vorteile .av-vorteile__inner {
		padding-left: min( var( --av-pad-h ), 20px );
		padding-right: min( var( --av-pad-h ), 20px );
	}

	.av-vorteile.av-vorteile--mobil-1 .av-vorteile__liste {
		grid-template-columns: minmax( 0, 1fr );
	}

	/* Leiste einspaltig: Einträge linksbündig untereinander */
	.av-vorteile.av-vorteile--mobil-2 .av-vorteile__liste {
		margin-left: -8px;
		margin-right: -8px;
	}

	.av-vorteile.av-vorteile--mobil-2 .av-vorteile__eintrag {
		padding-left: 8px;
		padding-right: 8px;
	}

	.av-vorteile.av-vorteile--leiste.av-vorteile--mobil-2 .av-vorteile__eintrag {
		flex-direction: column;
		align-items: flex-start;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.av-vorteile .av-vorteile__icon {
		transition: none;
	}

	.av-vorteile .av-vorteile__eintrag--link:hover .av-vorteile__icon {
		transform: none;
	}
}
