/*
 * ChurchTools Kalender – Frontend-Styles
 * Verwendet ausschließlich system-eigene Schriftarten (keine Google Fonts,
 * keine externen CDN-Abhängigkeiten) und ist vollständig über Elementor
 * überschreibbar (Selektoren mit niedriger Spezifität, CSS-Variablen).
 *
 * Listen- und Kartenansicht teilen sich dieselben Feld-Klassen
 * (.ctc-field-date, .ctc-field-title, ...), damit Stil-Einstellungen im
 * Elementor-Widget für beide Ansichten identisch gelten.
 */

.ctc-calendar {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	line-height: 1.5;
	color: #2b2b2b;
	box-sizing: border-box;
}

.ctc-calendar *,
.ctc-calendar *::before,
.ctc-calendar *::after {
	box-sizing: inherit;
}

/* Barrierefreiheit: sichtbarer Fokusring */
.ctc-calendar a:focus-visible,
.ctc-calendar button:focus-visible,
.ctc-calendar input:focus-visible,
.ctc-calendar [tabindex]:focus-visible {
	outline: 3px solid #1a73e8;
	outline-offset: 2px;
}

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

/* Meldungen */
.ctc-notice {
	padding: 14px 18px;
	border-radius: 10px;
	margin-bottom: 16px;
	font-size: 0.95em;
}

.ctc-notice-error {
	background: #fdecea;
	color: #9b2c22;
	border: 1px solid #f4c7c2;
}

.ctc-no-events {
	padding: 24px;
	text-align: center;
	color: #6b6b6b;
	font-style: italic;
}

/* Suche */
.ctc-search-wrap {
	margin-bottom: 20px;
}

.ctc-search-input {
	width: 100%;
	max-width: 420px;
	padding: 10px 14px;
	border: 1px solid #d4d4d8;
	border-radius: 8px;
	font-size: 1em;
	font-family: inherit;
	background: #fff;
	color: #2b2b2b;
}

/* -------------------- Gemeinsame Feld-Stile (Liste + Karte) -------------------- */
.ctc-field {
	display: block;
}

.ctc-field-date {
	font-weight: 600;
	color: #1a73e8;
	font-size: 0.9em;
	letter-spacing: 0.02em;
}

/* Rhythmus-Text der "Wiederkehrende Termine"-Karten - optisch an derselben
   Stelle/Rolle wie das Datum bei normalen Terminen, aber ohne konkretes
   Datum (siehe class-shortcode.php render_recurring_card_item()). */
.ctc-field-pattern {
	font-weight: 600;
	color: #1a73e8;
	font-size: 0.9em;
	letter-spacing: 0.02em;
}

.ctc-field-title {
	margin: 0;
	font-size: 1.15em;
	font-weight: 700;
}

.ctc-field-subtitle {
	margin: 0;
	font-size: 1em;
	font-weight: 500;
	color: #5c5c5c;
}

.ctc-field-time,
.ctc-field-location {
	font-size: 0.9em;
	color: #5c5c5c;
}

.ctc-field-description {
	margin: 4px 0 0;
	font-size: 0.95em;
	color: #444;
}

