/**
 * Token bridge.
 *
 * SINGLE SOURCE OF TRUTH = theme.json. It emits CSS custom properties
 * (--wp--preset--*, --wp--custom--*, --wp--style--global--*). This file only
 * *references* those variables to re-point the legacy global selectors that
 * live in css/styles.css, so changing a value in theme.json cascades here too.
 *
 * RULES: never hardcode px/hex here or in any block CSS — only var(--wp--...).
 * Enqueued AFTER css/styles.css so these token-driven rules win.
 */

/* Modular page columns are wrapped in block groups (class="wp-block-group col-3 …"),
 * so the legacy `.row [class^="col"]` float selector (starts-with) no longer
 * matches — the columns stacked instead of sitting side by side. Re-float via a
 * contains selector that matches the block-wrapped columns. */
.row [class*="col-"] { float: left; min-height: 1px; }

/* The row is a block-layout group, so its blockGap (section-gap, 60px) is applied
 * as a margin-block-start on every column after the first — pushing the content
 * column (col-7) 60px below the row top while the (first-child) sidebar column
 * stays put, so the title sat ~40px above the sidebar. The classic layout floats
 * the columns with NO inter-column vertical gap (they sit side by side), so zero
 * the blockGap here; the 100px top offset now comes from #content.no-image, and
 * both columns top-align at the row top exactly like the live site. */
.page-template-page-modular #content .row > * { margin-block-start: 0; }

/* Footer social icons: the source SVGs have mismatched intrinsic sizes
 * (the 2021 set is 41×41, the 2023 TikTok is 50×50) and had no CSS constraint,
 * so they rendered at different sizes and wrapped to a 2nd row. Normalize all to
 * one size so the 5 icons stay consistent and on a single line. */
#footer #footer-top #footer-social-links .footer-social-link img {
	width: var(--wp--custom--footer--social-icon-size);
	height: var(--wp--custom--footer--social-icon-size);
	display: block;
}
/* Keep all footer social icons on ONE row (they sit in the narrow col-3 and the
 * 25px right-margins pushed the 5th icon to a second line). Flex + nowrap + a
 * tighter gap fits them on a single line at every width. */
#footer #footer-top #footer-social-links {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 18px;
}
#footer #footer-top #footer-social-links .footer-social-link {
	margin-right: 0;
	flex: 0 0 auto;
}

/* Footer newsletter — small breakpoints.
 * Below 992px the footer columns stack full-width, so the newsletter column
 * (col-5) sits directly under the social-icons column (col-3) and the large
 * "Newsletter abonnieren" heading collided with the icons. The markup already
 * carries a .form-spacer-mobile at the top of that column for exactly this —
 * it just had no height. Give it height on mobile only (name says "mobile", so
 * it stays 0 on desktop where the columns are side by side). */
@media (max-width: 991px) {
	#footer #footer-top .form-spacer-mobile {
		height: 40px;
	}
}

/* Space between the consent-checkbox text and the "Senden" button — they were
 * flush against each other at every width. */
#footer #footer-top #form-content .btn-container {
	margin-top: 20px;
}

/* Footer newsletter heading overlap — below 1200px `body` switches to a FIXED
 * line-height of 23px (styles.css), which the large "Newsletter abonnieren" H1
 * (~30px glyphs) inherits: its line box became shorter than the text, so the
 * heading spilled down onto whatever follows. The xcpro form script injects a
 * 40px spacer after the H1 that normally separates it from the fields, but that
 * third-party script is blocked until cookie consent — so pre-consent the
 * spacer is absent and the cramped heading overlapped the Anrede select. Give
 * the heading its own leading so its box fits the glyphs (fixes the overlap
 * with or without the script) plus a margin-bottom for clear separation.
 * Scoped to ≤1200px (desktop is unaffected). */
@media (max-width: 1200px) {
	#footer #footer-top #form-content .main-heading h1 {
		line-height: 1.2;
		margin-bottom: 20px;
	}
}

/* Layout container — used by the header/footer blocks and page templates.
 * Only the max-width is token-bridged here. Deliberately NOT setting padding:
 * the original theme's .container padding is RESPONSIVE (0 20px base, 0 25px
 * ≤1780px, 0 30px ≤991px — all present in styles.css). This file loads after
 * styles.css, so an unconditional padding here overrode all three, flattening
 * every breakpoint to 20px and leaving the sides too tight vs the original.
 * Letting styles.css own the padding restores the original's wider gutters. */
.container {
	max-width: var(--wp--style--global--wide-size);
}

/* Primary CTA button (legacy .red-button + core button share the same tokens). */
.red-button {
	background: var(--wp--preset--color--brand-red);
	color: var(--wp--preset--color--white);
	padding: var(--wp--custom--button--padding-y) var(--wp--custom--button--padding-x);
	font-size: var(--wp--custom--button--font-size);
	line-height: var(--wp--custom--button--line-height);
	border-radius: var(--wp--custom--button--radius);
	transition: var(--wp--custom--transition);
}
.red-button:hover {
	background: var(--wp--preset--color--brand-red-dark);
}

