/**
 * Frontend-Styles für das Listen-Modul (Widget "ChurchTools Liste").
 */

.ctl-widget {
	max-width: 700px;
	width: 100%;
	box-sizing: border-box;
}

.ctl-widget * {
	box-sizing: border-box;
}

.ctl-list-title {
	margin: 0 0 4px;
}

.ctl-list-description {
	margin: 0 0 16px;
	color: #555;
}

.ctl-messages {
	min-height: 0;
	margin-bottom: 12px;
}

.ctl-messages:empty {
	display: none;
}

.ctl-message-success {
	color: #1a7e3c;
}

.ctl-message-error {
	color: #a94442;
}

.ctl-overview {
	margin-bottom: 24px;
}

/* Anonyme Zusammenfassung (Zähler statt Namen). */
.ctl-summary {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 20px;
}

.ctl-summary-item {
	background: #f4f5f7;
	border: 1px solid #e5e7ea;
	border-radius: 10px;
	padding: 10px 16px;
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 120px;
}

.ctl-summary-label {
	font-size: 0.8em;
	color: #5c5c5c;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.ctl-summary-value {
	font-size: 1.05em;
	font-weight: 700;
}

.ctl-full-notice {
	background: #fff8e1;
	border: 1px solid #e0c56b;
	color: #6b5300;
	border-radius: 10px;
	padding: 12px 16px;
}

/* Übersicht aller aktuellen Listen (Direktaufruf ohne ?liste=...). */
.ctl-index {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.ctl-index-item {
	display: flex;
	flex-direction: column;
	gap: 2px;
	background: #f4f5f7;
	border: 1px solid #e5e7ea;
	border-radius: 10px;
	padding: 14px 18px;
	text-decoration: none;
	color: inherit;
	transition: background 0.15s ease, transform 0.15s ease;
}

.ctl-index-item:hover,
.ctl-index-item:focus-visible {
	background: #eceef1;
	transform: translateY(-1px);
}

.ctl-index-title {
	font-weight: 700;
	font-size: 1.05em;
}

.ctl-index-subtitle {
	color: #5c5c5c;
	font-size: 0.92em;
}

.ctl-index-meta {
	color: #1a73e8;
	font-size: 0.88em;
	font-weight: 600;
	margin-top: 4px;
}

.ctl-empty {
	color: #6b6b6b;
	font-style: italic;
}

/* Horizontales Scrollen statt Layout-Bruch, falls die Tabelle (viele
   Spalten) auf schmalen Bildschirmen breiter als der Bildschirm wird. */
.ctl-table-wrapper {
	width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.ctl-table {
	width: 100%;
	min-width: 100%;
	border-collapse: collapse;
}

.ctl-table th,
.ctl-table td {
	text-align: left;
	padding: 8px 12px;
	border-bottom: 1px solid #e5e5e5;
}

.ctl-table thead th {
	background: #f4f5f7;
	font-weight: 600;
}

.ctl-table thead th.ctl-sortable {
	cursor: pointer;
	user-select: none;
}

.ctl-table thead th.ctl-sortable:hover,
.ctl-table thead th.ctl-sortable:focus-visible {
	background: #e9ebee;
}

.ctl-table thead th.ctl-sortable::after {
	content: "\21C5"; /* ⇅ - zeigt an, dass die Spalte sortierbar ist */
	display: inline-block;
	margin-left: 6px;
	opacity: 0.4;
	font-size: 0.85em;
}

.ctl-table thead th.ctl-sortable[data-sort-dir="asc"]::after {
	content: "\2191"; /* ↑ */
	opacity: 1;
}

.ctl-table thead th.ctl-sortable[data-sort-dir="desc"]::after {
	content: "\2193"; /* ↓ */
	opacity: 1;
}

.ctl-actions-head {
	width: 1%;
}

.ctl-actions {
	white-space: nowrap;
	text-align: right;
}

.ctl-edit-button,
.ctl-delete-button {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 0.85em;
	padding: 2px 6px;
	text-decoration: underline;
}

.ctl-delete-button {
	color: #a94442;
}

.ctl-form {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.ctl-field-group {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.ctl-field-label {
	font-weight: 600;
	font-size: 0.9em;
}

.ctl-required {
	color: #a94442;
}

.ctl-field-group input[type="text"],
.ctl-field-group input[type="number"],
.ctl-field-group select,
.ctl-field-group textarea {
	/* "!important" gegen Theme-Vorgaben für input[type="number"] (manche
	   Themes/Plugins schränken Zahlenfelder absichtlich auf eine schmale
	   "Warenkorb-Menge"-Breite ein, mit höherer Spezifität oder "!important"). */
	width: 100% !important;
	max-width: none !important;
	padding: 8px 10px;
	border: 1px solid #ccc;
	border-radius: 6px;
	font-size: 1em;
	font-family: inherit;
	box-sizing: border-box;
}

.ctl-field-group[data-field-type="checkbox"] {
	flex-direction: row;
	align-items: center;
}

.ctl-honeypot {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.ctl-submit-button {
	align-self: flex-start;
	background-color: var(--ctc-btn-bg, #1a73e8);
	color: var(--ctc-btn-color, #fff);
	/* Rahmen IMMER explizit setzen (nicht nur "border: none") - sonst kann
	   ein Standard-Rahmen des Themes/Browsers für <button>-Elemente
	   durchscheinen, den die eigene Regel nicht zuverlässig überschreibt.
	   Über die Elementor-Regler "Rahmenfarbe"/"Rahmenbreite" einstellbar
	   (Standard: unsichtbar). "!important", da manche Themes eigene
	   Standard-Rahmen für <button> mit höherer Selektor-Spezifität (z. B.
	   ".irgendein-wrapper button") oder sogar eigenem "!important" setzen -
	   ohne das hier gewinnt sonst deren Rahmen statt der Plugin-Einstellung. */
	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;
	padding: 10px 26px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

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

.ctl-submit-button:disabled {
	opacity: 0.6;
	cursor: default;
}

.ctl-privacy-notice {
	margin: 10px 0 0;
	font-size: 0.82em;
	color: #6b6b6b;
	line-height: 1.4;
}

/* Kleinere Bildschirme (Smartphones): Absenden-Button über die volle
   Breite (statt einer schmalen Schaltfläche links), Zusammenfassungs-
   Kacheln nehmen jeweils die volle Breite ein statt nebeneinander
   umzubrechen, und die Tabellen-/Formularabstände werden etwas enger. */
@media (max-width: 480px) {
	.ctl-summary {
		gap: 8px;
	}

	.ctl-summary-item {
		flex: 1 1 100%;
		min-width: 0;
	}

	.ctl-submit-button {
		align-self: stretch;
		width: 100%;
		text-align: center;
	}

	.ctl-table th,
	.ctl-table td {
		padding: 6px 8px;
		font-size: 0.92em;
	}
}
