/* ==========================================================================
   Auto-extrahiert aus detail.css (Hygiene-Split 2026-05-31)
   ========================================================================== */

/* ==========================================================================
   TABS & MAP MODULE (65%/35%)
   ========================================================================== */

.immo-tabs-map-module {
	width: 100%;
	/* Chimera: die Detail-Zeile hat KEIN 120px Top/Bottom-Padding wie das alte
	   immoLayoutRow-Layout. Der vertikale Full-Bleed (top/bottom: -120px am
	   Wrapper) hätte hier nichts zum Reinbluten → Map ragt oben+unten raus.
	   Variablen auf 0 = Map füllt exakt ihre Grid-Zelle (= Tab-Höhe). */
	--immo-padding-top: 0px;
	--immo-padding-bottom: 0px;
}

.immo-tabs-map-grid {
	display: grid;
	grid-template-columns: 65% 35%;
	gap: 0;
	align-items: stretch;
}

.immo-tabs-map-tabs {
	min-width: 0;
	position: relative;
	z-index: 100;
}

/* Map Section - Full bleed to right screen edge.
   Height kommt deterministisch vom Grid-Stretch (= Tab-Höhe).
   Wrapper ragt via top/bottom-Offset über den Container raus (visual bleed),
   ohne dass Browser eine zirkuläre min-height berechnen muss. */
.immo-tabs-map-map {
	position: relative;
	margin-right: calc(-50vw + 50%);
}

.immo-tabs-map-map-wrapper {
	position: absolute;
	/* Map ragt in den Padding der containing .immo-detail-row (120px top+bottom
	   per immoLayoutRow-Helper). Fallback-Wert 120px deckt das ab; bei
	   abweichendem Padding lässt sich die Variable im Site-Bootstrap setzen. */
	top: calc(var(--immo-padding-top, 120px) * -1);
	bottom: calc(var(--immo-padding-bottom, 120px) * -1);
	left: 0;
	right: 0;
	margin: 0;
	padding: 0;
}

.immo-tabs-map-map .immo-details-map {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
}

/* Override Leaflet inline styles for fullscreen map */
.immo-tabs-map-module .immo-tabs-map-map .immo-map-container.leaflet-container.leaflet-touch,
.immo-tabs-map-module .immo-tabs-map-map .immo-map-container.leaflet-container,
.immo-tabs-map-module .immo-tabs-map-map .leaflet-container {
	position: absolute !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	width: 100% !important;
	height: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
}

/* Move zoom controls to top-right */
.immo-tabs-map-module .leaflet-control-zoom {
	position: absolute !important;
	top: 20px !important;
	right: 20px !important;
	left: auto !important;
	margin: 0 !important;
}

.immo-tabs-map-module .leaflet-control-zoom,
.immo-tabs-map-module .leaflet-control-zoom a {
	box-shadow: none !important;
}

/* Grayscale map tiles – desaturated, low contrast */
.immo-tabs-map-module .grayscale-tiles {
	filter: grayscale(100%) sepia(15%) brightness(1.08) contrast(0.85) opacity(0.8);
}

