/* Wohnungsverwaltung – Frontend. Farben über --iwv-accent im Theme anpassbar. */
.iwv {
	--iwv-accent: #1f5f8b;
	--iwv-accent-contrast: #fff;
	--iwv-border: rgba(127, 127, 127, .28);
	--iwv-soft: rgba(127, 127, 127, .08);
	--iwv-radius: 10px;
	box-sizing: border-box;
}
.iwv *, .iwv *::before, .iwv *::after { box-sizing: inherit; }

/* Buttons */
.iwv .iwv-btn {
	display: inline-block; padding: .75em 1.4em; border-radius: 6px;
	background: var(--iwv-accent); color: var(--iwv-accent-contrast);
	text-decoration: none; font-weight: 600; line-height: 1.2; border: 2px solid var(--iwv-accent); max-width: 100%; text-align: center;
	transition: filter .15s;
}
.iwv .iwv-btn:hover, .iwv .iwv-btn:focus { filter: brightness(1.12); color: var(--iwv-accent-contrast); }
.iwv .iwv-btn-outline { background: transparent; color: var(--iwv-accent); }
.iwv .iwv-btn-outline:hover, .iwv .iwv-btn-outline:focus { background: var(--iwv-accent); color: var(--iwv-accent-contrast); filter: none; }

/* Liste */
.iwv-filter { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: flex-end; margin: 0 0 22px; padding: 14px 16px; border: 1px solid var(--iwv-border); border-radius: var(--iwv-radius); background: var(--iwv-soft); }
.iwv-filter label { display: flex; flex-direction: column; gap: 4px; font-size: .85em; font-weight: 600; }
.iwv-filter select, .iwv-filter input { font: inherit; font-weight: 400; padding: .45em .6em; min-width: 150px; border: 1px solid var(--iwv-border); border-radius: 6px; background: #fff; color: #1e1e1e; }
.iwv-count { margin-left: auto; font-size: .9em; opacity: .75; }

.iwv-liste .iwv-grid { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .iwv-liste .iwv-cols-2, .iwv-liste .iwv-cols-3, .iwv-liste .iwv-cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .iwv-liste .iwv-cols-3 { grid-template-columns: repeat(3, 1fr); } .iwv-liste .iwv-cols-4 { grid-template-columns: repeat(4, 1fr); } }

.iwv-card { display: flex; flex-direction: column; border: 1px solid var(--iwv-border); border-radius: var(--iwv-radius); overflow: hidden; }
.iwv-card[hidden] { display: none; }
.iwv-card-img { display: block; aspect-ratio: 4 / 3; background: var(--iwv-soft); overflow: hidden; }
.iwv-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.iwv-card:hover .iwv-card-img img { transform: scale(1.03); }
.iwv-noimg { display: flex; height: 100%; align-items: center; justify-content: center; opacity: .5; }
.iwv-card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.iwv-card-ort { margin: 0 0 4px; font-size: .85em; opacity: .7; }
.iwv-card-title { margin: 0 0 10px; font-size: 1.15em; line-height: 1.3; }
.iwv-card-title a { text-decoration: none; color: inherit; }
.iwv-facts { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .95em; }
.iwv-card-frei { margin: 0 0 14px; font-size: .9em; opacity: .8; }
.iwv-card .iwv-btn { margin-top: auto; align-self: flex-start; white-space: nowrap; }
.iwv-empty { padding: 24px; border: 1px dashed var(--iwv-border); border-radius: var(--iwv-radius); text-align: center; }

/* Detail */
.iwv-detail h2 { font-size: 1.3em; margin: 0 0 .6em; }
.iwv-admin-hinweis { padding: 10px 14px; background: #fff4d6; color: #5c4300; border-radius: 6px; }
.iwv-gallery { margin-bottom: 20px; }
.iwv-gallery-main { display: block; border-radius: var(--iwv-radius); overflow: hidden; aspect-ratio: 16 / 10; background: var(--iwv-soft); }
.iwv-gallery-main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.iwv-gallery-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-top: 8px; }
.iwv-gallery-thumbs a { display: block; aspect-ratio: 1; border-radius: 6px; overflow: hidden; }
.iwv-gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }

