/* =========================================================
   STANDORTE.CSS – konsolidiert, bereinigt und strukturiert
   ========================================================= */

/* ====== Basis & Variablen ====== */
:root {
  --brand: #b8903c;
  --line: #e7e7e7;
  --bg: #fafafa;
  --text: #2b2b2b;
  --panel-h: 78vh;
  --map-mobile-h: 42vh;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --map-shadow: 0 -10px 24px rgba(0,0,0,.10);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: #fff;
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}



/* ====== Filterbar ====== */
.filter-section {
  padding: 8px 0 16px;
  margin-top: 2%;
}

.filterbar {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 2fr auto; /* 3 dropdowns + search + button */
  align-items: end;
  gap: 10px;
  border-bottom: 4px solid #49a5a2;
  background: #ffffff;
  padding: 10px 14px;
  margin-bottom: -10px;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-field span {
  font-size: 12px;
  opacity: .75;
}

.filterbar select,
.filterbar input {
  border: 1px solid #cfcfcf;
  border-radius: 8px;
  padding: 6px 6px;
  background: #ffffff00;
}

.field-wide {
  grid-column: auto;
}

.filter-actions {
  display: flex;
  align-items: end;
}

.btn-reset {
  display: inline-block;
  padding: 10px 35px;
  margin-top: 20px;
  border: 1px solid var(--brand);
  border-radius: 8px;
  color: var(--brand);
  font-weight: 300;
  transition: border-color .2s ease, transform .2s ease;
  background: transparent;
}

.btn-reset {
  border-color: color-mix(in srgb, var(--brand) 75%, white);
  transform: translateY(-2px);
}

/* ====== Layout: 2-Spalten ====== */
.layout-2col {
  display: grid;
  grid-template-columns: 32% 68%;
  gap: 16px;
  align-items: start;
  padding-bottom: 24px;
}

/* ====== Overflow Guards ====== */
.layout-2col > .col,
.list-col,
.map-col {
  min-width: 0;
}

.map-col {
  overflow: hidden;
}

.standorte-page,
.filter-section,
.layout-2col,
.list-col,
.map-col {
  overflow-x: clip;
}

#map,
.immo-list, #estate-grid,
.filterbar {
  max-width: 100%;
}

/* ====== Linke Spalte (Liste) ====== */
.list-col {
  max-height: var(--panel-h);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-left: 12px;
  padding-right: 6px;
  margin-top: 0;
  padding-top: 0;
  position: relative;
}

.list-col::-webkit-scrollbar {
  width: 10px;
}

.list-col::-webkit-scrollbar-thumb {
  background: #d6d6d6;
  border-radius: 6px;
}

.list-col::-webkit-scrollbar-track {
  background: transparent;
}

/* ====== Immobilienkarten (Estate Cards) ====== */
.immo-list, #estate-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 60vh;
}

/* ensure the first card never has an extra top spacing */
.immo-list > li:first-child,
#estate-grid > *:first-child { margin-top: -483px; }

@media (max-width: 860px){
  .immo-list > li:first-child,
  #estate-grid > *:first-child{ margin-top: 0 !important; }
}

.immo-list > li:first-child .estate-card,
#estate-grid > *:first-child .estate-card { margin-top: 0; }

.immo-list > li, #estate-grid > * {
  margin: 0;
  padding: 0;
}

.estate-card {
  --teaserTitleH: 48px;
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid #c3c3c3;
  background: #fff;
  box-shadow: 0 6px 14px rgba(0,0,0,.06);
  transition: transform .22s ease, box-shadow .22s ease;
  aspect-ratio: 4 / 3;
  height: auto;
  display: block;
  --overlayH: 34%;
  --overlayH-hover: 56%;
  isolation: isolate;
}

.list-col .estate-card,
.immo-list .estate-card,
#estate-grid .estate-card {
  aspect-ratio: 4 / 3 !important;
  height: auto !important;
  min-height: 0 !important;
  width: 100%;
}

/* ====== Bilder ====== */
.estate-img{
  position:absolute;
  inset:0;
  z-index:0;
  margin:0;
  width:100%;
  height:100%;
  overflow:hidden;
}

.estate-img img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

/* ====== Hover-Effekte ====== */
.estate-img::after{
  content:"";
  position:absolute;
  left:0; right:0; bottom:0;
  height: var(--overlayH);
  background: linear-gradient(to top, rgba(0,0,0,.75), rgba(0,0,0,0));
  pointer-events:none;
  z-index:1;
  transition: height .28s ease;
}
.estate-card:hover .estate-img::after{ height: var(--overlayH-hover); }

.estate-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0,0,0,.14);
}


/* ====== Karteninhalt (Body) ====== */
.estate-body{
  position:absolute;
  left:0; right:0; bottom:0;
  padding: 12px 14px 12px;
  color:#fff;
  z-index:2;
  background: transparent !important;
  display:grid;
  gap:4px;
  transition: none;
}
.estate-card:hover .estate-body { transform: none; }

