/**
 * ZUKE Events – Frontend-Styles für alle vier Ansichten + Detail-Overlay.
 *
 * Alle Farben/Maße laufen über --zke-* Custom Properties: Defaults hier,
 * global überschrieben durch die "Events → Design"-Einstellungen (Inline-CSS),
 * pro Shortcode-Instanz überschreibbar via style-Attribut auf .zke.
 * Das Overlay hängt am <body>, bekommt die Instanz-Variablen vom JS kopiert.
 */

.zke,
.zke-overlay {
	--zke-accent: #689f38;
	--zke-accent-bright: #c6ff00;
	--zke-ink: #0f2b0f;
	--zke-text: #1a2e1a;
	--zke-muted: #4b5563;
	--zke-soft: #6b7280;
	--zke-line: #e5e7eb;
	--zke-paper: #fafcf8;
	--zke-card-bg: #ffffff;
	--zke-card-text: #1a2e1a;
	--zke-card-border: #8bc34a;
	--zke-card-border-width: 3px;
	--zke-card-radius: 18px;
	--zke-font-display: 'Oswald', 'Helvetica Neue', Arial, sans-serif;
	--zke-font-body: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

	font-family: var(--zke-font-body);
	color: var(--zke-text);
}

.zke *,
.zke *::before,
.zke *::after,
.zke-overlay *,
.zke-overlay *::before,
.zke-overlay *::after {
	box-sizing: border-box;
}

.zke button {
	font: inherit;
}

.zke-empty {
	font-family: var(--zke-font-body, inherit);
	color: #6b7280;
	font-size: 0.95rem;
}

.zke-arrow {
	display: inline-block;
	transition: transform 0.18s ease;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* =====================================================================
   Listenansicht
   ===================================================================== */

.zke-list {
	display: grid;
	gap: 16px;
}

.zke-row {
	display: grid;
	grid-template-columns: 110px 1fr;
	gap: 24px;
	align-items: center;
	background: #ffffff;
	border: 1px solid var(--zke-line);
	border-radius: 6px;
	padding: 22px 26px;
	cursor: pointer;
	transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.zke-row:hover,
.zke-row:focus-visible {
	border-color: var(--zke-accent);
	box-shadow: 0 8px 20px rgba(15, 43, 15, 0.08);
	transform: translateY(-1px);
}

.zke-row:focus-visible {
	outline: 2px solid var(--zke-accent);
	outline-offset: 2px;
}

.zke-row--highlight {
	border-color: var(--zke-card-border);
	background: linear-gradient(135deg, #ffffff, #e8f5e9);
}

/* v1.1.0: Hervorgehobene Events (z. B. der eigene Kongress) größer — mehr
   Fläche, größere Schrift, größere Logo-Fläche. */
.zke-row--highlight {
	grid-template-columns: 140px 1fr;
	gap: 32px;
	padding: 34px 38px;
}

.zke-row--highlight .zke-row__day {
	font-size: 2.3rem;
}

.zke-row--highlight .zke-row__month {
	font-size: 0.9rem;
}

.zke-row--highlight .zke-row__title {
	font-size: 1.5rem;
	margin-bottom: 8px;
}

.zke-row--highlight .zke-row__excerpt {
	font-size: 1rem;
}

.zke-row--highlight .zke-row__meta {
	font-size: 0.9rem;
}

.zke-row--highlight .zke-row__logo {
	flex-basis: 240px;
	width: 240px;
	height: 128px;
	padding: 16px 20px;
}

.zke-row__date {
	text-align: center;
	border-right: 1px solid var(--zke-line);
	padding-right: 16px;
}

.zke-row__day {
	font-family: var(--zke-font-display);
	font-weight: 700;
	font-size: 1.6rem;
	color: var(--zke-ink);
	line-height: 1;
}

.zke-row__month {
	font-size: 0.78rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.18em;
	color: var(--zke-accent);
	margin-top: 4px;
}

.zke-row__main {
	display: flex;
	gap: 24px;
	align-items: center;
	min-width: 0;
}

.zke-row__body {
	flex: 1 1 auto;
	min-width: 0;
}

.zke-row__title {
	font-family: var(--zke-font-display);
	font-weight: 600;
	font-size: 1.1rem;
	color: var(--zke-ink);
	margin: 0 0 4px;
}

.zke-row__excerpt {
	font-size: 0.9rem;
	color: var(--zke-muted);
	margin: 0;
	line-height: 1.6;
}

.zke-row__meta {
	font-size: 0.82rem;
	color: var(--zke-soft);
	margin-top: 6px;
}

.zke-row__note {
	font-size: 0.8rem;
	font-style: italic;
	color: var(--zke-accent);
	margin-top: 4px;
}

.zke-row__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 18px;
	margin-top: 12px;
}

.zke-row__more,
.zke-row__link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--zke-accent);
	text-decoration: none;
}

