/* ============================================
   Leo66 Flächentool – Frontend Styles
   Farben als CSS-Variablen (Werte aus der LEO66-Website),
   damit sie an einer Stelle angepasst werden können.
   ============================================ */

.leo66-ft-wrapper {
	--leo66-verfuegbar: #224e5f;
	--leo66-reserviert: #ca896a;
	--leo66-verkauft:   #b3b3b3;
	--leo66-highlight:  #224e5f;
	--leo66-text:       #1a2023;
	--leo66-text-leise: #6f7c8d;
	--leo66-line:       #e2e2e2;
	--leo66-aktiv-bg:   rgba(0, 0, 0, 0.05);

	/* Schriftgrössen nach Website: p = Outfit 20px, h5 = Outfit 24px, h6 = Outfit 20px */
	--leo66-fs-text:     20px; /* Fliesstext (p), Bezeichnungen, Buttons */
	--leo66-fs-kopf:     24px; /* Tabellenkopf „Geschoss, Mietfläche“ (wie h5) */
	--leo66-fs-geschoss: 20px; /* Geschoss DG, 2.OG … (wie h6) */
	--leo66-fs-label:    16px; /* Spaltenköpfe, Labels in Grossbuchstaben */
	--leo66-fs-klein:    16px; /* Zusatzinfos, PDF, Tooltips */

	/* Angaben links 2/5, Modell rechts 3/5 */
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
	gap: 40px;
	align-items: start;
	width: 100%;
	box-sizing: border-box;
	color: var(--leo66-text);
	font-size: var(--leo66-fs-text);
	font-weight: 300;
	line-height: 1.4;
}

.leo66-ft-table-col {
	min-width: 0;
	/* Breite der Spalte bestimmt das Tabellenlayout (siehe @container unten) */
	container-type: inline-size;
	container-name: leo66-tabelle;
}

.leo66-ft-svg-col {
	min-width: 0;
	/* Tabelle ist lang – Modell bleibt beim Scrollen im Blick */
	position: sticky;
	top: 40px;
}

.leo66-ft-model {
	position: relative;
	width: 100%;
	height: 620px;
	display: block;
}
.leo66-ft-model canvas {
	width: 100%;
	height: 100%;
	display: block;
	touch-action: pan-y;
}

/* ---------- Tooltip im Modell ---------- */
.leo66-ft-tooltip {
	position: absolute;
	z-index: 2;
	pointer-events: none;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	background: #fff;
	color: var(--leo66-text);
	border: 1px solid var(--leo66-text);
	border-radius: 10px;
	font-size: var(--leo66-fs-klein);
	line-height: 1.2;
	white-space: nowrap;
	box-shadow: 0 4px 14px rgba(26, 32, 35, 0.12);
}
.leo66-ft-tooltip[hidden] {
	display: none;
}
.leo66-ft-tooltip-icon {
	display: inline-flex;
}
.leo66-ft-tooltip-hint {
	color: var(--leo66-text-leise);
	font-size: var(--leo66-fs-klein);
	margin-left: 4px;
}

/* ---------- Feste Beschriftung Warenlift ---------- */
.leo66-ft-lift-label {
	position: absolute;
	z-index: 1;
	pointer-events: none;
	/* Unterkante mit Pfeilspitze sitzt auf dem Liftkasten */
	transform: translate(-50%, calc(-100% - 14px));
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 10px;
	background: #fff;
	color: var(--leo66-text);
	border: 1px solid var(--leo66-text);
	border-radius: 10px;
	font-size: var(--leo66-fs-klein);
	line-height: 1.2;
	white-space: nowrap;
	transition: background-color 0.2s ease, color 0.2s ease;
}
.leo66-ft-lift-label::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 100%;
	width: 1px;
	height: 14px;
	background: var(--leo66-text);
}
.leo66-ft-lift-label[hidden] {
	display: none;
}
.leo66-ft-lift-label.is-aktiv {
	background: var(--leo66-text);
	color: #fff;
}

/* ---------- Tabelle ---------- */
.leo66-ft-table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--leo66-fs-text);
	color: var(--leo66-text);
	margin: 0;
}

