/*
 * GRIBS Wohnen – Unterseiten: Wohnungs-Kacheln (Loop Grid), Einzelansicht, Rechtstexte.
 * Farben über die Variablen aus design.css.
 */

/* ---------- Abschnittstitel aus Shortcodes (gleich wie Elementor-H2) ---------- */
.gribs-abschnitt-titel {
	margin: 0 0 16px;
}

/* ---------- Kachel (Loop Item) ---------- */
.gribs-karte.e-con {
	background: #fff;
	border: 1px solid #D7DFD0;
	border-radius: 4px;
	overflow: hidden;
	height: 100%;
}
.gribs-karte .gribs-wohnung-bild {
	margin: 0;
}
.gribs-karte .gribs-wohnung-bild img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 2;
	object-fit: cover;
}
.gribs-karte .gribs-wohnung-bild figcaption {
	display: none; /* in der Kachel genügt das Bild, der Hinweis steht auf der Detailseite */
}
.gribs-karte .elementor-heading-title a {
	color: var(--gribs-basalt);
	text-decoration: underline;
	text-decoration-color: var(--gribs-gruen);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.18em;
}
.gribs-karte .elementor-heading-title a:hover {
	color: var(--gribs-gruen);
}
/* ganze Kachel anklickbar, ohne zweiten Link: der Titel-Link spannt sich über die Kachel */
.gribs-karte.e-con {
	position: relative;
}
.gribs-karte .elementor-heading-title a::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
}
.gribs-karte:focus-within {
	outline: 3px solid var(--gribs-basalt);
	outline-offset: 3px;
}
.gribs-karte .elementor-heading-title a:focus-visible {
	outline: none !important;
	box-shadow: none !important;
}
.gribs-karte .gribs-kurz p,
.gribs-karte .gribs-preis {
	margin: 0;
}
.gribs-kurz {
	color: var(--gribs-schiefer);
	font-size: 0.9375rem; /* Zimmer · m² · Etage passen in eine Zeile */
}
.gribs-preis {
	margin: 0;
	font-size: 1.0625rem;
}
.gribs-preis strong {
	color: var(--gribs-basalt);
}
.gribs-preis__warm {
	color: var(--gribs-schiefer);
}

/* kompakte Kachel (vermietete Wohnungen, ohne Bild) */
.gribs-karte--kompakt.e-con {
	border-left: 4px solid var(--gribs-feldrand);
}

/* ---------- Einzelansicht Wohnung ---------- */
.gribs-brotkrumen ol {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25em 0.5em;
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 1rem;
	color: var(--gribs-schiefer);
}
.gribs-brotkrumen li {
	margin: 0;
}
.gribs-brotkrumen li + li::before {
	content: '/';
	margin-right: 0.5em;
	color: var(--gribs-feldrand);
}
.gribs-brotkrumen a {
	color: var(--gribs-gruen);
	text-decoration: underline;
	text-underline-offset: 0.18em;
}

.gribs-eckdaten {
	margin: 0;
	border-top: 1px solid var(--gribs-feldrand);
}
.gribs-eckdaten > div {
	display: grid;
	grid-template-columns: minmax(8em, 40%) 1fr;
	gap: 1em;
	padding: 0.55em 0;
	border-bottom: 1px solid #D7DFD0;
}
.gribs-eckdaten dt {
	font-weight: 700;
	color: var(--gribs-basalt);
}
.gribs-eckdaten dd {
	margin: 0;
}

.gribs-wohnung-bild {
	margin: 0;
}
.gribs-wohnung-bild img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	border-radius: 3px;
}
.gribs-wohnung-bild figcaption,
.gribs-grundriss figcaption {
	margin-top: 0.5em;
	font-size: 1rem;
	color: var(--gribs-schiefer);
}
.gribs-grundriss {
	margin: 0;
	max-width: 760px;
}
.gribs-grundriss img {
	display: block;
	width: 100%;
	height: auto;
	background: #fff;
	border: 1px solid #D7DFD0;
	border-radius: 3px;
}
.gribs-wohnung-text ul {
	padding-left: 1.15em;
	margin: 0 0 1em;
}
.gribs-wohnung-text li::marker {
	color: var(--gribs-gruen);
}

