/* VereinPress – Mitgliederbereich und Aufgaben-Board (Website und Backend-Ansicht). */

.vp-portal,
.vp-board {
	--vp-border: #d0d4d9;
	--vp-muted: #646970;
	--vp-col-bg: #f3f4f6;
	--vp-card-bg: #fff;
	--vp-accent: #2271b1;
	--vp-late: #b32d2e;
	--vp-radius: 8px;
}

.vp-portal .vp-small,
.vp-board .vp-small {
	font-size: .875em;
	color: var(--vp-muted);
}

.vp-portal .vp-notice {
	border-left: 4px solid var(--vp-accent);
	background: #f0f6fc;
	padding: .25em 1em;
	margin: 0 0 1em;
}

.vp-portal .vp-notice.vp-error {
	border-color: var(--vp-late);
	background: #fcf0f1;
}

.vp-portal-login {
	max-width: 30em;
}

.vp-portal-login input[type="email"] {
	width: 100%;
	box-sizing: border-box;
}

.vp-portal-head {
	display: flex;
	flex-wrap: wrap;
	gap: .5em 1em;
	align-items: center;
	justify-content: space-between;
	padding-bottom: .75em;
	margin-bottom: 1em;
	border-bottom: 1px solid var(--vp-border);
}

.vp-portal-head form {
	margin: 0;
}

.vp-portal-events {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: .5em;
}

.vp-portal-events li {
	display: flex;
	flex-direction: column;
	gap: .15em;
	padding: .75em 1em;
	border: 1px solid var(--vp-border);
	border-radius: var(--vp-radius);
}

.vp-portal-events li.is-cancelled {
	opacity: .6;
	text-decoration: line-through;
}

/* ---------- Board ---------- */

/* Auf der Website über die (oft schmale) Inhaltsbreite des Themes hinaus nutzen. */
.vp-portal .vp-board {
	position: relative;
	left: 50%;
	width: min(1200px, calc(100vw - 32px));
	transform: translateX(-50%);
}

.vp-board-title {
	margin-bottom: .5em;
}

.vp-board-tools {
	display: flex;
	flex-wrap: wrap;
	gap: .5em;
	align-items: center;
	margin: 0 0 1em;
}

.vp-board-cols {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
	align-items: start;
}

@media (max-width: 782px) {
	.vp-board-cols {
		grid-template-columns: 1fr;
	}
}

.vp-board-col {
	background: var(--vp-col-bg);
	border-radius: var(--vp-radius);
	padding: 10px;
	min-height: 120px;
}

.vp-board-col h3 {
	display: flex;
	align-items: center;
	gap: .5em;
	font-size: 1em;
	margin: 0 0 10px;
	padding: 0;
}

.vp-board-count {
	font-size: .8em;
	font-weight: 400;
	background: #fff;
	border-radius: 999px;
	padding: 0 .6em;
	color: var(--vp-muted);
}

.vp-board-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-height: 40px;
}

.vp-board-col.is-over {
	outline: 2px dashed var(--vp-accent);
	outline-offset: -2px;
}

.vp-board-empty {
	margin: 0;
	color: var(--vp-muted);
	font-size: .875em;
	text-align: center;
	padding: .75em 0;
}

.vp-card-task {
	background: var(--vp-card-bg);
	border: 1px solid var(--vp-border);
	border-radius: 6px;
	padding: 8px 10px;
	box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
	line-height: 1.4;
}

.vp-board:not(.vp-board--readonly) .vp-card-task[draggable="true"] {
	cursor: grab;
}

.vp-card-task.is-dragging {
	opacity: .4;
}

.vp-card-task.is-mine {
	border-left: 3px solid var(--vp-accent);
}

.vp-card-col--done .vp-card-title,
.vp-board-col--done .vp-card-title {
	text-decoration: line-through;
	color: var(--vp-muted);
}

