/* ==========================================================================
   Immobilien: Übersicht (Filter, Raster) und Exposé-Seite
   ========================================================================== */

/* Filter (DKB-Leiste mit aufklappbarer Suche)
   ----------------------------------------------------------------------- */
.objekte__count { margin: 0 0 22px; font-size: clamp(1.5rem, 1.3rem + .8vw, 2.1rem); font-weight: 500; }
.filter { margin-bottom: clamp(32px, 4vw, 52px); background: #fff; box-shadow: var(--fi-shadow); border-bottom: 3px solid var(--fi-card-edge); border-radius: 2px; }
.filter__bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 24px; padding: 18px 22px; }
.filter__sort { width: min(260px, 100%); }
.filter__sort select { min-height: 46px; }
.filter__toggle { min-height: 46px; }
.filter__badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #fff; color: var(--fi-bordeaux); font-size: .72rem; }
.filter__links { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-left: auto; padding-bottom: 12px; }
.filter__link { display: inline-flex; align-items: center; gap: 6px; color: var(--fi-bordeaux); font-size: .9rem; font-weight: 600; text-decoration: none; }
.filter__link:hover { text-decoration: underline; }
.filter__panel { padding: 4px 22px 22px; border-top: 1px solid var(--fi-line); }
.js .filter:not(.is-open) .filter__panel { display: none; }
.filter__fields { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; padding-top: 18px; }
.filter__field select { min-height: 46px; }
.filter__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; margin-top: 18px; }
.filter__check { font-size: .88rem; font-weight: 600; }

.objekte__empty { display: grid; justify-items: center; gap: 10px; max-width: 640px; margin: 20px auto 0; padding: clamp(32px, 5vw, 56px); text-align: center; border: 1px dashed var(--fi-line-strong); border-radius: var(--fi-radius-lg); }
.objekte__empty .fi-icon { color: var(--fi-bordeaux); }
.objekte__empty h2 { margin: 6px 0 0; font-size: clamp(1.7rem, 1.4rem + 1vw, 2.2rem); }
.objekte__empty p { color: var(--fi-muted); }

/* Suchauftrag-Band */
.suchauftrag { padding-block: clamp(56px, 7vw, 104px); }
.suchauftrag__inner { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.suchauftrag__text .checklist { margin-top: 24px; }

/* Exposé: Kopf
   ----------------------------------------------------------------------- */
.objekt-head { padding-block: clamp(20px, 3vw, 32px) clamp(20px, 3vw, 32px); }
.objekt-head .breadcrumbs { margin-bottom: clamp(20px, 3vw, 36px); }
.objekt-head__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px 48px; }
.objekt-head__badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.objekt-head__title { max-width: 1000px; margin-bottom: 14px; font-size: clamp(2rem, 1.6rem + 1.7vw, 3rem); hyphens: manual; }
.objekt-head__loc { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; color: var(--fi-text); font-size: .85rem; font-weight: 700; letter-spacing: .06em; }
.objekt-head__loc .fi-icon { color: var(--fi-bordeaux); }
.objekt-head__nr { color: var(--fi-muted); font-weight: 600; }

.objekt-actions { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; flex-shrink: 0; }
.objekt-actions a,
.objekt-actions button {
	display: inline-flex; align-items: center; gap: 10px; padding: 5px 0;
	border: 0; background: none; color: var(--fi-bordeaux); font: inherit; font-size: .88rem; font-weight: 700; text-decoration: none; cursor: pointer;
}
.objekt-actions a:hover span,
.objekt-actions button:hover span { text-decoration: underline; }
.objekt-actions [aria-pressed="true"] .fi-icon { fill: currentColor; }