.zke-row:hover .zke-row__more .zke-arrow {
	transform: translateX(3px);
}

.zke-row__link:hover,
.zke-row__link:focus-visible {
	color: var(--zke-ink);
	text-decoration: underline;
}

/* v1.1.0: Feste Fläche fürs Veranstaltungslogo (Beitragsbild), damit Logos
   unterschiedlicher Formate gleich ruhig wirken. Erscheint nur mit Logo. */
.zke-row__logo {
	flex: 0 0 180px;
	width: 180px;
	height: 96px;
	padding: 12px 16px;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #ffffff;
	border: 1px solid var(--zke-line);
	border-radius: 6px;
}

.zke-row__logo-img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
}

/* =====================================================================
   Teaser-Grid (minimalistisch: Bild & Titel)
   ===================================================================== */

.zke-grid {
	display: grid;
	grid-template-columns: repeat(var(--zke-grid-cols, 3), 1fr);
	gap: 22px;
}

.zke-tile {
	display: flex;
	flex-direction: column;
	gap: 0;
	padding: 0;
	background: #ffffff;
	border: 1px solid var(--zke-line);
	border-radius: 10px;
	overflow: hidden;
	cursor: pointer;
	text-align: left;
	transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.zke-tile:hover,
.zke-tile:focus-visible {
	border-color: var(--zke-accent);
	box-shadow: 0 10px 24px rgba(15, 43, 15, 0.1);
	transform: translateY(-3px);
}

.zke-tile:focus-visible {
	outline: 2px solid var(--zke-accent);
	outline-offset: 2px;
}

.zke-tile--highlight {
	border-color: var(--zke-card-border);
}

.zke-tile__media {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 16 / 10;
	background: linear-gradient(135deg, #f4f9ef, #e8f5e9);
	overflow: hidden;
}

.zke-tile__img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: 14px;
	transition: transform 0.25s ease;
}

.zke-tile:hover .zke-tile__img {
	transform: scale(1.04);
}

.zke-tile__fallback {
	font-family: var(--zke-font-display);
	font-size: 3rem;
	font-weight: 700;
	color: var(--zke-accent);
	opacity: 0.55;
}

.zke-tile__title {
	font-family: var(--zke-font-display);
	font-weight: 600;
	font-size: 1rem;
	line-height: 1.35;
	color: var(--zke-ink);
	padding: 14px 16px 16px;
}

/* =====================================================================
   Kalenderansicht
   ===================================================================== */

.zke-cal {
	background: #ffffff;
	border: 1px solid var(--zke-line);
	border-radius: 10px;
	padding: 20px;
}

.zke-cal__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 14px;
}

.zke-cal__title {
	font-family: var(--zke-font-display);
	font-weight: 600;
	font-size: 1.25rem;
	color: var(--zke-ink);
	margin: 0;
	text-align: center;
}

.zke-cal__nav {
	flex: 0 0 auto;
	width: 38px;
	height: 38px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 1.4rem;
	line-height: 1;
	color: var(--zke-ink);
	background: #ffffff;
	border: 1px solid var(--zke-line);
	border-radius: 50%;
	cursor: pointer;
	transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.zke-cal__nav:hover:not(:disabled),
.zke-cal__nav:focus-visible {
	background: var(--zke-accent);
	border-color: var(--zke-accent);
	color: #ffffff;
}

.zke-cal__nav:disabled {
	opacity: 0.35;
	cursor: default;
}

.zke-cal__weekdays {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 4px;
	margin-bottom: 4px;
}

.zke-cal__weekdays span {
	text-align: center;
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: var(--zke-soft);
	padding: 6px 0;
}

.zke-cal__grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 4px;
}

.zke-cal__day {
	position: relative;
	min-height: 86px;
	background: var(--zke-paper);
	border: 1px solid var(--zke-line);
	border-radius: 6px;
	padding: 26px 4px 4px;
	overflow: hidden;
}