.vp-card-head {
	display: flex;
	gap: .35em;
	align-items: baseline;
	cursor: pointer;
	border-radius: 3px;
}
.vp-board:not(.vp-board--readonly) .vp-card-task[draggable="true"] .vp-card-head {
	cursor: grab;
}
.vp-card-head:focus-visible {
	outline: 2px solid var(--vp-accent);
	outline-offset: 2px;
}
.vp-card-chevron {
	flex: none;
	width: 1em;
	color: var(--vp-muted);
	cursor: pointer;
}
/* Nur-Lese-Ansicht im Backend: <details>/<summary> statt Skript */
summary.vp-card-head {
	list-style: none;
}
summary.vp-card-head::-webkit-details-marker {
	display: none;
}
details.vp-card-task > summary .vp-card-chevron::before {
	content: "▸";
}
details.vp-card-task[open] > summary .vp-card-chevron::before {
	content: "▾";
}
details.vp-card-task[open] > summary {
	margin-bottom: 4px;
}
details.vp-card-task:not([open]),
.vp-card-task.is-collapsed {
	padding-top: 6px;
	padding-bottom: 6px;
}

.vp-card-title {
	font-weight: 600;
	overflow-wrap: anywhere;
}

.vp-card-desc {
	font-size: .875em;
	margin-top: 4px;
	overflow-wrap: anywhere;
}

/* Formatierter Text (Markup::render / format()) */
.vp-formatted p,
.vp-formatted ul,
.vp-formatted ol {
	margin: 0 0 .4em;
}

.vp-formatted p:last-child,
.vp-formatted ul:last-child,
.vp-formatted ol:last-child {
	margin-bottom: 0;
}

.vp-formatted ul,
.vp-formatted ol {
	padding-left: 1.3em;
}

.vp-formatted ul {
	list-style: disc;
}

.vp-formatted ol {
	list-style: decimal;
}

.vp-formatted li {
	margin: 0;
}

/* Symbolleiste über dem Beschreibungsfeld */
.vp-fmt {
	display: flex;
	flex-direction: column;
	gap: 2px;
	font-size: .8em;
}

.vp-fmt textarea {
	font-size: 1rem;
}

.vp-fmt-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin: 2px 0;
}

.vp-board .vp-fmt-btn {
	font: inherit;
	font-size: .95em;
	line-height: 1;
	min-width: 30px;
	min-height: 28px;
	padding: 4px 8px;
	border: 1px solid var(--vp-border);
	border-radius: 4px;
	background: #fff;
	color: inherit;
	cursor: pointer;
}

.vp-board .vp-fmt-btn:hover,
.vp-board .vp-fmt-btn:focus-visible {
	border-color: var(--vp-accent);
	color: var(--vp-accent);
}

.vp-fmt-btn.is-bold {
	font-weight: 700;
}

.vp-fmt-btn.is-italic {
	font-style: italic;
}

.vp-fmt-preview {
	margin-top: 4px;
	padding: 6px 8px;
	border: 1px dashed var(--vp-border);
	border-radius: 4px;
	background: var(--vp-col-bg);
	font-size: 1rem;
}

.vp-fmt-preview::before {
	content: "Vorschau";
	display: block;
	font-size: .75em;
	color: var(--vp-muted);
	margin-bottom: 2px;
}

.vp-fmt-preview[hidden] {
	display: none;
}

.vp-card-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-top: 6px;
}

.vp-card-meta:empty {
	display: none;
}

.vp-chip {
	font-size: .75em;
	background: var(--vp-col-bg);
	border-radius: 999px;
	padding: 1px 8px;
}

.vp-chip.is-late {
	background: #fcf0f1;
	color: var(--vp-late);
	font-weight: 600;
}

.vp-card-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-top: 8px;
}

.vp-board .vp-icon-btn {
	font: inherit;
	font-size: .8em;
	line-height: 1;
	min-width: 30px;
	min-height: 30px;
	padding: 4px 8px;
	border: 1px solid var(--vp-border);
	border-radius: 4px;
	background: #fff;
	color: inherit;
	cursor: pointer;
}

.vp-board .vp-icon-btn:hover,
.vp-board .vp-icon-btn:focus-visible {
	border-color: var(--vp-accent);
	color: var(--vp-accent);
}