.leo66-ft-wrapper .leo66-ft-table thead th {
	/* Gleiche Schrift wie „Status:“ / „Vermarktung:“ – Theme-Schrift für th überschreiben */
	font-family: inherit !important;
	line-height: inherit;
	background: none;
	color: var(--leo66-text);
	text-align: left;
	/* wie h5: Outfit 24px, Gewicht wie der Fliesstext der Website (Light) */
	font-weight: 300;
	text-transform: none;
	letter-spacing: normal;
	font-size: var(--leo66-fs-kopf);
	padding: 12px 10px;
	border-bottom: 1px solid var(--leo66-line);
	white-space: nowrap;
}

.leo66-ft-table tbody td {
	padding: 18px 10px;
	border-bottom: 1px solid var(--leo66-line);
	vertical-align: middle;
}
.leo66-ft-table tbody td:first-child,
.leo66-ft-wrapper .leo66-ft-table thead th:first-child {
	padding-left: 0;
}
.leo66-ft-table tbody td:last-child,
.leo66-ft-wrapper .leo66-ft-table thead th:last-child {
	padding-right: 0;
	text-align: right;
}

/* Hover auf der Zeile bzw. Geschoss im Modell gewählt */
.leo66-row {
	transition: background-color 0.2s ease;
	cursor: default;
}
.leo66-row:hover,
.leo66-row.is-aktiv {
	background-color: var(--leo66-aktiv-bg);
}

/* ---------- Geschoss & Mietfläche ---------- */
.leo66-cell-geschoss {
	/* wie h6: Outfit 20px, fett wie die Flächentitel */
	font-size: var(--leo66-fs-geschoss);
	font-weight: 500;
	white-space: nowrap;
}
/* Geschoss nur in der ersten Zeile der Gruppe zeigen */
.leo66-row:not(.leo66-geschoss-start) .leo66-cell-geschoss {
	color: transparent;
}
.leo66-cell-mietflaeche .leo66-name,
.leo66-cell-mietflaeche .leo66-kennzahlen,
.leo66-cell-mietflaeche .leo66-details {
	display: block;
	/* alles wie p der Website: 20px Light, LEO66-Schwarz; nur der Titel kräftiger */
	font-size: var(--leo66-fs-text);
	font-weight: 300;
	color: var(--leo66-text);
}
.leo66-cell-mietflaeche .leo66-name {
	font-weight: 500;
}
.leo66-kennzahlen {
	margin-top: 2px;
	font-size: var(--leo66-fs-text);
	white-space: nowrap;
}
.leo66-details {
	margin-top: 2px;
	line-height: 1.4;
}

/* ---------- Status-Punkte ---------- */
.leo66-status-dot {
	display: inline-block;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--leo66-verfuegbar);
}
.status-verfuegbar .leo66-status-dot { background: var(--leo66-verfuegbar); }
.status-reserviert .leo66-status-dot { background: var(--leo66-reserviert); }
.status-verkauft   .leo66-status-dot { background: var(--leo66-verkauft); }

/* Verkaufte/vermietete Zeile ausgegraut, aber sichtbar */
.status-verkauft {
	opacity: 0.45;
}

/* Legenden-Punkte in ihren Farben */
.status-verfuegbar-dot { background: var(--leo66-verfuegbar); }
.status-reserviert-dot { background: var(--leo66-reserviert); }
.status-verkauft-dot   { background: var(--leo66-verkauft); }

/* ---------- Plan-Link ---------- */
.leo66-plan-typ {
	font-size: var(--leo66-fs-klein);
	font-weight: 500;
	letter-spacing: 0.03em;
}
.leo66-grundriss-link {
	color: var(--leo66-text);
	display: inline-flex;
	align-items: center;
	gap: 4px;
	text-decoration: none;
	white-space: nowrap;
	transition: color 0.2s ease;
}
.leo66-grundriss-link:hover {
	color: var(--leo66-highlight);
}
.leo66-grundriss-empty {
	color: #bbb;
}

