/* ==========================================================================
   HB9AF – Komponenten-Styles (helles Vereins-Theme)
   Farben, Schriften und Abstände kommen aus theme.json (CSS-Variablen).
   ========================================================================== */

:root {
	--hb-base: var(--wp--preset--color--base, #f7f9fc);
	--hb-surface: var(--wp--preset--color--surface, #ffffff);
	--hb-surface-2: var(--wp--preset--color--surface-2, #eef2f7);
	--hb-line: var(--wp--preset--color--line, #d9e0ea);
	--hb-line-strong: var(--wp--preset--color--line-strong, #bfcad8);
	--hb-text: var(--wp--preset--color--contrast, #172033);
	--hb-text-soft: var(--wp--preset--color--text-soft, #3b4658);
	--hb-muted: var(--wp--preset--color--muted, #5b6779);
	--hb-faint: var(--wp--preset--color--faint, #5c6880);
	--hb-accent: var(--wp--preset--color--accent, #1b4f8a);
	--hb-accent-hover: var(--wp--preset--color--accent-hover, #123a68);
	--hb-accent-deep: var(--wp--preset--color--accent-deep, #e4edf8);
	--hb-accent-line: var(--wp--preset--color--accent-line, #b9cfe8);
	--hb-accent-ink: var(--wp--preset--color--accent-ink, #ffffff);
	--hb-highlight: var(--wp--preset--color--highlight, #5bb0e8);
	--hb-highlight-line: var(--wp--preset--color--highlight-line, #338ccb);
	--hb-highlight-soft: var(--wp--preset--color--highlight-soft, #dcedfb);
	--hb-highlight-ink: var(--wp--preset--color--highlight-ink, #0c2440);
	--hb-good: var(--wp--preset--color--good, #166534);
	--hb-fair: var(--wp--preset--color--fair, #9a3412);
	--hb-poor: var(--wp--preset--color--poor, #b91c1c);
	--hb-mono: var(--wp--preset--font-family--mono, ui-monospace, monospace);
	--hb-serif: var(--wp--preset--font-family--serif, Georgia, serif);
	--hb-sans: var(--wp--preset--font-family--sans, system-ui, sans-serif);
	--hb-r-s: 10px;
	--hb-r-m: 14px;
	--hb-r-l: 16px;
	--hb-shadow: 0 1px 2px rgba(23, 32, 51, 0.06), 0 4px 14px rgba(23, 32, 51, 0.05);
	color-scheme: light;
}

body { -webkit-font-smoothing: antialiased; }

.screen-reader-text {
	border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
	height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute !important;
	width: 1px; word-wrap: normal !important;
}

:where(a, button, input, select, textarea):focus-visible {
	outline: 2px solid var(--hb-accent);
	outline-offset: 2px;
}

/* ---------- Kopfzeile ---------- */
.hbaf-site-header { background: var(--hb-surface); border-bottom: 1px solid var(--hb-line); }
.hbaf-site-header-inner { min-height: 72px; gap: 10px 28px; padding-block: 10px; }
.hbaf-brand { gap: 12px; align-items: center; }
.hbaf-brand .wp-block-site-logo img { width: 48px; height: 48px; border-radius: 50%; }
.hbaf-brand-text > * { margin: 0; }
.hbaf-wordmark { font-family: var(--hb-serif); font-weight: 700; font-size: 1.5rem; line-height: 1; letter-spacing: 0.01em; }
.hbaf-wordmark a { color: var(--hb-text); text-decoration: none; }
.hbaf-wordmark a:hover { color: var(--hb-accent); text-decoration: none; }
.hbaf-tagline { font-size: 0.75rem; color: var(--hb-muted); margin-top: 3px !important; letter-spacing: 0.02em; }
.hbaf-nav { flex: 1 1 auto; gap: 4px 20px; justify-content: flex-end; }
.hbaf-nav .current-menu-item > a, .hbaf-nav [aria-current="page"] { color: var(--hb-accent); }
.hbaf-nav .wp-block-navigation-item__content { padding: 6px 0; border-bottom: 2px solid transparent; }
.hbaf-nav > .wp-block-navigation__container > .current-menu-item > .wp-block-navigation-item__content { border-bottom-color: var(--hb-highlight-line); }
.wp-block-navigation__responsive-container.is-menu-open {
	background: var(--hb-surface) !important; color: var(--hb-text) !important;
}
@media (min-width: 600px) {
	.hbaf-nav .wp-block-navigation__submenu-container {
		background: var(--hb-surface) !important; color: var(--hb-text) !important;
		border: 1px solid var(--hb-line) !important; border-radius: var(--hb-r-s);
		box-shadow: var(--hb-shadow); padding: 6px !important; min-width: 220px !important;
	}
	.hbaf-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
		padding: 8px 12px; border-radius: 8px; border-bottom: 0; color: var(--hb-text-soft); white-space: nowrap;
	}
	.hbaf-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover,
	.hbaf-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content:focus-visible {
		background: var(--hb-surface-2); color: var(--hb-accent);
	}
}
.hbaf-nav .wp-block-navigation__submenu-icon { color: var(--hb-muted); }
.hbaf-site-header-search .wp-block-search__button {
	width: 44px; height: 44px; padding: 0; margin: 0; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
	border: 1px solid var(--hb-line-strong); background: var(--hb-surface); color: var(--hb-text-soft);
}
.hbaf-site-header-search .wp-block-search__button:hover { border-color: var(--hb-accent); color: var(--hb-accent); }
.hbaf-site-header-search .wp-block-search__button svg { fill: currentColor; width: 20px; height: 20px; min-width: 0; min-height: 0; }
.hbaf-site-header-search .wp-block-search__input { border-radius: 22px; }

/* ---------- Hauptbereich ---------- */
.hbaf-main { padding-top: 2rem; padding-bottom: 3.5rem; }
.hbaf-main > * + * { margin-block-start: 2.5rem; }
.hbaf-page-title { margin-bottom: 0.5rem; }
.hbaf-section-title { font-size: var(--wp--preset--font-size--xl); margin-bottom: 0; }
.hbaf-main > .hbaf-section-title + * { margin-block-start: 1rem; }
.hbaf-eyebrow {
	font-family: var(--hb-sans) !important; font-size: 0.8125rem !important; font-weight: 600 !important;
	text-transform: uppercase; letter-spacing: 0.08em; color: var(--hb-accent) !important; margin: 0 0 0.75rem;
}
.hbaf-more { margin-top: 0.75rem !important; font-weight: 600; }

/* Meta-Zeile: Datum · Rubrik */
.hbaf-meta { gap: 6px 10px; font-family: var(--hb-mono); font-size: 0.8125rem; color: var(--hb-muted); }
.hbaf-meta > * { margin: 0; }
.hbaf-meta .wp-block-post-terms a { color: var(--hb-accent); }
.hbaf-meta > * + *::before { content: "·"; margin-right: 10px; color: var(--hb-faint); }

/* ---------- Startseite ---------- */
.hbaf-hero {
	background: var(--hb-surface); border: 1px solid var(--hb-line); border-radius: var(--hb-r-l);
	padding: clamp(28px, 4vw, 48px) clamp(20px, 4vw, 48px) !important; box-shadow: var(--hb-shadow);
	position: relative; overflow: hidden;
}
.hbaf-hero-columns { gap: 32px; margin: 0; }
.hbaf-hero-image { margin: 0; }
.hbaf-hero-image img { width: 100%; height: auto; border-radius: var(--hb-r-m); display: block; box-shadow: var(--hb-shadow); }
.hbaf-hero-title { font-size: clamp(1.9rem, 1.3rem + 2vw, 2.75rem) !important; font-weight: 700; line-height: 1.12; margin: 0 0 0.75rem; }
.hbaf-hero-lead { font-size: 1.125rem; color: var(--hb-text-soft); max-width: 60ch; margin: 0; }
.hbaf-hero-buttons { margin-top: 1.5rem !important; }
.hbaf-home { gap: 40px; }
.hbaf-home-main > * + * { margin-block-start: 1rem; }
.hbaf-aside > * + * { margin-block-start: 1rem; }

/* ---------- Startseite: neuester Beitrag als Aufmacher ---------- */
.hbaf-latest .wp-block-post-template { margin: 0; }
.hbaf-latest .wp-block-post {
	display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 0 32px; align-items: center;
	background: var(--hb-surface); border: 1px solid var(--hb-line); border-radius: var(--hb-r-l);
	box-shadow: var(--hb-shadow); overflow: hidden;
}
.hbaf-latest-image { margin: 0; height: 100%; }
.hbaf-latest-image img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; display: block; }
.hbaf-latest-image.hbaf-thumb-placeholder { border: 0; border-right: 1px solid var(--hb-line); }
.hbaf-latest-body { padding: 28px 32px 28px 0; }
.hbaf-latest-body > * { margin: 0; }
.hbaf-latest-body > * + * { margin-top: 12px; }
.hbaf-latest-title { font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem) !important; font-weight: 700; line-height: 1.2; }
.hbaf-latest-title a { color: var(--hb-text); }
.hbaf-latest-title a:hover { color: var(--hb-accent); }
.hbaf-latest-excerpt { color: var(--hb-text-soft); font-size: 1rem; }
.hbaf-latest-excerpt p { margin: 0; }
.hbaf-latest-excerpt .wp-block-post-excerpt__more-text { margin-top: 12px; }
.hbaf-latest-excerpt .wp-block-post-excerpt__more-link { font-weight: 600; }
.hbaf-latest .hbaf-eyebrow { margin: 0; }

/* ---------- Beitragskarten ---------- */
.hbaf-grid-query .wp-block-post-template { gap: 28px 24px; }
.hbaf-grid-query .wp-block-post { display: flex; flex-direction: column; gap: 10px; }
.hbaf-thumb img, .hbaf-thumb { border-radius: 12px; }
.hbaf-thumb { background: var(--hb-surface-2); }
.hbaf-thumb-placeholder {
	aspect-ratio: 16 / 9; margin: 0; display: flex; align-items: center; justify-content: center;
	border: 1px dashed var(--hb-line-strong);
}
.hbaf-thumb-placeholder a { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; text-decoration: none; }
.hbaf-thumb-placeholder-mark { font-family: var(--hb-serif); font-weight: 700; font-size: 1.25rem; color: var(--hb-faint); letter-spacing: 0.04em; }
.hbaf-card-title { font-size: 1.25rem !important; line-height: 1.3; margin: 0; }
.hbaf-card-title a { color: var(--hb-text); }
.hbaf-card-excerpt { font-size: 0.9375rem; color: var(--hb-text-soft); margin: 0; }
.hbaf-card-excerpt p { margin: 0; }

/* Pagination */
.hbaf-pagination { margin-top: 2rem; font-family: var(--hb-mono); font-size: 0.875rem; }
.hbaf-pagination a, .hbaf-pagination .page-numbers {
	padding: 8px 12px; border-radius: var(--hb-r-s); border: 1px solid var(--hb-line-strong);
	background: var(--hb-surface); color: var(--hb-text-soft); text-decoration: none;
}
.hbaf-pagination .current { background: var(--hb-accent); color: var(--hb-accent-ink); border-color: var(--hb-accent); }

/* ---------- Karten (Block-Stile) ---------- */
.is-style-hbaf-card {
	background: var(--hb-surface); border: 1px solid var(--hb-line); border-radius: var(--hb-r-m);
	padding: 18px !important; box-shadow: var(--hb-shadow);
}
.is-style-hbaf-card > * { margin-block: 0; }
.is-style-hbaf-card > * + * { margin-block-start: 10px; }
.is-style-hbaf-card-accent {
	background: var(--hb-accent-deep); border: 1px solid var(--hb-accent-line); border-radius: var(--hb-r-l);
	padding: 22px 24px !important;
}
.is-style-hbaf-card-accent > * { margin-block: 0; }
.is-style-hbaf-card-accent > * + * { margin-block-start: 10px; }
.hbaf-card-heading { font-family: var(--hb-sans) !important; font-size: 0.8125rem !important; font-weight: 600 !important; text-transform: uppercase; letter-spacing: 0.08em; color: var(--hb-muted); }
.wp-block-button.is-style-outline .wp-block-button__link {
	background: transparent; color: var(--hb-accent); border: 1px solid var(--hb-accent);
}
.wp-block-button.is-style-outline .wp-block-button__link:hover { background: var(--hb-accent-deep); color: var(--hb-accent-hover); }

/* DX-Cluster-Karte (Muster hb9af/dx-cluster) */
.hbaf-status-dot::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--hb-good); margin-right: 8px; vertical-align: 1px; }
.hbaf-small { font-size: 0.875rem; color: var(--hb-text-soft); }
.hbaf-dx-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 0.9375rem; }
.hbaf-dx-facts dt { color: var(--hb-muted); }
.hbaf-dx-facts dd { margin: 0; }
.hbaf-dx-facts code { font-family: var(--hb-mono); font-size: 0.875rem; background: var(--hb-surface-2); padding: 0.1em 0.4em; border-radius: 6px; }
.hbaf-dx-links { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.875rem; font-weight: 600; padding-top: 10px; border-top: 1px solid var(--hb-line); }

/* Suchfeld */
.wp-block-search__input, .wp-block-search .wp-block-search__inside-wrapper {
	background: var(--hb-surface); color: var(--hb-text); border-color: var(--hb-line-strong); border-radius: 22px;
}
.hbaf-search .wp-block-search__inside-wrapper { padding: 4px; border: 1px solid var(--hb-line-strong); }
.hbaf-search .wp-block-search__input { border: 0; background: transparent; padding: 8px 12px; min-height: 36px; }
.hbaf-search .wp-block-search__button { border-radius: 18px; background: var(--hb-accent); color: var(--hb-accent-ink); border: 0; padding: 0 14px; }

/* ---------- Chips ---------- */
.hbaf-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.hbaf-chips a, .is-style-hbaf-chips a {
	display: inline-block; padding: 8px 14px; border-radius: 999px;
	background: var(--hb-surface); border: 1px solid var(--hb-line-strong);
	color: var(--hb-text-soft); font-size: 0.875rem; text-decoration: none;
}
.hbaf-chips a:hover, .is-style-hbaf-chips a:hover { border-color: var(--hb-accent); color: var(--hb-accent); text-decoration: none; }
.is-style-hbaf-chips .wp-block-post-terms__separator { display: none; }
.is-style-hbaf-chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Artikel ---------- */
.hbaf-article > * + * { margin-block-start: 1rem; }
.hbaf-article-title, .hbaf-page-title.wp-block-post-title { font-size: var(--wp--preset--font-size--xxxl) !important; font-weight: 700; line-height: 1.12; margin: 0.5rem 0 0.5rem; }
.hbaf-byline { gap: 8px; color: var(--hb-muted); font-size: 0.875rem; margin-bottom: 0.5rem; }
.hbaf-byline > * { margin: 0; }
.hbaf-article-image img { border-radius: var(--hb-r-l); }
.hbaf-prose { font-family: var(--hb-serif); font-size: 1.125rem; line-height: 1.7; color: var(--hb-text); }
.hbaf-prose :where(h2, h3, h4) { margin-top: 2.25rem; }
.hbaf-prose :where(ul, ol) { padding-left: 1.4em; }
.hbaf-prose :where(table) { font-family: var(--hb-sans); font-size: 0.9375rem; }
.hbaf-prose :where(code, kbd) { font-family: var(--hb-mono); font-size: 0.875em; background: var(--hb-surface-2); padding: 0.1em 0.35em; border-radius: 6px; }
.hbaf-prose :where(figcaption) { font-family: var(--hb-sans); }
/* Links im Fliesstext dauerhaft unterstrichen (WCAG 1.4.1), nicht in Knöpfen, Karten oder Plugin-Ausgaben. */
.wp-block-post-content > :is(p, ul, ol, blockquote, .wp-block-quote, .wp-block-table, .wp-block-details) a:not(.wp-block-button__link),
.wp-block-post-content > figure figcaption a,
.wp-block-post-content > :is(.wp-block-group, .wp-block-columns, .wp-block-media-text) :is(p, li, figcaption, td) a:not(.wp-block-button__link),
.wp-block-comment-content a {
	text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em;
	text-decoration-color: color-mix(in srgb, currentColor 50%, transparent);
}
.wp-block-post-content > :is(p, ul, ol, blockquote, .wp-block-quote, .wp-block-table, .wp-block-details) a:not(.wp-block-button__link):hover,
.wp-block-comment-content a:hover { text-decoration-color: currentColor; text-decoration-thickness: 2px; }
.hbaf-tags { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--hb-line); }
.hbaf-postnav { gap: 16px; margin-top: 1.5rem; }
.hbaf-postnav > div:empty { display: none; }
.hbaf-postnav > div {
	padding: 18px; border-radius: var(--hb-r-m); background: var(--hb-surface); border: 1px solid var(--hb-line);
	font-family: var(--hb-serif); font-weight: 600;
}
.hbaf-postnav .post-navigation-link__label { display: block; font-family: var(--hb-sans); font-weight: 400; font-size: 0.8125rem; color: var(--hb-muted); }
.hbaf-comments { margin-top: 3rem; border-top: 1px solid var(--hb-line); padding-top: 1.5rem; }

/* ---------- Formulare ---------- */
input[type="text"], input[type="email"], input[type="url"], input[type="search"], input[type="number"],
input[type="tel"], input[type="password"], select, textarea {
	background: var(--hb-surface); color: var(--hb-text);
	border: 1px solid var(--hb-line-strong); border-radius: var(--hb-r-s); padding: 10px 12px; font: inherit;
}
input::placeholder, textarea::placeholder { color: var(--hb-muted); opacity: 1; }
input[type="submit"], button[type="submit"] {
	background: var(--hb-accent); color: var(--hb-accent-ink); border: 0; border-radius: 999px; padding: 12px 20px; font-weight: 600; cursor: pointer;
}

/* ---------- Fusszeile ---------- */
.hbaf-site-footer { background: var(--hb-surface); border-top: 1px solid var(--hb-line); padding-top: 24px; padding-bottom: 24px; color: var(--hb-muted); font-size: 0.875rem; }
.hbaf-site-footer p { margin: 0; }
.hbaf-site-footer-brand { gap: 12px; align-items: center; }
.hbaf-site-footer-brand img { width: 32px; height: 32px; border-radius: 50%; }
.hbaf-site-footer-links { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }
.hbaf-version { font-family: var(--hb-mono); font-size: 0.75rem; color: var(--hb-faint); }

/* ==========================================================================
   Eigene Plugins im Theme-Look
   ========================================================================== */

/* HB9AF Events (hb9af-events ≥ 1.1): Plugin arbeitet mit Variablen, hier nur Theme-Werte.
   «Läuft» kräftig himmelblau mit Rahmen, «Bestätigt» hell himmelblau, Titel in der Serifenschrift. */
.hb9af-events {
	--hbev-surface: var(--hb-surface);
	--hbev-surface-2: var(--hb-surface-2);
	--hbev-line: var(--hb-line);
	--hbev-text: var(--hb-text);
	--hbev-muted: var(--hb-muted);
	--hbev-accent: var(--hb-accent);
	--hbev-accent-ink: var(--hb-accent-ink);
	--hbev-live: var(--hb-highlight);
	--hbev-live-ink: var(--hb-highlight-ink);
	--hbev-good-bg: var(--hb-highlight-soft);
	--hbev-good: var(--hb-accent-hover);
	--hbev-bad-bg: #fbe5e5;
	--hbev-bad: var(--hb-poor);
	--hbev-radius: var(--hb-r-m);
	--hbev-shadow: var(--hb-shadow);
}
.hb9af-events__title { font-family: var(--hb-serif); font-size: 1.2rem; }
.hb9af-events__year { font-size: var(--wp--preset--font-size--xl); }
.hb9af-events__btn:hover { filter: none; background: var(--hb-accent-hover); border-color: var(--hb-accent-hover); }
.hb9af-events__btn--secondary:hover { background: var(--hb-accent-deep); color: var(--hb-accent-hover); }
/* Im Fliesstext (Seite «Event-Kalender», Event-Seite): Plugin-Ausgabe in der Grundschrift, Liste ohne Einzug */
.hbaf-prose .hb9af-events { font-family: var(--hb-sans); font-size: 1rem; line-height: 1.55; }
.hbaf-prose .hb9af-events .hb9af-events__list { padding-left: 0; }
.hbaf-prose .hb9af-events .hb9af-events__title { font-family: var(--hb-serif); }
.hbaf-eyebrow a { color: inherit; text-decoration: none; }
.hbaf-eyebrow a:hover { text-decoration: underline; }

/* HB9AF Members (hb9af-members): Rollen-Badge in Primärfarbe, Karten wie Block-Stil «Karte» */
.hb9af-members__card { border-color: var(--hb-line); box-shadow: var(--hb-shadow); border-radius: var(--hb-r-m); }
.hb9af-members__role { background: var(--hb-accent); color: var(--hb-accent-ink); }
.hb9af-members__callsign { font-family: var(--hb-mono); color: var(--hb-accent); }
.hb9af-members__photo--placeholder { background: var(--hb-surface-2); color: var(--hb-muted); }

/* Solar-Widget (funkwelt-solar-widget): helles Plugin, nur Rahmen und Schrift angleichen */
.fw-solar-widget { border-color: var(--hb-line) !important; border-radius: var(--hb-r-s) !important; font-family: var(--hb-sans) !important; box-shadow: none !important; }
.is-style-hbaf-card .fw-solar-widget { border: 0 !important; }

/* ---------- Mobil ---------- */
@media (max-width: 781px) {
	.hbaf-home { gap: 24px; }
	.hbaf-latest .wp-block-post { grid-template-columns: 1fr; }
	.hbaf-latest-image { aspect-ratio: 16 / 9; }
	.hbaf-latest-body { padding: 20px; }
	.hbaf-site-header-inner { padding-block: 8px; gap: 8px 16px; min-height: 0; }
	.hbaf-brand .wp-block-site-logo img { width: 40px; height: 40px; }
	.hbaf-nav { justify-content: flex-start; }
}
@media (max-width: 599px) {
	.hbaf-site-header-inner { flex-wrap: nowrap !important; gap: 8px 10px; }
	.hbaf-brand { gap: 8px; min-width: 0; }
	.hbaf-wordmark { font-size: 1.25rem; }
	.hbaf-tagline { display: none; }
	.hbaf-site-header-search .wp-block-search__button { width: 40px; height: 40px; }
	/* Geöffnete Suche nimmt die ganze Zeile */
	.hbaf-site-header-inner:has(.hbaf-site-header-search:not(.wp-block-search__searchfield-hidden)) > :is(.hbaf-brand, .hbaf-nav) { display: none; }
	.hbaf-site-header-search:not(.wp-block-search__searchfield-hidden) { flex: 1 1 auto; }
	.hbaf-site-header-search:not(.wp-block-search__searchfield-hidden) .wp-block-search__inside-wrapper { width: 100% !important; }
	.hbaf-site-header-search:not(.wp-block-search__searchfield-hidden) .wp-block-search__input { flex: 1 1 auto !important; min-width: 0; width: auto !important; }
}
