/*
 * AFN Blöcke – Gestaltung der Blockstile und eigenen Blöcke (Website und Editor).
 * Farben, Schriften und Rundungen kommen aus den Theme-Variablen (--afn-…); jede hat hier eine
 * Rückfalle, damit alles auch ohne das Theme stimmt. Abweichende Farben aus den Einstellungen
 * und die einstellbaren Teile (Nummerierung, Aufklappboxen, Geräte-Sichtbarkeit) hängt das Plugin
 * als Inline-CSS an.
 */

:root {
	--afn-b-accent: var(--afn-accent, #0F6E6E);
	--afn-b-accent-soft: var(--afn-accent-soft, #D4ECEB);
	--afn-b-on-accent: var(--afn-on-accent, #FFFFFF);
	--afn-b-link: var(--afn-link, #0C5A5A);
	--afn-b-ink: var(--afn-ink, #231F1C);
	--afn-b-ink-soft: var(--afn-ink-soft, #5B544C);
	--afn-b-paper: var(--afn-paper, #F4F3EF);
	--afn-b-card: var(--afn-card, #FBFAF8);
	--afn-b-surface: var(--afn-surface, #ECEAE4);
	--afn-b-box: #F0EEEA;
	--afn-b-line: var(--afn-line, #DEDAD2);
	--afn-b-line-strong: var(--afn-line-strong, #C9C4BA);
	--afn-b-info: var(--afn-link, #0C5A5A);
	--afn-b-success: var(--afn-green, #3E7B4F);
	--afn-b-warning: var(--afn-signal, #FF7A1F);
	--afn-b-danger: var(--afn-red, #A1352E);
	--afn-b-dark: var(--afn-night, #141414);
	--afn-b-radius: var(--afn-radius, 12px);
	--afn-b-radius-sm: var(--afn-radius-sm, 8px);
	--afn-b-shadow: var(--afn-shadow-card, 0 1px 2px rgba(62, 44, 28, 0.06), 0 12px 28px -16px rgba(62, 44, 28, 0.28));
	--afn-b-font-head: var(--afn-font-head, inherit);
	--afn-b-font-sans: var(--afn-font-sans, inherit);
	--afn-b-num-radius: 6px;
	--afn-b-badge-transform: uppercase;
}

/* ==========================================================================
   1. Kästen (Gruppe): Hinweis, Info, Erfolg, Achtung, Warnung, Dunkel
   ========================================================================== */

.wp-block-group:is(.is-style-afn-note, .is-style-afn-info, .is-style-afn-success, .is-style-afn-warning, .is-style-afn-danger, .is-style-afn-dark) {
	--afn-b-tone: var(--afn-b-line-strong);
	box-sizing: border-box;
	margin-block: 1.5rem;
	padding: 1rem 1.25rem;
	border-inline-start: 4px solid var(--afn-b-tone);
	border-radius: var(--afn-b-radius-sm);
	background-color: var(--afn-b-box);
	color: var(--afn-b-ink);
}

.wp-block-group.is-style-afn-info { --afn-b-tone: var(--afn-b-info); }
.wp-block-group.is-style-afn-success { --afn-b-tone: var(--afn-b-success); }
.wp-block-group.is-style-afn-warning { --afn-b-tone: var(--afn-b-warning); }
.wp-block-group.is-style-afn-danger { --afn-b-tone: var(--afn-b-danger); }

.wp-block-group.is-style-afn-dark {
	--afn-b-tone: var(--afn-b-accent);
	background-color: var(--afn-b-dark);
	color: #F2F0EB;
}

.wp-block-group.is-style-afn-dark :is(a, a:visited) {
	color: #9EDDD8;
}

.wp-block-group:is(.is-style-afn-note, .is-style-afn-info, .is-style-afn-success, .is-style-afn-warning, .is-style-afn-danger, .is-style-afn-dark, .is-style-afn-bordered, .is-style-afn-light, .is-style-afn-shadow, .is-style-afn-inverse) > :first-child,
.wp-block-group:is(.is-style-afn-note, .is-style-afn-info, .is-style-afn-success, .is-style-afn-warning, .is-style-afn-danger, .is-style-afn-dark, .is-style-afn-bordered, .is-style-afn-light, .is-style-afn-shadow, .is-style-afn-inverse) > .wp-block-group__inner-container > :first-child {
	margin-block-start: 0;
}

.wp-block-group:is(.is-style-afn-note, .is-style-afn-info, .is-style-afn-success, .is-style-afn-warning, .is-style-afn-danger, .is-style-afn-dark, .is-style-afn-bordered, .is-style-afn-light, .is-style-afn-shadow, .is-style-afn-inverse) > :last-child,
.wp-block-group:is(.is-style-afn-note, .is-style-afn-info, .is-style-afn-success, .is-style-afn-warning, .is-style-afn-danger, .is-style-afn-dark, .is-style-afn-bordered, .is-style-afn-light, .is-style-afn-shadow, .is-style-afn-inverse) > .wp-block-group__inner-container > :last-child {
	margin-block-end: 0;
}

/* ==========================================================================
   2. Kästen (Gruppe): Rahmen, Fläche, Karte mit Schatten, Invers
   ========================================================================== */

.wp-block-group:is(.is-style-afn-bordered, .is-style-afn-light, .is-style-afn-shadow, .is-style-afn-inverse) {
	box-sizing: border-box;
	margin-block: 1.5rem;
	padding: 1.25rem 1.5rem;
	border-radius: var(--afn-b-radius);
}

.wp-block-group.is-style-afn-bordered {
	border: 1px solid var(--afn-b-line-strong);
}

.wp-block-group.is-style-afn-light:not(.has-background) {
	background-color: var(--afn-b-box);
}

.wp-block-group.is-style-afn-shadow {
	box-shadow: var(--afn-b-shadow);
}

.wp-block-group.is-style-afn-shadow:not(.has-background) {
	background-color: var(--afn-b-card);
}

.wp-block-group.is-style-afn-inverse:not(.has-background) {
	background-color: var(--afn-b-ink);
	color: var(--afn-b-paper);
}

/* ==========================================================================
   3. Akkordeon (Gruppe mit Aufklappboxen)
   Die Gestaltung der einzelnen Aufklappbox steht im Inline-CSS (abschaltbar, mit Ausnahmen).
   ========================================================================== */

.wp-block-group.is-style-afn-accordion {
	margin-block: 1.5rem;
}

/* ==========================================================================
   4. Nummerierte Überschriften
   Zähler: .entry-content (Theme) bzw. Editor. Die verschachtelte Zählung (1.2, 1.2.3) steht im
   Inline-CSS und lässt sich abschalten.
   ========================================================================== */

/* counter-reset addiert sich nicht: Eine andere Regel mit counter-reset am selben Element würde unsere Zähler
   löschen. Darum feste Spezifität (html body …) und die alten Canvas-Namen (h2 … h6) im Übergang mit dabei. */
html body :is(.entry-content, .wp-block-post-content, .afn-content),
html body.editor-styles-wrapper {
	counter-reset: afn-h2 h2;
}

html body :is(.entry-content, .wp-block-post-content, .afn-content, .is-root-container) h2,
html body.editor-styles-wrapper h2 { counter-reset: afn-h3 h3; }
html body :is(.entry-content, .wp-block-post-content, .afn-content, .is-root-container) h3,
html body.editor-styles-wrapper h3 { counter-reset: afn-h4 h4; }
html body :is(.entry-content, .wp-block-post-content, .afn-content, .is-root-container) h4,
html body.editor-styles-wrapper h4 { counter-reset: afn-h5 h5; }
html body :is(.entry-content, .wp-block-post-content, .afn-content, .is-root-container) h5,
html body.editor-styles-wrapper h5 { counter-reset: afn-h6 h6; }

:is(h2, h3, h4, h5, h6).is-style-afn-numbered {
	display: flex;
	align-items: flex-start;
	gap: 0.5em;
}

:is(h2, h3, h4, h5, h6).is-style-afn-numbered::before {
	flex: 0 0 auto;
	font-variant-numeric: tabular-nums;
	color: var(--afn-b-accent);
}

h2.is-style-afn-numbered::before { counter-increment: afn-h2; content: counter(afn-h2); }
h3.is-style-afn-numbered::before { counter-increment: afn-h3; content: counter(afn-h3); }
h4.is-style-afn-numbered::before { counter-increment: afn-h4; content: counter(afn-h4); }
h5.is-style-afn-numbered::before { counter-increment: afn-h5; content: counter(afn-h5); }
h6.is-style-afn-numbered::before { counter-increment: afn-h6; content: counter(afn-h6); }

/* H2: Zahl im Kästchen */
h2.is-style-afn-numbered::before {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-width: 1.3em;
	height: 1.3em;
	padding: 0.12em 0.32em 0;
	border-radius: var(--afn-b-num-radius);
	background-color: var(--afn-b-accent-soft);
	color: var(--afn-b-link);
	font-size: 0.95em;
	line-height: 1;
}

/* ==========================================================================
   5. Gestaltete Listen: Gestaltet, Häkchen, Kreuze
   ========================================================================== */

:is(ul, ol):is(.is-style-afn-styled, .is-style-afn-positive, .is-style-afn-negative) {
	padding-inline-start: 0;
	list-style: none;
}

:is(ul, ol):is(.is-style-afn-styled, .is-style-afn-positive, .is-style-afn-negative) > li {
	position: relative;
	padding-inline-start: 2.25rem;
}

:is(ul, ol):is(.is-style-afn-styled, .is-style-afn-positive, .is-style-afn-negative) > li + li {
	margin-block-start: 0.5rem;
}

:is(ul, ol):is(.is-style-afn-styled, .is-style-afn-positive, .is-style-afn-negative) > li::before {
	position: absolute;
	inset-inline-start: 0;
	top: 0.15em;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
}

/* Verschachtelte Listen darin: schlicht, etwas kleiner */
:is(ul, ol):is(.is-style-afn-styled, .is-style-afn-positive, .is-style-afn-negative) :is(ul, ol) {
	margin-block: 0.4rem;
	font-size: 0.95em;
}

/* Nummern */
ol:is(.is-style-afn-styled, .is-style-afn-positive, .is-style-afn-negative) {
	counter-reset: afn-ol;
}

ol:is(.is-style-afn-styled, .is-style-afn-positive, .is-style-afn-negative) > li::before {
	counter-increment: afn-ol;
	content: counter(afn-ol);
	width: 1.5rem;
	height: 1.5rem;
	border-radius: 50%;
	background-color: var(--afn-b-accent);
	color: var(--afn-b-on-accent);
	font-size: 0.8rem;
	font-weight: 700;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

ol.is-style-afn-positive > li::before { background-color: var(--afn-b-success); }
ol.is-style-afn-negative > li::before { background-color: var(--afn-b-danger); }

/* Punkte */
ul.is-style-afn-styled > li::before {
	content: "";
	inset-inline-start: 0.7rem;
	top: 0.62em;
	width: 0.42rem;
	height: 0.42rem;
	border-radius: 2px;
	background-color: var(--afn-b-accent);
}

/* Häkchen und Kreuze als Maske (keine Icon-Schrift nötig) */
ul:is(.is-style-afn-positive, .is-style-afn-negative) > li::before {
	content: "";
	inset-inline-start: 0.2rem;
	top: 0.2em;
	width: 1.15rem;
	height: 1.15rem;
	-webkit-mask: var(--afn-b-icon) center / contain no-repeat;
	mask: var(--afn-b-icon) center / contain no-repeat;
}

ul.is-style-afn-positive > li::before {
	--afn-b-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9.2 16.6 4.9 12.3l-1.6 1.6 5.9 5.9L21 8l-1.6-1.6z'/%3E%3C/svg%3E");
	background-color: var(--afn-b-success);
}

ul.is-style-afn-negative > li::before {
	--afn-b-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M18.4 4 12 10.4 5.6 4 4 5.6l6.4 6.4L4 18.4 5.6 20l6.4-6.4 6.4 6.4 1.6-1.6-6.4-6.4L20 5.6z'/%3E%3C/svg%3E");
	background-color: var(--afn-b-danger);
}

/* ==========================================================================
   6. Absatz „Hervorgehoben“, Trenner
   ========================================================================== */

p.is-style-afn-callout {
	font-family: var(--afn-b-font-head);
	font-size: 1.25rem;
	font-weight: 600;
	line-height: 1.4;
	color: var(--afn-b-ink);
}

hr.wp-block-separator:is(.is-style-afn-dashed, .is-style-afn-dotted, .is-style-afn-double) {
	height: 0;
	border: 0;
	border-top: 2px dashed var(--afn-b-line-strong);
	background: none;
	opacity: 1;
}

hr.wp-block-separator.is-style-afn-dotted { border-top-style: dotted; border-top-width: 3px; }
hr.wp-block-separator.is-style-afn-double { border-top: 4px double var(--afn-b-line-strong); }

/* ==========================================================================
   7. Etiketten (Inline): <span class="afn-badge afn-badge--info">
   ========================================================================== */

.afn-badge {
	display: inline-block;
	padding: 0.3em 0.62em 0.26em;
	border-radius: 999px;
	background-color: var(--afn-b-accent);
	color: var(--afn-b-on-accent);
	font-family: var(--afn-b-font-sans);
	font-size: 0.75em;
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: 0.04em;
	text-transform: var(--afn-b-badge-transform);
	vertical-align: 0.12em;
	white-space: nowrap;
}

.afn-badge:empty { display: none; }
.afn-badge :is(b, strong) { font-weight: inherit; }
.afn-badge--muted { background-color: var(--afn-b-surface); color: var(--afn-b-ink-soft); }
.afn-badge--info { background-color: var(--afn-b-accent-soft); color: var(--afn-b-link); }
.afn-badge--success { background-color: var(--afn-b-success); color: #FFFFFF; }
.afn-badge--warning { background-color: var(--afn-b-warning); color: #1C1208; }
.afn-badge--danger { background-color: var(--afn-b-danger); color: #FFFFFF; }
.afn-badge--dark { background-color: var(--afn-b-dark); color: #FFFFFF; }

/* ==========================================================================
   8. Beitragskarten (Block afn/post-card)
   ========================================================================== */

.afn-post-cards {
	--afn-card-img: 132px;
	--afn-card-ratio: 1 / 1;
	--afn-card-ratio-grid: 3 / 2;
	display: grid;
	gap: 0.85rem;
	margin-block: 1.5rem;
}

.afn-post-cards__label {
	margin: 0 0 -0.25rem;
	font-family: var(--afn-b-font-sans);
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--afn-b-ink-soft);
}

.afn-post-cards__items {
	display: grid;
	gap: 0.85rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.afn-post-card {
	position: relative;
	box-sizing: border-box;
	min-width: 0;
	margin: 0;
	color: var(--afn-b-ink);
}

.afn-post-cards--frame-border .afn-post-card {
	padding: 0.75rem;
	border: 1px solid var(--afn-b-line);
	border-radius: var(--afn-b-radius);
	background-color: var(--afn-b-card);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.afn-post-cards--frame-border .afn-post-card:hover {
	border-color: var(--afn-b-line-strong);
}

.afn-post-cards--frame-shadow .afn-post-card {
	padding: 0.75rem;
	border-radius: var(--afn-b-radius);
	background-color: var(--afn-b-card);
	box-shadow: var(--afn-b-shadow);
}

.afn-post-card__image {
	display: block;
	overflow: hidden;
	border-radius: var(--afn-b-radius-sm);
	background-color: var(--afn-b-surface);
	line-height: 0;
}

.afn-post-card__image img {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: cover;
	transition: transform 0.35s ease;
}

.afn-post-card:hover .afn-post-card__image img {
	transform: scale(1.03);
}

.afn-post-card__body {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	min-width: 0;
}

.afn-post-card__cat {
	font-family: var(--afn-b-font-sans);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	line-height: 1.3;
	text-transform: uppercase;
}

.afn-post-card__cat a {
	color: var(--afn-b-accent);
	text-decoration: none;
}

html body .afn-post-cards .afn-post-card__title {
	margin: 0;
	padding: 0;
	font-family: var(--afn-b-font-head);
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0;
	color: var(--afn-b-ink);
}

html body .afn-post-cards .afn-post-card__title::before,
html body .afn-post-cards .afn-post-card__title::after {
	content: none;
}

.afn-post-card__title a {
	color: inherit;
	text-decoration: none;
}

/* Ganze Karte klickbar */
.afn-post-card__title a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.afn-post-card__cat a {
	position: relative;
	z-index: 2;
}

.afn-post-card:hover .afn-post-card__title a,
.afn-post-card__title a:focus-visible {
	color: var(--afn-b-accent);
}

.afn-post-card__excerpt {
	margin: 0;
	font-size: 0.92rem;
	line-height: 1.5;
	color: var(--afn-b-ink-soft);
}

.afn-post-card__meta {
	font-family: var(--afn-b-font-sans);
	font-size: 0.78rem;
	line-height: 1.4;
	color: var(--afn-b-ink-soft);
}

.afn-post-card__meta > span + span::before {
	content: "·";
	margin-inline: 0.4em;
}

/* Bild links, Text rechts */
.afn-post-cards--horizontal .afn-post-card {
	display: grid;
	grid-template-columns: var(--afn-card-img) minmax(0, 1fr);
	align-items: center;
	gap: 1rem;
}

.afn-post-cards--horizontal .afn-post-card:not(:has(.afn-post-card__image)) {
	grid-template-columns: minmax(0, 1fr);
}

.afn-post-cards--horizontal .afn-post-card__image {
	aspect-ratio: var(--afn-card-ratio);
}

/* Kacheln */
.afn-post-cards--grid .afn-post-card {
	display: flex;
	flex-direction: column;
	gap: 0.7rem;
}

.afn-post-cards--grid .afn-post-card__image {
	aspect-ratio: var(--afn-card-ratio-grid);
}

/* Schlichte Liste */
.afn-post-cards--list .afn-post-cards__items {
	gap: 0;
}

.afn-post-cards--list .afn-post-card {
	padding: 0.55rem 0;
	border: 0;
	border-bottom: 1px solid var(--afn-b-line);
	border-radius: 0;
	background: none;
	box-shadow: none;
}

.afn-post-cards--list .afn-post-card:first-child {
	border-top: 1px solid var(--afn-b-line);
}

/* Spalten */
@media (min-width: 700px) {
	.afn-post-cards--cols-2 .afn-post-cards__items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.afn-post-cards--cols-3 .afn-post-cards__items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1000px) {
	.afn-post-cards--cols-3 .afn-post-cards__items { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
	.afn-post-cards--horizontal .afn-post-card {
		grid-template-columns: min(var(--afn-card-img), 92px) minmax(0, 1fr);
		gap: 0.75rem;
	}

	.afn-post-card__excerpt {
		display: none;
	}
}

/* ==========================================================================
   9. Autorenkasten (Block afn/author-box)
   ========================================================================== */

.afn-author-box {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: 1.1rem;
	align-items: start;
	box-sizing: border-box;
	margin-block: 1.75rem;
	padding: 1.25rem;
	border: 1px solid var(--afn-b-line);
	border-radius: var(--afn-b-radius);
	background-color: var(--afn-b-card);
}

.afn-author-box--no-avatar {
	grid-template-columns: minmax(0, 1fr);
}

.afn-author-box__avatar img {
	display: block;
	border-radius: 50%;
}

.afn-author-box__label {
	margin: 0 0 0.15rem;
	font-family: var(--afn-b-font-sans);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--afn-b-ink-soft);
}

html body .afn-author-box .afn-author-box__name {
	margin: 0 0 0.4rem;
	font-family: var(--afn-b-font-head);
	font-size: 1.15rem;
	font-weight: 700;
	line-height: 1.3;
}

html body .afn-author-box .afn-author-box__name a,
html body .afn-post-cards .afn-post-card__title a,
html body .afn-post-cards .afn-post-card__cat a,
html body .afn-author-box .afn-author-box__link {
	border: 0;
	box-shadow: none;
	background-image: none;
	text-decoration: none;
}

.afn-author-box__name a {
	color: var(--afn-b-ink);
}

.afn-author-box__name a:hover {
	color: var(--afn-b-accent);
}

.afn-author-box__bio {
	font-size: 0.95rem;
	line-height: 1.55;
	color: var(--afn-b-ink);
}

.afn-author-box__bio > :first-child { margin-top: 0; }
.afn-author-box__bio > :last-child { margin-bottom: 0; }

.afn-author-box__link {
	display: inline-block;
	margin-top: 0.6rem;
	font-family: var(--afn-b-font-sans);
	font-size: 0.85rem;
	font-weight: 700;
	color: var(--afn-b-link);
	text-decoration: none;
}

.afn-author-box__link:hover {
	color: var(--afn-b-accent);
	text-decoration: underline;
}

@media (max-width: 480px) {
	.afn-author-box {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* ==========================================================================
   10. Fortschrittsbalken (Block afn/progress)
   ========================================================================== */

.afn-progress {
	--afn-progress-height: 14px;
	--afn-progress-color: var(--afn-b-accent);
	margin-block: 0.4rem 1.1rem;
}

.afn-progress__label {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 0.3rem;
	font-family: var(--afn-b-font-sans);
	font-size: 0.85rem;
	color: var(--afn-b-ink-soft);
}

.afn-progress__track {
	overflow: hidden;
	height: var(--afn-progress-height);
	border-radius: 999px;
	background-color: var(--afn-b-surface);
}

.afn-progress__bar {
	height: 100%;
	border-radius: inherit;
	background-color: var(--afn-progress-color);
}

.afn-progress--striped .afn-progress__bar {
	background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.18) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.18) 50%, rgba(255, 255, 255, 0.18) 75%, transparent 75%, transparent);
	background-size: 1rem 1rem;
}

.afn-progress--info { --afn-progress-color: var(--afn-b-info); }
.afn-progress--success { --afn-progress-color: var(--afn-b-success); }
.afn-progress--warning { --afn-progress-color: var(--afn-b-warning); }
.afn-progress--danger { --afn-progress-color: var(--afn-b-danger); }
.afn-progress--dark { --afn-progress-color: var(--afn-b-dark); }

/* ==========================================================================
   11. Editor: Platzhalter der eigenen Blöcke
   ========================================================================== */

.afn-b-placeholder {
	padding: 1rem;
	border: 1px dashed var(--afn-b-line-strong);
	border-radius: var(--afn-b-radius-sm);
	color: var(--afn-b-ink-soft);
	font-family: var(--afn-b-font-sans);
	font-size: 0.9rem;
}

/* Spalten mit früherem Canvas-Rahmen */
.afn-bordered {
	box-sizing: border-box;
	padding: 1rem 1.25rem;
	border: 1px solid var(--afn-b-line-strong);
	border-radius: var(--afn-b-radius);
}

/* ==========================================================================
   Startseite und Landingpages (AFN Blöcke 1.2): Beitragsliste, Rubrik-Kacheln, Datum,
   Widget-Bereich, Abschnittstitel, Bänder
   ========================================================================== */

/* Abschnittstitel: VERSALIEN, Cursor in der Akzentfarbe, beim kleinen Stil eine feine Linie */
:is(h1, h2, h3, h4, h5, h6, p).is-style-afn-abschnitt,
:is(h1, h2, h3, h4, h5, h6, p).is-style-afn-abschnitt-gross {
	font-family: var(--afn-font-sans, inherit);
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	overflow-wrap: normal;
	word-break: keep-all;
	hyphens: manual;
	color: var(--afn-ink, inherit);
}

:is(h1, h2, h3, h4, h5, h6, p).is-style-afn-abschnitt {
	display: flex;
	align-items: center;
	gap: 0.7em;
	font-size: 0.95rem;
	line-height: 1.3;
	margin-top: 0;
	margin-bottom: 1.1rem;
}

:is(h1, h2, h3, h4, h5, h6, p).is-style-afn-abschnitt::after {
	content: "";
	flex: 1 1 auto;
	min-width: 2em;
	height: 0.8em;
	background:
		linear-gradient(var(--afn-b-accent), var(--afn-b-accent)) no-repeat left center / 0.42em 0.8em,
		linear-gradient(var(--afn-b-accent), var(--afn-b-accent)) no-repeat 0.95em center / 100% 3px;
}

:is(h1, h2, h3, h4, h5, h6, p).is-style-afn-abschnitt-gross {
	font-size: clamp(1.45rem, 1.1rem + 1.1vw, 2rem);
	line-height: 1.15;
	margin-top: 0;
	margin-bottom: 0.6rem;
}

:is(h1, h2, h3, h4, h5, h6, p).is-style-afn-abschnitt-gross::after {
	content: "\00a0\00a0";
	margin-left: 0.1em;
	background: linear-gradient(var(--afn-b-accent), var(--afn-b-accent)) no-repeat left 50% / 0.42em 0.8em;
}

/* Unterzeile unter Abschnittstiteln */
p.frontpage-subline-text {
	margin-top: 0;
	margin-bottom: 1.6rem;
}

/* Bänder (Gruppe mit Stil): Sand und Graphit, oben und unten gleich viel Luft */
.wp-block-group.is-style-afn-band,
.wp-block-group.is-style-afn-band-dunkel {
	padding-top: var(--afn-band-pad, clamp(40px, 2.5vw + 24px, 64px));
	padding-bottom: var(--afn-band-pad, clamp(40px, 2.5vw + 24px, 64px));
	margin-top: 0;
	margin-bottom: 0;
}

.wp-block-group.is-style-afn-band {
	background-color: var(--afn-surface, #ECEAE4);
}

.wp-block-group.is-style-afn-band-dunkel {
	--afn-card: #2E2E2E;
	--afn-surface: #262626;
	--afn-line: rgba(255, 255, 255, 0.12);
	--afn-line-strong: rgba(255, 255, 255, 0.34);
	--afn-ink: var(--afn-dunkel-text, #F2F0EB);
	--afn-ink-soft: var(--afn-dunkel-text-weich, #B9B5AE);
	--afn-accent: var(--afn-dunkel-akzent, var(--afn-glow, #3CC8C0));
	--afn-b-accent: var(--afn-dunkel-akzent, var(--afn-glow, #3CC8C0));
	--afn-link: var(--afn-dunkel-link, var(--afn-glow, #3CC8C0));
	--afn-link-hover: var(--afn-dunkel-hover, #FF7A1F);
	--afn-on-accent: var(--afn-dunkel-auf-akzent, #141414);
	--color-text-gray: var(--afn-dunkel-text-weich, #B9B5AE);
	background-color: var(--afn-graphite, #232323);
	color: var(--afn-ink);
}

.wp-block-group.is-style-afn-band > :last-child,
.wp-block-group.is-style-afn-band-dunkel > :last-child {
	margin-bottom: 0;
}

/* Errabic-Karten im dunklen Band: Karten eine Stufe heller, Schrift hell */
.is-style-afn-band-dunkel .errabic-post-item {
	background-color: var(--afn-card) !important;
	border-color: rgba(255, 255, 255, 0.08) !important;
}

.is-style-afn-band-dunkel .errabic-post-item:hover {
	border-color: rgba(255, 255, 255, 0.24) !important;
	box-shadow: 0 18px 34px -18px rgba(0, 0, 0, 0.8);
}

.is-style-afn-band-dunkel .errabic-post-item :is(h2, h3, h4, h2 a, h3 a, h4 a, .post-title, .post-title a) {
	color: var(--afn-ink) !important;
}

.is-style-afn-band-dunkel .errabic-post-item :is(p, .post-excerpt) {
	color: #CFCAC3 !important;
}

.is-style-afn-band-dunkel .errabic-responsive-grid::after {
	content: none;
}

/* Flache Karte (z. B. „Trending“): fast weiß, feine Kante */
.wp-block-group.is-style-afn-karte-flach {
	padding: 22px 26px;
	border-radius: var(--afn-radius, 12px);
	background-color: var(--afn-card, #FBFAF8);
	box-shadow: inset 0 0 0 1px var(--afn-line, #DEDAD2);
}

/* ---------------------------------------------------------- Beitragsliste */
.afn-beitraege {
	--afn-b-gap: 34px;
	margin-bottom: 1.6em;
}

.afn-beitraege__liste {
	margin: 0;
	padding: 0;
	list-style: none;
}

.afn-beitraege :is(h2, h3, h4, p).afn-titelbalken,
.afn-beitraege :is(.afn-nummer__titel, .afn-kompakt__titel, .afn-kachel__titel, .afn-listeneintrag__titel) {
	margin: 0 !important;
	font-family: var(--afn-font-head, inherit);
	font-weight: 700;
	letter-spacing: -0.01em;
}

.afn-beitraege a {
	text-decoration: none;
}

.afn-beitraege :is(.afn-kachel__bild, .afn-listeneintrag__bild, .afn-nummer__bild, .afn-kompakt__bild) {
	position: relative;
}

.afn-beitraege :is(.afn-aufmacher__bild, .afn-kachel__bild, .afn-listeneintrag__bild, .afn-nummer__bild, .afn-kompakt__bild) img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: cover;
}

/*
 * KI-Kennzeichnung (GD AI Image Labels) legt um Beitragsbilder einen Rahmen (inline-block).
 * Er muss die Bildfläche ausfüllen, sonst ist das absolut positionierte Bild 0 × 0 groß
 * und wird wegen loading="lazy" nie geladen.
 */
.afn-beitraege :is(.afn-aufmacher__bild, .afn-kachel__bild, .afn-listeneintrag__bild, .afn-nummer__bild, .afn-kompakt__bild) .gd-ai-featured-wrap,
.afn-rubrikkacheln .afn-rubrikkachel__bild .gd-ai-featured-wrap {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	max-width: none;
	container: gd-ai-label-frame / inline-size;
}

.afn-post-card__image .gd-ai-featured-wrap {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	container: gd-ai-label-frame / inline-size;
}

/* Unter 300 px Rahmenbreite blendet GD AI Image Labels die Kennzeichnung aus; dessen Container-Regel
   verliert aber gegen die eigene Grundregel. Hier mit ausreichender Spezifität nachgezogen. */
@container gd-ai-label-frame (max-width: 299px) {
	:is(.afn-beitraege, .afn-rubrikkacheln, .afn-post-cards) .gd-ai-image-frame > .gd-ai-image-label {
		display: none;
	}
}

.afn-b-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 8px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--afn-ink-soft, #5B544C);
}

.afn-b-meta__autor {
	font-weight: 700;
	color: var(--afn-ink, inherit);
}

.afn-b-meta__by {
	font-weight: 600;
	color: var(--afn-ink-soft, inherit);
}

/* Titel mit Balken (Aufmacher, Liste): jeder Balken rund 1,44 em hoch, feine Fuge zwischen den Zeilen */
.afn-titelbalken {
	line-height: calc(1.44em + var(--afn-title-gap, 3px));
	font-size: var(--afn-b-titel, 1.5rem);
}

.afn-titelbalken a {
	color: #FFFFFF;
}

.afn-titelbalken span {
	padding: 0.30em 0.35em 0.125em;
	background-color: var(--afn-titelbalken-bg, #231F1C);
	color: #FFFFFF;
	-webkit-box-decoration-break: clone;
	box-decoration-break: clone;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.afn-titelbalken a:is(:hover, :focus-visible) span {
	background-color: var(--afn-accent, #0F6E6E);
	color: var(--afn-on-accent, #FFFFFF);
}

.afn-titelbalken bdi.gd-ar {
	font-size: 1em;
	background-color: inherit;
	padding: 0.2em 0 0.14em;
	margin: -0.2em 0 -0.14em;
}

.is-akzent .afn-titelbalken span {
	background-color: var(--afn-accent, #0F6E6E);
}

.is-akzent .afn-titelbalken a:is(:hover, :focus-visible) span {
	background-color: var(--afn-ink, #231F1C);
	color: var(--afn-card, #FBFAF8);
}

/* Aufmacher: Bild mit Titel darauf */
.afn-beitraege--aufmacher .afn-beitraege__liste {
	display: grid;
	gap: var(--afn-b-gap);
}

.afn-aufmacher {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	min-height: var(--afn-b-hoehe, 480px);
	overflow: hidden;
	border-radius: var(--afn-radius, 12px);
	background: #141414;
	color: #FFFFFF;
	isolation: isolate;
}

.afn-aufmacher__bild {
	position: absolute;
	inset: 0;
	z-index: -1;
}

.afn-aufmacher__bild::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.38) 55%, rgba(0, 0, 0, 0.12) 100%);
}

.afn-aufmacher__bild img {
	transition: transform 0.5s ease;
}

.afn-aufmacher:hover .afn-aufmacher__bild img {
	transform: scale(1.03);
}

.afn-aufmacher__text {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: clamp(20px, 3vw, 30px);
	--afn-ink: #FFFFFF;
	--afn-ink-soft: #E6E2DC;
}

.afn-aufmacher .afn-titelbalken {
	font-size: var(--afn-b-titel, clamp(1.4rem, 1rem + 1.4vw, 2rem));
}

.afn-aufmacher__auszug {
	max-width: 46em;
	margin: 0;
	font-size: 1.05rem;
	line-height: 1.6;
	color: #EDE9E3;
}

.afn-aufmacher__auszug.afn-hat-ar {
	line-height: 1.9;
}

.afn-aufmacher .afn-rubrik:not(.afn-rubrik--erste) {
	background: transparent;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
	color: #FFFFFF;
}

.afn-aufmacher .afn-rubrik--erste {
	background: var(--afn-rubrik, var(--afn-accent, #0F6E6E));
	color: #FFFFFF;
}

/*
 * Aufmacher „Text links, Bild rechts“ (geteilt) und „Bild oben, Text darunter“ (oben):
 * Bild unverdeckt, Text auf der Kartenfläche, großer Titel ohne Balken.
 * Vergleichen ohne Speichern (nur Admins): ?afn_aufmacher=geteilt bzw. =oben
 */
.afn-aufmacher-stil--geteilt .afn-aufmacher,
.afn-aufmacher-stil--breit .afn-aufmacher,
.afn-aufmacher-stil--oben .afn-aufmacher {
	min-height: 0;
	justify-content: flex-start;
	background: var(--afn-card, #FBFAF8);
	color: var(--afn-ink, #231F1C);
	box-shadow: var(--afn-shadow-card, 0 1px 2px rgba(0, 0, 0, 0.06));
}

/* Neben einer Spalte: Text knapp halten, damit das Bild breiter als hoch bleibt (3:2-Bilder werden nur
   an den Seiten leicht beschnitten). Auszug höchstens drei Zeilen. */
.afn-aufmacher-stil--geteilt .afn-aufmacher {
	display: grid;
	grid-template-columns: minmax(0, 47fr) minmax(0, 53fr);
	align-items: stretch;
}

.afn-beitraege.afn-aufmacher-stil--geteilt .afn-titelbalken {
	font-size: min(var(--afn-b-titel, 1.6rem), clamp(1.3rem, 0.9rem + 0.8vw, 1.6rem));
}

.afn-beitraege.afn-aufmacher-stil--geteilt .afn-aufmacher__auszug {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	font-size: 1rem;
}

/* Volle Breite: Bild genau 3:2 (unbeschnitten), Text daneben mittig; die Nachbarspalte (z. B. „The Latest“)
   rückt als Reihe darunter. */
.afn-aufmacher-stil--breit .afn-aufmacher {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	align-items: center;
}

.afn-aufmacher-stil--breit .afn-aufmacher__bild {
	order: 2;
	align-self: center;
	min-height: 0;
	aspect-ratio: 3 / 2;
}

/* Titelgröße nach der Breite der Textspalte (Container-Einheit cqi), nicht nach dem Fenster: Die Spalte ist am
   Desktop rund 415 px, am Tablet 275 px, am Handy 350 px breit – das Fenster sagt darüber wenig. Die Titelgröße des
   Blocks gilt als Höchstwert, 1.5rem als Mindestwert (1.6.11; 1.6.10 nahm das Fenster, davor galt die Einstellung nicht). */
.afn-beitraege.afn-aufmacher-stil--breit .afn-aufmacher__text {
	container-type: inline-size;
}

.afn-beitraege.afn-aufmacher-stil--breit .afn-titelbalken {
	font-size: min(var(--afn-b-titel, 2.4rem), max(1.5rem, 7.6cqi));
}

/* Auszug im Aufmacher: Zeilenabstand enger (vorher 1.7 aus der allgemeinen Absatzregel) */
.afn-beitraege:is(.afn-aufmacher-stil--breit, .afn-aufmacher-stil--geteilt, .afn-aufmacher-stil--oben) .afn-aufmacher__auszug:not(.afn-hat-ar) {
	line-height: 1.5;
}

.afn-beitraege.afn-aufmacher-stil--breit .afn-aufmacher__auszug {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 5;
	line-clamp: 5;
	font-size: 1.05rem;
}

.wp-block-columns:has(.afn-aufmacher-stil--breit) {
	flex-direction: column;
	gap: clamp(44px, 3vw + 24px, 64px);
}

.wp-block-columns:has(.afn-aufmacher-stil--breit) > .wp-block-column {
	flex-basis: auto !important;
	width: 100%;
}

.wp-block-columns:has(.afn-aufmacher-stil--breit) .afn-beitraege--nummeriert .afn-beitraege__liste {
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 24px;
}

@media (max-width: 1019.98px) {
	.wp-block-columns:has(.afn-aufmacher-stil--breit) .afn-beitraege--nummeriert .afn-beitraege__liste {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Handy: „The Latest“ als schlichte Liste untereinander */
@media (max-width: 599.98px) {
	.wp-block-columns:has(.afn-aufmacher-stil--breit) .afn-beitraege--nummeriert .afn-beitraege__liste {
		grid-template-columns: minmax(0, 1fr);
		gap: 18px;
	}
}

/* Gespiegelt: Bild links, Text rechts (Einstellung „Bild links“) */
.afn-aufmacher--bild-links.afn-aufmacher-stil--breit .afn-aufmacher {
	grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
}

.afn-aufmacher--bild-links.afn-aufmacher-stil--geteilt .afn-aufmacher {
	grid-template-columns: minmax(0, 53fr) minmax(0, 47fr);
}

.afn-aufmacher--bild-links .afn-aufmacher .afn-aufmacher__bild {
	order: 0;
}

.afn-aufmacher-stil--geteilt .afn-aufmacher__bild,
.afn-aufmacher-stil--breit .afn-aufmacher__bild,
.afn-aufmacher-stil--oben .afn-aufmacher__bild {
	position: relative;
	inset: auto;
	z-index: auto;
	display: block;
	overflow: hidden;
}

.afn-aufmacher-stil--geteilt .afn-aufmacher__bild {
	order: 2;
	min-height: 100%;
	aspect-ratio: 4 / 3;
}

.afn-aufmacher-stil--oben .afn-aufmacher__bild {
	aspect-ratio: var(--afn-b-ratio, 16 / 9);
}

.afn-aufmacher-stil--geteilt .afn-aufmacher__bild::after,
.afn-aufmacher-stil--breit .afn-aufmacher__bild::after,
.afn-aufmacher-stil--oben .afn-aufmacher__bild::after {
	display: none;
}

.afn-aufmacher-stil--geteilt .afn-aufmacher__text,
.afn-aufmacher-stil--breit .afn-aufmacher__text,
.afn-aufmacher-stil--oben .afn-aufmacher__text {
	--afn-ink: inherit;
	--afn-ink-soft: inherit;
	justify-content: center;
	gap: 12px;
	padding: clamp(22px, 2.6vw, 34px);
}

.afn-aufmacher-stil--geteilt .afn-titelbalken,
.afn-aufmacher-stil--breit .afn-titelbalken,
.afn-aufmacher-stil--oben .afn-titelbalken {
	font-family: var(--afn-font-head, inherit);
	font-size: var(--afn-b-titel, clamp(1.6rem, 1.1rem + 1.5vw, 2.35rem));
	font-weight: 800;
	line-height: var(--afn-titel-zeile, 1.15);
	letter-spacing: -0.015em;	/* gleich lange Zeilen statt einem einzelnen Wort in der letzten */
	text-wrap: balance;
}

.afn-aufmacher-stil--geteilt .afn-titelbalken.afn-hat-ar,
.afn-aufmacher-stil--breit .afn-titelbalken.afn-hat-ar,
.afn-aufmacher-stil--oben .afn-titelbalken.afn-hat-ar {
	line-height: var(--afn-titel-zeile-ar, 1.5);
}

.afn-aufmacher-stil--geteilt .afn-titelbalken a,
.afn-aufmacher-stil--breit .afn-titelbalken a,
.afn-aufmacher-stil--oben .afn-titelbalken a {
	color: var(--afn-ink, #231F1C);
}

.afn-aufmacher-stil--geteilt .afn-titelbalken span,
.afn-aufmacher-stil--breit .afn-titelbalken span,
.afn-aufmacher-stil--oben .afn-titelbalken span {
	padding: 0;
	background: none;
	color: inherit;
}

.afn-aufmacher-stil--geteilt .afn-titelbalken a:is(:hover, :focus-visible) span,
.afn-aufmacher-stil--breit .afn-titelbalken a:is(:hover, :focus-visible) span,
.afn-aufmacher-stil--oben .afn-titelbalken a:is(:hover, :focus-visible) span {
	background: none;
	color: var(--afn-accent, #0F6E6E);
}

.afn-aufmacher-stil--geteilt .afn-aufmacher__auszug,
.afn-aufmacher-stil--breit .afn-aufmacher__auszug,
.afn-aufmacher-stil--oben .afn-aufmacher__auszug {
	color: var(--afn-ink-soft, #5B544C);
}

.afn-aufmacher-stil--geteilt .afn-aufmacher .afn-rubrik:not(.afn-rubrik--erste),
.afn-aufmacher-stil--breit .afn-aufmacher .afn-rubrik:not(.afn-rubrik--erste),
.afn-aufmacher-stil--oben .afn-aufmacher .afn-rubrik:not(.afn-rubrik--erste) {
	box-shadow: inset 0 0 0 1px var(--afn-line-strong, #C9C4BA);
	color: var(--afn-ink, #231F1C);
}

@media (max-width: 781.98px) {
	.afn-aufmacher-stil--geteilt .afn-aufmacher,
	.afn-aufmacher-stil--breit .afn-aufmacher,
	.afn-aufmacher--bild-links.afn-aufmacher-stil--geteilt .afn-aufmacher,
	.afn-aufmacher--bild-links.afn-aufmacher-stil--breit .afn-aufmacher {
		grid-template-columns: minmax(0, 1fr);
	}

	.afn-aufmacher-stil--geteilt .afn-aufmacher__bild,
	.afn-aufmacher-stil--breit .afn-aufmacher__bild,
	.afn-aufmacher--bild-links .afn-aufmacher .afn-aufmacher__bild {
		order: -1;
		aspect-ratio: 3 / 2;
	}

	.afn-beitraege.afn-aufmacher-stil--breit .afn-aufmacher__auszug {
		-webkit-line-clamp: 4;
		line-clamp: 4;
		font-size: 1rem;
	}
}

/* Nummerierte Liste: kleines Bild, Nummer als Schild unten links */
.afn-beitraege--nummeriert .afn-beitraege__liste {
	display: grid;
	gap: 22px;
	counter-reset: none;
}

.afn-nummer {
	display: grid;
	grid-template-columns: 72px minmax(0, 1fr);
	gap: 14px;
	align-items: center;
	margin: 0;
}

.afn-nummer__bild {
	position: relative;
	display: block;
	width: 72px;
	height: 72px;
	overflow: hidden;
	border-radius: var(--afn-radius-sm, 8px);
	background: var(--afn-surface, #ECEAE4);
}

.afn-nummer__zahl {
	position: absolute;
	left: 6px;
	bottom: 6px;
	padding: 3px 6px 2px;
	border-radius: 3px;
	background: var(--afn-accent, #0F6E6E);
	color: var(--afn-on-accent, #FFFFFF);
	font-family: var(--afn-font-head, inherit);
	font-size: 12px;
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: 0.04em;
	font-variant-numeric: tabular-nums;
}

.afn-beitraege .afn-nummer__titel,
.afn-beitraege .afn-kompakt__titel {
	font-size: var(--afn-b-titel, 1rem);
	font-weight: 600 !important;
	line-height: var(--afn-karte-zeile, 1.38);
}

.afn-nummer__titel.afn-hat-ar,
.afn-kompakt__titel.afn-hat-ar {
	line-height: var(--afn-karte-zeile-ar, 1.55);
}

:is(.afn-nummer__titel, .afn-kompakt__titel, .afn-kachel__titel, .afn-listeneintrag__titel) a {
	color: var(--afn-ink, inherit);
}

:is(.afn-nummer__titel, .afn-kompakt__titel, .afn-kachel__titel, .afn-listeneintrag__titel) a:is(:hover, :focus-visible) {
	color: var(--afn-link-hover, #0F6E6E);
}

.afn-nummer__text,
.afn-kompakt__text {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

/* Kompakt: kleines Bild, Titel; in Spalten mit feinen Trennlinien */
.afn-beitraege--kompakt .afn-beitraege__liste {
	display: grid;
	grid-template-columns: repeat(var(--afn-b-cols, 1), minmax(0, 1fr));
	gap: 20px 30px;
}

.afn-kompakt {
	display: grid;
	grid-template-columns: 64px minmax(0, 1fr);
	gap: 14px;
	align-items: center;
}

.afn-kompakt__bild {
	display: block;
	width: 64px;
	height: 64px;
	overflow: hidden;
	border-radius: var(--afn-radius-sm, 8px);
	background: var(--afn-surface, #ECEAE4);
}

.mit-linien.afn-beitraege--kompakt .afn-kompakt + .afn-kompakt {
	border-left: 1px solid var(--afn-line, #DEDAD2);
	padding-left: 30px;
}

/* Kacheln: Bild oben */
.afn-beitraege--kacheln .afn-beitraege__liste {
	display: grid;
	grid-template-columns: repeat(var(--afn-b-cols, 3), minmax(0, 1fr));
	gap: 44px var(--afn-b-gap);
}

.afn-kachel {
	display: flex;
	flex-direction: column;
	gap: 14px;
	min-width: 0;
}

.afn-kachel__bild {
	display: block;
	overflow: hidden;
	border-radius: 10px;
	aspect-ratio: var(--afn-b-ratio, 16 / 9);
	background: var(--afn-surface, #ECEAE4);
}

.afn-kachel__bild img {
	transition: transform 0.35s ease;
}

.afn-kachel:hover .afn-kachel__bild img {
	transform: scale(1.03);
}

.afn-kachel__text {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.afn-beitraege .afn-kachel__titel {
	font-size: var(--afn-b-titel, 1.2rem);
	line-height: var(--afn-karte-zeile, 1.3);
}

.afn-kachel__titel.afn-hat-ar {
	line-height: var(--afn-karte-zeile-ar, 1.5);
}

:is(.afn-kachel__auszug, .afn-listeneintrag__auszug) {
	margin: 0;
	font-size: 0.95rem;
	line-height: var(--afn-auszug-zeile, 1.6);
	color: var(--afn-ink-soft, #5B544C);
}

:is(.afn-kachel__auszug, .afn-listeneintrag__auszug).afn-hat-ar {
	line-height: var(--afn-auszug-zeile-ar, 1.9);
}

/* Liste: Bild links, Text rechts */
.afn-beitraege--liste .afn-beitraege__liste {
	display: grid;
	gap: 45px;
}

.afn-listeneintrag {
	display: grid;
	grid-template-columns: minmax(0, 45%) minmax(0, 1fr);
	gap: 30px;
	align-items: start;
	padding-bottom: 45px;
	border-bottom: 1px solid var(--afn-line, #DEDAD2);
}

.afn-listeneintrag:last-child {
	padding-bottom: 0;
	border-bottom: 0;
}

.afn-listeneintrag__bild {
	display: block;
	overflow: hidden;
	border-radius: 10px;
	aspect-ratio: var(--afn-b-ratio, 4 / 3);
	background: var(--afn-surface, #ECEAE4);
}

.afn-listeneintrag__text {
	display: flex;
	flex-direction: column;
	gap: 14px;
	min-width: 0;
}

.afn-listeneintrag .afn-titelbalken {
	font-size: var(--afn-b-titel, 1.35rem);
}

/* Liste ohne Balken (Schalter „Titel als Balken“ aus): Überschrift wie bei Kacheln */
.afn-beitraege .afn-listeneintrag__titel {
	font-size: var(--afn-b-titel, 1.35rem);
	line-height: var(--afn-karte-zeile, 1.3);
	text-wrap: balance;
}

.afn-listeneintrag__titel.afn-hat-ar {
	line-height: var(--afn-karte-zeile-ar, 1.5);
}

/* Mehr laden */
.afn-beitraege__mehr {
	display: flex;
	justify-content: center;
	margin-top: 36px;
}

.afn-beitraege__mehrknopf[aria-busy="true"] {
	opacity: 0.7;
	cursor: progress;
}

@media (max-width: 1019.98px) {
	.afn-beitraege--kacheln .afn-beitraege__liste {
		grid-template-columns: repeat(min(var(--afn-b-cols, 3), 2), minmax(0, 1fr));
	}

	.afn-beitraege--kompakt .afn-beitraege__liste {
		grid-template-columns: minmax(0, 1fr);
	}

	.mit-linien.afn-beitraege--kompakt .afn-kompakt + .afn-kompakt {
		border-left: 0;
		padding-left: 0;
		padding-top: 20px;
		border-top: 1px solid var(--afn-line, #DEDAD2);
	}
}

@media (max-width: 599.98px) {
	.afn-beitraege--kacheln .afn-beitraege__liste {
		grid-template-columns: minmax(0, 1fr);
	}

	.afn-listeneintrag {
		grid-template-columns: minmax(0, 1fr);
		gap: 16px;
	}

	.afn-aufmacher {
		min-height: min(var(--afn-b-hoehe, 480px), 420px);
	}
}

/* ---------------------------------------------------------- Rubrik-Kacheln */
.afn-rubrikkacheln {
	display: grid;
	grid-template-columns: repeat(var(--afn-b-cols, 5), minmax(0, 1fr));
	gap: 24px;
	margin-bottom: 1.6em;
}

.afn-rubrikkachel {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--afn-line, #DEDAD2);
	border-radius: var(--afn-radius, 12px);
	background: var(--afn-card, #FBFAF8);
	box-shadow: var(--afn-shadow-card, none);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.afn-rubrikkachel:hover {
	transform: translateY(-3px);
	box-shadow: 0 2px 4px rgba(62, 44, 28, 0.08), 0 18px 34px -16px rgba(62, 44, 28, 0.35);
}

.afn-rubrikkachel__bild {
	display: block;
	aspect-ratio: var(--afn-b-ratio, 3 / 2);
	overflow: hidden;
	background: var(--afn-surface, #ECEAE4);
}

.afn-rubrikkacheln .afn-rubrikkachel__bild {
	position: relative;
}

.afn-rubrikkacheln .afn-rubrikkachel__bild img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: cover;
}

.afn-rubrikkachel__text {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 16px 16px 20px;
}

.afn-rubrikkachel__kopf {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 10px;
}

.afn-rubrikkacheln .afn-rubrikkachel__titel {
	margin: 0;
	font-family: var(--afn-font-head, inherit);
	font-size: 1.1rem;
	font-weight: 700;
	line-height: 1.25;
}

.afn-rubrikkachel__titel a {
	color: var(--afn-ink, inherit);
	text-decoration: none;
}

.afn-rubrikkachel__pfeil {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 6px;
	background: var(--afn-accent, #0F6E6E);
	color: var(--afn-on-accent, #FFFFFF);
}

.afn-rubrikkachel__pfeil:hover {
	background: var(--afn-ink, #231F1C);
	color: var(--afn-paper, #FFFFFF);
}

.afn-rubrikkachel__text-beschreibung {
	margin: 0;
	font-size: 0.9rem;
	line-height: 1.6;
	color: var(--afn-ink-soft, #5B544C);
}

@media (max-width: 1019.98px) {
	.afn-rubrikkacheln {
		grid-template-columns: repeat(min(var(--afn-b-cols, 5), 3), minmax(0, 1fr));
	}
}

@media (max-width: 781.98px) {
	.afn-rubrikkacheln {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 479.98px) {
	.afn-rubrikkacheln {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (prefers-reduced-motion: reduce) {
	.afn-rubrikkachel,
	.afn-aufmacher__bild img,
	.afn-kachel__bild img {
		transition: none;
	}

	.afn-rubrikkachel:hover {
		transform: none;
	}
}

/* ---------------------------------------------------------- Datum, Widget-Bereich */
.afn-datum {
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: var(--afn-ink-soft, #5B544C);
}

.afn-widgetbereich .widget {
	margin-bottom: 44px;
}

.afn-widgetbereich .widget:last-child {
	margin-bottom: 0;
}

.afn-widgetbereich.is-mitlaufend .widget:last-child {
	position: sticky;
	top: calc(var(--afn-sticky-offset, 0px) + 20px);
}

/* Arabische Wurzeln in Titeln (د-ي-ن) nicht am Bindestrich umbrechen */
.afn-nobr {
	white-space: nowrap;
}


/* ==========================================================================
   1.6.0 – Anki-Zähler [afn_anki_count] und Newsletter-Archiv [afn_newsletter_archive]
   ========================================================================== */

/* Anki-Zähler: Fläche mit Akzentlinie, die Zahl groß */
.afn-anki-zaehler {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: .2em .5em;
	margin-block: 1.5rem;
	padding: 1rem 1.25rem;
	border-inline-start: 4px solid var(--afn-b-accent);
	border-radius: var(--afn-b-radius-sm);
	background-color: var(--afn-b-box);
	color: var(--afn-b-ink);
	line-height: 1.4;
}

.afn-anki-zaehler__text {
	font-weight: 600;
}

.afn-anki-zaehler__zahl {
	font-family: var(--afn-b-font-head);
	font-size: 1.6em;
	font-weight: 800;
	line-height: 1.1;
	color: var(--afn-b-accent);
	font-variant-numeric: tabular-nums;
}

/* Newsletter-Archiv: laufendes Jahr offen, frühere Jahre als Aufklappboxen; die Listen sehen aus wie die von MailPoet */
.afn-archiv {
	display: grid;
	gap: .9rem;
	margin-block: 1.5rem;
}

.afn-archiv > * {
	margin-block: 0;
}

.afn-archiv > .afn-archiv__jahr > h2.afn-archiv__kopf {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: .5em;
	margin: 0 0 .6em;
}

.afn-archiv__zahl {
	font-size: .85rem;
	font-weight: 500;
	letter-spacing: 0;
	text-transform: none;
	color: var(--afn-b-ink-soft);
}

.afn-archiv__kopf .afn-archiv__zahl {
	font-size: .5em;
}

.afn-archiv .wp-block-details > summary {
	font-size: 1.15em;
}

.afn-archiv .afn-archiv__jahr h3.afn-archiv__unterkopf {
	margin: 1.1rem 0 .5rem;
	font-size: 1.05rem;
	line-height: 1.3;
	color: var(--afn-b-ink-soft);
}

.afn-archiv .afn-archiv__jahr h3.afn-archiv__unterkopf:first-of-type {
	margin-top: 0;
}

.afn-archiv ul.mailpoet_archive {
	margin-block: 0 .5rem;
}

.afn-archiv ul.mailpoet_archive .mailpoet_archive_date {
	display: inline-block;
	min-width: 9.5em;
	font-variant-numeric: tabular-nums;
}

.afn-archiv__leer {
	color: var(--afn-b-ink-soft);
}

.afn-archiv__hinweis {
	padding: .6rem .9rem;
	border-inline-start: 4px solid var(--afn-b-warning);
	border-radius: var(--afn-b-radius-sm);
	background-color: var(--afn-b-box);
	font-size: .9em;
}

@media (max-width: 600px) {
	.afn-archiv ul.mailpoet_archive .mailpoet_archive_date {
		display: block;
		min-width: 0;
		margin-bottom: .15em;
	}
}