/* Galerie */
.objekt-gallery { position: relative; }
.objekt-gallery__tour { margin-top: 14px; }
.gallery__stage { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--fi-radius); background: var(--fi-surface); touch-action: pan-y; user-select: none; }
.gallery__slide { position: absolute; inset: 0; opacity: 0; transition: opacity .45s var(--fi-ease); }
.gallery__slide.is-active { opacity: 1; z-index: 1; }
.gallery__slide img { width: 100%; height: 100%; object-fit: cover; }
.gallery__nav {
	position: absolute; top: 50%; z-index: 3; transform: translateY(-50%);
	display: grid; place-items: center; width: 56px; height: 56px; padding: 0;
	border: 0; border-radius: 50%; background: rgb(255 255 255 / 94%); color: var(--fi-bordeaux);
	box-shadow: var(--fi-shadow); cursor: pointer; transition: background-color .2s, color .2s;
}
.gallery__nav:hover { background: var(--fi-bordeaux); color: #fff; }
.gallery__nav--prev { left: 18px; }
.gallery__nav--next { right: 18px; }
.gallery__expand {
	position: absolute; right: 16px; bottom: 16px; z-index: 3;
	display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px;
	border: 0; border-radius: 999px; background: rgb(35 31 32 / 72%); color: #fff;
	font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; backdrop-filter: blur(4px);
}
.gallery__expand:hover { background: var(--fi-bordeaux); }
.gallery__caption { min-height: 1.5em; margin: 10px 0 0; padding-bottom: 6px; border-bottom: 2px solid var(--fi-bordeaux); color: var(--fi-muted); font-size: .82rem; }
.gallery__thumbs { display: flex; gap: 10px; margin-top: 14px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 4px; }
.gallery__thumb { flex: 0 0 auto; width: 112px; aspect-ratio: 4 / 3; padding: 0; border: 2px solid transparent; border-radius: var(--fi-radius); overflow: hidden; background: var(--fi-surface); cursor: pointer; opacity: .7; transition: opacity .2s, border-color .2s; }
.gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumb:hover { opacity: 1; }
.gallery__thumb[aria-current="true"] { border-color: var(--fi-bordeaux); opacity: 1; }

/* Lightbox */
.lightbox { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; padding: 0; border: 0; background: rgb(20 12 15 / 96%); color: #fff; }
.lightbox::backdrop { background: rgb(20 12 15 / 96%); }
.lightbox__stage { position: absolute; inset: 24px 88px 72px; display: grid; place-items: center; }
.lightbox__img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 2px; }
.lightbox__bar { position: absolute; inset: auto 88px 18px; display: flex; justify-content: space-between; gap: 16px; font-size: .9rem; color: rgb(255 255 255 / 80%); }
.lightbox__caption { margin: 0; }
.lightbox__btn { position: absolute; display: grid; place-items: center; width: 56px; height: 56px; padding: 0; border: 0; border-radius: 50%; background: rgb(255 255 255 / 12%); color: #fff; cursor: pointer; transition: background-color .2s; }
.lightbox__btn:hover { background: rgb(255 255 255 / 24%); }
.lightbox__btn--prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox__btn--next { right: 20px; top: 50%; transform: translateY(-50%); }
.lightbox__btn--close { right: 20px; top: 20px; }

/* Kennzahlen-Band (wie DKB) */
.keyfacts { margin-top: clamp(32px, 4vw, 56px); background: var(--fi-bordeaux); color: #fff; }
.keyfacts__inner { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px clamp(24px, 3.4vw, 52px); padding-block: 30px clamp(70px, 8vw, 110px); }
.keyfacts__price,
.keyfacts__item { display: grid; align-content: start; gap: 4px; }
.keyfacts__price { padding: 10px 18px; margin: -10px 0 0 -18px; background: var(--fi-bordeaux-800); border-radius: var(--fi-radius); }
.keyfacts strong { color: #fff; font-size: clamp(1.45rem, 1.1rem + 1.2vw, 2rem); font-weight: 800; line-height: 1.15; letter-spacing: -.01em; white-space: nowrap; }
.keyfacts span { color: rgb(255 255 255 / 75%); font-size: .8rem; font-weight: 600; }

/* Layout Hauptbereich + Sidebar */
.objekt-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: clamp(32px, 4vw, 64px); align-items: start; padding-bottom: clamp(48px, 6vw, 88px); }
.objekt-highlights {
	position: relative; z-index: 2; margin-top: calc(-1 * clamp(56px, 6.5vw, 86px)); margin-bottom: clamp(32px, 4vw, 48px);
	padding: clamp(24px, 3vw, 36px); background: #fff; border-radius: var(--fi-radius); box-shadow: var(--fi-shadow-lg);
	transform: rotate(-.4deg);
}
.objekt-highlights .checklist { transform: rotate(.4deg); font-weight: 600; color: var(--fi-ink); }
.objekt-main > .objekt-section:first-child { margin-top: clamp(32px, 4vw, 48px); }

.objekt-section { padding-block: clamp(28px, 3vw, 40px); border-bottom: 1px solid var(--fi-line); }
.objekt-section:last-child { border-bottom: 0; }
.objekt-section h2 { margin-bottom: 20px; font-family: var(--fi-sans); font-size: 1.3rem; font-weight: 800; letter-spacing: -.01em; }

.datalist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; margin: 0; }
.datalist > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--fi-line); }
.datalist dt { color: var(--fi-muted); font-size: .92rem; }
.datalist dd { margin: 0; color: var(--fi-ink); font-size: .95rem; font-weight: 700; }

