/* ChurchTools Termine – übernimmt Schrift und Textfarbe vom Theme. */

.ctt {
	--ctt-akzent: currentColor;
	--ctt-linie: rgba(128, 128, 128, 0.28);
	--ctt-flaeche: rgba(128, 128, 128, 0.08);
	--ctt-radius: 10px;
	margin: 0 0 1.5em;
	padding: 0;
	list-style: none;
}

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

/* WordPress reserviert für noch nicht geladene Bilder ersatzweise 3000×1500 px. Hier geben Rahmen bzw.
   Bildmaße die Größe vor – ohne diese Zeile würde ein defektes Bild beim Format "original" riesig. */
.ctt img {
	contain-intrinsic-size: none;
}

.ctt .ctt-titel {
	margin: 0;
	padding: 0;
	font-size: 1.15em;
	line-height: 1.3;
	text-wrap: balance;
	overflow-wrap: anywhere;
	hyphens: auto;
}

.ctt .ctt-titel a {
	color: inherit;
	text-decoration: none;
}

.ctt .ctt-titel a:hover,
.ctt .ctt-titel a:focus-visible {
	text-decoration: underline;
}

.ctt .ctt-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0 1.1em;
	margin-top: 0.3em;
	font-size: 0.92em;
	line-height: 1.45;
	opacity: 0.8;
}

.ctt .ctt-zeit {
	white-space: nowrap;
}

.ctt .ctt-ort {
	overflow-wrap: anywhere;
}

.ctt .ctt-text {
	margin: 0.45em 0 0;
	font-size: 0.95em;
	line-height: 1.5;
}

.ctt .ctt-tag {
	display: block;
	font-size: 2.3em;
	font-weight: 700;
	line-height: 1;
}

.ctt .ctt-wtag {
	display: block;
	margin-top: 0.4em;
	font-size: 0.78em;
	line-height: 1;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	opacity: 0.7;
}

/* ---------- Layout "liste" ---------- */

.ctt--liste .ctt-monat {
	margin: 1.8em 0 0.7em;
	padding: 0;
	font-size: 1em;
	line-height: 1.3;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	opacity: 0.7;
}

.ctt--liste .ctt-monat:first-child {
	margin-top: 0;
}

.ctt--liste .ctt-termin {
	display: flex;
	align-items: center;
	gap: 1.2em;
	margin: 0 0 0.7em;
	padding: 0.95em 1em 0.95em 1.1em;
	border-left: 5px solid var(--ctt-farbe, var(--ctt-akzent));
	border-radius: 0 var(--ctt-radius) var(--ctt-radius) 0;
	background: var(--ctt-flaeche);
}

.ctt--liste .ctt-datum {
	flex: 0 0 3.4em;
	text-align: center;
}

.ctt--liste .ctt-inhalt {
	flex: 1 1 auto;
	min-width: 0;
}

.ctt--liste .ctt-bild {
	flex: 0 0 8.5em;
	overflow: hidden;
	border-radius: 6px;
	aspect-ratio: var(--ctt-format, 16 / 9);
}

/* Das Seitenverhältnis sitzt bewusst am Rahmen, nicht am Bild: So behält das Bild beim Format "original"
   seine eigenen Maße (auch schon, bevor es geladen ist). */
.ctt--liste .ctt-bild a {
	display: block;
	height: var(--ctt-bild-h, 100%);
}

.ctt--liste .ctt-bild img {
	display: block;
	width: 100%;
	height: var(--ctt-bild-h, 100%);
	object-fit: cover;
}

@media (max-width: 560px) {
	.ctt--liste .ctt-termin {
		flex-wrap: wrap;
		gap: 0.8em 1em;
	}

	.ctt--liste .ctt-bild {
		flex: 1 0 100%;
		order: -1;
	}

	.ctt--liste .ctt-inhalt {
		flex: 1 1 0;
	}
}

/* ---------- Layout "kacheln" ---------- */

.ctt--kacheln {
	--ctt-abstand: 1.4em;
	display: grid;
	/* Höchstens --ctt-spalten Spalten; wird es enger als 13em je Karte, werden es automatisch weniger. */
	grid-template-columns: repeat(
		auto-fill,
		minmax(
			min(100%, max(13em, calc((100% - (var(--ctt-spalten, 3) - 1) * var(--ctt-abstand)) / var(--ctt-spalten, 3)))),
			1fr
		)
	);
	gap: var(--ctt-abstand);
}

