/* Termine-Modul: Monatskalender + Liste der nächsten Termine.
   Nutzt --accent / --ink / --muted / --line / --bg der jeweiligen Website. */
.mod-events { --ev-accent: var(--accent, #2563eb); --ev-ink: var(--ink, #0f172a); --ev-muted: var(--muted, #64748b); --ev-line: var(--line, #e5e7ef); --ev-bg: var(--surface, #fff); }
.mod-events { margin: 0; padding-block: 0; }
.mod-events .ev-upcoming h3, .mod-events h3 { margin: 0 0 6px; font-size: 1.35em; }
.mod-events h4 { margin: 0 0 4px; font-size: 1.05em; }

/* ---- Kalender ---- */
.ev-calendar { margin: 0 0 28px; border: 1px solid var(--ev-line); border-radius: 18px; background: var(--ev-bg); overflow: hidden; }
.ev-cal-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--ev-line); }
.ev-cal-title { flex: 1; margin: 0; font-size: 1.15em; font-weight: 700; text-transform: capitalize; }
.ev-nav { appearance: none; border: 1px solid var(--ev-line); background: transparent; color: var(--ev-ink); border-radius: 999px; min-width: 38px; height: 38px; padding: 0 12px; font: inherit; font-weight: 600; cursor: pointer; transition: background-color .15s, border-color .15s; }
.ev-nav:hover { border-color: var(--ev-accent); color: var(--ev-accent); }
.ev-nav:focus-visible, .ev-day:focus-visible, .ev-ics:focus-visible { outline: 2px solid var(--ev-accent); outline-offset: 2px; }

.ev-weekdays, .ev-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.ev-weekdays span { padding: 10px 6px; text-align: center; font-size: .78em; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ev-muted); }
.ev-day { appearance: none; position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 3px; min-height: 72px; padding: 6px; border: 0; border-top: 1px solid var(--ev-line); border-left: 1px solid var(--ev-line); background: transparent; color: var(--ev-ink); font: inherit; text-align: left; cursor: default; }
.ev-day:nth-child(7n+1) { border-left: 0; }
.ev-day.has { cursor: pointer; }
.ev-day.has:hover { background: color-mix(in srgb, var(--ev-accent) 6%, transparent); }
.ev-day.out { color: var(--ev-muted); opacity: .45; }
.ev-day.sel { background: color-mix(in srgb, var(--ev-accent) 10%, transparent); box-shadow: inset 0 0 0 2px var(--ev-accent); }
.ev-num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: .88em; font-weight: 600; }
.ev-day.today .ev-num { background: var(--ev-accent); color: #fff; }
.ev-chip { display: block; padding: 2px 7px; border-radius: 6px; background: color-mix(in srgb, var(--ev-accent) 14%, transparent); color: var(--ev-ink); font-size: .74em; font-weight: 600; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mod-events .ev-more { display: block; margin: 0; padding: 0 0 0 4px; border-radius: 0; background: none; transform: none; gap: 0; font-size: .72em; font-weight: 600; color: var(--ev-muted); text-decoration: none; }
.mod-events .ev-more:hover { transform: none; gap: 0; }
.ev-dots { display: none; gap: 3px; justify-content: center; margin-top: auto; }
.ev-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--ev-accent); }

.ev-detail { padding: 18px 20px 20px; border-top: 1px solid var(--ev-line); background: color-mix(in srgb, var(--ev-accent) 4%, transparent); }
.ev-detail[hidden] { display: none; }
.ev-detail h4 { margin: 0 0 10px; text-transform: capitalize; }
.ev-detail .ev-item { padding: 14px 0; }

/* ---- Liste ---- */
.ev-item { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 18px; padding: 20px 0; border-bottom: 1px solid var(--ev-line); }
.ev-item:has(.ev-img) { grid-template-columns: 64px minmax(0, 1fr) 150px; }
.ev-item:first-of-type { padding-top: 14px; }
.ev-item:last-child { border-bottom: 0; }
.ev-badge { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 64px; height: 68px; border-radius: 14px; background: color-mix(in srgb, var(--ev-accent) 12%, transparent); color: var(--ev-accent); line-height: 1.1; }
.ev-badge strong { font-size: 1.55em; }
.ev-badge span { font-size: .75em; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.ev-meta { display: flex; flex-wrap: wrap; gap: 2px 18px; margin: 0 0 6px; font-size: .9em; color: var(--ev-muted); }
.ev-text { margin: 6px 0 0; white-space: pre-line; }
.ev-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 10px 0 0; }
.ev-link { color: var(--ev-accent); font-weight: 600; text-decoration: none; }
.ev-link:hover { text-decoration: underline; }
.ev-ics { appearance: none; border: 1px solid var(--ev-line); background: transparent; color: var(--ev-ink); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: .85em; font-weight: 600; cursor: pointer; }
.ev-ics:hover { border-color: var(--ev-accent); color: var(--ev-accent); }
.ev-ics[hidden] { display: none; }
.ev-item[hidden] { display: none; }
.ev-showmore { appearance: none; display: block; margin: 14px auto 0; border: 1px solid var(--ev-line); background: transparent; color: var(--ev-ink); border-radius: 999px; padding: 10px 22px; font: inherit; font-weight: 600; cursor: pointer; }
.ev-showmore:hover { border-color: var(--ev-accent); color: var(--ev-accent); }
.ev-showmore[hidden] { display: none; }
.ev-img { width: 150px; height: 110px; object-fit: cover; border-radius: 12px; }

@media (max-width: 760px) {
    .ev-day { min-height: 50px; align-items: center; padding: 4px 2px; }
    .ev-chip, .mod-events .ev-more { display: none; }
    .ev-dots { display: flex; }
    .ev-item, .ev-item:has(.ev-img) { grid-template-columns: 56px minmax(0, 1fr); gap: 14px; }
    .ev-badge { width: 56px; height: 60px; }
    .ev-img { grid-column: 1 / -1; width: 100%; height: auto; aspect-ratio: 16/9; }
}
@media (prefers-reduced-motion: reduce) { .ev-nav { transition: none; } }