.merkmale { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 0; padding: 0; list-style: none; }
.merkmale li { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--fi-surface); color: var(--fi-ink); font-size: .86rem; font-weight: 600; }
.merkmale .fi-icon { color: var(--fi-bordeaux); }

.objekt-note { margin: 0; padding: 14px 16px; border-radius: var(--fi-radius); background: var(--fi-surface); color: var(--fi-text); font-size: .92rem; }

/* Energieskala */
.energie { position: relative; margin: 34px 0 0; padding-top: 34px; }
.energie__bar { display: flex; height: 26px; border-radius: 3px; overflow: hidden; }
.energie__seg { display: grid; place-items: center; color: #fff; font-size: .72rem; font-weight: 800; text-shadow: 0 1px 1px rgb(0 0 0 / 25%); }
.energie__seg--0 { background: #00843d; }
.energie__seg--1 { background: #2e9e44; }
.energie__seg--2 { background: #8cc63f; }
.energie__seg--3 { background: #c9d431; color: #3b3b10; text-shadow: none; }
.energie__seg--4 { background: #f2d200; color: #3b3510; text-shadow: none; }
.energie__seg--5 { background: #f5a623; }
.energie__seg--6 { background: #ef7d22; }
.energie__seg--7 { background: #e2401c; }
.energie__seg--8 { background: #b81d24; }
.energie__seg.is-active { box-shadow: inset 0 0 0 2px rgb(0 0 0 / 35%); }
.energie__marker { position: absolute; top: 0; transform: translateX(-50%); display: grid; justify-items: center; }
.energie__marker span { padding: 3px 9px; border-radius: 3px; background: var(--fi-ink); color: #fff; font-size: .75rem; font-weight: 800; white-space: nowrap; }
.energie__marker::after { content: ""; width: 0; height: 0; border: 6px solid transparent; border-top-color: var(--fi-ink); }
.energie__ticks { position: relative; height: 22px; margin-top: 6px; color: var(--fi-muted); font-size: .72rem; font-variant-numeric: tabular-nums; }
.energie__ticks span { position: absolute; top: 0; transform: translateX(-50%); }
.energie__ticks span:first-child { transform: none; }

/* „mehr anzeigen“ */
.collapse__content { position: relative; }
.collapse.is-collapsible:not(.is-open) .collapse__content { max-height: 168px; overflow: hidden; }
.collapse.is-collapsible:not(.is-open) .collapse__content::after { content: ""; position: absolute; inset: auto 0 0; height: 72px; background: linear-gradient(to bottom, rgb(255 255 255 / 0%), #fff); }
.collapse__toggle { display: inline-flex; align-items: center; gap: 6px; margin: 12px auto 0; padding: 6px 4px; border: 0; background: none; color: var(--fi-bordeaux); font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer; }
.collapse { display: grid; }
.collapse.is-open .collapse__toggle .fi-icon { transform: rotate(180deg); }
.entry-text p { margin-bottom: 1em; }

/* Grundrisse */
.grundrisse { display: grid; gap: 20px; }
.grundrisse__item { display: block; padding: 16px; border: 1px solid var(--fi-line); border-radius: var(--fi-radius); background: #fff; text-decoration: none; }
.grundrisse__item img { width: 100%; height: auto; }
.grundrisse__item span { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: .85rem; font-weight: 700; }

/* Sidebar */
.objekt-aside { position: sticky; top: calc(var(--fi-header-h) + 24px); display: grid; gap: 20px; margin-top: clamp(-86px, -6.5vw, -56px); z-index: 2; }
.objekt-aside__card { padding: 26px; background: #fff; border: 1px solid var(--fi-line); border-radius: var(--fi-radius-lg); box-shadow: var(--fi-shadow); }
.objekt-aside__label { margin: 0 0 4px; color: var(--fi-muted); font-size: .74rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.objekt-aside__price { margin: 0; color: var(--fi-bordeaux); font-size: 2rem; font-weight: 800; letter-spacing: -.02em; }
.objekt-aside__meta { margin: 4px 0 0; color: var(--fi-muted); font-size: .88rem; }
.objekt-aside__actions { display: grid; gap: 10px; margin-top: 20px; }
.objekt-aside__actions .link-arrow { justify-self: center; margin-top: 6px; }
.objekt-aside__ap .ap-card { box-shadow: none; border: 1px solid var(--fi-line); padding: 18px; gap: 16px; }
.objekt-aside__ap .ap-card__photo { width: 72px; height: 72px; }
.objekt-aside__ap .ap-card__initials { font-size: 1.6rem; }

/* Ansprechpartner-Band */
.objekt-ap { padding-block: clamp(44px, 5vw, 72px); }
.objekt-ap__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 48px; }
.objekt-ap h2 { margin: 0; font-size: clamp(1.8rem, 1.5rem + 1.2vw, 2.6rem); }
.objekt-ap .ap-card { min-width: min(100%, 440px); }

.objekt-anfrage .lead-form { padding: clamp(24px, 4vw, 48px); background: #fff; border-radius: var(--fi-radius-lg); box-shadow: var(--fi-shadow); }
.objekt-rechner .section-head p { max-width: 640px; }

/* Responsiv */
@media (max-width: 1200px) {
	.filter__fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
	.filter__bar { padding: 16px; }
	.filter__sort, .filter__toggle { width: 100%; }
	.filter__links { margin-left: 0; padding-bottom: 0; }
	.filter__panel { padding: 0 16px 16px; }
}

@media (max-width: 1024px) {
	.objekt-layout { grid-template-columns: 1fr; }
	.objekt-aside { position: static; margin-top: 0; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
	/* Ansprechpartner folgt weiter unten im Band – hier nicht doppelt zeigen. */
	.objekt-aside__ap { display: none; }
	.suchauftrag__inner { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
	.objekt-head__row { flex-direction: column; align-items: flex-start; }
	.objekt-actions { display: flex; flex-wrap: wrap; gap: 4px 18px; }
	.objekt-actions span { font-size: .82rem; }
	.gallery__stage { aspect-ratio: 4 / 3; }
	.gallery__nav { width: 44px; height: 44px; }
	.gallery__nav--prev { left: 10px; }
	.gallery__nav--next { right: 10px; }
	.gallery__thumb { width: 84px; }
	.keyfacts__inner { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 16px; }
	.keyfacts__price { grid-column: 1 / -1; margin: 0; justify-self: start; }
	.datalist { grid-template-columns: 1fr; }
	.filter__fields { grid-template-columns: 1fr 1fr; }
	.lightbox__stage { inset: 70px 12px 80px; }
	.lightbox__btn--prev, .lightbox__btn--next { top: auto; bottom: 12px; transform: none; }
	.lightbox__bar { inset: 18px 80px auto 16px; }
	.energie__seg { font-size: .6rem; }
	.energie__ticks span:nth-child(even) { display: none; }
}

/* Druckansicht (Exposé) */
@media print {
	.objekt-actions, .gallery__nav, .gallery__expand, .gallery__thumbs, .objekt-aside__actions, .objekt-rechner,
	.objekt-anfrage, .objekt-aehnliche, .collapse__toggle, .map-consent, .breadcrumbs { display: none !important; }
	.collapse.is-collapsible .collapse__content { max-height: none !important; overflow: visible !important; }
	.collapse__content::after { display: none !important; }
	.keyfacts { background: #fff !important; color: #000 !important; border-block: 2px solid var(--fi-bordeaux); }
	.keyfacts strong, .keyfacts span { color: #000 !important; }
	.keyfacts__price { background: none !important; }
	.objekt-layout { grid-template-columns: 1fr 260px; }
	.objekt-highlights { margin-top: 16px; box-shadow: none; border: 1px solid var(--fi-line); transform: none; }
	.objekt-ap { background: #fff !important; color: #000 !important; }
	.objekt-ap h2 { color: var(--fi-bordeaux) !important; }
	.gallery__stage { aspect-ratio: 16 / 8; }
	.gallery__slide:not(.is-active) { display: none; }
}
