/*
 * Main stylesheet (front end + editor via add_editor_style).
 *
 * theme.json is the single source of truth for design tokens. WordPress
 * outputs them as --wp--preset--* / --wp--custom--* properties; the short
 * aliases below mirror them for use in this file. Change values in
 * theme.json, not here.
 *
 * The brigade's design: dark top bar, light header with the text logo left
 * and the navigation right, pages in a narrow column, dark footer. Each step
 * (reports, photos, Termine, the start page, …) adds the rules of its own
 * templates.
 */

/* ---------- Tokens (mirrors of theme.json) ---------- */
:root {
	--color-base: var(--wp--preset--color--base);
	--color-surface: var(--wp--preset--color--surface);
	--color-border: var(--wp--preset--color--border);
	--color-muted: var(--wp--preset--color--muted);
	--color-contrast: var(--wp--preset--color--contrast);
	--color-primary: var(--wp--preset--color--primary);
	--color-primary-dark: var(--wp--preset--color--primary-dark);
	--color-dark: var(--wp--preset--color--dark);

	--font-sans: var(--wp--preset--font-family--sans);
	--font-mono: var(--wp--preset--font-family--mono);

	--text-sm: var(--wp--preset--font-size--small);
	--text-md: var(--wp--preset--font-size--medium);
	--text-lg: var(--wp--preset--font-size--large);
	--text-xl: var(--wp--preset--font-size--x-large);
	--text-2xl: var(--wp--preset--font-size--xx-large);

	--space-xs: var(--wp--preset--spacing--20);
	--space-s: var(--wp--preset--spacing--30);
	--space-m: var(--wp--preset--spacing--40);
	--space-l: var(--wp--preset--spacing--50);
	--space-xl: var(--wp--preset--spacing--60);
	--space-2xl: var(--wp--preset--spacing--70);

	--content-size: var(--wp--style--global--content-size, 46rem);
	--wide-size: var(--wp--style--global--wide-size, 80rem);
	--gutter: var(--wp--custom--gutter);
	--radius: var(--wp--custom--radius);
	--shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 4px 16px rgb(0 0 0 / 0.07);
	--shadow-hover: 0 2px 4px rgb(0 0 0 / 0.08), 0 10px 28px rgb(0 0 0 / 0.12);
	--focus-color: var(--color-contrast);
	--target-min: 2.75rem;
}

/* ---------- Reset (small) ---------- */
*,
*::before,
*::after {
	box-sizing: border-box;
}

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd {
	margin: 0;
}

/*
 * Root size grows from 16px (up to 1280px wide) to 20px at 2560px and 24px at
 * 3840px and wider, so everything sized in rem (text, widths, spacing) scales
 * together on large screens. Phones and tablets are unaffected. The value is in
 * theme.json (custom.root-font-size).
 */
html {
	font-size: var(--wp--custom--root-font-size, 100%);
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	min-height: 100vh;
	font-family: var(--font-sans);
	font-size: var(--text-md);
	line-height: var(--wp--custom--line-height--body);
	color: var(--color-contrast);
	background: var(--color-base);
	-webkit-font-smoothing: antialiased;
}

img,
picture,
video,
svg {
	display: block;
	max-width: 100%;
	height: auto;
}

input,
button,
textarea,
select {
	font: inherit;
}

a {
	color: var(--color-primary);
	text-underline-offset: 0.15em;
}

a:hover {
	color: var(--color-primary-dark);
}

[hidden] {
	display: none !important;
}

/*
 * Visible focus everywhere: dark ring with a white halo; on the dark top bar and footer a white ring
 * (--focus-color set there). The colour is read here, not in a :root shorthand, so it follows the section.
 */
:focus-visible {
	outline: 3px solid var(--focus-color);
	outline-offset: 2px;
	box-shadow: 0 0 0 5px var(--color-base);
}

.icon {
	flex: none;
	width: 1.125em;
	height: 1.125em;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* ---------- Accessibility helpers ---------- */
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	top: var(--space-xs);
	left: var(--space-xs);
	z-index: 1000;
	padding: var(--space-xs) var(--space-s);
	color: var(--color-base);
	background: var(--color-contrast);
	border-radius: var(--radius);
	transform: translateY(-200%);
}

.skip-link:focus {
	color: var(--color-base);
	transform: none;
}

.site-main:focus {
	outline: none;
	box-shadow: none;
}

/* ---------- Layout ---------- */
.container {
	width: 100%;
	max-width: calc(var(--wide-size) + 2 * var(--gutter));
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.container--narrow {
	max-width: calc(var(--content-size) + 2 * var(--gutter));
}

/*
 * Footer stays at the bottom on short pages. Scoped with :has() so it doesn't
 * apply in the block editor, where this file's `body` maps to the canvas.
 */
body:has(> .site-footer) {
	display: flex;
	flex-direction: column;
}

.site-main {
	display: block;
	flex: 1 0 auto;
	padding-block: var(--space-l) var(--space-xl);
}

/* The start page's sections bring their own spacing; the last one (Warnungen, grey) meets the footer. */
.home .site-main {
	padding-block: 0;
}

.page-header {
	margin-bottom: var(--space-l);
}

.page-header > * + * {
	margin-top: var(--space-xs);
}

.page-title,
.entry-title {
	font-size: var(--text-2xl);
	font-weight: 700;
	line-height: var(--wp--custom--line-height--heading);
	overflow-wrap: break-word;
	hyphens: auto;
}

.page-description {
	color: var(--color-muted);
}

/* "Aktuelle Berichte" above a report's or an archive's title, as a link back. */
.page-kicker {
	margin-bottom: var(--space-xs);
	font-size: var(--text-sm);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.page-kicker a {
	color: var(--color-primary);
	text-decoration: none;
}

.page-kicker a:hover {
	text-decoration: underline;
}

.notice-box {
	margin-block: var(--space-m);
	padding: var(--space-s) var(--space-m);
	background: var(--color-surface);
	border-left: 4px solid var(--color-primary);
	border-radius: var(--radius);
}

/* The start page's sections: a centred title with a short red line under it, a centred button after the content. */
.section {
	padding-block: var(--space-xl);
}

/* The Mannschaft's sections and the Feuerwehrjugend's contact people: less space, none below. */
.section--compact {
	padding-block: var(--space-l) 0;
}

/* The Feuerwehrjugend's reports on the surface colour. */
.section--surface {
	background: var(--color-surface);
}

.section-title {
	margin-bottom: var(--space-l);
	font-size: var(--text-xl);
	font-weight: 700;
	text-align: center;
}

.section-title::after {
	display: block;
	width: 3rem;
	height: 4px;
	margin: var(--space-xs) auto 0;
	content: "";
	background: var(--color-primary);
	border-radius: 2px;
}

.section-actions {
	margin-top: var(--space-l);
	text-align: center;
}

/* ---------- Buttons ---------- */
.button,
.wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-xs);
	min-height: var(--target-min);
	padding: 0.625rem 1.5rem;
	font-weight: 600;
	color: var(--color-base);
	text-decoration: none;
	background: var(--color-primary);
	border: 2px solid var(--color-primary);
	border-radius: var(--radius);
	cursor: pointer;
}

.button:hover,
.wp-block-button__link:hover {
	color: var(--color-base);
	background: var(--color-primary-dark);
	border-color: var(--color-primary-dark);
}

.button--outline {
	color: var(--color-primary);
	background: transparent;
}

.button--outline:hover {
	color: var(--color-base);
}

/* On the red "Mitglied werden" section. */
.button--light {
	color: var(--color-primary-dark);
	background: var(--color-base);
	border-color: var(--color-base);
}

.button--light:hover {
	color: var(--color-base);
	background: transparent;
	border-color: var(--color-base);
}

.link-arrow {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	min-height: 1.5rem;
	font-weight: 600;
	text-decoration: none;
}

.link-arrow:hover {
	text-decoration: underline;
}