/* Galerie (WordPress-Galerie aus dem Widget „Bildergalerie“) */
.gallery {
	display: grid !important;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
	margin: 0 !important;
}
.gallery .gallery-item {
	width: auto !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
}
.gallery .gallery-item img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: 3px;
	border: 0 !important;
}
.gallery .gallery-caption {
	margin-top: 0.4em;
	font-size: 1rem;
	color: var(--gribs-schiefer);
	text-align: left;
}
@media (max-width: 1024px) {
	.gallery { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
	.gallery { grid-template-columns: 1fr; }
}

/* ---------- Rechtstexte ---------- */
.gribs-rechtstext h2 {
	margin-top: 1.6em;
}
.gribs-rechtstext h3 {
	margin-top: 1.3em;
}
.gribs-rechtstext p,
.gribs-rechtstext li {
	max-width: 72ch;
}

/* ---------- Kontaktkasten ---------- */
.gribs-kasten.e-con {
	background: var(--gribs-flaeche);
	border-radius: 4px;
}

/* Abschnitt „Grundriss + Fotos“ ausblenden, wenn die Wohnung beides nicht hat */
.gribs-medien.e-con:not(:has(img)) {
	display: none;
}

/* ---------- Formulare auf hellem Grund ---------- */
.elementor-field-type-acceptance a {
	text-decoration: underline;
	text-underline-offset: 0.18em;
}
.elementor-form .elementor-mark-required .elementor-field-label::after {
	color: var(--gribs-gruen);
}
.gribs-dunkel .elementor-form .elementor-mark-required .elementor-field-label::after {
	color: var(--gribs-logo);
}

/* Kontaktseite: obere Footer-Zeile wird dort nicht ausgegeben (inc/design.php) – nur Abstände anpassen */
body.gribs-seite-kontakt .gribs-footer-unten.e-con {
	margin-top: 0;
}

/* Schalter „Wohnungsauswahl im Kontaktformular“ aus: Auswahl „Wohnung“ weglassen */
.gribs-ohne-wohnungsauswahl .elementor-field-group-wohnung {
	display: none;
}
body.gribs-seite-kontakt .gribs-dunkel.e-con {
	--padding-top: 32px;
}
body.gribs-seite-kontakt .gribs-footer-unten > .e-con-inner {
	border-top: 0;
	padding-top: 0;
}

/* Ganze Kachel klickbar: Elementor setzt Widgets/Container auf position:relative –
   innerhalb der Kachel aufheben, damit sich der Titel-Link über die ganze Kachel spannt. */
.gribs-karte .elementor-element,
.gribs-karte .elementor-widget-container,
.gribs-karte .elementor-heading-title {
	position: static !important;
}
.gribs-karte.e-con {
	position: relative !important;
	cursor: pointer;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.gribs-karte.e-con:hover {
	border-color: var(--gribs-gruen);
	box-shadow: 0 6px 18px rgba(30, 42, 36, 0.12);
}
.gribs-karte.e-con:hover .elementor-heading-title a {
	color: var(--gribs-gruen);
}

/* Preis: Kaltmiete und Warmmiete untereinander */
.gribs-preis__kalt,
.gribs-preis__warm {
	display: block;
}

/* ---------- Umgebungskarte (Vermietung): Stadtplan mit Piktogrammen und Legende ---------- */
.gribs-umgebungskarte {
	margin: 0;
}
.gribs-karte__plan {
	position: relative;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: 4px;
	background: #e9eee3;
}
/* Ausschnitt um Biesnitz: 700 × 525 px des 1024 × 768 px großen Plans, ab 60/60 */
.gribs-umgebungskarte .gribs-karte__plan img {
	display: block;
	max-width: none;
	width: 146.29%;
	height: auto;
	aspect-ratio: 4 / 3; /* sonst greift die Platzhaltergröße für lazy geladene Bilder */
	margin: -8.57% 0 0 -8.57%;
	border-radius: 0;
}
.gribs-karte__punkt {
	position: absolute;
	width: clamp(26px, 7%, 40px);
	aspect-ratio: 1;
	transform: translate(-50%, -50%);
	display: grid;
	place-items: center;
	padding: 0.4em;
	box-sizing: border-box;
	background: #fff;
	color: var(--gribs-gruen-dunkel);
	border: 1.5px solid var(--gribs-gruen);
	border-radius: 8px;
	box-shadow: 0 1px 3px rgba(30, 42, 36, 0.3);
	font-size: clamp(11px, 2.4vw, 16px);
}
.gribs-karte__punkt--haus {
	width: clamp(34px, 9.5%, 52px);
	border-radius: 50%;
	background: var(--gribs-gruen);
	color: #fff;
	border: 3px solid #fff;
	box-shadow: 0 2px 6px rgba(30, 42, 36, 0.45);
}
.gribs-karte-icon {
	width: 100%;
	height: 100%;
	display: block;
}
.gribs-umgebungskarte figcaption {
	font-style: normal;
	margin-top: 1rem;
	font-size: 0.9375rem;
	color: var(--gribs-basalt);
}
.gribs-karte__titel {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin: 0 0 0.6rem;
	font-weight: 600;
}
.gribs-karte__legende {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
	gap: 0.45rem 1.25rem;
}
.gribs-karte__legende li {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin: 0;
}
.gribs-karte__symbol {
	flex: none;
	width: 1.75rem;
	height: 1.75rem;
	display: grid;
	place-items: center;
	padding: 0.3rem;
	box-sizing: border-box;
	background: #fff;
	color: var(--gribs-gruen-dunkel);
	border: 1.5px solid var(--gribs-gruen);
	border-radius: 6px;
}
.gribs-karte__symbol--haus {
	border-radius: 50%;
	background: var(--gribs-gruen);
	color: #fff;
	border-color: var(--gribs-gruen);
}
.gribs-karte__quelle {
	margin: 0.75rem 0 0;
	font-size: 0.8125rem;
	color: var(--gribs-schiefer);
}
