/* Stange Immobilien – passt sich Schrift und Farben des Themes an, Akzent über --sti-accent */
:root { --sti-accent: #1f3a5f; }
.sti {
	--sti-border: rgba(0, 0, 0, .1);
	--sti-muted: rgba(0, 0, 0, .58);
	--sti-bg: rgba(0, 0, 0, .03);
	--sti-radius: 10px;
	box-sizing: border-box;
	line-height: 1.55;
	container-type: inline-size; /* Layout richtet sich nach der Inhaltsbreite des Themes, nicht nach dem Bildschirm */
}
.sti *, .sti *::before, .sti *::after { box-sizing: inherit; }
.sti img { max-width: 100%; height: auto; display: block; }

/* ---------- Buttons & Badges ---------- */
.sti-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: .4em;
	padding: .7em 1.3em; border: 2px solid var(--sti-accent); border-radius: 6px;
	background: var(--sti-accent); color: #fff; font: inherit; font-weight: 600;
	text-decoration: none; cursor: pointer; transition: opacity .15s;
}
.sti-btn:hover, .sti-btn:focus-visible { opacity: .88; color: #fff; }
.sti-btn--ghost { background: transparent; color: var(--sti-accent); }
.sti-btn--ghost:hover { color: var(--sti-accent); background: var(--sti-bg); }
.sti-btn--block { width: 100%; }

.sti-badge {
	display: inline-block; padding: .25em .7em; border-radius: 99px;
	background: var(--sti-accent); color: #fff; font-size: .78rem; font-weight: 600;
	letter-spacing: .02em; line-height: 1.4;
}
.sti-badge--light { background: var(--sti-bg); color: inherit; border: 1px solid var(--sti-border); }
.sti-badge--status { background: #b8860b; }

/* ---------- Filter ---------- */
.sti-filter {
	display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end;
	padding: 16px; margin: 0 0 24px; background: var(--sti-bg);
	border: 1px solid var(--sti-border); border-radius: var(--sti-radius);
}
.sti-filter label { display: flex; flex-direction: column; gap: 4px; flex: 1 1 150px; margin: 0; }
.sti-filter label span { font-size: .8rem; color: var(--sti-muted); font-weight: 600; }
.sti-filter select {
	width: 100%; padding: .55em .7em; border: 1px solid var(--sti-border); border-radius: 6px;
	background: #fff; font: inherit; color: inherit; min-height: 44px;
}
.sti-filter .sti-btn { flex: 0 0 auto; min-height: 44px; }

/* ---------- Grid & Karten ---------- */
.sti-grid {
	display: grid; gap: 24px;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}
.sti-card {
	border: 1px solid var(--sti-border); border-radius: var(--sti-radius);
	overflow: hidden; background: #fff; transition: box-shadow .2s, transform .2s;
}
.sti-card:hover { box-shadow: 0 10px 30px rgba(0, 0, 0, .08); transform: translateY(-2px); }
.sti-card__link { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }
.sti-card__link:hover { color: inherit; }
.sti-card__img { position: relative; aspect-ratio: 4 / 3; background: var(--sti-bg); overflow: hidden; }
.sti-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.sti-card:hover .sti-card__img img { transform: scale(1.03); }
.sti-card__noimg { position: absolute; inset: 0; background: linear-gradient(135deg, var(--sti-bg), rgba(0,0,0,.08)); }
.sti-card__img .sti-badge { position: absolute; top: 12px; left: 12px; }
.sti-card__img .sti-badge--status { left: auto; right: 12px; }
.sti-card__body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.sti-card__ort { margin: 0 0 4px; font-size: .85rem; color: var(--sti-muted); }
.sti-card__title { margin: 0 0 14px; font-size: 1.08rem; line-height: 1.35; }
.sti-card__facts {
	display: flex; gap: 0; margin: auto 0 0; padding: 12px 0 0; list-style: none;
	border-top: 1px solid var(--sti-border);
}
.sti-card__facts li { flex: 1; display: flex; flex-direction: column; margin: 0; padding: 0 8px 0 0; }
.sti-card__facts li + li { padding-left: 10px; border-left: 1px solid var(--sti-border); }
.sti-card__facts strong { font-size: .98rem; white-space: nowrap; }
.sti-card__facts span { font-size: .75rem; color: var(--sti-muted); }

.sti-empty { padding: 30px; text-align: center; background: var(--sti-bg); border-radius: var(--sti-radius); }

.sti-pagination { display: flex; justify-content: center; gap: 6px; margin-top: 30px; flex-wrap: wrap; }
.sti-pagination .page-numbers {
	min-width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center;
	padding: 0 10px; border: 1px solid var(--sti-border); border-radius: 6px; text-decoration: none; color: inherit;
}
.sti-pagination .current { background: var(--sti-accent); border-color: var(--sti-accent); color: #fff; }

/* ---------- Detail ---------- */
.sti-back { margin: 0 0 12px; }
.sti-back a { text-decoration: none; color: var(--sti-accent); font-weight: 600; }
.sti-head { margin-bottom: 20px; }
.sti-head__badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.sti-head__ort { margin: 0 0 6px; color: var(--sti-muted); }
.sti-head__preis { margin: 0; font-size: 1.6rem; font-weight: 700; color: var(--sti-accent); }
.sti-head__preis span { font-size: .9rem; font-weight: 600; color: var(--sti-muted); margin-right: .3em; }

.sti-gallery { display: grid; gap: 8px; margin-bottom: 30px; }
.sti-gallery button {
	all: unset; cursor: zoom-in; display: block; position: relative; overflow: hidden;
	border-radius: var(--sti-radius); background: var(--sti-bg);
}
.sti-gallery button:focus-visible { outline: 3px solid var(--sti-accent); outline-offset: 2px; }
.sti-gallery__main { aspect-ratio: 16 / 9; }
.sti-gallery__main img, .sti-gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; }
.sti-gallery__count {
	position: absolute; right: 12px; bottom: 12px; padding: .35em .8em; border-radius: 99px;
	background: rgba(0, 0, 0, .65); color: #fff; font-size: .8rem; font-weight: 600;
}
.sti-gallery__thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sti-gallery__thumbs button { aspect-ratio: 4 / 3; }
@container (min-width: 820px) {
	.sti-gallery { grid-template-columns: 2fr 1fr; }
	.sti-gallery__main { aspect-ratio: auto; min-height: 420px; }
	.sti-gallery__main:only-child { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
	.sti-gallery__thumbs { grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; }
	.sti-gallery__thumbs button { aspect-ratio: auto; }
}

.sti-layout { display: grid; gap: 30px; }
@container (min-width: 900px) {
	.sti-layout { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
	.sti-side { position: sticky; top: 30px; }
}
.sti-lead { font-size: 1.12rem; margin: 0 0 24px; }
.sti-box {
	padding: 24px; margin-bottom: 24px; border: 1px solid var(--sti-border);
	border-radius: var(--sti-radius); background: #fff;
}
.sti-box h2 { margin: 0 0 16px; font-size: 1.25rem; }
.sti-small { margin: 14px 0 0; font-size: .85rem; color: var(--sti-muted); }
.sti-text > :last-child { margin-bottom: 0; }

.sti-facts { display: grid; gap: 0 30px; }
@container (min-width: 640px) { .sti-facts:not(.sti-facts--single) { grid-template-columns: 1fr 1fr; } }
.sti-facts dl { margin: 0; }
.sti-facts div {
	display: flex; justify-content: space-between; gap: 16px; padding: 9px 0;
	border-bottom: 1px solid var(--sti-border);
}
.sti-facts dt { color: var(--sti-muted); margin: 0; }
.sti-facts dd { margin: 0; font-weight: 600; text-align: right; }

.sti-features {
	display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 8px 20px; margin: 0 0 16px; padding: 0; list-style: none;
}
.sti-features li { position: relative; padding-left: 26px; margin: 0; }
.sti-features li::before {
	content: "✓"; position: absolute; left: 0; top: .25em; width: 18px; height: 18px; border-radius: 50%;
	background: var(--sti-accent); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}

.sti-plans { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.sti-plans button { all: unset; cursor: zoom-in; border: 1px solid var(--sti-border); border-radius: 8px; overflow: hidden; background: #fff; }

/* Energieskala */
.sti-energy { position: relative; margin: 6px 0 34px; }
.sti-energy__bar { display: grid; grid-template-columns: repeat(9, 1fr); border-radius: 6px; overflow: hidden; }
.sti-energy__bar span {
	padding: 6px 0; text-align: center; font-size: .78rem; font-weight: 700; color: #fff; opacity: .55;
}
.sti-energy__bar span.is-active { opacity: 1; box-shadow: inset 0 0 0 2px rgba(0,0,0,.35); }
.sti-energy__bar span:nth-child(1) { background: #00a650; }
.sti-energy__bar span:nth-child(2) { background: #4cb848; }
.sti-energy__bar span:nth-child(3) { background: #8dc63f; }
.sti-energy__bar span:nth-child(4) { background: #c4d82e; color: #333; }
.sti-energy__bar span:nth-child(5) { background: #fff200; color: #333; }
.sti-energy__bar span:nth-child(6) { background: #fdb913; color: #333; }
.sti-energy__bar span:nth-child(7) { background: #f37021; }
.sti-energy__bar span:nth-child(8) { background: #ed1c24; }
.sti-energy__bar span:nth-child(9) { background: #b5121b; }
.sti-energy__marker { position: absolute; top: 100%; transform: translateX(-50%); padding-top: 4px; }
.sti-energy__marker::before {
	content: ""; position: absolute; top: -2px; left: 50%; transform: translateX(-50%);
	border: 6px solid transparent; border-bottom-color: currentColor; border-top: 0;
}
.sti-energy__marker span { font-size: .8rem; font-weight: 700; white-space: nowrap; }

.sti-docs { margin: 0; padding-left: 1.2em; }

/* Kontakt & Formular */
.sti-contact__name { margin: 0; font-weight: 700; font-size: 1.05rem; }
.sti-contact__firma { margin: 0 0 12px; color: var(--sti-muted); }
.sti-contact p { margin-top: 0; }
.sti-contact__link { color: var(--sti-accent); text-decoration: none; font-weight: 600; word-break: break-word; }
.sti-form { display: grid; gap: 12px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--sti-border); }
.sti-form label { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.sti-form label > span { font-size: .85rem; font-weight: 600; }
.sti-form input[type="text"], .sti-form input[type="email"], .sti-form input[type="tel"], .sti-form textarea {
	width: 100%; padding: .65em .8em; border: 1px solid var(--sti-border); border-radius: 6px;
	font: inherit; color: inherit; background: #fff; min-height: 44px;
}
.sti-form input:focus, .sti-form textarea:focus { outline: 2px solid var(--sti-accent); outline-offset: 0; border-color: transparent; }
.sti-form .sti-check { flex-direction: row; align-items: flex-start; gap: 8px; }
.sti-form .sti-check input { margin-top: .3em; flex: 0 0 auto; width: 18px; height: 18px; }
.sti-form .sti-check span { font-weight: 400; font-size: .8rem; line-height: 1.45; }
.sti-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.sti-notice { padding: 12px 14px; border-radius: 6px; margin: 14px 0 0; font-size: .92rem; }
.sti-notice--success { background: #e7f6ec; color: #135c2b; }
.sti-notice--error { background: #fdecea; color: #8a1c13; }

/* Lightbox */
.sti-lb {
	position: fixed; inset: 0; z-index: 99999; background: rgba(10, 10, 12, .94);
	display: flex; align-items: center; justify-content: center;
}
.sti-lb[hidden] { display: none; }
.sti-lb img { max-width: 92vw; max-height: 86vh; width: auto; height: auto; object-fit: contain; border-radius: 4px; }
.sti-lb button {
	position: absolute; border: 0; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer;
	width: 52px; height: 52px; border-radius: 50%; font-size: 26px; line-height: 1;
	display: flex; align-items: center; justify-content: center;
}
.sti-lb button:hover, .sti-lb button:focus-visible { background: rgba(255, 255, 255, .25); outline: none; }
.sti-lb button[hidden] { display: none; }
.sti-lb__close { top: 18px; right: 18px; }
.sti-lb__prev { left: 18px; top: 50%; transform: translateY(-50%); }
.sti-lb__next { right: 18px; top: 50%; transform: translateY(-50%); }
.sti-lb__count { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: rgba(255,255,255,.8); font-size: .9rem; }
@media (max-width: 600px) {
	.sti-lb__prev, .sti-lb__next { top: auto; bottom: 10px; transform: none; }
	.sti-lb__count { bottom: 26px; }
}
@media (prefers-reduced-motion: reduce) {
	.sti-card, .sti-card__img img { transition: none; }
}