/* ---------- Button (wie „Kontakt →“ der Website) ---------- */
.leo66-ft-wrapper .leo66-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	padding: 10px 18px;
	background: transparent;
	color: var(--leo66-text);
	border: 1px solid var(--leo66-text);
	border-radius: 10px;
	font-family: inherit;
	font-size: var(--leo66-fs-text);
	font-weight: 300;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	transition: color 0.2s ease, border-color 0.2s ease;
}
.leo66-ft-wrapper .leo66-btn:hover,
.leo66-ft-wrapper .leo66-btn:focus-visible {
	/* Kein Fill: Rahmen, Text und Pfeil mit 70 % Deckkraft */
	background: transparent;
	color: rgba(26, 32, 35, 0.7);
	border-color: rgba(26, 32, 35, 0.7);
}
.leo66-btn-pfeil {
	flex: none;
	width: 22px;
	height: 22px;
	transition: transform 0.2s ease;
}
.leo66-btn:hover .leo66-btn-pfeil {
	transform: translateX(3px);
}

/* ---------- Pläne zum ganzen Gebäude ---------- */
.leo66-ft-wrapper .leo66-dokumente-titel th {
	font-family: inherit !important;
	background: none;
	padding: 20px 0 0;
	border-bottom: 1px solid var(--leo66-line);
	text-align: left;
}
/* „Pläne“ als Klapp-Button im Stil der Spaltenköpfe */
.leo66-ft-wrapper .leo66-dokumente-toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	margin: 0;
	padding: 10px 0;
	background: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	color: var(--leo66-text);
	font-family: inherit;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	font-size: var(--leo66-fs-label);
	line-height: inherit;
	cursor: pointer;
}
.leo66-toggle-pfeil {
	transition: transform 0.2s ease;
}
.leo66-dokumente.is-offen .leo66-toggle-pfeil {
	transform: rotate(180deg);
}
.leo66-dokument[hidden] {
	display: none !important;
}
.leo66-dokument td {
	padding-top: 12px;
	padding-bottom: 12px;
}