a.ctc-link-button {
	display: inline-block;
	align-self: flex-start;
	margin-top: 8px;
	padding: 8px 18px;
	background-color: var(--ctc-btn-bg, #1a73e8);
	color: var(--ctc-btn-color, #fff);
	/* Rahmen IMMER explizit setzen, siehe Kommentar bei .ctl-submit-button
	   in lists-frontend.css - über Elementor einstellbar (Standard: unsichtbar).
	   "!important" gegen Theme-Standardrahmen mit höherer Spezifität. */
	border-width: var(--ctc-btn-border-width, 0px) !important;
	border-style: solid !important;
	border-color: var(--ctc-btn-border-color, transparent) !important;
	border-radius: 999px;
	font-size: 0.9em;
	font-weight: 600;
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease;
}

a.ctc-link-button:hover,
a.ctc-link-button:focus-visible {
	background-color: var(--ctc-btn-bg-hover, #0f52ba);
	color: var(--ctc-btn-color, #fff);
}

/* Form-Vorlage "Nur Text": kein Hintergrund, Farbe wie Hintergrundfarbe, unterstrichen */
a.ctc-link-button-shape-text {
	background: transparent !important;
	color: var(--ctc-btn-bg, #1a73e8);
	padding: 0 !important;
	text-decoration: underline;
}

a.ctc-link-button-shape-text:hover,
a.ctc-link-button-shape-text:focus-visible {
	background: transparent !important;
	color: var(--ctc-btn-bg-hover, #0f52ba);
}

/* -------------------- Listenansicht -------------------- */
.ctc-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.ctc-list-item {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	background: #ffffff;
	border: 1px solid #ececec;
	border-radius: 10px;
	padding: 14px 18px;
}

.ctc-list-image {
	flex: 0 0 auto;
	width: 76px;
	aspect-ratio: 3 / 2;
	border-radius: 8px;
	overflow: hidden;
	background: #eef1f4;
}

.ctc-list-image img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.ctc-list-content {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

@media (max-width: 480px) {
	.ctc-list-item {
		flex-direction: column;
	}
	.ctc-list-image {
		width: 100%;
		aspect-ratio: 16 / 9;
	}
}

/* -------------------- Kartenansicht -------------------- */
.ctc-cards {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
}

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

@media (max-width: 600px) {
	.ctc-cards {
		grid-template-columns: 1fr;
	}
}

.ctc-card {
	background: #ffffff;
	border: 1px solid #ececec;
	border-radius: 14px;
	padding: 0;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ctc-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.ctc-card-image {
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: #eef1f4;
}

.ctc-card-image img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.ctc-card-content {
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

/* -------------------- Wochentrenner (nach jedem Sonntag) -------------------- */
.ctc-week-divider {
	grid-column: 1 / -1; /* sorgt in der Kartenansicht (CSS-Grid) für eine eigene, volle Zeile */
	width: 100%;
	border: none;
	border-top-color: #d6d6d6;
	list-style: none;
}

.ctc-week-divider-space {
	border-top: none !important;
}

/* "Mehr anzeigen" Button */
.ctc-more-wrap {
	text-align: center;
	margin-top: 24px;
}

.ctc-more-button {
	background-color: var(--ctc-btn-bg, #1a73e8);
	color: var(--ctc-btn-color, #fff);
	border: 2px solid var(--ctc-btn-bg, #1a73e8);
	border-radius: 999px;
	padding: 10px 28px;
	font-size: 1em;
	font-family: inherit;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.ctc-more-button:hover,
.ctc-more-button:focus-visible {
	background-color: var(--ctc-btn-bg-hover, #0f52ba);
	border-color: var(--ctc-btn-bg-hover, #0f52ba);
	color: var(--ctc-btn-color, #fff);
}

/* -------------------- Hero-Ansicht (Slider) -------------------- */
.ctc-hero-slider {
	position: relative;
	overflow: hidden;
	border-radius: 14px;
	background: #eef1f4;
	--ctc-hero-gradient-1: rgba(0, 0, 0, 0.85);
	--ctc-hero-gradient-2: rgba(0, 0, 0, 0);
	--ctc-hero-gradient-angle: 315deg;
}

.ctc-hero-track {
	position: relative;
	width: 100%;
}

.ctc-hero-slide {
	display: none;
	width: 100%;
}

.ctc-hero-slide.is-active {
	display: block;
	animation: ctc-hero-fade 0.4s ease;
}

@keyframes ctc-hero-fade {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

.ctc-hero-item {
	display: flex;
	flex-direction: column;
}

.ctc-hero-image {
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: #dfe3e8;
}

.ctc-hero-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ctc-hero-content {
	padding: 24px 28px 28px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ctc-hero-content .ctc-field-title {
	font-size: 1.6em;
}

/* -------- Hintergrund-Layout: Bild als Vollflächen-Hintergrund -------- */
.ctc-hero-layout-background .ctc-hero-item {
	position: relative;
	display: block;
	min-height: 460px;
}

.ctc-hero-layout-background .ctc-hero-image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	aspect-ratio: auto;
}

.ctc-hero-layout-background .ctc-hero-content {
	position: absolute;
	inset: 0;
	width: 100%;
	justify-content: flex-end;
	align-items: flex-start;
	padding: 36px;
	/* Verlauf: Richtung frei einstellbar (Stil → Hero-Ansicht → Winkel). */
	background: linear-gradient(var(--ctc-hero-gradient-angle), var(--ctc-hero-gradient-1) 0%, var(--ctc-hero-gradient-2) 65%);
	color: #ffffff;
}

.ctc-hero-layout-background .ctc-field {
	color: inherit;
}

.ctc-hero-arrow {
	position: absolute;
	transform: translateY(-50%);
	background: rgba(255, 255, 255, 0.85);
	color: #2b2b2b;
	border: none;
	width: 40px;
	height: 40px;
	font-size: 1.4em;
	line-height: 1;
	cursor: pointer;
	z-index: 2;
}

.ctc-hero-arrow:hover,
.ctc-hero-arrow:focus-visible {
	background: #ffffff;
}

/* Form */
.ctc-hero-arrow-shape-circle {
	border-radius: 50%;
}

.ctc-hero-arrow-shape-square {
	border-radius: 6px;
}

.ctc-hero-arrow-shape-none {
	background: transparent !important;
	width: auto;
	height: auto;
	padding: 6px;
}

/* Vertikale Position */
.ctc-hero-arrow-pos-top {
	top: 18%;
}

.ctc-hero-arrow-pos-middle {
	top: 45%;
}

.ctc-hero-arrow-pos-bottom {
	top: 78%;
}

.ctc-hero-prev {
	left: 14px;
}

.ctc-hero-next {
	right: 14px;
}

.ctc-hero-dots {
	position: absolute;
	bottom: 14px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	gap: 8px;
	z-index: 2;
}

.ctc-hero-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	border: 2px solid #ffffff;
	background: rgba(255, 255, 255, 0.4);
	padding: 0;
	cursor: pointer;
}

.ctc-hero-dot.is-active {
	background: #ffffff;
}

@media (min-width: 700px) {
	.ctc-hero-layout-side .ctc-hero-item {
		flex-direction: row;
	}
	.ctc-hero-layout-side .ctc-hero-image {
		width: 50%;
		aspect-ratio: auto;
	}
	.ctc-hero-layout-side .ctc-hero-content {
		width: 50%;
		justify-content: center;
	}
}

/* -------------------- Monatsansicht -------------------- */
.ctc-month-view {
	width: 100%;
}

.ctc-month-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}

.ctc-month-label {
	font-weight: 700;
	font-size: 1.15em;
}

.ctc-month-prev,
.ctc-month-next {
	background: transparent;
	border: 1px solid #d4d4d8;
	border-radius: 8px;
	width: 36px;
	height: 36px;
	font-size: 1.2em;
	cursor: pointer;
	line-height: 1;
}

.ctc-month-prev:hover,
.ctc-month-next:hover {
	background: #f2f2f2;
}

.ctc-month-grid {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 6px;
	width: 100%;
}

.ctc-month-weekday {
	min-width: 0;
	text-align: center;
	font-size: 0.8em;
	font-weight: 700;
	color: #6b6b6b;
	padding: 6px 0;
}

.ctc-month-day {
	min-width: 0;
	min-height: 70px;
	border: 1px solid #ececec;
	border-radius: 8px;
	padding: 6px;
	font-size: 0.85em;
	background: #fff;
	position: relative;
	overflow: hidden;
}

.ctc-month-day.is-empty {
	background: transparent;
	border-color: transparent;
}

.ctc-month-day.is-today {
	border-color: #1a73e8;
	border-width: 2px;
}

/* Vergangene Tage bleiben sichtbar (inkl. ihrer Termine) statt zu
   verschwinden, wirken aber gedimmt - Termine bleiben weiterhin anklickbar,
   nur .ctc-month-day-number/.ctc-month-event-dot werden optisch reduziert. */
.ctc-month-day.is-past {
	background: #f7f7f7;
}

.ctc-month-day.is-past .ctc-month-day-number,
.ctc-month-day.is-past .ctc-month-event-dot {
	opacity: 0.5;
}

.ctc-month-day-number {
	font-weight: 600;
	display: block;
	margin-bottom: 4px;
}

.ctc-month-event-dot {
	display: block;
	width: 100%;
	text-align: left;
	background: #eaf1fd;
	color: #1a3d8f;
	border: none;
	border-radius: 5px;
	padding: 2px 5px;
	margin-bottom: 3px;
	font-size: 0.85em;
	line-height: 1.3;
	cursor: pointer;
	font-family: inherit;
}

.ctc-month-event-title,
.ctc-month-event-time {
	display: block;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ctc-month-event-time {
	font-size: 0.9em;
	opacity: 0.85;
}

.ctc-month-event-dot:hover,
.ctc-month-event-dot:focus-visible {
	background: #1a73e8;
	color: #fff;
}

.ctc-month-detail {
	margin-top: 18px;
}

.ctc-month-detail-close {
	background: #fff;
	border: 1px solid #ececec;
	border-radius: 50%;
	width: 32px;
	height: 32px;
	font-size: 1.1em;
	cursor: pointer;
	line-height: 1;
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 1;
}

.ctc-month-detail-inner {
	position: relative;
	max-width: 420px;
	margin: 0 auto;
}

/* Innerhalb der Monats-Detailansicht darf die geklonte Karte nicht wieder
   als Grid-Kachel schrumpfen - volle Breite des Detailbereichs nutzen. */
.ctc-month-detail-inner .ctc-card {
	width: 100%;
}

/* Diese Karten sind nur die serverseitige "Quelle" für die Monatsansicht
   und werden nie direkt angezeigt, sondern nur per JS geklont. */
.ctc-month-event-cards {
	display: none;
}

/* Editor-Hinweis (nur im Elementor-Editor sichtbar) */
.ctc-editor-notice {
	background: #fff8e1;
	border: 1px dashed #e0b400;
	padding: 12px 16px;
	border-radius: 8px;
	margin-bottom: 12px;
	font-size: 0.9em;
	color: #6b5300;
}

/* -------------------- ChurchTools Gruppe einbetten (Widget) -------------------- */
.ctc-group-embed {
	position: relative;
	width: 100%;
	background: #f4f5f7;
}

.ctc-group-embed iframe {
	width: 100%;
	min-height: 200px;
}

.ctc-group-embed-restricted {
	background: transparent;
	text-align: center;
	padding: 20px 0;
}

.ctc-group-embed-login-button {
	display: inline-block;
	background-color: #1a73e8;
	color: #ffffff;
	border: 2px solid #1a73e8;
	border-radius: 999px;
	padding: 12px 28px;
	font-weight: 600;
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.ctc-group-embed-login-button:hover,
.ctc-group-embed-login-button:focus-visible {
	background-color: #0f52ba;
	border-color: #0f52ba;
	color: #ffffff;
}

.ctc-group-embed-helper {
	margin: 10px 0 0;
	font-size: 0.9em;
	color: #6b6b6b;
}

.ctc-group-embed-occupancy {
	display: inline-block;
	background: #eef4ff;
	color: #1a3d7c;
	padding: 6px 14px;
	border-radius: 999px;
	font-size: 0.9em;
	font-weight: 600;
	margin-bottom: 10px;
}

/* -------------------- ChurchTools Gruppen-Übersicht (Widget) -------------------- */
.ctc-gd-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
}

.ctc-gd-card {
	background: #ffffff;
	border-radius: 10px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.ctc-gd-image {
	width: 100%;
	height: 180px;
	overflow: hidden;
	background: #eef1f4;
}

.ctc-gd-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ctc-gd-content {
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.ctc-gd-name {
	margin: 0;
	font-size: 1.15em;
	font-weight: 700;
}

.ctc-gd-meeting-time,
.ctc-gd-location {
	font-size: 0.9em;
	color: #5c5c5c;
}

.ctc-gd-occupancy {
	display: inline-block;
	background: #eef4ff;
	color: #1a3d7c;
	padding: 4px 12px;
	border-radius: 999px;
	font-size: 0.85em;
	font-weight: 600;
	align-self: flex-start;
}

.ctc-gd-description {
	margin: 4px 0 0;
	font-size: 0.95em;
	color: #444;
}

.ctc-gd-link {
	display: inline-block;
	align-self: flex-start;
	margin-top: 8px;
	padding: 8px 18px;
	background-color: #1a73e8;
	color: #ffffff;
	border: 2px solid #1a73e8;
	border-radius: 999px;
	font-weight: 600;
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.ctc-gd-link:hover,
.ctc-gd-link:focus-visible {
	background-color: #0f52ba;
	border-color: #0f52ba;
	color: #ffffff;
}

/* Anmeldestatus (offen/geschlossen) in den Gruppen-Widgets. */
.ctc-gd-signup-status {
	font-size: 0.88em;
	font-weight: 600;
	display: inline-block;
	align-self: flex-start;
	padding: 3px 10px;
	border-radius: 999px;
}

.ctc-gd-signup-status.is-open {
	background: #e6f4ea;
	color: #1a5e33;
}

.ctc-gd-signup-status.is-closed {
	background: #fdecea;
	color: #9b2c22;
}

/* Listenansicht der Gruppen-Übersicht: kompakte Zeilen, Bild links. */
.ctc-gd-list {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.ctc-gd-list-item {
	display: flex;
	flex-direction: row;
	align-items: flex-start;
	gap: 16px;
	padding: 14px 18px;
}

.ctc-gd-list-item .ctc-gd-image {
	flex: 0 0 auto;
	width: 110px;
	aspect-ratio: 3 / 2;
	height: auto;
	border-radius: 8px;
	overflow: hidden;
}

.ctc-gd-list-item .ctc-gd-content {
	flex: 1 1 auto;
	min-width: 0;
	padding: 0;
}

@media (max-width: 600px) {
	.ctc-gd-list-item {
		flex-direction: column;
	}
	.ctc-gd-list-item .ctc-gd-image {
		width: 100%;
	}
}

/* Hero-Ansicht der Gruppen-Übersicht: erbt das komplette Hero-Layout
   des Kalender-Widgets (.ctc-hero-*); hier nur Feinschliff. */
.ctc-gd-view-hero .ctc-gd-content {
	padding: 0;
}

/* "Anmeldebutton"-Widget (eigenständiger Redirect-Button). */
.ctc-gsb-button {
	display: inline-block;
}

@media (max-width: 780px) {
	.ctc-gd-grid {
		grid-template-columns: 1fr;
	}
}

/* -------------------- Einzelne Termin-Feld-Widgets -------------------- */
.ctc-efw-text {
	margin: 0;
}

.ctc-efw-image {
	width: 100%;
	overflow: hidden;
}

.ctc-efw-image img {
	width: 100%;
	height: 100%;
	display: block;
}