.ctt--kacheln .ctt-karte {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border-radius: var(--ctt-radius);
	background: var(--ctt-flaeche);
	border-bottom: 4px solid var(--ctt-farbe, var(--ctt-akzent));
}

.ctt--kacheln .ctt-karte-kopf {
	position: relative;
	min-height: var(--ctt-kopf-min, 0);
	aspect-ratio: var(--ctt-format, 16 / 9);
	background: var(--ctt-linie);
}

/* Ohne Bild: Fläche in der Kalenderfarbe tönen. */
.ctt--kacheln .ctt-karte-kopf--ohne {
	aspect-ratio: var(--ctt-format-leer, var(--ctt-format, 16 / 9));
	background: color-mix(in srgb, var(--ctt-farbe, #888) 30%, transparent);
}

.ctt--kacheln .ctt-karte-kopf a {
	display: block;
	height: var(--ctt-bild-h, 100%);
}

.ctt--kacheln .ctt-karte-kopf img {
	display: block;
	width: 100%;
	height: var(--ctt-bild-h, 100%);
	object-fit: cover;
}

.ctt--kacheln .ctt-plakette {
	position: absolute;
	top: 0.8em;
	left: 0.8em;
	min-width: 3.4em;
	padding: 0.55em 0.6em 0.5em;
	border-radius: 8px;
	background: #fff;
	color: #1a1a1a;
	text-align: center;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

.ctt--kacheln .ctt-plakette .ctt-tag {
	font-size: 1.6em;
}

.ctt--kacheln .ctt-plakette .ctt-wtag {
	opacity: 1;
	color: var(--ctt-farbe, inherit);
	font-weight: 700;
}

.ctt--kacheln .ctt-inhalt {
	min-width: 0;
	padding: 1em 1.1em 1.1em;
}

.ctt--kacheln .ctt-meta {
	display: block;
}

.ctt--kacheln .ctt-ort {
	display: block;
}

/* ---------- Layout "kompakt" ---------- */

.ctt--kompakt .ctt-zeile {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.1em 1em;
	margin: 0;
	padding: 0.6em 0 0.6em 0.8em;
	border-left: 3px solid var(--ctt-farbe, var(--ctt-akzent));
	border-bottom: 1px solid var(--ctt-linie);
	list-style: none;
}

.ctt--kompakt .ctt-zeile:last-child {
	border-bottom: 0;
}

.ctt--kompakt .ctt-kdatum {
	flex: 0 0 7.2em;
	font-weight: 700;
}

.ctt--kompakt .ctt-ktitel {
	flex: 1 1 10em;
	min-width: 0;
}

.ctt--kompakt .ctt-ktitel a {
	color: inherit;
	text-decoration: none;
}

.ctt--kompakt .ctt-ktitel a:hover,
.ctt--kompakt .ctt-ktitel a:focus-visible {
	text-decoration: underline;
}

.ctt--kompakt .ctt-kzeit {
	font-size: 0.9em;
	opacity: 0.75;
	white-space: nowrap;
}

/* ---------- Terminansicht (Vorschau-Fenster und Terminseite) ---------- */

.ctt-v {
	display: grid;
	/* Bild links, Angaben rechts; wird es schmal, rutschen die Angaben unter das Bild. */
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 17em), 1fr));
	gap: 1.6em 2em;
	align-items: start;
	margin: 0;
}

.ctt-v--ohne-bild {
	grid-template-columns: minmax(0, 1fr);
}

.ctt-v .ctt-v-bild {
	position: relative;
	overflow: hidden;
	border-radius: var(--ctt-radius);
	background: var(--ctt-flaeche);
}

.ctt-v .ctt-v-bild img {
	display: block;
	width: 100%;
	height: auto;
	max-height: 75vh;
	object-fit: contain;
}

.ctt-v .ctt-v-bildlink {
	position: absolute;
	right: 0.8em;
	bottom: 0.8em;
	padding: 0.5em 1.1em;
	border-radius: 999px;
	background: rgba(20, 24, 32, 0.78);
	color: #fff;
	font-size: 0.8em;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
}

.ctt-v .ctt-v-bildlink:hover,
.ctt-v .ctt-v-bildlink:focus-visible {
	background: rgba(20, 24, 32, 0.95);
	color: #fff;
}

.ctt-v .ctt-v-daten {
	min-width: 0;
}

