/*
 * Grundgestaltung der WG-Blöcke. Bewusst zurückhaltend: Schrift und Farben
 * erben vom Theme, Akzent und Abstände lassen sich über die Variablen anpassen.
 */
:root {
	--wg-accent: #2f8794;
	--wg-accent-contrast: #fff;
	--wg-muted: color-mix(in srgb, currentColor 58%, transparent);
	--wg-line: color-mix(in srgb, currentColor 16%, transparent);
	--wg-surface: color-mix(in srgb, currentColor 4%, transparent);
	--wg-radius: 6px;
	--wg-gap: 1.25rem;
}

/* ---- Bausteine ---- */
.wg-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	padding: 0.6em 1.1em;
	border: 1px solid var(--wg-accent);
	border-radius: var(--wg-radius);
	background: var(--wg-accent);
	color: var(--wg-accent-contrast);
	font: inherit;
	font-size: 0.95em;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
}
.wg-btn:hover { filter: brightness(1.08); }
.wg-btn:disabled { opacity: 0.5; cursor: default; }
.wg-btn--ghost { background: transparent; color: inherit; border-color: var(--wg-line); }
.wg-link { background: none; border: 0; padding: 0; color: var(--wg-accent); font: inherit; text-decoration: underline; cursor: pointer; }
.wg-notice { padding: 1rem 1.25rem; border: 1px dashed var(--wg-line); border-radius: var(--wg-radius); color: var(--wg-muted); }
.wg-field { display: flex; flex-direction: column; gap: 0.3em; font-size: 0.9em; }
.wg-field > span { color: var(--wg-muted); }
.wg-field input, .wg-field select, .wg-field textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 0.55em 0.7em;
	border: 1px solid var(--wg-line);
	border-radius: var(--wg-radius);
	background: transparent;
	color: inherit;
	font: inherit;
}
.wg-field .is-invalid, .wg-field input.is-invalid { border-color: #c0392b; }
.wg-range { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4em; }

/* ---- Kartei ---- */
.wg-filters {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 0.9rem;
	align-items: end;
	margin-bottom: 1.5rem;
	padding: 1rem;
	border: 1px solid var(--wg-line);
	border-radius: var(--wg-radius);
}
.wg-filters__actions { display: flex; gap: 1rem; align-items: center; }
.wg-count { margin: 0 0 0.75rem; color: var(--wg-muted); font-size: 0.9em; }
.wg-grid { display: grid; grid-template-columns: repeat(var(--wg-columns, 4), minmax(0, 1fr)); gap: var(--wg-gap); }
@media (max-width: 900px) { .wg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .wg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; } }
.wg-pagination { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 1.5rem; }

.wg-card { display: flex; flex-direction: column; min-width: 0; }
.wg-card__media { position: relative; aspect-ratio: 3 / 4; overflow: hidden; border-radius: var(--wg-radius); background: var(--wg-surface); }
.wg-card__media > a { display: block; height: 100%; }
.wg-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }
.wg-card__media:hover img { transform: scale(1.03); }
.wg-card__name { margin: 0.6rem 0 0; font-size: 1em; line-height: 1.3; }
.wg-card__name a { color: inherit; text-decoration: none; }
.wg-card__meta { margin: 0.15em 0 0; color: var(--wg-muted); font-size: 0.85em; }