/* Gradient overlay from left – must sit above map tiles */
.immo-tabs-map-map-gradient {
	position: absolute;
	top: 0;
	left: 0;
	width: 600px;
	height: 100%;
	background: linear-gradient(to right, #f2f0ee, rgba(242, 240, 238, 0));
	z-index: 500;
	pointer-events: none;
}

.immo-tabs-map-no-location {
	color: #666;
	font-style: italic;
	padding: 40px;
}

/* Scroll hint overlay */
.immo-map-scroll-hint {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background-color: rgba(0, 0, 0, 0.7);
	color: #fff;
	padding: 12px 24px;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 500;
	z-index: 1000;
	pointer-events: none;
	white-space: nowrap;
}

/* Tab Navigation */
.immo-tabs-nav {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 8px;
	border-bottom: 1px solid #eee;
}

.immo-tabs-nav-item {
	margin: 0;
	padding: 0;
}

.immo-tabs-nav-button {
	background: #ffffff;
	border: 1px solid #eee;
	border-bottom: none;
	cursor: pointer;
	padding: 12px 24px;
	display: block;
	width: 100%;
	text-align: center;
	transition: all 0.2s ease;
	position: relative;
	bottom: -1px;
	text-transform: none;
	color: var(--immo-detail-ci-color-2);
	font-size: inherit;
	font-weight: normal;
}

.immo-tabs-nav-button:hover {
	background: #f7fafc;
	border-color: #e1e1e1;
	border-bottom: none;
	color: var(--immo-detail-ci-color-2);
	box-shadow: none;
}

.immo-tabs-nav-active .immo-tabs-nav-button {
	background: #ffffff;
	border-color: #eee;
	border-bottom: 1px solid #ffffff;
	color: var(--immo-detail-ci-color-1);
	box-shadow: none;
}

/* Tab Content */
.immo-tabs-content {
	width: 100%;
}

.immo-tabs-panel {
	width: 100%;
	border-right: 1px solid #eee;
	border-bottom: 1px solid #eee;
	border-left: 1px solid #eee;
	background: #ffffff;
}

.immo-tabs-panel[hidden] {
	display: none;
}

.immo-tabs-panel-content {
	padding: 26px;
	/* OpenImmo-Freitexte sind Plaintext mit Zeilenumbrüchen/Einrückungen —
	   pre-wrap erhält Umbrüche + Leerzeichen und bricht lange Zeilen um. */
	white-space: pre-wrap;
}

.immo-tabs-panel-content > *:first-child {
	margin-top: 0;
}

.immo-tabs-panel-content > *:last-child {
	margin-bottom: 0;
}

.immo-tabs-panel-content p {
	margin-bottom: 1em;
}

.immo-tabs-panel-content p:first-child {
	margin-top: 0;
}

.immo-tabs-panel-content p:last-child {
	margin-bottom: 0;
}

/* Expandable Content */
.immo-expandable-text {
	width: 100%;
	padding-bottom: 1.5rem;
}

.immo-expandable-content {
	max-height: 200px;
	overflow: hidden;
	position: relative;
	transition: max-height 0.3s ease, -webkit-mask-image 0.3s ease, mask-image 0.3s ease;
	-webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent 100%);
	mask-image: linear-gradient(to bottom, #000 70%, transparent 100%);
	padding-bottom: 0.5rem;
}

.immo-expanded .immo-expandable-content,
.immo-no-truncate .immo-expandable-content {
	overflow: visible;
	-webkit-mask-image: none;
	mask-image: none;
	padding-bottom: 1.5rem;
}

.immo-detail-page .immo-expand-button {
	background: transparent;
	border: none;
	color: var(--immo-detail-ci-color-1);
	cursor: pointer;
	padding: 10px 0;
	margin: 1rem 26px 0;       /* margin-left/right matched to .immo-tabs-panel-content padding */
	display: inline-block;
	text-decoration: none;
	box-shadow: none;
	outline: none;
}

.immo-detail-page .immo-expand-button:hover {
	color: var(--immo-detail-ci-color-2);
	background: transparent;
	box-shadow: none;
	outline: none;
	border: none;
}

/* Accordion Headers (hidden on desktop) */
.immo-accordion-header {
	display: none;
}


/* ==========================================================================
   RESPONSIVE – Tabs & Map
   ========================================================================== */

@media (max-width: 1024px) {
	.immo-tabs-map-grid {
		grid-template-columns: 1fr;
		gap: 0;
	}

	.immo-tabs-map-tabs {
		position: relative;
		z-index: 600;
	}

	.immo-tabs-map-map {
		margin-right: calc(-50vw + 50%);
		margin-left: calc(-50vw + 50%);
		margin-top: 80px;
		margin-bottom: 0;
	}

	.immo-tabs-map-map-wrapper {
		position: relative;
		min-height: 460px;
	}

	.immo-tabs-map-map-gradient {
		position: absolute;
		display: block;
		top: 0;
		left: 0;
		right: 0;
		bottom: auto;
		width: 100%;
		height: 200px;
		background: linear-gradient(to bottom, #f2f0ee, rgba(242, 240, 238, 0));
		z-index: 500;
		pointer-events: none;
	}
}

@media (max-width: 768px) {
	.immo-tabs-map-tabs {
		position: relative;
		z-index: 600;
	}

	.immo-tabs-map-map {
		margin-bottom: 80px;
	}

	.immo-tabs-map-map-wrapper {
		min-height: 400px;
	}

	.immo-tabs-map-map-gradient {
		height: 80px;
	}

	/* Tabs → Accordion on mobile */
	.immo-tabs-nav {
		display: none;
	}

	.immo-accordion-header {
		display: flex;
		justify-content: space-between;
		align-items: center;
		background: #ffffff;
		border: 1px solid #eee;
		border-bottom: none;
		padding: 16px 20px;
		cursor: pointer;
		color: var(--immo-detail-ci-color-2);
		font-weight: 500;
		transition: color 0.2s ease;
	}

	.immo-accordion-header:hover {
		background: #ffffff;
	}

	.immo-accordion-header-active {
		color: var(--immo-detail-ci-color-1);
		background: #ffffff;
	}

	.immo-accordion-icon {
		display: inline-block;
		width: 20px;
		height: 20px;
		position: relative;
		transition: transform 0.2s ease;
	}

	.immo-accordion-icon::before {
		content: '';
		position: absolute;
		top: 50%;
		left: 50%;
		transform: translate(-50%, -50%) rotate(45deg);
		width: 8px;
		height: 8px;
		border-right: 2px solid currentColor;
		border-bottom: 2px solid currentColor;
		transition: transform 0.2s ease;
	}

	.immo-accordion-header-active .immo-accordion-icon::before {
		transform: translate(-50%, -50%) rotate(-135deg);
	}

	.immo-tabs-panel {
		border-top: none;
		border-bottom: none;
	}

	.immo-tabs-panel:last-child {
		border-bottom: 1px solid #eee;
	}

	.immo-tabs-panel[hidden] {
		display: block;
	}

	.immo-tabs-panel-content {
		display: none;
		padding: 20px;
	}

	.immo-tabs-panel-active .immo-tabs-panel-content {
		display: block;
	}
}