/* ---------- Top bar ---------- */
.top-bar {
	font-size: var(--text-sm);
	color: var(--color-base);
	background: var(--color-dark);
	--focus-color: var(--color-base);
}

.top-bar :focus-visible {
	box-shadow: none;
}

.top-bar__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 0 var(--space-s);
	margin: 0;
	padding: 0;
	list-style: none;
}

.top-bar a {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	min-height: var(--target-min);
	padding-inline: 0.25rem;
	color: inherit;
	text-decoration: none;
}

.top-bar a:hover span {
	text-decoration: underline;
}

.top-bar__social a {
	min-width: var(--target-min);
	justify-content: center;
}

/* Small screens: social links as icons, the label stays for screen readers. */
@media (max-width: 47.999em) {
	.top-bar__label {
		position: absolute !important;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
	}

	.top-bar__list {
		gap: 0 0.35rem;
	}

	.top-bar__list .icon {
		display: none;
	}

	.top-bar__list .top-bar__social .icon {
		display: block;
	}
}

/* The narrowest phones (360 px, most Android phones): top bar and header stay on one line each. */
@media (max-width: 24.999em) {
	.top-bar__list {
		gap: 0 0.15rem;
	}

	.top-bar__social a {
		min-width: 2rem;
		padding-inline: 0;
	}
}

/* ---------- Header & navigation ---------- */
.site-header {
	position: relative;
	z-index: 50;
	background: var(--color-base);
	box-shadow: 0 1px 0 var(--color-border), 0 4px 14px rgb(0 0 0 / 0.04);
}

.site-header__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-s);
	min-height: 4.75rem;
	padding-block: var(--space-xs);
}

/* Logo: the brigade's Wappen (assets/images/wappen.svg) and the organisation's name in two lines. */
.site-logo {
	display: inline-flex;
	align-items: center;
	gap: 0.75rem;
	min-height: var(--target-min);
	color: var(--color-contrast);
	text-decoration: none;
}

.site-logo:hover {
	color: var(--color-contrast);
}

.site-logo__mark {
	display: block;
	flex: none;
	width: auto;
	height: 3rem;
}

.site-logo__text {
	display: flex;
	flex-direction: column;
	line-height: 1.15;
}

.site-logo__line1 {
	font-size: 0.75rem;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--color-muted);
}

.site-logo__line2 {
	font-size: 1.25rem;
	font-weight: 700;
}

.site-nav__menu,
.site-nav__menu .sub-menu,
.footer-nav__menu {
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-nav__menu a,
.site-nav__toggle-sub--label {
	display: flex;
	align-items: center;
	min-height: var(--target-min);
	padding: 0.5rem 0.75rem;
	font-weight: 500;
	color: var(--color-contrast);
	text-decoration: none;
	border-radius: var(--radius);
}

.site-nav__menu a:hover,
.site-nav__toggle-sub:hover {
	color: var(--color-primary);
}

.site-nav__menu .current-menu-item > a,
.site-nav__menu .current_page_item > a,
.site-nav__menu .current-menu-ancestor > a,
.site-nav__menu .current-menu-ancestor > .site-nav__toggle-sub--label,
.site-nav__menu .current-menu-parent > .site-nav__toggle-sub--label {
	color: var(--color-primary);
	font-weight: 600;
}

/* The label reserves the width of its bold form (inc/navigation.php nav_label()): no shift when the page changes. */
.site-nav__label {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
}

.site-nav__label::after {
	height: 0;
	overflow: hidden;
	font-weight: 600;
	visibility: hidden;
	content: attr(data-label);
	pointer-events: none;
	user-select: none;
}

.site-nav__toggle-sub {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.25rem;
	min-width: var(--target-min);
	min-height: var(--target-min);
	padding: 0.5rem;
	color: var(--color-contrast);
	background: transparent;
	border: 0;
	border-radius: var(--radius);
	cursor: pointer;
}

.site-nav__toggle-sub--label {
	padding-right: 0.5rem;
	font-family: inherit;
}

.site-nav__chevron {
	transition: transform 0.15s ease;
}

.site-nav__toggle-sub[aria-expanded="true"] .site-nav__chevron {
	transform: rotate(180deg);
}

.site-nav__toggle {
	display: inline-flex;
	align-items: center;
	gap: var(--space-xs);
	min-height: var(--target-min);
	padding: 0.5rem 1rem;
	font-weight: 600;
	color: var(--color-contrast);
	background: transparent;
	border: 2px solid var(--color-border);
	border-radius: var(--radius);
	cursor: pointer;
}

@media (max-width: 24.999em) {
	.site-header__inner {
		flex-wrap: nowrap;
		gap: var(--space-xs);
	}

	.site-logo {
		gap: 0.5rem;
	}

	.site-logo__mark {
		height: 2.5rem;
	}

	.site-logo__line1 {
		font-size: 0.625rem;
	}

	.site-logo__line2 {
		font-size: 1.05rem;
	}

	.site-nav__toggle {
		padding-inline: 0.6rem;
	}
}

.site-nav__toggle-icon,
.site-nav__toggle-icon::before,
.site-nav__toggle-icon::after {
	display: block;
	width: 1.125rem;
	height: 2px;
	background: currentColor;
}

.site-nav__toggle-icon {
	position: relative;
}

.site-nav__toggle-icon::before,
.site-nav__toggle-icon::after {
	position: absolute;
	content: "";
}

.site-nav__toggle-icon::before {
	top: -6px;
}

.site-nav__toggle-icon::after {
	top: 6px;
}

.site-nav__toggle[aria-expanded="true"] .site-nav__toggle-icon {
	background: transparent;
}

.site-nav__toggle[aria-expanded="true"] .site-nav__toggle-icon::before {
	top: 0;
	transform: rotate(45deg);
}

.site-nav__toggle[aria-expanded="true"] .site-nav__toggle-icon::after {
	top: 0;
	transform: rotate(-45deg);
}

/* Mobile and tablet: collapsed menu (only when JS runs; without JS the full menu shows). */
@media (max-width: 63.999em) {
	html:not(.js) .site-nav {
		flex-basis: 100%;
	}

	.js .site-nav__menu {
		display: none;
	}

	.js .site-nav__toggle[aria-expanded="true"] + .site-nav__menu {
		position: absolute;
		top: 100%;
		inset-inline: 0;
		z-index: 100;
		display: block;
		max-height: calc(100vh - 8rem);
		overflow-y: auto;
		padding: var(--space-xs) var(--gutter) var(--space-s);
		background: var(--color-base);
		border-top: 1px solid var(--color-border);
		box-shadow: 0 12px 24px rgb(0 0 0 / 0.12);
	}

	.site-nav__menu > li {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		border-bottom: 1px solid var(--color-border);
	}

	.site-nav__menu > li > a {
		flex: 1;
	}

	.site-nav__menu .sub-menu {
		flex-basis: 100%;
		padding: 0 0 var(--space-xs) var(--space-s);
	}

	.js .site-nav__menu .sub-menu {
		display: none;
	}

	.js .site-nav__toggle-sub[aria-expanded="true"] + .sub-menu {
		display: block;
	}

	.site-nav__toggle-sub--label {
		flex: 1;
		justify-content: space-between;
		padding-left: 0.75rem;
	}
}

/* Desktop: horizontal menu, submenus on click/keyboard (JS) and hover/focus (CSS fallback). */
@media (min-width: 64em) {
	.site-nav__toggle {
		display: none;
	}

	.site-nav__menu {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 0.15rem;
	}

	.site-nav__menu > li {
		position: relative;
		display: flex;
		align-items: center;
	}

	.site-nav__menu .sub-menu {
		position: absolute;
		top: 100%;
		left: 0;
		z-index: 100;
		display: none;
		min-width: 14rem;
		padding: var(--space-xs);
		background: var(--color-base);
		border: 1px solid var(--color-border);
		border-top: 3px solid var(--color-primary);
		border-radius: 0 0 var(--radius) var(--radius);
		box-shadow: var(--shadow-hover);
	}

	.site-nav__toggle-sub[aria-expanded="true"] + .sub-menu,
	html:not(.js) .site-nav__menu li:hover > .sub-menu,
	html:not(.js) .site-nav__menu li:focus-within > .sub-menu {
		display: block;
	}
}

/* ---------- Entries (pages and single reports) ---------- */
.entry-header,
.entry-content > *,
.entry-album,
.share,
.post-navigation {
	max-width: var(--content-size);
	margin-inline: auto;
}

.entry-header,
.entry-content,
.entry-album,
.share {
	padding-inline: var(--gutter);
}

.entry-header {
	/* Padding outside the max-width, so the title lines up with .entry-content > *. */
	box-sizing: content-box;
	margin-bottom: var(--space-l);
}

.container .entry-content {
	padding-inline: 0;
}

/* A report's album in the Fotogalerie (single.php), under the share links. */
.entry-album {
	box-sizing: content-box;
	margin-top: var(--space-l);
}

/* A page's own text above its layout (template-parts/page-intro.php). */
.entry-content--intro {
	margin-bottom: var(--space-l);
}

.entry-content--intro > * {
	margin-inline: 0;
}

/* Block editor: same gap under the post title as .entry-header on the front end. */
.editor-post-title {
	margin-bottom: var(--space-l);
}

/* A report's date and categories. */
.entry-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1rem;
	margin-top: var(--space-xs);
	font-size: var(--text-sm);
	color: var(--color-muted);
}