/* Herz auf der Kachel: immer gut lesbar, auch auf hellen Fotos */
.wg-heart {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	display: grid;
	place-items: center;
	width: 2.25rem;
	height: 2.25rem;
	border: 0;
	border-radius: 50%;
	background: rgb(255 255 255 / 0.88);
	color: #1f1c19;
	font-size: 1.1rem;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 1px 4px rgb(0 0 0 / 0.15);
}
.wg-heart:hover, .wg-heart:focus-visible { background: #fff; }
.wg-heart.is-active { color: #c2185b; }

.wg-shortlist-toggle { grid-column: 2; grid-row: 1 / span 2; }

.wg-shortlist-toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
	padding: 0.35em 0.6em;
	border: 1px solid var(--wg-line);
	border-radius: 999px;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 0.8em;
	cursor: pointer;
}
.wg-shortlist-toggle.is-active { border-color: var(--wg-accent); color: var(--wg-accent); }
.wg-btn.wg-shortlist-toggle { border-radius: var(--wg-radius); font-size: 0.95em; padding: 0.6em 1.1em; }
.wg-btn.wg-shortlist-toggle.is-active { background: transparent; }

/* ---- Profil ---- */
.wg-profile__layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
@media (max-width: 780px) { .wg-profile__layout { grid-template-columns: 1fr; } }
.wg-profile__hero { display: block; aspect-ratio: 3 / 4; overflow: hidden; border-radius: var(--wg-radius); background: var(--wg-surface); }
.wg-profile__hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wg-profile__name { margin: 0; font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.05; }
.wg-profile__sub { margin: 0.5rem 0 1.75rem; color: var(--wg-muted); }
.wg-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1rem 1.5rem; margin: 0 0 2rem; padding: 1.25rem 0; border-top: 1px solid var(--wg-line); border-bottom: 1px solid var(--wg-line); }
.wg-facts dt { font-size: 0.72em; letter-spacing: 0.12em; text-transform: uppercase; color: var(--wg-muted); }
.wg-facts dd { margin: 0.2em 0 0; }
.wg-profile__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.wg-gallery { list-style: none; margin: 2.5rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); grid-auto-flow: dense; gap: var(--wg-gap); }
.wg-gallery__item a { display: block; aspect-ratio: 3 / 4; overflow: hidden; border-radius: var(--wg-radius); background: var(--wg-surface); }
/* Querformat ueber zwei Spalten; 3:2 auf doppelter Breite entspricht etwa der Hoehe einer 3:4-Kachel */
.wg-gallery__item--landscape { grid-column: span 2; }
.wg-gallery__item--landscape a { aspect-ratio: auto; height: 100%; }
.wg-gallery__item img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---- Slider ---- */
.wg-slider { position: relative; }
.wg-slider__track {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: clamp(180px, 22vw, 280px);
	gap: 1rem;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	padding-bottom: 0.25rem;
}
.wg-slider__track::-webkit-scrollbar { display: none; }
.wg-slider__track > .wg-card { scroll-snap-align: start; }
.wg-slider__nav { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.75rem; }
.wg-slider__btn { width: 2.5rem; height: 2.5rem; border: 1px solid var(--wg-line); border-radius: 50%; background: transparent; color: inherit; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.wg-slider__btn:disabled { opacity: 0.3; cursor: default; }

/* ---- Merkliste und Anfrage ---- */
.wg-shortlist__toolbar { display: flex; justify-content: space-between; align-items: center; margin: 1rem 0; }
.wg-shortlist__links { display: flex; gap: 1.25rem; }
.wg-inquiry { margin-top: 2.5rem; padding: clamp(1rem, 3vw, 2rem); border: 1px solid var(--wg-line); border-radius: var(--wg-radius); }
.wg-inquiry__title { margin: 0 0 1rem; }
.wg-inquiry__about { margin: -0.25rem 0 1.25rem; color: var(--wg-muted); }
.wg-profile .wg-inquiry { scroll-margin-top: 2rem; }
.wg-inquiry__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.wg-field--wide { grid-column: 1 / -1; }
@media (max-width: 640px) { .wg-inquiry__grid { grid-template-columns: 1fr; } }
.wg-inquiry__legal { color: var(--wg-muted); font-size: 0.85em; }
.wg-inquiry__status:empty { display: none; }
.wg-inquiry__status.is-success { color: #1a7f37; }
.wg-inquiry__status.is-error { color: #c0392b; }
.wg-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
	.wg-card__media img { transition: none; }
	.wg-card__media:hover img { transform: none; }
}

/* ---- Bewerbungsformular ---- */
.wg-apply__form { display: flex; flex-direction: column; gap: 2rem; }
.wg-apply__section { margin: 0; padding: 1.5rem 0 0; border: 0; border-top: 1px solid var(--wg-line); display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.wg-apply__section legend { padding: 0 0.5rem 0 0; font-weight: 600; font-size: 1.05em; }
.wg-apply__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.wg-apply__grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 640px) { .wg-apply__grid, .wg-apply__grid--3 { grid-template-columns: 1fr 1fr; } }
.wg-apply .wg-field > label { color: inherit; font-weight: 500; }
.wg-field__error { color: #c0392b; font-size: 0.85em; }
.wg-field__error:empty { display: none; }
.wg-field.is-invalid input, .wg-field.is-invalid select, .wg-field.is-invalid textarea { border-color: #c0392b; }
.wg-apply__checks { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.wg-apply__checks label, .wg-apply__consent { display: flex; gap: 0.6rem; align-items: flex-start; }
.wg-apply__consent input, .wg-apply__checks input { accent-color: var(--wg-accent); margin-top: 0.25em; }
.wg-apply__consent.is-invalid { color: #c0392b; }
.wg-apply__hint { margin: 0; color: var(--wg-muted); font-size: 0.9em; }
.wg-apply__photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 0.75rem; }
.wg-apply__photo, .wg-apply__add { position: relative; aspect-ratio: 3 / 4; border-radius: var(--wg-radius); overflow: hidden; }
.wg-apply__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wg-apply__photo button { position: absolute; top: 0.3rem; right: 0.3rem; width: 1.75rem; height: 1.75rem; border: 0; border-radius: 50%; background: rgb(0 0 0 / 0.6); color: #fff; cursor: pointer; font-size: 1rem; line-height: 1; }
.wg-apply__add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.25rem; border: 1px dashed var(--wg-line); color: var(--wg-muted); font-size: 0.9em; cursor: pointer; text-align: center; }
.wg-apply__add span { font-size: 1.8rem; line-height: 1; }
.wg-apply__add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.wg-apply__add[hidden] { display: none; }
[data-wg-field="files"].is-invalid .wg-apply__add { border-color: #c0392b; }
.wg-apply__guardian { display: flex; flex-direction: column; gap: 0.75rem; padding: 1rem; border-radius: var(--wg-radius); background: color-mix(in srgb, #f59e0b 12%, transparent); }
.wg-apply__guardian[hidden] { display: none; }
.wg-apply__guardian p { margin: 0; }
.wg-apply__status--error { margin: 0; padding: 0.75rem 1rem; border-radius: var(--wg-radius); background: color-mix(in srgb, #c0392b 10%, transparent); color: #c0392b; }
.wg-apply__submit { display: flex; flex-direction: column; gap: 0.75rem; }
.wg-apply__submit .wg-btn { justify-content: center; padding: 0.85em 1.5em; font-size: 1em; }
.wg-apply__progress { height: 6px; border-radius: 999px; background: var(--wg-line); overflow: hidden; }
.wg-apply__progress span { display: block; height: 100%; width: 0; background: var(--wg-accent); transition: width 0.2s; }
.wg-apply__done { padding: 3rem 0; text-align: center; }
.wg-apply input[type='checkbox'] { width: 1.15em; height: 1.15em; flex-shrink: 0; }