/* Homepage.
 * Dynamic image URLs are passed as CSS custom properties on the element
 * (--hero-bg / --news-bg / --parallax-bg); every actual declaration lives here,
 * so nothing design-related is inline. */
#hero.home-hero {
	height: var(--wp--custom--home--hero-height);
	background-image: var(--hero-bg);
	background-repeat: no-repeat;
	background-position: center bottom;
	background-size: cover;
}
/* Hero <img> (the "low-ratio" path custom.js switches to for wide/short hero
 * images) must always fill the full width. styles.css only sets width:100% on
 * `#content #hero img`, but the img actually lives in `#hero-mobile`, so it fell
 * back to `img{max-width:100%}` and rendered at its natural size (e.g. 1920px) —
 * leaving a gap on screens wider than the image. Force 100% on both. */
#content #hero img,
#content #hero-mobile img {
	width: 100%;
	display: block;
}
#quick-links .home-title {
	text-align: center;
}

/* External-link block (cows/external-link) — the block outputs the default
 * .wp-block-cows-external-link class, and its bundled index.css is incomplete
 * (no arrow, not bold, wrong font, stray @import, double margin). Recreate the
 * original a.external-link styling exactly: red, ">" arrow, bold, hover underline.
 * margin-bottom:0 because the converted block already has a core/spacer after it. */
a.wp-block-cows-external-link {
	display: inline-block;
	padding-left: 20px;
	background: url("img/arrow.svg") no-repeat 0 center;
	font-family: inherit;
	font-weight: 700;
	color: var(--wp--preset--color--brand-red);
	margin-bottom: 50px; /* classic a.external-link default (spacers removed) */
	text-decoration: none;
}

/* Spacers removed → the converted YouTube embed renders as .wp-block-embed
 * (not .youtube-video), so give it the same bottom spacing the original
 * .youtube-video had, so it isn't cramped against the next section. */
.page-template-page-modular #content .wp-block-embed {
	margin-bottom: 100px;
}
a.wp-block-cows-external-link:hover {
	text-decoration: underline;
	color: var(--wp--preset--color--brand-red);
}

/* Quick-links circle icons: the base (>1200px) rule has no max-width, relying on
 * the icon SVGs being ~107px. The Social Media icon is a 512px raster PNG, so it
 * overflows the circle on desktop. Cap the icons to the SVG size — but ONLY on
 * desktop: the classic theme already caps them responsively (60px ≤1200px, 35px
 * ≤991px) to fit the smaller circles (200px / 70px). Leaving this cap unscoped
 * overrode those (tokens.css loads last), forcing a 107px icon into the 70px
 * circle at ≤991px, so the icons overflowed. Scoped to >1200px, each breakpoint
 * keeps its own fitting icon size. */
@media (min-width: 1201px) {
	#content #quick-links .col-4 .round img {
		max-width: 107px;
		max-height: 107px;
	}
}

/* Quick-links (SCHNELLZUGRIFF), small breakpoints: the classic dropped to
 * 2-per-row (.col-4 width:50%) and left-aligned the section heading below 992px.
 * Keep the 3 icons on one row and the heading centered at every width, matching
 * the desktop layout (and the original desktop). */
@media (max-width: 991px) {
	#content #quick-links .col-4 { width: 33.3333%; }
	#content #quick-links h2 { text-align: center; }
}

/* Remove the block-theme's default flow gap between #main's children
 * (header → content → footer). WordPress applies the group blockGap
 * (section-gap, 60px) between them, creating extra whitespace above the hero
 * and below the last section; the classic theme had them flush. */
#main > * {
	margin-block-start: 0;
	margin-block-end: 0;
}

/* The block flow layout adds a 24px margin-block-start between every sibling
 * (:where(.is-layout-flow) > *). On modular pages that put an extra gap where
 * the classic markup had none: between the page title and the content (the
 * classic gap is #content h1's 30px margin-bottom alone), and between every
 * section inside .entry-content (classic spacing came only from the .section-*
 * / secmb-{px} margins). Zero the flow gap inside the content column so those
 * govern alone — same reasoning as the #main > * rule above. */
.page-template-page-modular #content .col-7 > *,
.page-template-page-modular #content .entry-content > * {
	margin-block-start: 0;
}

/* ===== Native content blocks (section_text → core paragraph/heading/list/buttons)
 * The migrator (acf-blocks-migrator ≥1.14.0) now emits native Gutenberg blocks for
 * text sections instead of a single cows/section-text wrapper. Reproduce the
 * original `.section-text` typography + spacing on those native blocks. body
 * already sets 18px / line-height 1.55 / letter-spacing 1.08px, so mostly this is
 * bottom spacing + list padding, matching styles.css's `.section-text p`
 * (margin-bottom:30px) and `.section-text ul` (padding-left:20px). ===== */