.ctt-v .ctt-v-kategorie {
	display: inline-block;
	padding: 0.45em 0.9em;
	border-radius: 4px;
	background: var(--ctt-farbe, #222);
	color: var(--ctt-auf-farbe, #fff);
	font-size: 0.7em;
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1.2;
	text-transform: uppercase;
}

.ctt-v .ctt-v-titel {
	margin: 0.45em 0 0;
	padding: 0;
	font-size: 1.9em;
	line-height: 1.15;
	text-wrap: balance;
	overflow-wrap: anywhere;
	hyphens: auto;
}

.ctt-v .ctt-v-untertitel {
	margin: 0.5em 0 0;
	font-size: 1.1em;
	line-height: 1.4;
	opacity: 0.85;
}

.ctt-v .ctt-v-liste {
	display: grid;
	gap: 1.1em;
	margin: 1.5em 0 0;
	padding: 0;
}

.ctt-v .ctt-v-liste dt {
	display: flex;
	align-items: center;
	gap: 0.7em;
	margin: 0;
	font-size: 0.72em;
	font-weight: 700;
	letter-spacing: 0.1em;
	line-height: 1.3;
	text-transform: uppercase;
}

.ctt-v .ctt-v-liste dt span {
	opacity: 0.7;
}

.ctt-v .ctt-v-liste .ctt-symbol {
	flex: 0 0 auto;
	color: var(--ctt-farbe, currentColor);
	font-size: 1.7em;
}

.ctt-v .ctt-v-liste dd {
	margin: 0.35em 0 0;
	padding: 0;
	font-size: 1.05em;
	line-height: 1.45;
	overflow-wrap: anywhere;
}

.ctt-v .ctt-v-text {
	margin-top: 1.5em;
	line-height: 1.6;
	overflow-wrap: anywhere;
}

.ctt-v .ctt-v-text > :first-child {
	margin-top: 0;
}

.ctt-v .ctt-v-text > :last-child {
	margin-bottom: 0;
}

.ctt-v .ctt-v-aktionen {
	margin: 1.5em 0 0;
}

.ctt .ctt-knopf {
	display: inline-block;
	padding: 0.55em 1.3em;
	border: 2px solid currentColor;
	border-radius: 999px;
	font-weight: 700;
	line-height: 1.3;
	text-decoration: none;
}

/* ---------- Vorschau-Fenster ---------- */

html.ctt-dialog-offen {
	overflow: hidden;
}

/* Das Fenster liegt außerhalb des Seiteninhalts, deshalb bekommt es feste, gut lesbare Farben. */
.ctt-dialog {
	width: min(62rem, calc(100vw - 2rem));
	max-width: none;
	max-height: calc(100vh - 2rem);
	max-height: calc(100dvh - 2rem);
	margin: auto;
	padding: 0;
	overflow: hidden;
	border: 0;
	border-radius: 14px;
	background: #fff;
	color: #1c1f24;
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.ctt-dialog::backdrop {
	background: rgba(15, 18, 24, 0.62);
}

.ctt-dialog .ctt-dialog-rahmen {
	display: flex;
	flex-direction: column;
	max-height: calc(100vh - 2rem);
	max-height: calc(100dvh - 2rem);
}

.ctt-dialog .ctt-dialog-kopf {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: space-between;
	gap: 1em;
	padding: 0.7em 0.9em 0.7em 1.5em;
	border-bottom: 1px solid rgba(0, 0, 0, 0.09);
}

.ctt-dialog .ctt-dialog-label {
	font-size: 1.05em;
	font-weight: 700;
	line-height: 1.3;
}

.ctt-dialog .ctt-dialog-zu {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: none;
	color: inherit;
	font-size: 1.4rem;
	cursor: pointer;
}

.ctt-dialog .ctt-dialog-zu:hover {
	background: rgba(0, 0, 0, 0.07);
}

.ctt-dialog .ctt-dialog-zu:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.ctt-dialog .ctt-dialog-inhalt {
	flex: 1 1 auto;
	min-height: 0;
	padding: 1.5em;
	overflow: auto;
	overscroll-behavior: contain;
}

.ctt-dialog .ctt-v a:not(.ctt-v-bildlink) {
	color: inherit;
}

@media (max-width: 600px) {
	.ctt-dialog {
		width: calc(100vw - 1rem);
		max-height: calc(100vh - 1rem);
		max-height: calc(100dvh - 1rem);
	}

	.ctt-dialog .ctt-dialog-rahmen {
		max-height: calc(100vh - 1rem);
		max-height: calc(100dvh - 1rem);
	}

	.ctt-dialog .ctt-dialog-inhalt {
		padding: 1.1em;
	}

	.ctt-v .ctt-v-titel {
		font-size: 1.5em;
	}

	.ctt-v .ctt-v-bild img {
		max-height: 55vh;
	}
}

/* ---------- Layout "slider" ---------- */

.ctt--slider {
	--ctt-abstand: 1.4em;
	position: relative;
}

.ctt--slider .ctt-bahn {
	display: flex;
	gap: var(--ctt-abstand);
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.ctt--slider .ctt-bahn::-webkit-scrollbar {
	display: none;
}

.ctt--slider .ctt-bahn:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 4px;
}

.ctt--slider .ctt-folie {
	/* Höchstens --ctt-spalten nebeneinander; wird es enger als 13em je Termin, automatisch weniger.
	   Das Skript setzt --ctt-folie-breite passgenau; der zweite Wert gilt, solange es nicht geladen ist. */
	flex: 0 0 var(--ctt-folie-breite, min(100%, max(13em, calc((100% - (var(--ctt-spalten, 3) - 1) * var(--ctt-abstand)) / var(--ctt-spalten, 3)))));
	min-width: 0;
	scroll-snap-align: start;
}

.ctt--slider .ctt-folie-kopf {
	position: relative;
	overflow: hidden;
	min-height: var(--ctt-kopf-min, 0);
	aspect-ratio: var(--ctt-format, 2 / 1);
	background: var(--ctt-linie);
}

.ctt--slider .ctt-folie-kopf--ohne {
	aspect-ratio: var(--ctt-format-leer, var(--ctt-format, 2 / 1));
	background: color-mix(in srgb, var(--ctt-farbe, #888) 30%, transparent);
}

.ctt--slider .ctt-folie-kopf a {
	display: block;
	height: var(--ctt-bild-h, 100%);
}

.ctt--slider .ctt-folie-kopf img {
	display: block;
	width: 100%;
	height: var(--ctt-bild-h, 100%);
	object-fit: cover;
	transition: transform 0.4s ease;
}

.ctt--slider .ctt-folie:hover .ctt-folie-kopf img {
	transform: scale(1.04);
}

.ctt--slider .ctt-plakette {
	position: absolute;
	top: 0.9em;
	left: 0.9em;
	min-width: 3.5em;
	padding: 0.6em 0.6em 0.55em;
	background: var(--ctt-farbe, #222);
	color: var(--ctt-auf-farbe, #fff);
	text-align: center;
}

.ctt--slider .ctt-plakette .ctt-tag {
	font-size: 1.6em;
}

.ctt--slider .ctt-plakette .ctt-wtag {
	font-weight: 700;
	opacity: 1;
}

.ctt--slider .ctt-kategorie {
	position: absolute;
	top: 0.9em;
	right: 0.9em;
	max-width: calc(100% - 6.5em);
	padding: 0.5em 0.9em;
	overflow: hidden;
	border-radius: 4px;
	background: var(--ctt-farbe, #222);
	color: var(--ctt-auf-farbe, #fff);
	font-size: 0.68em;
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1.2;
	text-overflow: ellipsis;
	text-transform: uppercase;
	white-space: nowrap;
}

.ctt--slider .ctt-inhalt {
	padding: 1.1em 1.2em 0.4em;
}

.ctt--slider .ctt-titel {
	margin-bottom: 0.6em;
}

.ctt--slider .ctt-angabe {
	display: flex;
	align-items: flex-start;
	gap: 0.6em;
	margin-top: 0.35em;
	font-size: 0.9em;
	line-height: 1.45;
}

.ctt--slider .ctt-angabe span {
	min-width: 0;
	overflow-wrap: anywhere;
	opacity: 0.8;
}

.ctt--slider .ctt-symbol {
	flex: 0 0 auto;
	margin-top: 0.2em;
	color: var(--ctt-farbe, currentColor);
}

.ctt--slider .ctt-pfeil {
	position: absolute;
	top: var(--ctt-pfeil-oben, 28%);
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.75em;
	height: 2.75em;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #fff;
	color: #1a1a1a;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.22);
	cursor: pointer;
	transform: translateY(-50%);
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.ctt--slider .ctt-pfeil[hidden] {
	display: none;
}

.ctt--slider .ctt-pfeil--zurueck {
	left: 0.6em;
}

.ctt--slider .ctt-pfeil--weiter {
	right: 0.6em;
}

.ctt--slider .ctt-pfeil .ctt-symbol {
	margin: 0;
	color: inherit;
	font-size: 1.3em;
}

.ctt--slider .ctt-pfeil:hover:not(:disabled) {
	transform: translateY(-50%) scale(1.08);
}

.ctt--slider .ctt-pfeil:focus-visible {
	outline: 2px solid #1a1a1a;
	outline-offset: 2px;
}

.ctt--slider .ctt-pfeil:disabled {
	opacity: 0;
	pointer-events: none;
}

.ctt--slider .ctt-punkte {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.2em;
	margin-top: 1.2em;
}

.ctt--slider .ctt-punkte[hidden] {
	display: none;
}

/* Die Schaltfläche ist groß genug zum Antippen, sichtbar ist nur der kleine Punkt darin. */
.ctt--slider .ctt-punkt {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 1.75em;
	height: 1.75em;
	margin: 0;
	padding: 0 0.3em;
	border: 0;
	background: none;
	color: inherit;
	cursor: pointer;
}

.ctt--slider .ctt-punkt::before {
	content: "";
	display: block;
	width: 0.6em;
	height: 0.6em;
	border-radius: 999px;
	background: currentColor;
	opacity: 0.25;
	transition: width 0.25s ease, opacity 0.25s ease;
}

.ctt--slider .ctt-punkt[aria-current="true"]::before {
	width: 1.6em;
	opacity: 0.85;
}

.ctt--slider .ctt-punkt:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 0;
}

@media (prefers-reduced-motion: reduce) {
	.ctt--slider .ctt-folie-kopf img,
	.ctt--slider .ctt-pfeil,
	.ctt--slider .ctt-punkt::before {
		transition: none;
	}

	.ctt--slider .ctt-folie:hover .ctt-folie-kopf img {
		transform: none;
	}
}

/* ---------- Bildformat auf Handys (bildformat_mobil) ---------- */

@media (max-width: 600px) {
	.ctt--liste .ctt-bild {
		aspect-ratio: var(--ctt-format-mobil, var(--ctt-format, 16 / 9));
	}

	.ctt--liste .ctt-bild a,
	.ctt--liste .ctt-bild img,
	.ctt--kacheln .ctt-karte-kopf a,
	.ctt--kacheln .ctt-karte-kopf img,
	.ctt--slider .ctt-folie-kopf a,
	.ctt--slider .ctt-folie-kopf img {
		height: var(--ctt-bild-h-mobil, var(--ctt-bild-h, 100%));
	}

	.ctt--kacheln .ctt-karte-kopf {
		aspect-ratio: var(--ctt-format-mobil, var(--ctt-format, 16 / 9));
	}

	.ctt--slider .ctt-folie-kopf {
		aspect-ratio: var(--ctt-format-mobil, var(--ctt-format, 2 / 1));
	}

	.ctt--kacheln .ctt-karte-kopf--ohne {
		aspect-ratio: var(--ctt-format-mobil-leer, var(--ctt-format-mobil, var(--ctt-format-leer, var(--ctt-format, 16 / 9))));
	}

	.ctt--slider .ctt-folie-kopf--ohne {
		aspect-ratio: var(--ctt-format-mobil-leer, var(--ctt-format-mobil, var(--ctt-format-leer, var(--ctt-format, 2 / 1))));
	}
}

/* ---------- Bildanpassung "einpassen": ganzes Bild im festen Rahmen, nichts wird abgeschnitten ---------- */

.ctt--einpassen .ctt-folie-kopf:not(.ctt-folie-kopf--ohne),
.ctt--einpassen .ctt-karte-kopf:not(.ctt-karte-kopf--ohne),
.ctt--einpassen .ctt-bild {
	position: relative;
	overflow: hidden;
	background: var(--ctt-flaeche);
}

/* Freie Flächen neben oder über dem Bild: dasselbe Bild, weichgezeichnet. */
.ctt--einpassen .ctt-folie-kopf:not(.ctt-folie-kopf--ohne)::before,
.ctt--einpassen .ctt-karte-kopf:not(.ctt-karte-kopf--ohne)::before,
.ctt--einpassen .ctt-bild::before {
	content: "";
	position: absolute;
	inset: -15%;
	background-image: var(--ctt-bild-url, none);
	background-position: center;
	background-size: cover;
	filter: blur(20px);
	opacity: 0.55;
}

.ctt--einpassen .ctt-folie-kopf img,
.ctt--einpassen .ctt-karte-kopf img,
.ctt--einpassen .ctt-bild img {
	position: relative;
	object-fit: contain;
}