.estate-body h3{
  margin:0;
  padding:0;
  font: 300 clamp(1.0rem,1.15vw,1.1rem)/1.16 system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
  color:#fff !important;
  text-shadow:0 2px 10px rgba(0,0,0,.65);
}

/* ====== Meta-Daten (Icons, Preis, Fläche etc.) ====== */
.estate-meta{
  display:flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap !important;
  gap: 10px;
  margin: 2px 0 0;
  line-height:1.15;
  margin-left: -25px;
  font: 200 clamp(.80rem,0.9vw,.9rem)/1.15 system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
  color:#fff;
  text-shadow:0 1px 6px rgba(0,0,0,.55);
  white-space: nowrap;
  min-width: 0;   /* allow shrinking within the overlay */
}
.estate-meta > *{
  display:inline-flex;
  align-items:center;
  flex: 0 0 auto;
  white-space: nowrap;
  min-width: 0;
}
.estate-meta strong{
  color:#fff;
  font-weight:300;
}

.estate-loc{
  margin-top: 2px;
  color: rgba(255,255,255,.90);
  text-shadow: 0 1px 6px rgba(0,0,0,.55);
  font-weight: 200;
  font-size: clamp(.8rem, .85vw, 1rem);
  line-height: 1.2;
}

/* ====== Link-Styles ====== */
.immo-list a.estate-card, .immo-list a.estate-card:link, .immo-list a.estate-card:visited, .immo-list a.estate-card:hover, .immo-list a.estate-card:active, #estate-grid a.estate-card, #estate-grid a.estate-card:link, #estate-grid a.estate-card:visited, #estate-grid a.estate-card:hover, #estate-grid a.estate-card:active {
  text-decoration: none !important;
  color: inherit !important;
  display: block;
}

/* ====== Karte rechts ====== */
.map-col {
  min-height: var(--panel-h);
}

#map {
  width: 100%;
  height: 100%;
  min-height: var(--panel-h);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eee;
}

/* ====== Responsive ====== */
@media (max-width: 1024px) {
  .filterbar {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: auto;
  }

  .filter-section{ display:none; }

  .field-wide {
    grid-column: auto;
  }

  .layout-2col {
    grid-template-columns: 1fr;
    min-height: 100vh;                                 /* eine Scrollfläche */
    padding-bottom: calc(var(--map-mobile-h) + var(--safe-bottom) + 16px); /* Platz für sticky Map */
    position: relative;                                 /* context for absolute children */
  }

  .list-col{
    max-height: none;
    overflow: visible;           /* Seite scrollt, nicht die Liste */
    padding-left: 0;
    padding-right: 0;
    padding-bottom: calc(var(--map-mobile-h) + var(--safe-bottom) + 16px); /* Karten werden nicht von der Map überlagert */
    margin-bottom: 0;
    margin-top: -400px;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }
  .map-col{
    position: fixed;          /* fix the map to the bottom of the viewport */
    left: 0;
    right: 0;
    bottom: var(--safe-bottom);
    height: var(--map-mobile-h);
    width: 100vw;
    min-height: initial;
    z-index: 30;              /* above content */
    background: #fff;
    box-shadow: var(--map-shadow);
    margin: 0;                /* remove any gap */
    border-top: 1px solid var(--line);
  }
  #map{
    position: absolute;       /* fill the fixed container */
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
  }

  .card {
    flex-direction: column;
  }

  .card img {
    width: 100%;
    height: 180px;
  }
}

@media (max-width: 380px){
  :root{ --map-mobile-h: 38vh; }
}

@media (max-width: 640px){
  .layout-2col{ gap: 12px; }
  .standorte-page, .filter-section, .layout-2col, .list-col, .map-col{ overflow-x: clip; }
  /* tighten card layout and avoid double scroll areas */
  .immo-list, #estate-grid{ gap: 10px; }
}

/* ====== Fallbacks (wenn JS anderes Markup rendert) ====== */
.list-col .immo-list > li, .list-col #estate-grid > * {
  max-width: 100%;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .06);
  background: #fff;
}

.list-col .immo-list img, .list-col #estate-grid img {
  width: 100% !important;
  height: 200px !important;
  object-fit: cover !important;
  display: block !important;
}

.list-col .immo-list > li h3, .list-col .immo-list > li .title, .list-col #estate-grid > * h3, .list-col #estate-grid > * .title {
  padding: 12px 14px;
  font-weight: 400;
  margin: 10px 0 6px;
}

.list-col .immo-list > li p, .list-col .immo-list > li .addr, .list-col .immo-list > li .price, .list-col .immo-list > li .area, .list-col #estate-grid > * p, .list-col #estate-grid > * .addr, .list-col #estate-grid > * .price, .list-col #estate-grid > * .area {
  padding: 0 14px 10px;
  margin: 0;
  line-height: 1.35;
}