.entry-meta__item {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
}

/* A report's title photo, when its text doesn't show it (single.php). */
.entry-hero {
	box-sizing: content-box;
	max-width: var(--content-size);
	margin: 0 auto var(--space-l);
	padding-inline: var(--gutter);
}

.entry-hero.alignwide {
	max-width: var(--wide-size);
}

.entry-hero img {
	width: 100%;
	border-radius: var(--radius);
}

/* A vehicle's photo (single-ff_fahrzeug.php): shown whole at its own size, centred. */
.entry-hero--contain img {
	width: auto;
	margin-inline: auto;
}

.entry-content > * + * {
	margin-top: var(--wp--style--block-gap, var(--space-s));
}

.entry-content :is(h2, h3, h4) {
	margin-top: var(--space-l);
	line-height: var(--wp--custom--line-height--heading);
}

.entry-content :is(ul, ol) {
	padding-left: 1.25rem;
}

.entry-content a {
	overflow-wrap: anywhere;
}

/* What a block of the site says in the block editor while its data is missing (blocks/spende-qr). */
.ff-placeholder {
	padding: var(--space-s) var(--space-m);
	color: #4a3b00;
	background: #fff8db;
	border: 2px dashed #b08900;
	border-radius: var(--radius);
}

/* "Einleitung" (the platform's lead paragraph; the old site's class entry-lead). */
.is-style-einleitung {
	font-size: var(--text-lg);
}

/* "Hinweis" (the platform's notice group): a highlighted box. */
.wp-block-group.is-style-hinweis {
	padding: var(--space-m);
	background: var(--color-surface);
	border-left: 4px solid var(--color-primary);
	border-radius: var(--radius);
}

.wp-block-group.is-style-hinweis > :first-child {
	margin-top: 0;
}

.wp-block-group.is-style-hinweis > :last-child {
	margin-bottom: 0;
}

/* Tiles with an icon (Columns block "feature-tiles", column style "Symbol: …"). */
.wp-block-columns.feature-tiles {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
	gap: var(--space-m);
}

.feature-tiles > .wp-block-column {
	padding: var(--space-m);
	text-align: center;
	background: var(--color-surface);
	border-radius: var(--radius);
}

.feature-tiles > .wp-block-column > * + * {
	margin-top: var(--space-xs);
}

.feature-tiles :is(h2, h3, h4) {
	margin-top: 0;
	font-size: var(--text-md);
}

.feature-tiles p {
	font-size: var(--text-sm);
	color: var(--color-muted);
}

[class*="is-style-ff-icon-"]::before {
	display: block;
	width: 3rem;
	height: 3rem;
	margin: 0 auto var(--space-s);
	content: "";
	background: var(--color-primary);
	mask: var(--ff-icon) center / contain no-repeat;
}

.is-style-ff-icon-helm {
	--ff-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3C7.3 3 4 6.6 4 11.5V14H2v2.5h20V14h-2v-2.5C20 6.6 16.7 3 12 3zm-1 2.1v6.4h2V5.1c2.9.5 5 3.1 5 6.4V14H6v-2.5c0-3.3 2.1-5.9 5-6.4zM4.5 18h15L18 21H6z'/%3E%3C/svg%3E");
}

.is-style-ff-icon-zelt {
	--ff-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M10.3 2.5 12 5.3l1.7-2.8 1.7 1-2.2 3.7L22 21H2l8.8-13.8-2.2-3.7zM12 9.8 5.6 19H9l3-5 3 5h3.4z'/%3E%3C/svg%3E");
}

.is-style-ff-icon-erste-hilfe {
	--ff-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M9 3h6a1 1 0 0 1 1 1v2h4a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4V4a1 1 0 0 1 1-1zm1 2v1h4V5zm1 5v3H8v2h3v3h2v-3h3v-2h-3v-3z'/%3E%3C/svg%3E");
}

.is-style-ff-icon-team {
	--ff-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 4a3 3 0 1 1 0 6 3 3 0 0 1 0-6zM5.5 6.5a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5zm13 0a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5zM12 12c3.3 0 6 1.8 6 4v3H6v-3c0-2.2 2.7-4 6-4zm-7.2 1.2A5.6 5.6 0 0 0 4.5 16v3H1v-2.6c0-1.6 1.6-2.9 3.8-3.2zm14.4 0c2.2.3 3.8 1.6 3.8 3.2V19h-3.5v-3a5.6 5.6 0 0 0-.3-2.8z'/%3E%3C/svg%3E");
}

.wp-block-image img {
	border-radius: var(--radius);
}

.wp-block-image figcaption,
.wp-element-caption {
	margin-top: 0.35rem;
	font-size: var(--text-sm);
	color: var(--color-muted);
}

/*
 * Report galleries (the step "Fotos" and the Baustein "Fotos"): the title photo large, the others in an even
 * grid of three (two on phones); the photo count decides the layout so the last row is always full. This is the
 * old site's default style "Titelfoto + Raster", the only one stored galleries use (inc/galleries.php). Counting
 * uses *-of-type, so a caption doesn't count.
 */
.wp-block-gallery.has-nested-images {
	--ff-gap: 0.5rem;
	display: grid !important;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--ff-gap) !important;
}

.entry-content .wp-block-gallery.has-nested-images {
	max-width: var(--wide-size);
}

.wp-block-gallery.has-nested-images figure.wp-block-image {
	position: relative;
	width: auto !important;
	margin: 0 !important;
	overflow: hidden;
	background: var(--color-surface);
	border-radius: var(--radius);
	aspect-ratio: 4 / 3;
}

.wp-block-gallery.has-nested-images figure.wp-block-image > a,
.wp-block-gallery.has-nested-images figure.wp-block-image > img,
.wp-block-gallery.has-nested-images figure.wp-block-image > a > img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100% !important;
	height: 100% !important;
	border-radius: 0;
	object-fit: cover;
}

.wp-block-gallery.has-nested-images figure.wp-block-image > a > img {
	position: static;
	transition: transform 0.3s ease;
}

.wp-block-gallery.has-nested-images figure.wp-block-image > a:hover > img {
	transform: scale(1.03);
}

.wp-block-gallery.has-nested-images figure.wp-block-image > a:focus-visible {
	outline-offset: -3px;
	box-shadow: inset 0 0 0 5px var(--color-base);
}

.wp-block-gallery.has-nested-images:not(.is-cropped) figure.wp-block-image img {
	object-fit: contain;
}

