/* Kurstermine: Liste der kommenden Kurstermine. Fassung 2.0.0 (23.11.2026), Quelle: Repository ki-werkzeuge, Ordner wordpress/kurstermine. */

.kt-termine {
	--kt-accent: #00ace6;
	--kt-red: #e5303b;
	--kt-border: #e3e6ea;
	--kt-text: #2b2f33;
	--kt-muted: #5f6670;
	--kt-bg-soft: #f7f9fa;
	margin: 0 0 2em;
}

.kt-termine,
.kt-termine *,
.kt-termine *::before,
.kt-termine *::after {
	box-sizing: border-box;
}

/* Liste: Theme-Stile für ul/li neutralisieren */
.kt-termine .kt-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.kt-termine .kt-item {
	list-style: none;
	margin: 0 0 14px;
	padding: 18px 20px;
	display: grid;
	grid-template-columns: var(--kt-cal-w, 114px) minmax(0, 1fr) auto; /* feste Kachelspalte, damit alle Titel bündig stehen; minmax(0) verhindert Überbreite durch Formularfelder */
	gap: 20px;
	align-items: center;
	background: #fff;
	border: 1px solid var(--kt-border);
	border-radius: 12px;
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.kt-termine .kt-item::before {
	display: none; /* manche Themes setzen Aufzählungszeichen per ::before */
}

.kt-termine .kt-item:last-child {
	margin-bottom: 0;
}

/* ---- Kalenderkachel ---- */

.kt-termine .kt-cal {
	display: inline-flex;
	align-self: start;
	justify-self: start;
	background: #fff;
	border: 1px solid var(--kt-border);
	border-radius: 10px;
	box-shadow: 0 2px 6px rgba(16, 24, 40, 0.06);
	overflow: hidden;
	line-height: 1;
	text-align: center;
	user-select: none;
}

.kt-termine .kt-cal-col {
	display: flex;
	flex-direction: column;
	min-width: 56px;
}

.kt-termine .kt-cal-col + .kt-cal-col {
	border-left: 1px solid var(--kt-border);
}

.kt-termine .kt-cal-month {
	display: block;
	padding: 7px 8px 6px;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.04em;
	border-bottom: 1px solid var(--kt-border);
}

.kt-termine .kt-cal-start .kt-cal-month {
	color: var(--kt-accent);
}

.kt-termine .kt-cal-end .kt-cal-month {
	color: var(--kt-red);
}

.kt-termine .kt-cal-day {
	display: block;
	padding: 9px 8px 11px;
	font-size: 26px;
	font-weight: 400;
	color: var(--kt-text);
	font-variant-numeric: tabular-nums;
}

/* ---- Inhalt ---- */

.kt-termine .kt-body {
	min-width: 0;
}

.kt-termine .kt-title {
	margin: 0 0 4px;
	padding: 0;
	font-size: 1.15em;
	font-weight: 700;
	line-height: 1.3;
	color: var(--kt-text);
}

.kt-termine .kt-meta {
	margin: 0;
	padding: 0;
	font-size: 0.95em;
	line-height: 1.5;
	color: var(--kt-muted);
}

.kt-termine .kt-range {
	color: var(--kt-text);
	font-weight: 600;
}

.kt-termine .kt-desc {
	margin: 8px 0 0;
	padding: 0;
	font-size: 0.95em;
	line-height: 1.55;
	color: var(--kt-text);
}

/* ---- Status und Button ---- */

.kt-termine .kt-side {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 8px;
}

.kt-termine .kt-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 0.8em;
	font-weight: 700;
	line-height: 1.5;
	white-space: nowrap;
}

.kt-termine .kt-badge-frei {
	background: #e3f5e8;
	color: #1d6b34;
}

.kt-termine .kt-badge-wenige {
	background: #fff1d6;
	color: #8a5300;
}

.kt-termine .kt-button {
	display: inline-block;
	padding: 11px 20px;
	border-radius: 8px;
	background: var(--kt-accent);
	color: #fff !important;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	text-decoration: none !important;
	white-space: nowrap;
	transition: filter 0.15s ease;
}

.kt-termine a.kt-button:hover,
.kt-termine a.kt-button:focus-visible {
	filter: brightness(0.9);
}

.kt-termine a.kt-button:focus-visible {
	outline: 3px solid var(--kt-accent);
	outline-offset: 2px;
}

.kt-termine .kt-button-disabled {
	background: #e9ecef;
	color: var(--kt-muted) !important;
	cursor: not-allowed;
}

.kt-termine .kt-status-ausgebucht .kt-cal,
.kt-termine .kt-status-ausgebucht .kt-title,
.kt-termine .kt-status-ausgebucht .kt-range {
	opacity: 0.6;
}

.kt-termine .kt-empty {
	margin: 0;
	padding: 16px 20px;
	border-left: 4px solid var(--kt-accent);
	background: var(--kt-bg-soft);
}

