/* =========================================================
   Detailseite einer Immobilie (single-immobilie.php)
   Tokens zentral; dunkle Farbe #000, Flächen-BG #f4f5f5.
   ========================================================= */

/* Cross-Document View-Transition (Karte → Detailseite). */
@view-transition { navigation: auto; }

/* Ganze Seite auf den Flächen-Hintergrund setzen. */
body.single-immobilie { background: #f4f5f5; }

.dps-single {
	--dps-text: #000000;
	--dps-muted: #5b6172;
	--dps-bg: #f4f5f5;
	--dps-card: #ffffff;
	--dps-divider: #ececf0;
	--dps-border: #f3f4f6;
	--dps-shadow: 0 1px 2px rgba(20, 22, 30, .04), 0 8px 24px rgba(20, 22, 30, .06);
	/* Kachel (Eckdaten-Box) getrennt von --dps-card, damit die Makler-Karte weiß
	   bleibt, während die Fakten-Kacheln je Bereich eine eigene Farbe bekommen. */
	--dps-tile: var(--dps-card);
	--dps-tile-border: var(--dps-border);
	/* Akzentfarbe (Buttons, Links, CTA-Wert). Basis = neutrales Schwarz/Weiß. */
	--dps-accent: #000000;
	--dps-accent-ink: #ffffff;
	--dps-accent-hover: #333333;

	max-width: 1100px;
	margin: 0 auto;
	padding: 0 20px; /* kein Top-/Bottom-Padding */
	color: var(--dps-text);
	background: var(--dps-bg);
}
.dps-single * { box-sizing: border-box; }

/* =========================================================
   Exclusive-Objekte: dunkle Farbwelt (schwarzer Hintergrund,
   dunkelgraue Boxen, weißer Text). Die meisten Boxen nutzen
   var(--dps-*) und kippen allein durch den Variablen-Override.
   Body-Klasse dps-exclusive (siehe DPS_CPT::body_class()).
   ========================================================= */
body.dps-exclusive { background: #0f0f0f; }
.dps-single.exclusive {
	--dps-text: #ffffff;
	--dps-muted: #b6bac4;
	--dps-bg: #0f0f0f;
	--dps-card: #1a1a1a;
	--dps-divider: rgba(255, 255, 255, .10);
	--dps-border: #2a2a2a;
	--dps-tile: #1a1a1a;
	--dps-tile-border: #2a2a2a;
	--dps-accent: #c4a265;       /* Champagner-Gold (Doerfert/Forbes) */
	--dps-accent-ink: #0f0f0f;   /* dunkler Text auf Gold */
	--dps-accent-hover: #d8be86; /* helleres Gold beim Hover (dunkler Grund) */
	--dps-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .5);
}
/* Sticky-CTA: dunkles Glas statt hellem. */
.dps-single.exclusive .dps-cta {
	background: rgba(20, 22, 26, .6);
	border-color: rgba(255, 255, 255, .14);
	box-shadow: 0 6px 24px rgba(0, 0, 0, .5);
}
.dps-single.exclusive .dps-cta__label { color: #b6bac4; }
/* Das Anfrage-Formular (#dps-anfrage) wird bewusst NICHT vom Plugin gestylt —
   die Gestaltung (auch im Exclusive-Dark-Theme) erfolgt direkt in Elementor. */

/* =========================================================
   Home- & Investment-Objekte: helle Marken-Farbwelt — weißer
   Hintergrund, warme Creme/Beige-Kacheln, Champagner-Gold als
   Akzent (Buttons, CTA). Beide Bereiche teilen dasselbe Theme.
   Body-Klassen dps-home / dps-investment (siehe DPS_CPT::body_class()).
   ========================================================= */
body.dps-home,
body.dps-investment { background: #ffffff; }
.dps-single.home,
.dps-single.investment {
	--dps-text: #1a1a1a;
	--dps-muted: #6b6255;        /* warmer Grauton */
	--dps-bg: #ffffff;
	--dps-card: #ffffff;         /* Makler-Karte bleibt weiß */
	--dps-divider: #efe9db;
	--dps-border: #eee9dd;
	--dps-tile: #f3ecdd;         /* Creme/Beige der Eckdaten-Kacheln */
	--dps-tile-border: #eae0cc;
	--dps-accent: #c4a265;       /* Champagner-Gold */
	--dps-accent-ink: #1a1a1a;   /* dunkler Text auf Gold */
	--dps-accent-hover: #b08e4f; /* dunkleres Gold beim Hover (heller Grund) */
	--dps-shadow: 0 1px 2px rgba(20, 22, 30, .04), 0 8px 24px rgba(20, 22, 30, .07);
}
.dps-single__title { font-size: 32px; line-height: 1.2; margin: 24px 0 8px; letter-spacing: -.01em; }
.dps-single__section { margin: 72px 0; }
.dps-single__section h2 { font-size: 22px; margin: 0 0 16px; letter-spacing: -.01em; }

/* Gemeinsamer Button-Stil (Detailseite + Sticky-CTA). */
.dps-single .dps-btn,
.dps-cta .dps-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 18px;
	background: var(--dps-accent);
	color: var(--dps-accent-ink);
	border: 2px solid var(--dps-accent);
	border-radius: 10px;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	text-decoration: none;
	transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.dps-single .dps-btn:hover,
.dps-single .dps-btn:focus-visible,
.dps-cta .dps-btn:hover,
.dps-cta .dps-btn:focus-visible { background: var(--dps-accent-hover); border-color: var(--dps-accent-hover); color: var(--dps-accent-ink); }

/* ---------- Eckdaten: jede Angabe eine eigene weiße Box, gap 8px ---------- */
.dps-single__facts {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 8px;
}
.dps-single__fact {
	background: var(--dps-tile);
	border: 1px solid var(--dps-tile-border);
	border-radius: 12px;
	padding: 14px 18px;
}
.dps-single__fact-label { font-size: 11px; text-transform: uppercase; color: var(--dps-muted); letter-spacing: .04em; font-weight: 600; margin-bottom: 4px; line-height: 1.2; }
.dps-single__fact-value { font-size: 16px; font-weight: 600; color: var(--dps-text); }

/* ---------- Aufklappbare Texte (Beschreibung/Lage/…) ---------- */
.dps-collapse { position: relative; max-height: 500px; overflow: hidden; }
.dps-collapse.is-open { max-height: none; }
.dps-collapse::after {
	content: "";
	position: absolute; left: 0; right: 0; bottom: 0; height: 90px;
	background: linear-gradient(to bottom, rgba(244, 245, 245, 0), var(--dps-bg));
	pointer-events: none;
}
.dps-collapse.is-open::after { display: none; }
.dps-collapse__body > h2:first-child { margin-top: 0; }
.dps-collapse__toggle { margin-top: 14px; }
.dps-collapse__toggle[hidden] { display: none; }

/* ---------- Texte / Video ---------- */
.dps-single__text { font-size: 16px; line-height: 1.65; }
.dps-single__text p { margin: 0 0 14px; }
.dps-single__video { position: relative; padding-bottom: 56.25%; height: 0; border-radius: 14px; overflow: hidden; background: #000; margin-bottom: 16px; }
.dps-single__video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Kontakt-Sektion: zwei Spalten (links Makler, rechts Formular) ---------- */
.dps-contact {
	display: grid;
	grid-template-columns: minmax(300px, 380px) 1fr;
	gap: 32px;
	align-items: start;
}
/* Nur eine Seite vorhanden (kein Formular oder kein Makler) → volle Breite. */
.dps-contact--single { grid-template-columns: 1fr; }
@media (max-width: 820px) { .dps-contact { grid-template-columns: 1fr; } }

/* Makler-Karte (linke Spalte): größeres Profilbild oben, Kontaktdaten darunter. */
.dps-broker {
	background: var(--dps-card);
	border: 1px solid var(--dps-border);
	border-radius: 14px;
	padding: 26px;
}
.dps-broker__avatar { display: block; width: 160px; height: 160px; border-radius: 50%; object-fit: cover; background: #e9ebef; margin: 0 0 18px; }
.dps-broker__name { margin: 0 0 2px; font-size: 20px; letter-spacing: -.01em; }
.dps-broker__position { color: var(--dps-muted); font-size: 14px; margin: 0 0 10px; }
.dps-broker__contact { display: flex; flex-direction: column; gap: 2px; font-size: 15px; line-height: 1.3; }
.dps-broker__contact span { display: inline-flex; align-items: center; gap: 8px; }
.dps-broker__ico { flex: 0 0 auto; color: var(--dps-text); }
.dps-broker__contact a { color: var(--dps-text); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color .15s; }
.dps-broker__contact a:hover { border-bottom-color: var(--dps-text); }
.dps-broker__company { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--dps-divider); font-size: 13px; color: var(--dps-muted); }

/* ---------- Eingebundenes Formular (rechte Spalte) + Sticky-CTA ---------- */
.dps-anfrage { scroll-margin-top: 80px; }
.dps-cta {
	position: sticky;
	bottom: calc(16px + env(safe-area-inset-bottom));
	z-index: 900;
	margin-top: 24px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	/* Glas-Effekt + dezenter Schatten. Klebt innerhalb von .dps-content am unteren
	   Viewport-Rand und stoppt vor dem Ansprechpartner (Ende von .dps-content). */
	background: rgba(255, 255, 255, .65);
	-webkit-backdrop-filter: blur(14px) saturate(1.4);
	backdrop-filter: blur(14px) saturate(1.4);
	border: 1px solid rgba(255, 255, 255, .45);
	border-radius: 16px;
	padding: 12px 20px;
	box-shadow: 0 6px 24px rgba(20, 22, 30, .12);
}
.dps-cta__label { font-size: 12px; color: #5b6172; text-transform: uppercase; letter-spacing: .04em; }
.dps-cta__value { font-size: 18px; }
.dps-cta__btn { white-space: nowrap; }

/* =========================================================
   Galerie / Slider — Fullscreen (max 2560px), H1-Overlay
   ========================================================= */
.dps-gallery {
	/* Full-bleed-Wrapper über die volle Viewport-Breite (kein horizontaler Overflow). */
	width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-bottom: 48px;
}
.dps-gallery * { box-sizing: border-box; }

.dps-gallery__main {
	/* Slider selbst auf 2560px gedeckelt und zentriert. */
	position: relative;
	width: 100%;
	max-width: 2560px;
	margin: 0 auto 12px;
	overflow: hidden;
	background: #e9ebef;
}

.dps-gallery__main .swiper-slide {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 16 / 9;
	background: #e9ebef;
}
@media (max-width: 600px) { .dps-gallery__main .swiper-slide { aspect-ratio: 16 / 12; } }
.dps-gallery__main .swiper-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* H1-Overlay: Titel + Subline, vertikal und horizontal zentriert über dem ersten Slide. */
.dps-hero {
	position: absolute;
	inset: 0;
	z-index: 4;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	text-align: center;
	padding: clamp(20px, 5vw, 56px);
	pointer-events: none;
	background: radial-gradient(ellipse at center, rgba(20, 22, 30, .6), rgba(20, 22, 30, .25) 75%);
}
.dps-hero__inner { max-width: min(1100px, 100%); }
.dps-hero__title {
	margin: 0;
	color: #fff;
	font-size: clamp(26px, 4vw, 48px);
	line-height: 1.12;
	letter-spacing: -.01em;
	/* Beim Seitenladen von unten einblenden + von blur zu scharf. */
	animation: dps-hero-rise .8s cubic-bezier(.2, .7, .2, 1) both;
}
.dps-hero__sub {
	margin: 6px 0 0;
	color: #fff;
	opacity: .92;
	font-size: clamp(14px, 2vw, 18px);
	font-weight: 300;
	letter-spacing: .01em;
	/* Gleiche Animation wie die H1, nur leicht verzögert. */
	animation: dps-hero-rise .8s cubic-bezier(.2, .7, .2, 1) .2s both;
}
/* „Verkauft"-Badge über dem Titel im Hero (gleiche Optik wie auf den Karten,
   aber statisch statt absolut – filter.css wird auf Detailseiten nicht geladen). */
.dps-hero__badge {
	display: inline-block;
	margin: 0 0 14px;
	padding: 5px 13px;
	border-radius: 999px;
	font-size: clamp(11px, 1.4vw, 13px);
	font-weight: 700;
	letter-spacing: .04em;
	line-height: 1.5;
	text-transform: uppercase;
	color: #fff;
	background: rgba(0, 0, 0, .45);
	-webkit-backdrop-filter: blur(8px) saturate(1.2);
	backdrop-filter: blur(8px) saturate(1.2);
	border: 1px solid rgba(255, 255, 255, .18);
}
@keyframes dps-hero-rise {
	from { opacity: 0; transform: translateY(24px); filter: blur(12px); }
	to   { opacity: 1; transform: translateY(0);    filter: blur(0); }
}

/* Thumbnails auf Content-Breite (nicht full-bleed). */
.dps-gallery__thumbs { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.dps-gallery__thumbs .swiper-slide {
	cursor: pointer;
	border-radius: 10px;
	overflow: hidden;
	aspect-ratio: 4 / 3;
	background: #e9ebef;
	opacity: .55;
	transition: opacity .2s ease;
}
.dps-gallery__thumbs .swiper-slide-thumb-active { opacity: 1; }
.dps-gallery__thumbs .swiper-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Runde Pfeile mit dunklem Hintergrund, leichte Bewegung beim Hover. */
.dps-gallery .swiper-button-prev,
.dps-gallery .swiper-button-next {
	color: #fff;
	background: #000;
	width: 44px;
	height: 44px;
	margin-top: -22px;
	padding: 0;
	border-radius: 50%;
	opacity: 1;
	transition: transform .18s ease, background .18s ease;
}
.dps-gallery .swiper-button-prev:hover { transform: translateX(-3px); background: #000; }
.dps-gallery .swiper-button-next:hover { transform: translateX(3px); background: #000; }
.dps-gallery .swiper-button-prev::after,
.dps-gallery .swiper-button-next::after { font-size: 22px; font-weight: 600; }

/* Pagination */
.dps-gallery .swiper-pagination-bullet { background: #fff; opacity: .7; width: 8px; height: 8px; }
.dps-gallery .swiper-pagination-bullet-active { background: #fff; opacity: 1; width: 24px; border-radius: 4px; }

/* Counter unten links */
.dps-gallery__count {
	position: absolute;
	left: 16px;
	bottom: 14px;
	background: rgba(0, 0, 0, .78);
	color: #fff;
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	pointer-events: none;
	z-index: 5;
}

@media (max-width: 600px) {
	.dps-gallery .swiper-button-prev,
	.dps-gallery .swiper-button-next { width: 36px; height: 36px; margin-top: -18px; }
	.dps-gallery .swiper-button-prev::after,
	.dps-gallery .swiper-button-next::after { font-size: 18px; }
	.dps-cta__value { font-size: 16px; }
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
	@view-transition { navigation: none; }
	.dps-gallery .swiper-button-prev,
	.dps-gallery .swiper-button-next,
	.dps-single .dps-btn,
	.dps-cta .dps-btn { transition: none !important; }
	.dps-hero__title,
	.dps-hero__sub { animation: none !important; }
}