.wp-block-gallery.has-nested-images > figure:first-of-type,
.wp-block-gallery.has-nested-images > figure:last-of-type:nth-of-type(even) {
	grid-column: 1 / -1;
	aspect-ratio: 3 / 2;
}

@media (min-width: 40em) {
	.wp-block-gallery.has-nested-images {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.wp-block-gallery.has-nested-images > figure:last-of-type:nth-of-type(even) {
		grid-column: auto;
		aspect-ratio: 4 / 3;
	}

	/* Lead 2×2 with two photos beside it; then rows of three (count ≡ 0 mod 3). */
	.wp-block-gallery.has-nested-images > figure:first-of-type {
		grid-column: span 2;
		grid-row: span 2;
		aspect-ratio: auto;
	}

	/* Count ≡ 1 mod 3 (4, 7, 10 …): lead across the full width instead. */
	.wp-block-gallery.has-nested-images > figure:first-of-type:nth-last-of-type(3n+4) {
		grid-column: 1 / -1;
		grid-row: auto;
		aspect-ratio: 2 / 1;
	}

	/* Count ≡ 2 mod 3 (5, 8, 11 …): the last photo takes two cells. */
	.wp-block-gallery.has-nested-images > figure:last-of-type:nth-of-type(3n+5) {
		grid-column: span 2;
		aspect-ratio: auto;
	}

	/* Two photos: side by side. */
	.wp-block-gallery.has-nested-images:has(> figure:first-of-type:nth-last-of-type(2)) {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.wp-block-gallery.has-nested-images > figure:first-of-type:nth-last-of-type(2) {
		grid-column: auto;
		grid-row: auto;
		aspect-ratio: 4 / 3;
	}
}

/* A single photo: full width, the whole photo up to 80% of the screen height. */
.wp-block-gallery.has-nested-images > figure.wp-block-image:first-of-type:last-of-type {
	grid-column: 1 / -1;
	grid-row: auto;
	max-height: 80vh;
	aspect-ratio: var(--ff-ar, 3 / 2);
}

/* Long galleries: the first photos and a button (main.js adds .is-collapsed). Phones: the lead and eight. */
.wp-block-gallery.has-nested-images.is-collapsed > figure.wp-block-image:nth-of-type(n+10) {
	display: none;
}

@media (min-width: 40em) {
	/* Twelve: the lead (2 × 2) with two beside it, then three rows of three, whatever the full count is. */
	.wp-block-gallery.has-nested-images.is-collapsed > figure.wp-block-image:nth-of-type(n+10) {
		display: block;
	}

	.wp-block-gallery.has-nested-images.is-collapsed > figure.wp-block-image:nth-of-type(n+13) {
		display: none;
	}

	.wp-block-gallery.has-nested-images.is-collapsed > figure.wp-block-image:first-of-type {
		grid-column: span 2;
		grid-row: span 2;
		aspect-ratio: auto;
	}
}

.entry-content > .gallery-more {
	max-width: var(--wide-size);
	margin-top: var(--space-s);
	text-align: center;
}

.site-lightbox-link {
	cursor: zoom-in;
}

/* Links page: categories as collapsible Details blocks, with their count (inc/setup.php). */
.wp-block-details {
	background: var(--color-base);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
}

.wp-block-details + .wp-block-details {
	margin-top: var(--space-xs);
}

.wp-block-details summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-s);
	min-height: var(--target-min);
	padding: 0.75rem var(--space-m);
	font-weight: 600;
	list-style: none;
	cursor: pointer;
}

.wp-block-details summary::-webkit-details-marker {
	display: none;
}

.wp-block-details summary::after {
	flex: none;
	width: 0.6rem;
	height: 0.6rem;
	content: "";
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	transition: transform 0.15s ease;
}

.wp-block-details[open] summary::after {
	transform: rotate(-135deg);
}

.wp-block-details[open] summary {
	color: var(--color-primary);
	border-bottom: 1px solid var(--color-border);
}

.wp-block-details > :not(summary) {
	margin: var(--space-s) var(--space-m);
}

.wp-block-details li + li {
	margin-top: 0.35rem;
}

.link-count {
	margin-right: auto;
	font-weight: 400;
	color: var(--color-muted);
}

/* Impressum: the publisher's address (template-parts/publisher.php). */
.contact-block {
	font-style: normal;
}

/* The Impressum's legal lines from "Kontaktdaten" (template-parts/publisher.php): term above value. */
.publisher-legal dt {
	margin-top: var(--space-xs);
	font-weight: 600;
}

.publisher-legal dd {
	margin: 0;
}

/* Two-click YouTube placeholder (kracht-core, video-embeds.php). It has its own
   aspect ratio, so core's spacer for responsive embeds would add a gap above. */
.wp-block-embed.wp-has-aspect-ratio:has(.kracht-video) .wp-block-embed__wrapper::before {
	content: none;
}

.kracht-video {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	color: var(--color-base);
	background: repeating-linear-gradient(135deg, #2a2d33 0 14px, #24272c 14px 28px);
	border-radius: var(--radius);
}

.kracht-video__box {
	display: grid;
	align-content: center;
	justify-items: center;
	gap: 0.6rem;
	height: 100%;
	padding: var(--space-m);
	text-align: center;
	--focus-color: var(--color-base);
}

.kracht-video__box :focus-visible {
	box-shadow: none;
}

.kracht-video__title {
	font-size: var(--text-lg);
	font-weight: 600;
}

.kracht-video__notice {
	max-width: 34rem;
	font-size: var(--text-sm);
	color: #d9dbe0;
}

.kracht-video__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: var(--space-s);
}

.kracht-video__load {
	min-height: var(--target-min);
	padding: 0.5rem 1.25rem;
	font-weight: 600;
	color: var(--color-base);
	background: var(--color-primary);
	border: 0;
	border-radius: var(--radius);
	cursor: pointer;
}

.kracht-video__load:hover {
	background: var(--color-primary-dark);
}

.kracht-video__link {
	display: inline-flex;
	align-items: center;
	min-height: var(--target-min);
	color: var(--color-base);
	font-weight: 600;
}

.kracht-video__link:hover {
	color: var(--color-base);
}

.kracht-video__frame {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

@media (max-width: 30em) {
	.kracht-video {
		aspect-ratio: auto;
	}

	.kracht-video.is-loaded {
		aspect-ratio: 16 / 9;
	}
}

/* ---------- Share links (template-parts/share.php) ---------- */
.share {
	box-sizing: content-box;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-xs) var(--space-s);
	margin-top: var(--space-l);
}

.share__title {
	margin: 0;
	font-weight: 600;
}

.share__list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.share__item {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	min-height: var(--target-min);
	padding: 0.25rem 0.9rem;
	font: inherit;
	font-size: var(--text-sm);
	font-weight: 500;
	color: var(--color-contrast);
	text-decoration: none;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: 999px;
	cursor: pointer;
}

.share__item:hover {
	color: var(--color-primary);
	border-color: var(--color-primary);
}

.share__item .icon {
	width: 1.1rem;
	height: 1.1rem;
}

.share__status {
	flex-basis: 100%;
	margin: 0;
	font-size: var(--text-sm);
	color: var(--color-muted);
}

.share__status:empty {
	display: none;
}

/* ---------- Kontakt block (mu-plugins/site/blocks/kontakt) ---------- */
.ff-kontakt {
	padding: var(--space-m);
	background: var(--color-surface);
	border-left: 4px solid var(--color-primary);
	border-radius: var(--radius);
}

.ff-kontakt__name {
	margin: 0 0 0.25rem;
	font-weight: 600;
}

.ff-kontakt__address {
	margin: 0 0 var(--space-s);
	font-style: normal;
}

/* Beats the content list styles (.entry-content ul). */
.ff-kontakt ul.ff-kontakt__links {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* ---------- Spenden-QR-Code block (mu-plugins/site/blocks/spende-qr) ---------- */
.ff-spende {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--space-s) var(--space-l);
	align-items: start;
	margin-block: var(--space-m);
	padding: var(--space-m);
	background: var(--color-surface);
	border-radius: var(--radius);
}