.page-template-page-modular #content .entry-content > p,
.page-template-page-modular #content .entry-content > ul,
.page-template-page-modular #content .entry-content > ol,
.page-template-page-modular #content .entry-content > .wp-block-list,
.page-template-page-modular #content .entry-content > .wp-block-buttons {
	margin-bottom: 30px;
}
.page-template-page-modular #content .entry-content > ul,
.page-template-page-modular #content .entry-content > ol,
.page-template-page-modular #content .entry-content > .wp-block-list {
	padding-left: 20px;
}
/* Standalone all-bold lines promoted to H3 (the WYSIWYG had no real heading tags).
 * Styled as a modest sub-heading in brand brown — not the big uppercase #content h2. */
.page-template-page-modular #content .entry-content > h3.wp-block-heading {
	color: var(--wp--preset--color--brand-brown);
	font-weight: 700;
	font-size: 22px;
	line-height: 1.3;
	letter-spacing: 1.08px;
	text-transform: none;
	margin-top: 44px;
	margin-bottom: 18px;
}
/* Space ABOVE section titles — the original leaves clear breathing room before each
 * heading; the native/heading blocks lost it. GLOBAL: applies to the big
 * .section-title (h2) headings on every page, in both content formats. The first
 * heading collapses its top margin against the page top / intro naturally. */
/* Space above section titles. Scoped to `.page-template-page-modular #content` (to
 * beat the classic same-scope rules) and !important (to beat WordPress's flow-layout
 * `margin-block-start` on `.entry-content` children, which otherwise zeroes/overrides
 * a plain `margin-top`). */
.page-template-page-modular #content .section-title { margin-top: 55px !important; }
.page-template-page-modular #content .section-title:first-child,
.page-template-page-modular #content .entry-content > .section-title:first-child { margin-top: 0 !important; }
/* Large single-line labels ("Berichte") that the cows/section-text block now emits
 * as an <h3.section-text-title> — same modest brown sub-heading as the native
 * migrator's promoted H3s (not the big uppercase #content h2). */
#content h3.section-text-title {
	color: var(--wp--preset--color--brand-brown);
	font-weight: 700;
	font-size: 22px;
	line-height: 1.3;
	letter-spacing: 1.08px;
	text-transform: none;
	margin-top: 44px;
	margin-bottom: 18px;
}
/* large_font text sections — mirrors `.section-text.large` (25px / 35px). */
.page-template-page-modular #content .entry-content .text-large {
	font-size: 25px;
	line-height: 35px;
}
@media (max-width: 1200px) {
	.page-template-page-modular #content .entry-content .text-large { line-height: 33px; }
}

/* "Rot" style (is-style-red) — standalone URL/CTA links are RED BOLD TEXT LINKS,
 * NOT filled buttons (matches the original). The migrator now emits plain link
 * paragraphs; this also neutralises any is-style-red buttons already baked into
 * previously-converted pages, so they render as text links without re-conversion. */
.wp-block-button.is-style-red { display: inline-block; margin: 0; }
.wp-block-button.is-style-red .wp-block-button__link {
	background-color: transparent;
	color: var(--wp--preset--color--brand-red);
	border: 0;
	border-radius: 0;
	font-weight: 700;
	padding: 0;
	text-decoration: none;
}
.wp-block-button.is-style-red .wp-block-button__link:hover {
	background-color: transparent;
	color: var(--wp--preset--color--brand-red-dark, #b80619);
	text-decoration: underline;
}
.news-image {
	background-image: var(--news-bg);
}
.parallax-image {
	background-image: var(--parallax-bg);
}

/* Reusable-block mirrors: the classic section styles are scoped to
 * `.page-template-page-modular #content`, so re-declare the same values
 * (unscoped) for the reusable cows blocks — identical look on ANY page. */
.cows-text-link .section-title { font-size: 30px; margin-bottom: 30px; }
.cows-text-link .section-text  { letter-spacing: 1.08px; }
.cows-text-link .section-text p  { margin-bottom: 30px; }
.cows-text-link .section-text ul { padding-left: 20px; }

/* News block (cows/news) — mirrors the classic #news card rules, class-based
 * so it can be reused on any page (and appear more than once). */
/* Section spacing: the classic #news had margin-top:125px (mobile #news-mobile
 * 65px); the block had none, so News sat flush against the section above it. */
.cows-news { margin-top: 125px; }
.cows-news__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.cows-news .news { margin-bottom: 20px; }
.cows-news .news-image { height: 283px; width: 100%; background-size: cover; background-position: center; display: block; }
/* Text aligned with the image's left/right edges (vertical padding only) instead
 * of the classic 35px all-round inset, so the date/title/body line up under the
 * image edge. */
.cows-news .news-info { padding: 35px 0; }
.cows-news .news-info .news-time { font-size: 19px; line-height: 1.2; margin-bottom: 8px; }
.cows-news .news-info h3 { margin-bottom: 9px; }
.cows-news .news-info h3 a { color: var(--wp--preset--color--brand-brown); }
.cows-news .news-info .news-text { letter-spacing: 1.08px; font-size: 18px; line-height: 1.55; }
.cows-news .news-info .news-text .news-link { color: var(--wp--preset--color--brand-red); font-size: 18px; font-weight: 700; }
@media (max-width: 991px) {
	.cows-news { margin-top: 65px; }
	.cows-news__grid { grid-template-columns: 1fr; gap: 20px; }
	.cows-news .news-info { padding: 20px 0; }
}

/* Section-title jump anchors: the id now lives on the heading itself (core/heading
 * `anchor`), replacing the old `<div class="anchor" style="margin-top:-150px">`
 * spacer. scroll-margin-top offsets #{slug} jumps to clear the 70px fixed header. */
.page-template-page-modular #content .section-title { scroll-margin-top: 150px; }

/* Vertical rhythm between modular content sections. */
.section-title,
.section-text,
.section-image,
.youtube-video,
.section-testimonial,
.section-downloads,
.expanding-element,
.external-link {
	margin-bottom: var(--wp--custom--spacing--section-gap);
}

/* Top margin on the text sections so they aren't cramped against the element above
 * — requested for `.section-text`. Applied to both the classic cows/section-text
 * container AND the native-migrated equivalent (a `.text-large` lead paragraph, or
 * the first paragraph after a section heading) so pages in either format match.
 * `.page-template-page-modular #content` scope + !important so these beat the classic
 * same-scope rules AND WordPress's flow-layout `margin-block-start` on entry-content
 * children (which otherwise overrides a plain margin-top). */
.page-template-page-modular #content .section-text {
	margin-top: 40px !important;
}
.page-template-page-modular #content .entry-content > .text-large,
.page-template-page-modular #content .entry-content > h2.section-title + p,
.page-template-page-modular #content .entry-content > h3.wp-block-heading + p {
	margin-top: 40px !important;
}