.iwv-keyfacts { list-style: none; padding: 0; margin: 0 0 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.iwv-keyfacts li { padding: 12px 14px; border-radius: 8px; background: var(--iwv-soft); display: flex; flex-direction: column; }
.iwv-keyfacts span { font-size: .8em; opacity: .7; }
.iwv-keyfacts strong { font-size: 1.25em; }
.iwv-cta-top { margin: 0 0 28px; }

.iwv-columns { display: grid; gap: 20px; grid-template-columns: 1fr; margin-bottom: 28px; }
@media (min-width: 760px) { .iwv-columns { grid-template-columns: 1fr 1fr; } }
.iwv-box { border: 1px solid var(--iwv-border); border-radius: var(--iwv-radius); padding: 16px 18px; }
.iwv-table { width: 100%; border-collapse: collapse; margin: 0; border: 0; }
.iwv-table th, .iwv-table td { padding: 7px 0; border: 0; border-bottom: 1px solid var(--iwv-border); text-align: left; vertical-align: top; font-size: .95em; background: none; }
.iwv-table th { font-weight: 400; opacity: .8; padding-right: 12px; }
.iwv-table td { text-align: right; font-weight: 600; }
.iwv-table tr:last-child th, .iwv-table tr:last-child td { border-bottom: 0; }
.iwv-table .iwv-sum th, .iwv-table .iwv-sum td { font-weight: 700; opacity: 1; }

.iwv-section { margin-bottom: 28px; }
.iwv-ausstattung { columns: 2 220px; padding-left: 1.2em; margin: 0; }
.iwv-ausstattung li { margin-bottom: 4px; break-inside: avoid; }
.iwv-grundriss { display: block; max-width: 760px; }
.iwv-grundriss img { width: 100%; height: auto; border: 1px solid var(--iwv-border); border-radius: 6px; background: #fff; }

.iwv-energie .iwv-table { max-width: 560px; }
.iwv-ea-skala { display: flex; gap: 2px; margin: 0 0 14px; max-width: 560px; }
.iwv-ea-k { flex: 1; text-align: center; padding: 6px 0; font-weight: 700; font-size: .85em; color: #fff; opacity: .45; border-radius: 3px; }
.iwv-ea-k.iwv-ea-aktiv { opacity: 1; transform: scaleY(1.25); box-shadow: 0 0 0 2px #1e1e1e; }
.iwv-ea-0 { background: #00a651; } .iwv-ea-1 { background: #2db34a; } .iwv-ea-2 { background: #8dc63f; }
.iwv-ea-3 { background: #c2d82e; color: #1e1e1e; } .iwv-ea-4 { background: #fff200; color: #1e1e1e; } .iwv-ea-5 { background: #fdb913; color: #1e1e1e; }
.iwv-ea-6 { background: #f37021; } .iwv-ea-7 { background: #ed1c24; } .iwv-ea-8 { background: #a0171d; }

.iwv-cta { padding: 22px 24px; border-radius: var(--iwv-radius); background: var(--iwv-soft); border: 1px solid var(--iwv-border); margin-bottom: 20px; }
.iwv-cta p { margin: 0 0 14px; }
.iwv-hinweis { font-size: .85em; opacity: .7; }

/* Lightbox */
.iwv-lightbox { position: fixed; inset: 0; z-index: 99999; background: rgba(0,0,0,.9); display: flex; align-items: center; justify-content: center; padding: 40px 56px; }
.iwv-lightbox[hidden] { display: none; }
.iwv-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.iwv-lightbox button { position: absolute; background: rgba(255,255,255,.15); color: #fff; border: 0; width: 44px; height: 44px; border-radius: 50%; font-size: 24px; cursor: pointer; line-height: 1; }
.iwv-lightbox button:hover { background: rgba(255,255,255,.3); }
.iwv-lb-close { top: 12px; right: 12px; }
.iwv-lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.iwv-lb-next { right: 8px; top: 50%; transform: translateY(-50%); }
@media (max-width: 600px) { .iwv-lightbox { padding: 56px 8px; } .iwv-lb-prev, .iwv-lb-next { top: auto; bottom: 8px; transform: none; } }