.ff-spende__qr {
	margin: 0;
	text-align: center;
}

.ff-spende__qr img {
	display: block;
	width: 12rem;
	height: auto;
	margin-inline: auto;
	background: #fff;
	border-radius: calc(var(--radius) / 2);
}

.ff-spende__qr figcaption {
	max-width: 16rem;
	margin: var(--space-xs) auto 0;
	font-size: var(--text-sm);
	color: var(--color-muted);
}

.ff-spende__details {
	margin: 0;
}

.ff-spende__details dt {
	font-size: var(--text-sm);
	font-weight: 600;
	color: var(--color-muted);
}

.ff-spende__details dd {
	margin: 0 0 var(--space-xs);
}

.ff-spende__iban {
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.02em;
	white-space: nowrap;
}

.ff-spende__hint,
.ff-spende__download {
	margin: 0;
	font-size: var(--text-sm);
}

@media (min-width: 40em) {
	.ff-spende {
		grid-template-columns: auto minmax(0, 1fr);
		grid-template-rows: auto auto 1fr;
	}

	.ff-spende__qr {
		grid-row: span 3;
	}
}

/* ---------- Files (core/file as a download card, inc/files.php) ---------- */
.file-card {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-s) var(--space-m);
	margin-block: var(--space-m);
	padding: var(--space-s);
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
}

.file-card__preview,
.file-card__icon {
	flex: 0 0 auto;
	display: block;
	width: 4.5rem;
}

.file-card__preview img {
	display: block;
	width: 100%;
	height: auto;
	background: var(--color-base);
	border: 1px solid var(--color-border);
	border-radius: calc(var(--radius) / 2);
}

.file-card__icon .icon {
	display: block;
	width: 3rem;
	height: 3rem;
	margin-inline: auto;
	color: var(--color-muted);
}

.file-card__body {
	display: grid;
	flex: 1 1 12rem;
	gap: 0.15rem;
	min-width: 0;
}

.file-card__name {
	font-weight: 600;
	color: var(--color-contrast);
	overflow-wrap: anywhere;
}

.file-card__name:hover {
	color: var(--color-primary);
}

.file-card__meta {
	font-size: var(--text-sm);
	color: var(--color-muted);
}

.file-card__download .icon {
	width: 1.15rem;
	height: 1.15rem;
}

/* ---------- Footer ---------- */
.site-footer {
	padding-top: var(--space-xl);
	font-size: var(--text-sm);
	line-height: 1.6;
	color: #c9ccd2;
	background: var(--color-dark);
	--focus-color: var(--color-base);
}

.site-footer :focus-visible {
	box-shadow: none;
}

.site-footer a {
	color: #eceef1;
	text-decoration: none;
}

.site-footer a:hover {
	color: var(--color-base);
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

/*
 * Phones: the brigade and Kontakt across, then Feuerwehr | Social Media and Rechtliches in two columns.
 * Tablets: the brigade across, the four subjects below it. Wide screens: all five side by side.
 */
.site-footer__inner {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--space-l) var(--space-m);
	padding-bottom: var(--space-xl);
}

.site-footer__org,
.site-footer__org + .site-footer__col {
	grid-column: 1 / -1;
}

@media (min-width: 48em) {
	.site-footer__inner {
		grid-template-columns: 1.6fr 1fr 1fr 1fr;
	}

	.site-footer__org + .site-footer__col {
		grid-column: auto;
	}
}

@media (min-width: 72em) {
	.site-footer__inner {
		grid-template-columns: 1.5fr 1.4fr 1fr 1fr 1fr;
	}

	.site-footer__org {
		grid-column: auto;
	}
}

/* The brigade: Wappen and name as one link home, the district, the emergency number. */
.site-footer__brand {
	display: inline-flex;
	align-items: center;
	gap: var(--space-s);
}

.site-footer a.site-footer__brand:hover {
	text-decoration: none;
}

.site-footer__logo {
	flex: none;
	width: auto;
	height: 3.25rem;
}

.site-footer__name {
	max-width: 14rem;
	font-size: var(--text-md);
	font-weight: 600;
	line-height: 1.3;
	color: var(--color-base);
}

.site-footer__district {
	margin-top: var(--space-s);
}

.site-footer__emergency {
	display: inline-block;
	margin-top: var(--space-s);
	padding: 0.4rem 0.75rem;
	border-left: 3px solid var(--color-primary);
	border-radius: 0 var(--radius) var(--radius) 0;
	background: rgb(255 255 255 / 0.06);
}

.site-footer__emergency a {
	display: inline-flex;
	align-items: center;
	min-height: 1.5rem;
	font-weight: 600;
	color: var(--color-base);
}

/* Each column's title: plain, white, the same in all four. */
.site-footer__heading {
	margin-bottom: var(--space-s);
	font-size: var(--text-sm);
	font-weight: 600;
	line-height: 1.3;
	color: var(--color-base);
}

.site-footer__address {
	margin-bottom: var(--space-xs);
	font-style: normal;
}

/* Every list in the footer is a plain stack with the same rhythm; each link is a target of 28 px. */
.site-footer__list {
	display: grid;
	gap: 0.15rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-footer__list a {
	display: inline-flex;
	align-items: center;
	min-height: 1.75rem;
}

/* A long e-mail address breaks only when its column is narrower than the address (the narrowest phones). */
.site-footer__email a {
	overflow-wrap: anywhere;
}

/* Social Media: each network's icon in a round badge, the name beside it. */
.site-footer__social {
	gap: var(--space-xs);
}

.site-footer__social a {
	gap: 0.6rem;
}

.site-footer__social-icon {
	display: grid;
	place-items: center;
	width: 2rem;
	height: 2rem;
	border-radius: 50%;
	background: rgb(255 255 255 / 0.08);
	transition: background-color 0.15s;
}

.site-footer__social-icon .icon {
	width: 1rem;
	height: 1rem;
}

.site-footer__social a:hover .site-footer__social-icon {
	background: var(--color-primary);
}

/* The last line: the copyright left, the agency's credit (mu-plugins/site/credit.php) right. */
.site-footer__bottom {
	border-top: 1px solid rgb(255 255 255 / 0.1);
	color: #9ea3ad;
}

.site-footer__bottom-inner {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: var(--space-xs) var(--space-m);
	padding-block: var(--space-s);
}

.site-footer__copyright,
.site-credit {
	margin: 0;
	font-size: var(--text-sm);
}

.site-credit a {
	display: inline-flex;
	align-items: center;
	min-height: 1.75rem;
	font-weight: 600;
}

/* ---------- Search form (404, search) ---------- */
.search-form {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-xs);
	margin-block: var(--space-s);
}

.search-form label {
	flex: 1 1 16rem;
}

.search-field {
	width: 100%;
	min-height: var(--target-min);
	padding: var(--space-xs) var(--space-s);
	border: 1px solid var(--color-muted);
	border-radius: var(--radius);
}

.search-submit {
	min-height: var(--target-min);
	padding: var(--space-xs) var(--space-m);
	color: var(--color-base);
	background: var(--color-primary);
	border: 0;
	border-radius: var(--radius);
	cursor: pointer;
}

.search-submit:hover {
	background: var(--color-primary-dark);
}