.zke-cal__day--pad {
	background: transparent;
	border-color: transparent;
}

.zke-cal__day--today {
	border-color: var(--zke-accent);
	box-shadow: inset 0 0 0 1px var(--zke-accent);
}

.zke-cal__day--today .zke-cal__num {
	background: var(--zke-accent);
	color: #ffffff;
}

.zke-cal__num {
	position: absolute;
	top: 4px;
	right: 4px;
	min-width: 20px;
	height: 20px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 0.72rem;
	font-weight: 600;
	color: var(--zke-soft);
	border-radius: 10px;
	padding: 0 5px;
}

.zke-cal__events {
	display: grid;
	gap: 3px;
}

.zke-cal__event {
	display: block;
	width: 100%;
	border: 0;
	background: var(--zke-accent);
	color: #ffffff;
	font-size: 0.72rem;
	font-weight: 600;
	line-height: 1.25;
	text-align: left;
	padding: 3px 7px;
	border-radius: 3px;
	cursor: pointer;
	transition: filter 0.15s ease;
}

.zke-cal__event:hover,
.zke-cal__event:focus-visible {
	filter: brightness(1.12);
}

.zke-cal__event--hl {
	background: var(--zke-ink);
	box-shadow: inset 0 0 0 1px var(--zke-accent-bright);
}

.zke-cal__event--first {
	border-top-left-radius: 8px;
	border-bottom-left-radius: 8px;
}

.zke-cal__event--last {
	border-top-right-radius: 8px;
	border-bottom-right-radius: 8px;
}

.zke-cal__event-label {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* =====================================================================
   Event-Card (Trading-Card-Stil) — Teaser und Detail
   ===================================================================== */

.zke-card {
	position: relative;
	width: 100%;
	max-width: 420px;
	background: var(--zke-card-bg);
	color: var(--zke-card-text);
	border: var(--zke-card-border-width) solid var(--zke-card-border);
	border-radius: var(--zke-card-radius);
	padding: 18px;
	box-shadow: 0 14px 34px rgba(15, 43, 15, 0.14);
	overflow: hidden;
}

.zke--single {
	display: flex;
	justify-content: center;
}

/* Dezenter Holo-Schimmer auf Hover (nur Teaser). */
.zke-card--teaser::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, 0.35) 50%, transparent 62%);
	transform: translateX(-120%);
	pointer-events: none;
}

.zke-card--teaser:hover::after {
	transition: transform 0.7s ease;
	transform: translateX(120%);
}

.zke-card--highlight {
	box-shadow: 0 14px 34px rgba(15, 43, 15, 0.14), 0 0 0 3px rgba(198, 255, 0, 0.35);
}

.zke-card__back {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 12px;
	padding: 7px 14px;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--zke-card-text);
	background: transparent;
	border: 1px solid var(--zke-card-border);
	border-radius: 999px;
	cursor: pointer;
	transition: background 0.18s ease, color 0.18s ease;
}

.zke-card__back:hover,
.zke-card__back:focus-visible {
	background: var(--zke-accent);
	border-color: var(--zke-accent);
	color: #ffffff;
}

.zke-card__back:hover .zke-arrow {
	transform: translateX(-3px);
}

.zke-card__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 14px;
	margin-bottom: 12px;
}

.zke-card__title {
	font-family: var(--zke-font-display);
	font-weight: 700;
	font-size: 1.25rem;
	line-height: 1.25;
	color: inherit;
	margin: 0;
}

.zke-card__badge {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-width: 58px;
	padding: 6px 8px;
	background: var(--zke-accent);
	color: #ffffff;
	border-radius: 10px;
}

.zke-card__badge-day {
	font-family: var(--zke-font-display);
	font-weight: 700;
	font-size: 1.05rem;
	line-height: 1;
	white-space: nowrap;
}

.zke-card__badge-month {
	font-size: 0.68rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	margin-top: 3px;
}

.zke-card__media {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 16 / 10;
	background: linear-gradient(135deg, #f4f9ef, #e8f5e9);
	border: 1px solid var(--zke-line);
	border-radius: calc(var(--zke-card-radius) / 2);
	overflow: hidden;
	margin-bottom: 14px;
}

.zke-card__img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: 12px;
}

.zke-card__media-fallback {
	font-family: var(--zke-font-display);
	font-size: 3.4rem;
	font-weight: 700;
	color: var(--zke-accent);
	opacity: 0.55;
}