/* Per-section bottom margin. The classic page-modular.php applied an inline
 * `margin-bottom:{px}` to a section only when its ACF margin_bottom field was
 * truthy (0/empty fell back to the section class default). The block migrator
 * reproduces that override with a `secmb-{px}` utility class on the section's
 * root element (see acf-blocks-migrator's margin_class()), instead of an inline
 * style that would break editor block validation. These rules match the section
 * defaults' specificity (.page-template-page-modular #content .section-*) and,
 * loading later than styles.css, win for the rows that carry the class — while
 * every margin-less row stays on its class default above. Only the values that
 * occur in the data are needed; a superset is listed so re-runs never miss one. */
.page-template-page-modular #content .secmb-5   { margin-bottom: 5px; }
.page-template-page-modular #content .secmb-10  { margin-bottom: 10px; }
.page-template-page-modular #content .secmb-12  { margin-bottom: 12px; }
.page-template-page-modular #content .secmb-15  { margin-bottom: 15px; }
.page-template-page-modular #content .secmb-19  { margin-bottom: 19px; }
.page-template-page-modular #content .secmb-20  { margin-bottom: 20px; }
.page-template-page-modular #content .secmb-25  { margin-bottom: 25px; }
.page-template-page-modular #content .secmb-30  { margin-bottom: 30px; }
.page-template-page-modular #content .secmb-40  { margin-bottom: 40px; }
.page-template-page-modular #content .secmb-50  { margin-bottom: 50px; }
.page-template-page-modular #content .secmb-60  { margin-bottom: 60px; }
.page-template-page-modular #content .secmb-65  { margin-bottom: 65px; }
.page-template-page-modular #content .secmb-70  { margin-bottom: 70px; }
.page-template-page-modular #content .secmb-80  { margin-bottom: 80px; }
.page-template-page-modular #content .secmb-90  { margin-bottom: 90px; }
.page-template-page-modular #content .secmb-100 { margin-bottom: 100px; }
.page-template-page-modular #content .secmb-120 { margin-bottom: 120px; }
.page-template-page-modular #content .secmb-150 { margin-bottom: 150px; }

/* ==========================================================================
   Terminkalender (cows/event-calendar) — the filterable event list that
   replaces The Events Calendar's list view. All colours come from the site
   tokens (brand red for date tiles, brand brown for headings/titles). Scoped
   to .event-calendar so nothing leaks to other pages.
   ========================================================================== */