/* ---------- Report cards (template-parts/post-card.php) ---------- */
.card-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
	gap: var(--space-m);
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 40em) {
	.card-grid--3,
	.card-grid--4 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 64em) {
	.card-grid--3 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.card-grid--4 {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

.card {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--color-base);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:has(.card__link):hover {
	box-shadow: var(--shadow-hover);
	transform: translateY(-2px);
}

/* The card's one link stretches over it, so the focus ring goes round the whole card. */
.card:focus-within {
	outline: 3px solid var(--focus-color);
	outline-offset: 2px;
}

.card__link:focus-visible {
	outline: none;
	box-shadow: none;
}

.card__media {
	position: relative;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: var(--color-surface);
}

.card__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* A report without a picture: the brigade's Wappen, grey and quiet, where the "FF" stood. */
.card__placeholder {
	display: grid;
	place-items: center;
	height: 100%;
}

.card__placeholder img {
	width: 5.5rem;
	height: auto;
	opacity: 0.35;
	filter: grayscale(1);
}

.card__badge {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	padding: 0.2rem 0.65rem;
	font-size: 0.7rem;
	font-weight: 600;
	line-height: 1.5;
	color: var(--color-base);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	background: var(--color-primary);
	border-radius: 999px;
}

/* A report's main category above its title, in the category's colour (theme.json custom.badge; the own screens and
   "Nächste Termine" use the same colours). Text, not a badge on the photo: it stays readable on any picture. */
.card__category {
	margin-bottom: -0.25rem;
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.3;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--wp--custom--badge--sonstiges);
}

.card__category--einsaetze {
	color: var(--wp--custom--badge--einsatz);
}

.card__category--ausbildung {
	color: var(--wp--custom--badge--ausbildung);
}

.card__category--feuerwehrjugend {
	color: var(--wp--custom--badge--jugend);
}

.card__category--veranstaltungen,
.card__category--gratulationen {
	color: var(--wp--custom--badge--veranstaltung);
}

.card__category--bewerbe {
	color: var(--wp--custom--badge--bewerb);
}

/* The number of photos on an album card (template-parts/album-card.php). */
.card__badge--count {
	font-size: 0.8rem;
	background: rgb(0 0 0 / 0.72);
}

.card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 0.5rem;
	padding: var(--space-m);
}

.card__title {
	font-size: 1.125rem;
	font-weight: 600;
	line-height: 1.35;
	overflow-wrap: break-word;
	hyphens: auto;
	/* Break long words only where both parts are readable. */
	hyphenate-limit-chars: 12 5 5;
}

.card__link {
	color: var(--color-contrast);
	text-decoration: none;
}

/* The whole card is clickable via the title link (one link, one tab stop). */
.card__link::after {
	position: absolute;
	inset: 0;
	content: "";
}

.card__link:hover {
	color: var(--color-primary);
}

.card__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem;
	font-size: var(--text-sm);
	color: var(--color-muted);
}

.card__excerpt {
	font-size: 0.95rem;
	color: var(--color-muted);
}

.card__excerpt p {
	display: -webkit-box;
	overflow: hidden;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
}

.card__more {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	margin-top: auto;
	padding-top: 0.25rem;
	font-size: var(--text-sm);
	font-weight: 600;
	color: var(--color-primary);
}

/* Phones: the newest report stays a full card, every other one is a compact row (photo left, category, title, date),
   so a list of six is two screens long, not seven. The whole row is still the one link. */
@media (max-width: 39.999em) {
	.card-grid {
		gap: var(--space-s);
	}

	.card-grid > .post-card:not(:first-child) {
		display: grid;
		grid-template-columns: 6.5rem minmax(0, 1fr);
	}

	.card-grid > .post-card:not(:first-child) .card__media {
		height: 100%;
		min-height: 6.5rem;
		aspect-ratio: auto;
	}

	.card-grid > .post-card:not(:first-child) .card__placeholder img {
		width: 3rem;
	}

	.card-grid > .post-card:not(:first-child) .card__body {
		gap: var(--space-xs);
		padding: var(--space-s);
	}

	/* Whole words in the narrow column; a word longer than the line still breaks (.card__title). */
	.card-grid > .post-card:not(:first-child) .card__title {
		font-size: var(--text-md);
		hyphens: manual;
	}

	/* A one-line title is a 23 px link box; the link itself stays a 24 px target, as on the album cards. */
	.card-grid > .post-card:not(:first-child) .card__link {
		display: inline-block;
		min-height: 1.5rem;
	}

	.card-grid > .post-card:not(:first-child) .card__excerpt,
	.card-grid > .post-card:not(:first-child) .card__more {
		display: none;
	}
}

/* ---------- Reports list: filter and pagination ---------- */
.filter {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: var(--space-s);
	margin-bottom: var(--space-l);
	padding: var(--space-m);
	background: var(--color-surface);
	border-radius: var(--radius);
}

.filter__field {
	display: grid;
	flex: 1 1 13rem;
	gap: 0.25rem;
}

.filter label {
	font-size: var(--text-sm);
	font-weight: 600;
}

.filter select {
	min-height: var(--target-min);
	padding: 0.5rem 0.75rem;
	color: var(--color-contrast);
	background: var(--color-base);
	border: 1px solid var(--color-muted);
	border-radius: var(--radius);
}

.filter__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-s);
}

.filter__reset {
	display: inline-flex;
	align-items: center;
	min-height: var(--target-min);
	font-size: var(--text-sm);
}

.pagination {
	margin-top: var(--space-l);
}

.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--space-xs);
}

.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: var(--target-min);
	min-height: var(--target-min);
	padding: 0.25rem 0.75rem;
	color: var(--color-contrast);
	text-decoration: none;
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
}

.pagination a.page-numbers:hover {
	color: var(--color-primary);
	border-color: var(--color-primary);
}

.pagination .page-numbers.current {
	color: var(--color-base);
	background: var(--color-primary);
	border-color: var(--color-primary);
}

.pagination .page-numbers.dots {
	border-color: transparent;
}

/* Older and newer report under a single report. */
.post-navigation {
	margin-top: var(--space-xl);
	padding-top: var(--space-m);
	border-top: 1px solid var(--color-border);
}

.post-navigation .nav-links {
	display: grid;
	gap: var(--space-m);
}

@media (min-width: 40em) {
	.post-navigation .nav-links {
		grid-template-columns: 1fr 1fr;
	}

	.post-navigation .nav-next {
		grid-column: 2;
		text-align: right;
	}
}

.post-navigation a {
	display: block;
	font-weight: 600;
	color: var(--color-contrast);
	text-decoration: none;
}

.post-navigation a:hover {
	color: var(--color-primary);
}

.nav-label {
	display: block;
	font-size: var(--text-sm);
	font-weight: 400;
	color: var(--color-muted);
}

/* ---------- Fotogalerie (page-fotogalerie.php) and the lightbox ---------- */
.year-filter ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 0 0 var(--space-l);
	padding: 0;
	list-style: none;
}

.year-filter a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: var(--target-min);
	min-height: var(--target-min);
	padding: 0.25rem 0.85rem;
	color: var(--color-contrast);
	text-decoration: none;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: 999px;
}

.year-filter a:hover {
	color: var(--color-primary);
	border-color: var(--color-primary);
}

.year-filter a[aria-current="page"] {
	color: var(--color-base);
	background: var(--color-primary);
	border-color: var(--color-primary);
}

.album-card .card__title {
	font-size: 1rem;
}

/* A one-line title at 1rem is a 22 px link box; the check's (and WCAG's) 24 px minimum (the card around it is the
   real target, but the link itself should pass too). Titles of two lines and more are higher anyway. */
.album-card__link {
	display: inline-block;
	min-height: 1.5rem;
}

.album-card__link[aria-busy="true"] {
	cursor: progress;
}

.album-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-m);
	margin-top: var(--space-s);
}

/* An album's photos in justified rows: each photo grows in proportion to its aspect ratio (--ff-ar), so all
   photos in a row share one height; the ::after filler keeps the last row from stretching. */
.album-photos {
	--ff-row: 9rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 40em) {
	.album-photos {
		--ff-row: 14rem;
	}
}

.album-photos::after {
	content: "";
	flex: 1000000 1 0;
}

.album-photos > li {
	flex: calc(var(--ff-ar, 1.3333) * 1000) 1 calc(var(--ff-ar, 1.3333) * var(--ff-row));
	aspect-ratio: var(--ff-ar, 4 / 3);
}

.album-photos a {
	display: block;
	height: 100%;
	overflow: hidden;
	border-radius: var(--radius);
	cursor: zoom-in;
}

.album-photos img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.2s ease;
}