/* ---- Tablet: Button unter den Inhalt ---- */
@media (max-width: 900px) {
	.kt-termine .kt-item {
		grid-template-columns: var(--kt-cal-w, 114px) minmax(0, 1fr);
		align-items: start;
	}

	.kt-termine .kt-side {
		grid-column: 2;
		flex-direction: row;
		align-items: center;
		justify-content: flex-start;
		flex-wrap: wrap;
	}
}

/* ---- Handy: Kachel neben Titel, Beschreibung und Button über die volle Breite ---- */
@media (max-width: 560px) {
	.kt-termine {
		--kt-cal-w: 102px;
	}

	.kt-termine .kt-item {
		gap: 12px 14px;
		padding: 16px;
	}

	.kt-termine .kt-body {
		display: contents;
	}

	.kt-termine .kt-cal {
		grid-column: 1;
		grid-row: 1 / span 2;
	}

	.kt-termine .kt-title {
		grid-column: 2;
		grid-row: 1;
		align-self: end;
		margin: 0;
	}

	.kt-termine .kt-meta {
		grid-column: 2;
		grid-row: 2;
		align-self: start;
	}

	.kt-termine .kt-desc {
		grid-column: 1 / -1;
		margin: 0;
	}

	.kt-termine .kt-cal-col {
		min-width: 50px;
	}

	.kt-termine .kt-cal-day {
		font-size: 22px;
	}

	.kt-termine .kt-side {
		grid-column: 1 / -1;
		flex-direction: column;
		align-items: stretch;
	}

	.kt-termine .kt-badge {
		align-self: flex-start;
	}

	.kt-termine .kt-button {
		display: block;
		width: 100%;
	}
}

/* ===================================================================
 * Anmeldeformular (Contact Form 7), aufklappbar direkt unter dem Termin
 * ================================================================= */

.kt-termine .kt-slot {
	display: none;
	grid-column: 1 / -1;
	min-width: 0;
}

.kt-termine .kt-item-open .kt-slot {
	display: block;
}

.kt-termine .kt-item-open {
	border-color: var(--kt-accent);
	box-shadow: 0 4px 16px rgba(0, 172, 230, 0.12);
}

.kt-termine .kt-button-open {
	background: #fff;
	color: var(--kt-accent) !important;
	box-shadow: inset 0 0 0 2px var(--kt-accent);
}

.kt-termine .kt-panel {
	margin: 2px 0 0;
	padding: 20px 0 0;
	border-top: 1px solid var(--kt-border);
	animation: kt-panel-in 0.2s ease-out;
}

.kt-termine .kt-panel[hidden] {
	display: none;
}

@keyframes kt-panel-in {
	from { opacity: 0; transform: translateY(-6px); }
	to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.kt-termine .kt-panel {
		animation: none;
	}
}

.kt-termine .kt-panel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 14px;
}

.kt-termine .kt-panel-title {
	margin: 0;
	padding: 0;
	font-size: 0.8em;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--kt-accent);
}

/* Schließen-Knopf nur mit JavaScript sinnvoll */
.kt-termine .kt-panel-close {
	display: none;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 6px 10px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: var(--kt-muted);
	font: inherit;
	font-size: 0.9em;
	line-height: 1.2;
	cursor: pointer;
}

.kt-js .kt-termine .kt-panel-close {
	display: inline-flex;
}

.kt-termine .kt-panel-close span {
	font-size: 1.4em;
	line-height: 1;
}

.kt-termine .kt-panel-close:hover,
.kt-termine .kt-panel-close:focus-visible {
	background: var(--kt-bg-soft);
	color: var(--kt-text);
}

/* Contact Form 7: Gestaltung kommt vom Theme (wie auf der Kontaktseite),
   hier nur, was im Termin nötig ist. */
.kt-termine .kt-panel-form .wpcf7 input[type="text"],
.kt-termine .kt-panel-form .wpcf7 input[type="email"],
.kt-termine .kt-panel-form .wpcf7 input[type="tel"],
.kt-termine .kt-panel-form .wpcf7 input[type="date"],
.kt-termine .kt-panel-form .wpcf7 input[type="number"],
.kt-termine .kt-panel-form .wpcf7 select,
.kt-termine .kt-panel-form .wpcf7 textarea {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

.kt-termine .kt-panel-form .wpcf7-form > p:last-of-type {
	margin-bottom: 0;
}

/* Versteckt abgelegte Formulare (vor dem ersten Klick) */
.kt-termine > .kt-panel {
	border: 0;
	padding: 0;
}

.kt-termine .kt-panel-form,
.kt-termine .kt-panel-form .wpcf7,
.kt-termine .kt-panel-form form {
	min-width: 0;
	max-width: 100%;
}

/* Lange deutsche Wörter (z. B. „Führerscheinklassen“) sauber trennen statt hart umbrechen */
.kt-termine .kt-title,
.kt-termine .kt-desc {
	-webkit-hyphens: auto;
	hyphens: auto;
	overflow-wrap: break-word;
}