.event-calendar { margin: 40px 0 80px; color: #555; }

/* Search bar */
.event-calendar .ec-search { position: relative; margin-bottom: 40px; }
.event-calendar .ec-search input[type="text"] {
	width: 100%;
	padding: 18px 62px 18px 20px;
	border: 1px solid #d8d5d0;
	border-radius: 0;
	font-size: 18px;
	color: var(--wp--preset--color--brand-brown);
	background: #fff;
}
.event-calendar .ec-search-btn {
	position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
	background: none; border: none; padding: 8px; cursor: pointer;
	color: var(--wp--preset--color--brand-brown); line-height: 0;
}

/* Top bar: prev/next arrows · Heute · date-range · Liste/Karten · abonnieren.
 * Mirrors the original Events Calendar top bar (which offers the same controls);
 * everything is a plain GET link/dropdown — no JS. */
.event-calendar .ec-topbar { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-bottom: 34px; }
.event-calendar .ec-arrows { display: flex; gap: 10px; }
.event-calendar .ec-arrow {
	width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
	border: 1px solid var(--wp--preset--color--brand-brown); color: var(--wp--preset--color--brand-brown);
	text-decoration: none; background: #fff;
}
.event-calendar .ec-arrow:hover { background: var(--wp--preset--color--brand-brown); color: #fff; }
.event-calendar .ec-arrow.is-disabled { opacity: .35; pointer-events: none; }
.event-calendar .ec-today {
	color: var(--wp--preset--color--brand-brown); text-decoration: none; font-size: 18px;
}
.event-calendar .ec-today:hover { text-decoration: underline; }
.event-calendar .ec-daterange {
	display: inline-flex; align-items: center; gap: 10px;
	background: var(--wp--preset--color--brand-brown); color: #fff;
	font-weight: 700; padding: 12px 22px; letter-spacing: .5px;
}
.event-calendar .ec-daterange svg { flex: 0 0 auto; }
/* Liste / Karten view toggle */
.event-calendar .ec-views { display: flex; }
.event-calendar .ec-view-btn {
	width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
	border: 1px solid var(--wp--preset--color--brand-brown); color: var(--wp--preset--color--brand-brown);
	background: #fff; text-decoration: none;
}
.event-calendar .ec-view-btn + .ec-view-btn { border-left: none; }
.event-calendar .ec-view-btn:hover { background: #f0eeec; }
.event-calendar .ec-view-btn.is-active { background: var(--wp--preset--color--brand-brown); color: #fff; }
/* Kalender abonnieren (export) dropdown */
.event-calendar .ec-subscribe { position: relative; margin-left: auto; }
.event-calendar .ec-subscribe > summary {
	list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 10px;
	border: 1px solid var(--wp--preset--color--brand-brown); color: var(--wp--preset--color--brand-brown);
	background: #fff; padding: 11px 20px; font-size: 16px; white-space: nowrap;
}
.event-calendar .ec-subscribe > summary::-webkit-details-marker { display: none; }
.event-calendar .ec-subscribe > summary::after { content: "▾"; font-size: 13px; }
.event-calendar .ec-subscribe[open] > summary { background: var(--wp--preset--color--brand-brown); color: #fff; }
.event-calendar .ec-subscribe-list {
	position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; min-width: 200px;
	list-style: none; margin: 0; padding: 6px 0; background: #fff;
	border: 1px solid #d8d5d0; box-shadow: 0 6px 22px rgba(0,0,0,.12);
}
.event-calendar .ec-subscribe-list li { margin: 0; }
.event-calendar .ec-subscribe-list a {
	display: block; padding: 10px 20px; color: var(--wp--preset--color--brand-brown);
	text-decoration: none; font-size: 16px;
}
.event-calendar .ec-subscribe-list a:hover { background: #f0eeec; }

/* Two-column layout: filter sidebar + list */
.event-calendar .ec-layout { display: flex; gap: 48px; align-items: flex-start; }
.event-calendar .ec-filters { flex: 0 0 300px; max-width: 300px; }
.event-calendar .ec-list { flex: 1 1 auto; min-width: 0; }

/* Filter sidebar */
.event-calendar .ec-filter-heading {
	color: var(--wp--preset--color--brand-brown);
	font-size: 30px; font-weight: 700; letter-spacing: 2px; margin: 0 0 24px;
}
.event-calendar .ec-filter {
	background: #eeecea; margin-bottom: 14px; border: none;
}
.event-calendar .ec-filter > summary {
	list-style: none; cursor: pointer; padding: 16px 20px;
	color: var(--wp--preset--color--brand-brown); font-size: 17px;
	display: flex; justify-content: space-between; align-items: center;
}
.event-calendar .ec-filter > summary::-webkit-details-marker { display: none; }
.event-calendar .ec-filter > summary::after { content: "+"; font-size: 22px; line-height: 1; color: var(--wp--preset--color--brand-red); }
.event-calendar .ec-filter[open] > summary::after { content: "–"; }
.event-calendar .ec-filter-body { padding: 4px 20px 18px; }
.event-calendar .ec-filter-body label { display: block; margin-bottom: 8px; font-size: 16px; color: #555; cursor: pointer; }
.event-calendar .ec-filter-body input[type="checkbox"] { margin-right: 8px; }
.event-calendar .ec-filter-body input[type="date"] { width: 100%; padding: 8px 10px; border: 1px solid #d8d5d0; }
.event-calendar .ec-filter-actions { margin-top: 20px; display: flex; align-items: center; gap: 16px; }
.event-calendar .ec-filter-submit {
	background: var(--wp--preset--color--brand-red); color: #fff; border: none;
	padding: 12px 24px; font-weight: 700; font-size: 16px; cursor: pointer; border-radius: 0;
}
.event-calendar .ec-filter-submit:hover { background: var(--wp--preset--color--brand-red-dark, #b80619); }
.event-calendar .ec-filter-clear { color: var(--wp--preset--color--brand-brown); font-size: 15px; text-decoration: underline; }

/* Month header */
/* #content prefix so it beats the theme's `#content h2` (ID specificity),
 * which uppercases + would otherwise restyle these headings. */
#content .event-calendar .ec-month {
	color: var(--wp--preset--color--brand-brown);
	font-size: 30px; font-weight: 700; margin: 40px 0 24px;
	text-transform: none; /* the original month labels are mixed-case */
}
.event-calendar .ec-month:first-child { margin-top: 0; }

/* Event row */
.event-calendar .ec-event {
	display: flex; align-items: stretch; gap: 30px;
	padding-bottom: 28px; margin-bottom: 28px;
	border-bottom: 1px solid #e2ded9; text-decoration: none;
}
.event-calendar .ec-event:hover .ec-title { text-decoration: underline; }
.event-calendar .ec-date-tile {
	flex: 0 0 132px; width: 132px; min-height: 132px;
	background: var(--wp--preset--color--brand-red); color: #fff;
	display: flex; flex-direction: column; align-items: center; justify-content: center;
	font-size: 30px; font-weight: 700; line-height: 1.05;
}
.event-calendar .ec-date-tile .ec-wd { font-size: 26px; }
.event-calendar .ec-info { display: flex; flex-direction: column; justify-content: center; }
.event-calendar .ec-when { color: var(--wp--preset--color--brand-brown); font-size: 18px; margin-bottom: 10px; letter-spacing: .5px; }
.event-calendar .ec-title { color: var(--wp--preset--color--brand-brown); font-size: 22px; font-weight: 700; margin-bottom: 12px; }
.event-calendar .ec-kanton { font-style: italic; font-size: 18px; color: #555; margin-bottom: 6px; }
.event-calendar .ec-town { font-size: 18px; color: #555; }
.event-calendar .ec-empty { color: var(--wp--preset--color--brand-brown); font-size: 20px; padding: 20px 0; }

/* Karten (card grid) view — the second of the two Liste/Karten views. */
.event-calendar .ec-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px; margin-bottom: 8px; }
.event-calendar .ec-card { display: flex; flex-direction: column; text-decoration: none; background: #fff; }
.event-calendar .ec-card:hover .ec-title { text-decoration: underline; }
.event-calendar .ec-card-media {
	position: relative; height: 200px; background: #f0eeec no-repeat center / cover;
	display: flex; align-items: center; justify-content: center;
}
.event-calendar .ec-card-media .ec-date-tile { width: 108px; flex: 0 0 108px; min-height: 108px; font-size: 26px; }
.event-calendar .ec-card-media .ec-date-tile .ec-wd { font-size: 20px; }
.event-calendar .ec-card-body { display: flex; flex-direction: column; padding: 20px 4px 0; }

/* Bottom nav — compact, light-bordered "Previous / Upcoming events" buttons (The Events Calendar footer). */
.event-calendar .ec-pagination {
	display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 30px;
}
.event-calendar .ec-page-btn {
	display: inline-flex; align-items: center; gap: 10px;
	border: 1px solid #dcd8d2; color: #3a3a3a;
	background: #fff; padding: 13px 22px; font-size: 16px; font-weight: 400; text-decoration: none;
	transition: border-color .15s, color .15s;
}
.event-calendar .ec-page-btn:hover { border-color: var(--wp--preset--color--brand-brown); color: var(--wp--preset--color--brand-brown); }
.event-calendar .ec-page-btn svg { flex: 0 0 auto; }
.event-calendar .ec-page-spacer { flex: 0 0 auto; width: 1px; }

/* "Subscribe to calendar" — brown button centred in a full-width grey panel, with space before the footer. */
.event-calendar .ec-subscribe-panel {
	background: #ededed; margin-top: 30px; margin-bottom: 48px; padding: 44px 20px 54px;
	display: flex; flex-direction: column; align-items: center;
}
.event-calendar .ec-subscribe--panel { position: static; margin-left: 0; width: 100%; max-width: 900px; display: flex; flex-direction: column; align-items: center; }
.event-calendar .ec-subscribe--panel > summary,
.event-calendar .ec-subscribe--panel[open] > summary {
	justify-content: center; padding: 13px 22px; font-size: 16px;
	background: var(--wp--preset--color--brand-brown); color: #fff; border-color: var(--wp--preset--color--brand-brown);
}
.event-calendar .ec-subscribe--panel .ec-subscribe-list {
	position: static; right: auto; top: auto; box-shadow: none; z-index: auto;
	width: 100%; margin-top: 18px; padding: 20px 24px; background: #fff;
}
.event-calendar .ec-subscribe--panel .ec-subscribe-list a { padding: 11px 4px; font-size: 16px; }

/* Small breakpoints: stack the filter above the list, shrink the date tile. */
@media (max-width: 991px) {
	.event-calendar .ec-layout { flex-direction: column; gap: 30px; }
	.event-calendar .ec-filters { flex-basis: auto; max-width: none; width: 100%; }
	.event-calendar .ec-date-tile { flex-basis: 84px; width: 84px; min-height: 84px; font-size: 22px; }
	.event-calendar .ec-date-tile .ec-wd { font-size: 18px; }
	.event-calendar .ec-event { gap: 18px; }
	.event-calendar .ec-title { font-size: 20px; }
	.event-calendar .ec-subscribe { margin-left: 0; }
}
@media (max-width: 767px) {
	.event-calendar .ec-cards { grid-template-columns: 1fr; }
}

/* Single event detail (cows/event-details) — reproduces the original's The Events
   Calendar single page 1:1. Values mirror the original theme's css/events.css
   (--pri:#786855, --red:#E4081F, --rounded:3px). Section headings deliberately have
   NO font override so the theme's #content h2 (big uppercase brown) governs, exactly
   as on the original where the meta headings sit inside #content. */
.event-detail { margin: 10px 0 80px; color: #555; }

/* Live event search (typeahead) — input 1px #ccc / radius 2px / 60px tall, magnifier
   on the right; suggestion dropdown with landscape thumb + bold name + grey date
   (mirrors the original "Veranstaltungen suchen" ecsa search). */
.event-detail .ed-search { position: relative; margin: 24px 0 40px; }
.event-detail .ed-search-input {
	width: 100%; height: 60px; box-sizing: border-box;
	border: 1px solid #cccccc; border-radius: 2px;
	padding: 0 56px 0 16px; font-size: 16px; color: #222; background: #fff;
}
.event-detail .ed-search-input:focus { outline: none; border-color: var(--wp--preset--color--brand-brown); }
.event-detail .ed-search-icon {
	position: absolute; top: 0; right: 16px; height: 60px;
	display: flex; align-items: center; color: var(--wp--preset--color--brand-brown); pointer-events: none;
}
.event-detail .ed-search-results {
	position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20;
	background: #fff; border: 1px solid #cccccc; max-height: 430px; overflow-y: auto;
	box-shadow: 0 6px 18px rgba(0,0,0,.12);
}
.event-detail .ed-search-item {
	display: flex; align-items: center; gap: 24px; padding: 16px;
	text-decoration: none; border-bottom: 1px solid #eeeeee;
}
.event-detail .ed-search-item:last-child { border-bottom: 0; }
.event-detail .ed-search-item:hover { background: #f7f6f4; }
.event-detail .ed-search-img {
	flex: 0 0 auto; width: 230px; height: 130px;
	background: #eeeeee center/cover no-repeat;
}
/* Events with no thumbnail fall back to the generic cow image — the original forces
   this same image for every search suggestion (events.css .ecsa-img). */
.event-detail .ed-search-img--ph { background-image: url(img/event-search-fallback.jpg); }
.event-detail .ed-search-info { display: flex; flex-direction: column; min-width: 0; }
.event-detail .ed-search-name { color: #222; font-weight: 700; font-size: 20px; line-height: 1.25; margin-bottom: 6px; }
.event-detail .ed-search-date { color: #555; font-size: 16px; }
@media (max-width: 767px) {
	.event-detail .ed-search-img { width: 120px; height: 74px; }
	.event-detail .ed-search-item { gap: 14px; }
}

/* « Alle Veranstaltungen back-link (computed: #786855, 18px, weight 400). */
.event-detail .ed-all {
	display: inline-block; margin: 0 0 24px;
	color: var(--wp--preset--color--brand-brown); font-weight: 400; font-size: 18px; text-decoration: none;
}
.event-detail .ed-all:hover { text-decoration: underline; }

/* Event title (matches the original .tribe-events-single-event-title: 36px,
   bold, brand brown #786855, no transform), placed after the « Alle
   Veranstaltungen back-link and before the date. */
.event-detail .ed-title {
	color: #786855; font-size: 36px; font-weight: 700;
	line-height: 1.55; text-transform: none;
	margin: 8px 0 0;
}
@media (max-width: 767px) {
	.event-detail .ed-title { font-size: 28px; line-height: 1.3; }
}

/* Date (tribe-events-schedule → .tribe-event-date-start): grey #555, 18px, bold. */
.event-detail .ed-date {
	color: #555; font-size: 18px; font-weight: 700;
	margin: 24px 0 32px;
}

/* Prev / next — bordered brown buttons (events.css: 2px solid #786855;
   padding:1.5rem 2rem; border-radius:3px; ← / → arrows). Top and bottom. */
.event-detail .ed-nav { display: flex; justify-content: space-between; gap: 16px; margin: 24px 0; flex-wrap: wrap; }
.event-detail .ed-nav a {
	border: 2px solid var(--wp--preset--color--brand-brown); border-radius: 3px;
	/* ~52px tall like the original (was 24px → 70px). */
	padding: 15px 30px; color: var(--wp--preset--color--brand-brown);
	text-decoration: none; font-weight: 400; line-height: 1;
}
.event-detail .ed-nav a:hover { background: var(--wp--preset--color--brand-brown); color: #fff; }
.event-detail .ed-nav .ed-next { margin-left: auto; }

/* Event description = the town. */
.event-detail .ed-desc { margin: 24px 0; }
.event-detail .ed-desc p { margin: 0; font-size: 18px; color: #555; }

/* "Zum Kalender hinzufügen" — grey #EEEEEE panel, centred; brown button; no icons
   (events.css hides .tribe-common-c-svgicon on single); bordered inline list. */
.event-detail .ed-addcal-panel {
	background: #eeeeee; border-radius: 5px; padding: 64px; margin: 32px 0;
	display: flex; flex-direction: column; align-items: center;
}
.event-detail .ed-addcal.ec-subscribe { position: static; margin: 0; }
.event-detail .ed-addcal.ec-subscribe > summary {
	display: inline-flex; align-items: center; gap: 8px;
	background: var(--wp--preset--color--brand-brown); color: #fff;
	border: 1px solid var(--wp--preset--color--brand-brown); border-radius: 3px;
	padding: 11px 20px; font-size: 19.2px; justify-content: center;
}
.event-detail .ed-addcal.ec-subscribe > summary::after { content: none; } /* use inline caret svg */
.event-detail .ed-cal-icon { width: 19px; height: 19px; flex: 0 0 auto; }
.event-detail .ed-cal-caret { flex: 0 0 auto; }
/* Hover / open (events.css): white bg, brown text + border, icon inverts to dark. */
.event-detail .ed-addcal.ec-subscribe > summary:hover,
.event-detail .ed-addcal.ec-subscribe[open] > summary {
	background: #fff; color: var(--wp--preset--color--brand-brown);
	border-color: var(--wp--preset--color--brand-brown);
}
.event-detail .ed-addcal.ec-subscribe > summary:hover .ed-cal-icon,
.event-detail .ed-addcal.ec-subscribe[open] > summary .ed-cal-icon { filter: invert(1); }
.event-detail .ed-addcal .ec-subscribe-list {
	position: static; margin: 14px auto 0; box-shadow: none;
	border: 1px solid #dcd7e2; min-width: 260px;
}

/* Details / Veranstaltungsort content (headings inherit #content h2). */
.event-detail .ed-details p,
.event-detail .ed-venue p { margin: 0 0 8px; font-size: 18px; color: #555; }
.event-detail .ed-details a { color: var(--wp--preset--color--brand-red); text-decoration: none; word-break: break-word; }
.event-detail .ed-details a:hover { text-decoration: underline; }
.event-detail .ed-kanton { font-style: italic; }

/* Related events — white cards, 3 across; SQUARE image on top, then title (30px
   brown) + date (16px grey). Computed from the original: li bg #fff, img square,
   .tribe-related-event-info padding 8px 16px, title a 30px/700 #786855, date #555. */
.event-detail .ed-related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin-top: 4px; }
.event-detail .ed-related-item { display: flex; flex-direction: column; text-decoration: none; background: #fff; }
.event-detail .ed-related-media {
	display: flex; align-items: center; justify-content: center;
	/* Landscape thumb like the original (307×230 ≈ 4:3), not a tall square. */
	aspect-ratio: 307 / 230; background: #eeeeee; background-size: cover; background-position: center; background-repeat: no-repeat;
}
.event-detail .ed-related-ph { color: #c9c2b6; }
.event-detail .ed-related-body { padding: 8px 16px 16px; }
.event-detail .ed-related-title { display: block; color: var(--wp--preset--color--brand-brown); font-weight: 700; font-size: 30px; line-height: 1.2; margin-bottom: 6px; }
.event-detail .ed-related-item:hover .ed-related-title { text-decoration: underline; }
.event-detail .ed-related-date { display: block; color: #555; font-size: 16px; }

@media (max-width: 991px) {
	.event-detail .ed-related-title { font-size: 24px; }
}
@media (max-width: 767px) {
	.event-detail .ed-related-grid { grid-template-columns: 1fr; }
	.event-detail .ed-addcal-panel { padding: 32px 20px; }
}

/* -------------------------------------------------------------------------
 * Search results — reproduce the original classic search layout with blocks.
 *
 * The original wraps each hit in `.search-row` ( <h2><a>title</a></h2> + <p>
 * excerpt + <a>mehr</a> ). The block query emits the same content through
 * core blocks instead: post-title, post-excerpt, and post-excerpt's
 * more-link ("mehr"). These rules map the block element classes onto the
 * exact `.page-search .search-row` values already in styles.css (font sizes,
 * colours, the red "mehr"), and — being #content-prefixed — beat the theme's
 * `#content h2 { text-transform:uppercase }` and `#content a` colour so the
 * headings render mixed-case in #786855 just like the live site.
 * ---------------------------------------------------------------------- */
.page-search .wp-block-post-template.search-results-list {
	list-style: none;
	margin: 0;
	padding: 0;
	gap: 0;
}
.page-search .wp-block-post {
	margin: 0 0 20px;
}
#content .page-search .wp-block-post-title {
	margin: 0 !important;
	font-size: 30px;
	line-height: 1.2;
	text-transform: none;
}
#content .page-search .wp-block-post-title a {
	color: #786855;
	text-transform: none;
	text-decoration: none;
}
.page-search .wp-block-post-excerpt {
	margin: 0;
}
.page-search .wp-block-post-excerpt__excerpt {
	margin: 0;
	letter-spacing: 1.08px;
	font-size: 18px;
	line-height: 1.55;
}
.page-search .wp-block-post-excerpt__more-text {
	margin: 0;
}
#content .page-search .wp-block-post-excerpt__more-link {
	color: #E4081F;
	font-size: 18px;
	font-weight: 700;
	text-decoration: none;
}