.album-photos a:hover img {
	transform: scale(1.04);
}

/* The lightbox's own parts (assets/js/lightbox.js): "Zum Bericht" in the top bar, the description at the bottom. */
.pswp__site-report {
	display: inline-flex;
	align-items: center;
	align-self: center;
	min-height: 2.25rem;
	margin-right: 0.5rem;
	padding: 0.25rem 0.9rem;
	font-size: var(--text-sm);
	font-weight: 600;
	color: #fff;
	text-decoration: none;
	background: var(--color-primary);
	border-radius: var(--radius);
	pointer-events: auto;
}

.pswp__site-report:hover {
	color: #fff;
	background: var(--color-primary-dark);
}

.pswp__site-caption {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	padding: 0.75rem 1rem;
	font-size: var(--text-sm);
	color: #fff;
	text-align: center;
	background: linear-gradient(to top, rgb(0 0 0 / 0.85), rgb(0 0 0 / 0.5) 70%, transparent);
}

.pswp__site-caption:empty {
	display: none;
}

/* ---------- Start page (front-page.php) ---------- */
/* The hero: the start page's featured image across the full width, darkened towards the bottom, the name over it. */
.hero {
	position: relative;
	display: grid;
	align-items: end;
	min-height: clamp(16rem, 42vw, 34rem);
	overflow: hidden;
	color: var(--color-base);
	background: var(--color-dark);
}

.hero__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hero::after {
	position: absolute;
	inset: 0;
	content: "";
	background: linear-gradient(to top, rgb(0 0 0 / 0.72) 0%, rgb(0 0 0 / 0.25) 55%, rgb(0 0 0 / 0.05) 100%);
}

.hero__content {
	position: relative;
	z-index: 1;
	padding-block: var(--space-xl);
}

.hero__title {
	max-width: 20ch;
	font-size: clamp(1.9rem, 4.6vw, 3.5rem);
	font-weight: 700;
	line-height: 1.12;
	text-shadow: 0 2px 12px rgb(0 0 0 / 0.4);
}

/* The newest reports with "Nächste Termine" beside them (template-parts/termine-box.php). */
.home-reports {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--space-l);
}

/* Beside the reports from 64em: the box grows with the layout; the reports
   use two columns until there is room for three cards of a readable width. */
@media (min-width: 64em) {
	.home-reports {
		grid-template-columns: minmax(0, 1fr) clamp(19rem, 30%, 25rem);
		align-items: start;
	}

	.home-reports .card-grid--3 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	/* The box is much shorter than the reports: keep it in view while scrolling past them. */
	.home-reports__aside {
		position: sticky;
		top: var(--space-m);
	}
}

@media (min-width: 90em) {
	.home-reports .card-grid--3 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.termine-box {
	padding: var(--space-m);
	background: var(--color-surface);
	border-top: 4px solid var(--color-primary);
	border-radius: var(--radius);
}

.termine-box__title {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: var(--space-s);
	font-size: var(--text-lg);
	font-weight: 600;
}

.termine-box__title .icon {
	color: var(--color-primary);
}

.termine-box__empty {
	color: var(--color-muted);
}

/* "Mitglied werden": the red section with the icon, the teaser (that page's excerpt) and a light button. */
.section--join {
	--focus-color: var(--color-base);
	color: var(--color-base);
	background: var(--color-primary);
}

.section--join :focus-visible {
	box-shadow: 0 0 0 5px var(--color-primary-dark);
}

.join {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-m) var(--space-l);
}

.join__icon {
	flex: none;
	width: clamp(4rem, 10vw, 7rem);
	height: auto;
	opacity: 0.9;
}

.join__text {
	flex: 1 1 28rem;
	max-width: 46rem;
}

.join__kicker {
	margin-bottom: 0.25rem;
	font-size: var(--text-sm);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	opacity: 0.85;
}

.join__title {
	margin-bottom: var(--space-xs);
	font-size: var(--text-xl);
	font-weight: 700;
	line-height: var(--wp--custom--line-height--heading);
}

@media (max-width: 39.999em) {
	.join__icon {
		display: none;
	}
}

/* "Warnungen" (template-parts/warning-box.php): the last section, grey, meets the footer. The map is a local copy,
   shown whole in a 16:10 box; without a current copy the box points to the source. */
.section--warnings {
	background: var(--color-surface);
}

.warning__media {
	display: grid;
	place-items: center;
	aspect-ratio: 16 / 10;
	padding: var(--space-xs);
	background: var(--color-base);
	border-bottom: 1px solid var(--color-border);
}

.warning__image {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.warning__placeholder {
	display: grid;
	place-items: center;
	gap: 0.5rem;
	font-size: var(--text-sm);
	color: var(--color-muted);
	text-align: center;
}

.warning__placeholder .icon {
	width: 2.5rem;
	height: 2.5rem;
	color: var(--color-primary);
}

.warning__label {
	font-size: 0.95rem;
	color: var(--color-muted);
}

/* ---------- Termine: an event's page, the start page popup ---------- */
.termin-list {
	display: grid;
	gap: var(--space-s);
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Start page box: one column beside the reports, two when the box is full width. */
.termin-list--compact {
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
	gap: var(--space-m);
}

.termin {
	display: flex;
	gap: var(--space-s);
	align-items: flex-start;
}

.termin-list:not(.termin-list--compact) .termin {
	padding: var(--space-m);
	background: var(--color-base);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}

.termin__date {
	display: grid;
	flex: none;
	place-content: center;
	width: 3.5rem;
	min-height: 3.5rem;
	padding-block: 0.35rem;
	line-height: 1.1;
	text-align: center;
	color: var(--color-base);
	background: var(--color-primary);
	border-radius: var(--radius);
}

.termin__day {
	font-size: 1.3rem;
	font-weight: 700;
}

.termin__month {
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
}

.termin__body {
	display: grid;
	flex: 1;
	gap: 0.2rem;
	min-width: 0;
}

/* Kind of event, coloured like the report badges (theme.json custom.badge), and "Abgesagt". */
.termin__kicker {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.15rem 0.6rem;
}

.termin__cancelled {
	display: inline-block;
	padding: 0.05rem 0.5rem;
	font-size: 0.75rem;
	font-weight: 700;
	line-height: 1.5;
	color: #fff;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	background: var(--color-primary-dark);
	border-radius: 999px;
}

.termin--cancelled .termin__title {
	text-decoration: line-through;
	text-decoration-thickness: 1px;
}

.termin--cancelled .termin__date {
	opacity: 0.6;
}

.termin__type {
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.3;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--wp--custom--badge--sonstiges);
}

.termin__type--uebung {
	color: var(--wp--custom--badge--ausbildung);
}

.termin__type--veranstaltung {
	color: var(--wp--custom--badge--veranstaltung);
}

.termin__type--bewerb {
	color: var(--wp--custom--badge--bewerb);
}

.termin__title {
	font-weight: 600;
	line-height: 1.35;
	overflow-wrap: anywhere;
	hyphens: auto;
	hyphenate-limit-chars: 12 5 5;
}

.termin__title a {
	display: inline-block;
	min-height: 1.5rem;
	color: var(--color-contrast);
	text-decoration: none;
}

.termin__title a:hover {
	color: var(--color-primary);
	text-decoration: underline;
}

.termin__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.15rem 0.75rem;
	font-size: var(--text-sm);
	color: var(--color-muted);
}

/* Time and place: each on its own line in the start page box; the icon sits on
   the first text line, so a long place wraps under its own text. */
.termin__meta > span {
	display: inline-flex;
	align-items: flex-start;
	gap: 0.35rem;
	min-width: 0;
	overflow-wrap: anywhere;
}

.termin__meta .icon {
	margin-top: 0.2em;
}

.termin-list--compact .termin__meta {
	display: grid;
	gap: 0.15rem;
}

.termin__text {
	margin-top: var(--space-xs);
}

.termin__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem var(--space-m);
	margin-top: var(--space-xs);
	font-size: var(--text-sm);
}

