/* ---------------------------------------
   Stil für Wohnungsliste (nur wohnungen.html)
---------------------------------------- */

#filter {
  max-width: 600px;
  margin: 3rem auto 2rem;
}

#filter label {
  display: block;
  margin-top: 1rem;
}

#filter input,
#filter select {
  padding: 0.5rem;
  width: 100%;
}

#filter button {
  padding: 0.5rem 1rem;
  margin-top: 1rem;
  margin-right: 0.5rem;
}

.warnung {
  color: darkred;
  font-style: italic;
  padding: 1rem;
  background: #fef3e2;
  border-left: 4px solid #c34;
  margin: 1rem 0;
}

.wohnung-row {
  display: flex;
  height: 200px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.wohnung-bild {
  width: 35%;
  height: 100%;
  border-right: 1px solid #eee;
}

.bild-einfach {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wohnung-details {
  width: 65%;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  overflow: hidden;
}

.wohnung-details .kopf h3 {
  font-size: 1.1rem;
  margin: 0;
  line-height: 1.3;
  max-height: 2.6em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wohnung-details .kopf .adresse {
  font-size: 0.9rem;
  color: #666;
  margin: 0.3rem 0 0.6rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wohnung-details .infos p {
  font-size: 1rem;
  margin: 0.2rem 0;
}

.wohnung-details .kontakt p {
  font-size: 0.9rem;
  color: #555;
  line-height: 1.3;
  margin: 0.1rem 0;
}

.wohnung-bild {
  width: 35%;
  height: 100%;
  border-right: 1px solid #eee;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f2f2f2; /* optionaler grauer Hintergrund, wenn kein Bild */
  position: relative;
  overflow: hidden;
}

.wohnung-bild img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
  display: block;
}

/* --- Popup Fenster für Wohnungsdetails --- */

.popup {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.popup.hidden {
  display: none;
}

.popup-content {
  background: #fff;
  padding: 2rem;
  max-width: 800px;
  width: 90%;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0,0,0,0.2);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.popup-close {
  position: absolute;
  top: 0.5rem;
  right: 1rem;
  font-size: 1.8rem;
  cursor: pointer;
  color: #888;
}

.popup-bilder {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: space-between;
  position: relative;
  overflow: visible; /* neu oder sicherstellen */
}

.popup-bilder img {
  width: calc(25% - 0.5rem);
  height: auto;
  border-radius: 5px;
  cursor: zoom-in;
  transition: transform 0.2s ease;
  z-index: 1;
}

.popup-bilder img:hover {
  transform: scale(2.5);
  z-index: 1000;
  background: white;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.4);
  border-radius: 10px;
}


#wohnungs-popup {
  background: white;
  max-width: 800px;
  width: 90%;
  max-height: 90vh;  /* wichtig */
  overflow-y: auto;  /* ermöglicht Scrollen */
  padding: 2rem;
  border-radius: 10px;
  position: relative;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);

}


/* ------------------------------
   MOBILE ANPASSUNG
------------------------------- */
@media (max-width: 768px) {
  .wohnung-row {
    flex-direction: column;
    height: auto;
  }

  .wohnung-bild {
    width: 100%;
    height: 200px;
    border-right: none;
    border-bottom: 1px solid #eee;
  }

  .wohnung-details {
    width: 100%;
    padding: 1rem;
  }

  .popup-bilder img {
    width: calc(50% - 0.5rem);
  }

  #wohnungs-popup {
    max-height: 80vh;      /* neu oder anpassen */
    overflow-y: auto;      /* scrollbar aktivieren */
    padding: 1rem;
  }

  .popup-content {
    max-height: 90vh;      /* ebenfalls sicherstellen */
    overflow-y: auto;
    padding: 1rem;
  }
}

#popup-kontakt p {
  font-size: 0.95rem;
  color: #444;
  margin: 0.2rem 0;
}