.vp-board .vp-icon-btn:disabled {
	opacity: .35;
	cursor: default;
}

.vp-task-form {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 6px;
}

.vp-task-form > * {
	min-width: 0;
}

.vp-task-form .vp-wide {
	grid-column: 1 / -1;
}

.vp-task-form label {
	display: flex;
	flex-direction: column;
	font-size: .8em;
	gap: 2px;
}

.vp-task-form input,
.vp-task-form select,
.vp-task-form textarea {
	width: 100%;
	box-sizing: border-box;
	font-size: 1rem;
}

.vp-task-form .vp-form-buttons {
	grid-column: 1 / -1;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.vp-board-add {
	margin-top: 8px;
}

.vp-board-add > summary {
	cursor: pointer;
	color: var(--vp-accent);
	font-size: .9em;
	padding: 4px 0;
}

.vp-board-add[open] > summary {
	margin-bottom: 6px;
}

.vp-board-error {
	color: var(--vp-late);
	font-weight: 600;
}

.vp-board-error:empty {
	display: none;
}

.vp-board .vp-delete {
	color: var(--vp-late);
}

/* Anhänge an Aufgaben */
.vp-card-files {
	list-style: none;
	margin: 6px 0 0;
	padding: 0;
	font-size: .85em;
}

.vp-card-files li {
	display: flex;
	align-items: baseline;
	gap: 2px;
	min-width: 0;
}

.vp-card-files li::before {
	content: "📎";
	margin-right: 4px;
	font-size: .9em;
}

.vp-board .vp-file-remove {
	border: 0;
	background: none;
	color: var(--vp-late);
	cursor: pointer;
	font-size: 1.1em;
	line-height: 1;
	padding: 0 4px;
	margin-left: auto;
}

.vp-card-files a {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.vp-card-files .vp-file-dl {
	flex: 0 0 auto;
}

.vp-card-files .vp-small {
	white-space: nowrap;
}

/* Miniaturen (Bild-Anhänge) */
.vp-thumbs {
	list-style: none;
	margin: 6px 0 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.vp-thumbs li {
	position: relative;
	margin: 0;
}

.vp-thumbs a {
	display: block;
	width: 72px;
	height: 72px;
	border-radius: 4px;
	overflow: hidden;
	background: var(--vp-col-bg, #f3f4f6);
	border: 1px solid var(--vp-border, #d0d4d9);
}

.vp-thumbs a:focus-visible {
	outline: 2px solid var(--vp-accent, #2271b1);
	outline-offset: 1px;
}

.vp-thumbs img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.vp-thumbs .vp-file-remove {
	position: absolute;
	top: 2px;
	right: 2px;
	margin: 0;
	padding: 0;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .9);
	box-shadow: 0 0 0 1px rgba(0, 0, 0, .15);
	font-size: 15px;
}

.vp-card-files .vp-file-dl {
	text-decoration: none;
	padding: 0 2px;
}

/* Großansicht */
.vp-lightbox {
	border: 0;
	padding: 0;
	margin: auto;
	width: 100vw;
	height: 100vh;
	max-width: 100vw;
	max-height: 100vh;
	background: rgba(0, 0, 0, .9);
	color: #fff;
}

.vp-lightbox::backdrop {
	background: rgba(0, 0, 0, .6);
}

.vp-lightbox[open] {
	display: flex;
	flex-direction: column;
}

.vp-lightbox-stage {
	position: relative;
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 16px 8px 0;
}

.vp-lightbox-stage img {
	max-width: calc(100% - 112px);
	max-height: 100%;
	object-fit: contain;
	background: #fff;
}

.vp-lightbox-nav {
	flex: 0 0 48px;
	height: 64px;
	border: 0;
	border-radius: 6px;
	background: rgba(255, 255, 255, .12);
	color: #fff;
	font-size: 32px;
	line-height: 1;
	cursor: pointer;
}

.vp-lightbox-nav:disabled {
	opacity: .25;
	cursor: default;
}

.vp-lightbox-nav[hidden] {
	display: none;
}

.vp-lightbox-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 16px;
	padding: 12px 16px;
}

.vp-lightbox-name {
	flex: 1 1 auto;
	min-width: 0;
	overflow-wrap: anywhere;
}

.vp-lightbox-count {
	opacity: .7;
}

.vp-lightbox .vp-lightbox-btn {
	color: #fff;
	background: rgba(255, 255, 255, .15);
	border: 0;
	border-radius: 4px;
	padding: 6px 12px;
	font: inherit;
	text-decoration: none;
	cursor: pointer;
}

.vp-lightbox .vp-lightbox-btn[hidden] {
	display: none;
}

@media (max-width: 600px) {
	.vp-lightbox-stage {
		padding: 8px 0 0;
		gap: 0;
	}

	.vp-lightbox-stage img {
		max-width: 100%;
	}

	.vp-lightbox-nav {
		position: absolute;
		top: 50%;
		transform: translateY(-50%);
		background: rgba(0, 0, 0, .4);
	}

	.vp-lightbox-prev {
		left: 4px;
	}

	.vp-lightbox-next {
		right: 4px;
	}
}

/* Datei-Zelle in Backend-Tabellen (Protokolle, Kassenbuch) */
.vp-file-cell {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.vp-file-thumb {
	display: block;
	width: 48px;
	height: 48px;
	border-radius: 4px;
	overflow: hidden;
	border: 1px solid #d0d4d9;
	background: #f3f4f6;
	flex: 0 0 auto;
}

.vp-file-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.vp-file-cell .vp-file-dl {
	text-decoration: none;
}

/* Einstellungen: aufklappbare Gruppen (z. B. Mail-Arten) */
.vp-portal .vp-settings-group {
	border: 1px solid var(--vp-border);
	border-radius: 6px;
	padding: 0 14px;
	margin: 0 0 1em;
}
.vp-portal .vp-settings-group > summary {
	cursor: pointer;
	padding: 10px 0;
	font-weight: 600;
}
.vp-portal .vp-settings-group > summary .vp-small {
	font-weight: normal;
	margin-left: .4em;
}
.vp-portal .vp-settings-group[open] > summary {
	border-bottom: 1px solid var(--vp-border);
	margin-bottom: .6em;
}
.vp-portal .vp-mail-prefs { border: 0; margin: 0 0 1em; padding: 0; }
.vp-portal .vp-mail-prefs p { margin: .3em 0; }
.vp-portal .screen-reader-text {
	position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
	overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* Positions-Pfeile: am Rechner mit Maus reicht Ziehen & Ablegen – Pfeile nur unsichtbar für Tastatur/Screenreader
   (beim Fokussieren per Tastatur werden sie sichtbar). Auf Touch-Geräten bleiben sie stets sichtbar. */
@media (hover: hover) and (pointer: fine) {
	.vp-board .vp-card-task:not(:has(.vp-move-btn:focus-visible)) .vp-move-btn {
		position: absolute;
		width: 1px;
		height: 1px;
		min-width: 0;
		min-height: 0;
		margin: -1px;
		padding: 0;
		border: 0;
		overflow: hidden;
		clip: rect(0 0 0 0);
		clip-path: inset(50%);
		white-space: nowrap;
	}
}

/* Checkliste je Aufgabe */
.vp-checklist-box {
	margin: 6px 0;
	font-size: .875em;
}
.vp-task-checklist {
	list-style: none;
	margin: 0 0 4px;
	padding: 0;
}
.vp-task-checklist li {
	display: flex;
	align-items: flex-start;
	gap: .3em;
	margin: 0;
	padding: 2px 0;
}
.vp-task-checklist label {
	flex: 1;
	display: flex;
	align-items: flex-start;
	gap: .45em;
	cursor: pointer;
	overflow-wrap: anywhere;
}
.vp-task-checklist input[type="checkbox"] {
	margin: .2em 0 0;
	flex: none;
}
.vp-task-checklist li.is-done .vp-check-label {
	text-decoration: line-through;
	color: var(--vp-muted);
}
.vp-task-checklist .vp-check-mark {
	flex: none;
	width: 1.1em;
}
.vp-check-btn {
	flex: none;
	border: 0;
	background: none;
	color: var(--vp-muted);
	cursor: pointer;
	padding: 0 .25em;
	line-height: 1.4;
	opacity: .6;
	font-size: 1em;
}
.vp-check-btn:hover,
.vp-check-btn:focus-visible {
	color: var(--vp-accent);
	opacity: 1;
}
.vp-check-btn:disabled {
	opacity: .2;
	cursor: default;
}
.vp-check-remove:hover,
.vp-check-remove:focus-visible {
	color: var(--vp-late);
}
.vp-task-checklist li[draggable="true"] {
	cursor: grab;
}
.vp-task-checklist li.is-dragging {
	opacity: .4;
}
.vp-task-checklist .vp-check-edit {
	flex: 1;
	min-width: 0;
	font-size: 1em;
	padding: 2px 6px;
}
.vp-check-add {
	display: flex;
	gap: 4px;
}
.vp-check-add .vp-check-new {
	flex: 1;
	min-width: 0;
	font-size: 1em;
	padding: 2px 6px;
}
.vp-chip.is-complete {
	background: #e6f4ea;
	color: #1e6b34;
}

/* Fortschritt der Checkliste in der Kopfzeile (rechtsbündig, auch zugeklappt) */
.vp-card-head .vp-card-title {
	flex: 1;
	min-width: 0;
}
.vp-card-head .vp-card-progress {
	flex: none;
	align-self: center;
	font-weight: normal;
	text-decoration: none;
}

/* Checkliste: „+ Punkt“ statt dauerhaft sichtbarem Eingabefeld */
.vp-check-more {
	border: 0;
	background: none;
	padding: 2px 0;
	color: var(--vp-accent);
	cursor: pointer;
	font-size: 1em;
}
.vp-check-more:hover,
.vp-check-more:focus-visible {
	text-decoration: underline;
}

/* Checkliste optisch vom Aufgabentext absetzen: eigene, leicht hinterlegte Fläche */
.vp-checklist-box,
.vp-task-checklist--readonly {
	background: var(--vp-col-bg);
	border-radius: 4px;
	padding: 6px 8px;
	margin: 8px 0;
}
.vp-checklist-box .vp-task-checklist {
	margin-bottom: 2px;
}
.vp-task-checklist--readonly {
	font-size: .875em;
}

/* Bearbeiten-Formular: Abschnitte Checkliste / Anhänge */
.vp-task-extras {
	border-top: 1px solid var(--vp-border);
	padding-top: 6px;
}
.vp-form-section {
	font-weight: 600;
	font-size: .875em;
	margin: 6px 0 2px;
}
.vp-task-extras .vp-checklist-box {
	margin-top: 2px;
}
.vp-task-extras .vp-small {
	margin: 6px 0 0;
}
/* Checkliste im Formular: Formular-Stile für Beschriftungen/Felder nicht übernehmen */
.vp-task-form .vp-task-checklist label {
	flex-direction: row;
	align-items: flex-start;
	gap: .45em;
	font-size: 1em;
}
.vp-task-form .vp-task-checklist input[type="checkbox"] {
	width: auto;
}
.vp-task-form .vp-checklist-box input[type="text"] {
	font-size: 1em;
}

/* Ablagefläche für Anhänge im Bearbeiten-Formular */
.vp-dropzone {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .3em;
	margin-top: 4px;
}
.vp-dropzone-hint {
	display: none;
}
@media (hover: hover) and (pointer: fine) {
	.vp-dropzone {
		border: 2px dashed var(--vp-border);
		border-radius: 6px;
		padding: 10px;
		justify-content: center;
		font-size: .875em;
		color: var(--vp-muted);
		text-align: center;
	}
	.vp-dropzone-hint {
		display: inline;
	}
	.vp-dropzone.is-over {
		border-color: var(--vp-accent);
		background: #eef5fb;
		color: var(--vp-accent);
	}
}