/* Poster beside the text on the event page; opens in the lightbox. */
.termin__poster {
	flex: none;
	align-self: flex-start;
	width: clamp(5.5rem, 24%, 9rem);
	overflow: hidden;
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	cursor: zoom-in;
}

.termin__poster img {
	width: 100%;
	transition: transform 0.2s ease;
}

.termin__poster:hover img {
	transform: scale(1.04);
}

.single-ff_termin .termin-list {
	margin-top: var(--space-m);
}

.single-ff_termin .termin__poster {
	width: clamp(7rem, 34%, 18rem);
}

/* Phones: the poster goes below the text, so the text keeps its width. */
@media (max-width: 39.999em) {
	.single-ff_termin .termin {
		flex-wrap: wrap;
	}

	.single-ff_termin .termin__body {
		flex-basis: calc(100% - 3.5rem - var(--space-s));
	}

	.single-ff_termin .termin__poster {
		order: 3;
		width: calc(100% - 3.5rem - var(--space-s));
		max-width: 18rem;
		margin-left: calc(3.5rem + var(--space-s));
	}
}

/* ---------- Event popup (start page) ---------- */
/* A modal <dialog> (template-parts/termin-popup.php, assets/js/popup.js): poster beside the text, below 48em on top. */
.termin-popup {
	width: min(54rem, calc(100vw - 2rem));
	max-width: none;
	max-height: calc(100dvh - 2rem);
	padding: 0;
	overflow: auto;
	color: var(--color-contrast);
	background: var(--color-base);
	border: 0;
	border-radius: var(--radius);
	box-shadow: 0 24px 64px rgb(0 0 0 / 0.35);
}

.termin-popup::backdrop {
	background: rgb(18 19 22 / 0.72);
}

.termin-popup__inner {
	position: relative;
	display: grid;
}

.termin-popup__poster {
	display: block;
	background: var(--color-surface);
}

.termin-popup__poster img {
	display: block;
	width: 100%;
	height: auto;
	max-height: 55dvh;
	object-fit: contain;
}

.termin-popup__body {
	padding: var(--space-m);
}

.termin-popup__title {
	margin: 0.25rem 0 var(--space-s);
	font-size: var(--text-xl);
	line-height: 1.2;
}

.termin-popup__actions {
	margin: var(--space-m) 0 0;
}

/* Large and clearly visible, over the poster's corner. */
.termin-popup__close {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	min-height: var(--target-min);
	padding: 0.4rem 1rem 0.4rem 0.75rem;
	font: inherit;
	font-weight: 600;
	color: var(--color-base);
	background: var(--color-dark);
	border: 2px solid var(--color-base);
	border-radius: 999px;
	box-shadow: 0 2px 10px rgb(0 0 0 / 0.3);
	cursor: pointer;
}

.termin-popup__close:hover {
	background: var(--color-primary);
}

.termin-popup__close .icon {
	width: 1.25rem;
	height: 1.25rem;
}

@media (min-width: 48em) {
	.termin-popup__inner {
		grid-template-columns: minmax(0, 26rem) minmax(0, 1fr);
		align-items: center;
	}

	.termin-popup__poster img {
		max-height: calc(100dvh - 2rem);
	}

	.termin-popup__body {
		padding: var(--space-xl) var(--space-l);
	}
}

@media (prefers-reduced-motion: no-preference) {
	.termin-popup[open] {
		animation: site-popup-in 0.25s ease-out;
	}

	.termin-popup[open]::backdrop {
		animation: site-fade-in 0.25s ease-out;
	}
}

@keyframes site-popup-in {
	from {
		opacity: 0;
		transform: translateY(1rem) scale(0.98);
	}
}

@keyframes site-fade-in {
	from {
		opacity: 0;
	}
}

/* ---------- Records: badges on the overview pages (Fuhrpark, Mannschaft) ---------- */
.badge {
	display: inline-block;
	padding: 0.15rem 0.6rem;
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.5;
	color: var(--color-contrast);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: 999px;
}

/* A draft (or a person without consent), shown only to those who may edit records. */
.badge--draft,
.card__badge--draft {
	color: var(--color-contrast);
	background: #fde68a;
	border-color: #d4a514;
}

/* ---------- Fuhrpark (page-fuhrpark.php, template-parts/vehicle-card.php) ---------- */
.vehicle-list {
	display: grid;
	gap: var(--space-l);
}

.vehicle {
	display: grid;
	overflow: hidden;
	background: var(--color-base);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}

@media (min-width: 48em) {
	.vehicle {
		grid-template-columns: 1fr 1fr;
		align-items: center;
	}

	.vehicle--reversed .vehicle__media {
		order: 2;
	}
}

.vehicle__media {
	aspect-ratio: 16 / 10;
	height: 100%;
	background: var(--color-surface);
}

.vehicle__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.vehicle__body {
	display: grid;
	gap: var(--space-xs);
	padding: var(--space-l);
}

.vehicle__badges {
	display: flex;
	gap: 0.35rem;
}

.vehicle__title {
	font-size: var(--text-xl);
	font-weight: 700;
}

.vehicle__fullname {
	font-weight: 500;
	color: var(--color-primary);
}

.vehicle__text {
	color: var(--color-muted);
}

/* ---------- Mannschaft (page-mannschaft.php, page-feuerwehrjugend.php, template-parts/person-card.php) ---------- */
/* Links to the sections (Kommando, Züge, …) when there are more than two. */
.section-nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 0 0 var(--space-m);
	padding: 0;
	list-style: none;
}

.section-nav a {
	display: inline-flex;
	align-items: center;
	min-height: var(--target-min);
	padding: 0.25rem 0.9rem;
	color: var(--color-contrast);
	text-decoration: none;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: 999px;
}

.section-nav a:hover {
	color: var(--color-primary);
	border-color: var(--color-primary);
}

.person-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--space-m);
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 40em) {
	.person-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (min-width: 64em) {
	.person-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

@media (min-width: 90em) {
	.person-grid {
		grid-template-columns: repeat(5, minmax(0, 1fr));
	}
}

/* Centred group of people (the Kommando, the Feuerwehrjugend's contact people). */
.person-grid.person-grid--center {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
}

.person-grid--center > .person {
	width: clamp(9rem, 40%, 14rem);
}

/* Member card ("trading card" style): framed, photo on top, rank badge on its edge, Zug as a footer strip. */
.person {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	text-align: center;
	background: var(--color-base);
	border: 1px solid var(--color-border);
	border-top: 4px solid var(--color-primary);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}

.person__photo {
	position: relative;
	aspect-ratio: 4 / 5;
	overflow: hidden;
	background: var(--color-surface);
}

.person__photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.person__placeholder {
	width: 40%;
	height: 100%;
	margin-inline: auto;
	color: var(--color-border);
}

.person__body {
	position: relative;
	flex: 1;
	padding: 1.4rem var(--space-s) var(--space-s);
}

/* Dienstgrad: a badge sitting on the photo's lower edge. */
.person__rank {
	position: absolute;
	top: 0;
	left: 50%;
	min-width: 3.25rem;
	margin: 0;
	padding: 0.2rem 0.65rem;
	font-size: var(--text-sm);
	font-weight: 700;
	line-height: 1.4;
	color: var(--color-base);
	letter-spacing: 0.05em;
	white-space: nowrap;
	background: var(--color-primary);
	border: 2px solid var(--color-base);
	border-radius: 999px;
	transform: translate(-50%, -50%);
}

.person__rank abbr {
	text-decoration: none;
}

.person__name {
	font-size: 1.05rem;
	font-weight: 600;
	line-height: 1.3;
}

.person__function {
	margin-top: 0.2rem;
	font-size: var(--text-sm);
	color: var(--color-muted);
	hyphens: auto;
}

.person__zug {
	margin: 0;
	padding: 0.4rem var(--space-s);
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--color-contrast);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	background: var(--color-surface);
	border-top: 1px solid var(--color-border);
}