/* ---------- Legende ---------- */
.leo66-ft-legende {
	display: flex;
	align-items: center;
	gap: 8px 20px;
	margin-top: 28px;
	font-size: var(--leo66-fs-text);
	flex-wrap: wrap;
}
.leo66-legende-label {
	font-size: var(--leo66-fs-label);
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}
.leo66-legende-item {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

/* ---------- Kontakt Vermarktung (über den Flächen) ---------- */
.leo66-ft-kontakt {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin: 0 0 32px;
	font-size: var(--leo66-fs-text);
}
.leo66-kontakt-name {
	font-size: var(--leo66-fs-text);
	font-weight: 300;
}
.leo66-ft-wrapper .leo66-ft-kontakt a {
	color: var(--leo66-text);
	text-decoration: none;
}
.leo66-ft-kontakt a:hover {
	color: rgba(26, 32, 35, 0.7);
}

/* ---------- Schmale Spalte: jede Fläche zweizeilig ----------
   Mit Website-Schriftgrössen braucht die Tabelle ~680px. Ist die linke
   Spalte schmaler, stehen Status, Plan und Anfrage in einer zweiten Zeile
   unter der Bezeichnung. */
@container leo66-tabelle (max-width: 680px) {
	.leo66-ft-table,
	.leo66-ft-table thead,
	.leo66-ft-table tbody {
		display: block;
	}
	.leo66-ft-table tr {
		display: grid;
		grid-template-columns: 120px auto auto minmax(0, 1fr);
		grid-template-areas:
			"geschoss name name name"
			"geschoss status plan anfrage";
		column-gap: 24px;
		row-gap: 14px;
		align-items: center;
		padding: 18px 0;
		border-bottom: 1px solid var(--leo66-line);
	}
	.leo66-ft-table thead tr {
		grid-template-areas: "geschoss name name name";
		padding: 12px 0;
	}
	.leo66-ft-wrapper .leo66-ft-table thead th,
	.leo66-ft-table tbody td,
	.leo66-ft-table tbody td:first-child,
	.leo66-ft-table tbody td:last-child {
		padding: 0;
		border: 0;
		text-align: left;
	}
	.leo66-ft-wrapper .leo66-ft-table thead th:nth-child(n+3) {
		display: none;
	}
	.leo66-ft-table tr > :nth-child(1) { grid-area: geschoss; }
	.leo66-ft-table tr > :nth-child(2) { grid-area: name; }
	.leo66-ft-table tr > :nth-child(3) { grid-area: status; }
	.leo66-ft-table tr > :nth-child(4) { grid-area: plan; }
	.leo66-ft-table tr > :nth-child(5) { grid-area: anfrage; justify-self: end; }
	.leo66-ft-table tbody td.leo66-cell-anfrage { text-align: right; }

	/* „Pläne“-Titel über die ganze Breite */
	.leo66-ft-table tr.leo66-dokumente-titel {
		display: block;
		padding: 0;
	}
	.leo66-ft-wrapper .leo66-dokumente-titel th {
		display: block;
		padding: 20px 0 0;
		border: 0;
	}
	.leo66-ft-table .leo66-dokument .leo66-cell-leer {
		display: none;
	}
	/* Plan-Zeilen einzeilig: Name links, PDF rechts */
	.leo66-ft-table tr.leo66-dokument {
		grid-template-areas: "geschoss name name plan";
		grid-template-columns: 120px auto auto minmax(0, 1fr);
	}
	.leo66-ft-table tr.leo66-dokument > :nth-child(4) {
		justify-self: end;
	}
}

/* ---------- Responsive: Gebäude über die Tabelle, Tabelle als Karten ---------- */
@media (max-width: 1024px) {
	.leo66-ft-wrapper {
		grid-template-columns: minmax(0, 1fr);
		gap: 24px;
	}
	.leo66-ft-svg-col {
		order: -1;
		position: static;
	}
	/* Nicht 620px hoch, sondern im Querformat 4:3 */
	.leo66-ft-model {
		height: auto;
		aspect-ratio: 4 / 3;
		max-height: 560px;
	}
}

@media (max-width: 600px) {
	.leo66-ft-table thead {
		display: none;
	}
	.leo66-ft-table, .leo66-ft-table tbody, .leo66-ft-table tr, .leo66-ft-table td {
		display: block;
		width: 100%;
		box-sizing: border-box;
	}
	.leo66-ft-table tr {
		margin-bottom: 16px;
		border: 1px solid var(--leo66-line);
		border-radius: 10px;
		padding: 8px 12px;
	}
	.leo66-ft-table tbody td,
	.leo66-ft-table tbody td:first-child,
	.leo66-ft-table tbody td:last-child {
		border: none;
		padding: 6px 0;
		display: flex;
		justify-content: space-between;
		align-items: center;
		gap: 12px;
		text-align: right;
	}
	.leo66-ft-table td::before {
		content: attr(data-label);
		font-weight: 500;
		text-transform: uppercase;
		font-size: var(--leo66-fs-label);
		letter-spacing: 0.03em;
		text-align: left;
	}
	.leo66-row:not(.leo66-geschoss-start) .leo66-cell-geschoss {
		color: inherit;
	}
	/* Mietfläche ohne Label, linksbündig als Block */
	.leo66-ft-table tbody td.leo66-cell-mietflaeche {
		display: block;
		text-align: left;
	}
	.leo66-ft-table td.leo66-cell-mietflaeche::before,
	.leo66-ft-table td.leo66-cell-anfrage::before,
	.leo66-ft-table td.leo66-cell-leer {
		display: none;
	}
	.leo66-ft-table tbody td.leo66-cell-anfrage {
		justify-content: flex-end;
		padding-top: 10px;
	}
	/* Plan-Zeilen kompakt: Name links, PDF rechts */
	.leo66-dokumente-titel {
		border: none !important;
		padding: 0 !important;
	}
	.leo66-ft-wrapper .leo66-dokumente-titel th {
		display: block;
		padding: 4px 0 8px;
		border: none;
	}
	.leo66-dokument .leo66-cell-geschoss {
		display: none !important;
	}
}