.zke-card__meta {
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0 0 12px;
	padding: 10px 12px;
	background: rgba(104, 159, 56, 0.08);
	border-radius: calc(var(--zke-card-radius) / 2);
	font-size: 0.85rem;
}

.zke-card__meta li {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
}

.zke-icon {
	flex: 0 0 auto;
	width: 15px;
	height: 15px;
	color: var(--zke-accent);
}

.zke-card__body {
	font-size: 0.9rem;
	line-height: 1.65;
}

.zke-card__excerpt {
	margin: 0;
}

.zke-card__content p {
	margin: 0 0 0.8em;
}

.zke-card__content p:last-child {
	margin-bottom: 0;
}

.zke-card__note {
	font-size: 0.8rem;
	font-style: italic;
	color: var(--zke-accent);
	margin: 10px 0 0;
}

.zke-card__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 16px;
}

.zke-card__foot:empty {
	display: none;
	margin: 0;
}

.zke-card__link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--zke-accent);
	text-decoration: none;
}

.zke-card__link:hover,
.zke-card__link:focus-visible {
	text-decoration: underline;
}

.zke-card__more {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 9px 18px;
	font-size: 0.85rem;
	font-weight: 600;
	color: #ffffff;
	background: var(--zke-accent);
	border: 0;
	border-radius: 999px;
	cursor: pointer;
	transition: filter 0.18s ease;
}

.zke-card__more:hover,
.zke-card__more:focus-visible {
	filter: brightness(1.12);
}

.zke-card__more:hover .zke-arrow {
	transform: translateX(3px);
}

/* =====================================================================
   Detail-Overlay + FLIP-Animation
   ===================================================================== */

.zke-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.zke-overlay__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 32, 16, 0.55);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.zke-overlay.is-open .zke-overlay__backdrop {
	opacity: 1;
}

.zke-overlay__card {
	position: relative;
	width: min(560px, 94vw);
	max-height: min(88vh, 88svh);
	overflow-y: auto;
	overscroll-behavior: contain;
	transform-origin: top left;
	will-change: transform, opacity;
	transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.32s ease;
	border-radius: var(--zke-card-radius);
}

.zke-overlay__card .zke-card {
	max-width: none;
}

.zke-noscroll {
	overflow: hidden;
}

/* =====================================================================
   Responsive
   ===================================================================== */

@media (max-width: 980px) {
	.zke-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 768px) {
	.zke-row {
		grid-template-columns: 80px 1fr;
		gap: 16px;
		padding: 18px 20px;
	}

	.zke-row__day {
		font-size: 1.3rem;
	}

	.zke-row__main {
		flex-direction: column-reverse;
		align-items: flex-start;
		gap: 14px;
	}

	/* Logo-Fläche steht mobil über dem Text, volle Breite bis 220 px. */
	.zke-row__logo,
	.zke-row--highlight .zke-row__logo {
		flex-basis: auto;
		width: 100%;
		max-width: 220px;
		height: 96px;
	}

	.zke-row--highlight {
		gap: 16px;
		padding: 22px 20px;
	}

	/* Gleiche Größe wie normale Zeilen — „24–25" passt sonst nicht in 80 px. */
	.zke-row--highlight .zke-row__day {
		font-size: 1.3rem;
	}

	.zke-row--highlight .zke-row__title {
		font-size: 1.25rem;
	}

	.zke-cal__day {
		min-height: 56px;
		padding: 22px 3px 3px;
	}

	/* Chips → Punkte, Titel steckt im title-Attribut / aria-label. */
	.zke-cal__event {
		width: 10px;
		height: 10px;
		padding: 0;
		border-radius: 50%;
		margin: 0 auto;
	}

	.zke-cal__event-label {
		display: none;
	}

	.zke-cal__events {
		grid-template-columns: repeat(auto-fit, 10px);
		justify-content: center;
		gap: 3px;
	}
}

@media (max-width: 560px) {
	.zke-grid {
		grid-template-columns: 1fr;
	}

	.zke-overlay {
		padding: 12px;
	}
}

/* =====================================================================
   Reduzierte Bewegung
   ===================================================================== */

@media (prefers-reduced-motion: reduce) {
	.zke *,
	.zke-overlay,
	.zke-overlay__card,
	.zke-overlay__backdrop {
		transition: none !important;
		animation: none !important;
	}
}