.list-col .immo-list > li .meta,
.list-col .immo-list > li ul:not(.estate-meta),
.list-col #estate-grid > * .meta,
.list-col #estate-grid > * ul:not(.estate-meta) {
  list-style: none;
  margin: 0;
  padding: 0 14px 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  align-items: start;
}

.list-col .estate-card {
  position: relative !important;
}

.list-col .estate-card .estate-img img, .list-col #estate-grid .estate-card .estate-img img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block;
}


/* Linke Spalte – oben KEIN reservierter Platz auf der Standortseite */
.page-standorte .list-col {
  padding-top: 0;       /* falls vorher >0 wegen sticky Filter */
}

/* Liste selbst startet ohne Abstand */
.page-standorte #immo-list {
  margin-top: 0;
  padding-top: 0;
}

/* Sicherheitshalber erste Kachel ohne extra Top-Margin */
.page-standorte #immo-list > li:first-child,
.page-standorte #immo-list > .immo-item:first-child {
  margin-top: 0;
}


/* Auf der Standort-Seite: Status-/Ladezeilen innerhalb der linken Spalte nicht anzeigen,
   damit kein Leerraum (Gap) oberhalb der ersten Karte entsteht */
.page-standorte .list-col > #estate-status,
.page-standorte .list-col > #immo-status,
.page-standorte .list-col > .status,
.page-standorte .list-col > .loading,
.page-standorte .list-col > .load-status,
.page-standorte .list-col > .estate-status,
.page-standorte .list-col > .immo-status,
.page-standorte .list-col > p[role="status"],
.page-standorte .list-col > [data-role="status"],
.page-standorte .list-col > [aria-live="polite"]:not(#immo-list):not(#estate-grid) {
  display: none !important;
}

/* Sicherheitsnetz: in der linken Spalte nur die eigentliche Liste sichtbar lassen */
.page-standorte .list-col > :not(#immo-list):not(#estate-grid):not(.immo-list) {
  display: none !important;
}




/* Marker und glass card in der Map */

/* --- Google Maps InfoWindow “glass” preset --- */
.gm-style .gm-style-iw-c {
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  overflow: visible !important;
}

/* hide the default white pointer/triangle */
.gm-style .gm-style-iw-tc::after {
  display: none !important;
}

/* allow our content to overflow without scrollbars */
.gm-style .gm-style-iw-d {
  overflow: visible !important;
}

/* optional: hide close “x” for a cleaner badge look */
.gm-ui-hover-effect {
  display: none !important;
}

/* our compact glass tooltip */
.glass-iw {
  --glass-bg: rgba(23, 36, 56, 0.55); /* tweak tint here */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: var(--glass-bg);
  color: #fff;
  padding: 8px 10px;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  max-width: 260px;         /* slightly wider for longer titles */
  pointer-events: none;            /* keeps it non-interactive on hover */
  white-space: normal;
}

.glass-iw .t {
  font: 600 13px/1.35 system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  letter-spacing: .2px;
  white-space: normal;      /* allow multi-line wrapping */
  word-wrap: break-word;
  overflow: visible;        /* no clipping */
  text-overflow: unset;
  line-height: 1.35;
}





/* HEADER */
/* Header auf der Standort-Seite immer solid */
.page-standorte .site-header,
.page-standorte .site-header.is-transparent,
.page-standorte .site-header.header--transparent,
.page-standorte .site-header.header--glass {
  background: #fff !important;
  box-shadow: 0 1px 8px rgba(0,0,0,.08) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Logo/Links im Solid-Zustand dunkel einfärben */
.page-standorte .site-header .nav a,
.page-standorte .site-header .nav button,
.page-standorte .site-header .nav .link,
.page-standorte .site-header .logo,
.page-standorte .site-header .menu-toggle {
  color: #1c1c1c !important;
  fill: #1c1c1c !important;
}

/* Optional: Aktiven/hover Zustand (Brand-Farbe) */
.page-standorte .site-header .nav a:hover,
.page-standorte .site-header .nav a[aria-current="page"] {
  color: var(--brand, #b8903c) !important;
}
/* Force solid header on Standorte page */
body.force-solid-header #site-header .site-header {
  background-color: #ffffff !important;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  backdrop-filter: none;
}
body.force-solid-header #site-header .site-header.is-transparent {
  background-color: #ffffff !important;
}
/* Optional: ensure dark logo/text variant */
body.force-solid-header #site-header .logo--light { display: none !important; }
body.force-solid-header #site-header .logo--dark  { display: block !important; }
body.force-solid-header #site-header .nav a,
body.force-solid-header #site-header .nav button { color: #0f172a !important; }

@media (max-width: 640px){
  .estate-meta{
    gap:8px;
    font: 200 clamp(.76rem,0.9vw,.88rem)/1.12 system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
  }
}
/* Mobile helper: when the map is fixed, prevent a visual gap above it */
@media (max-width: 1024px){
  .layout-2col{ gap: 12px; }
  .layout-2col > .map-col{ gap: 0; }
}