/* Immobilienliste: lokal begrenzt, Farbrollen „Immobilien“ aus docs/knowledge/design-system/portal-colors.md. */
.hwx-estates-view {
  display: block;
  --estate-brand: #5c9e2e;
  --estate-action: #406f20;
  --estate-hover: #375f1c;
  --estate-soft: #ebf3e6;
  --estate-ink: #0c3247;
  --estate-text: #303030;
  --estate-muted: #596975;
  --estate-line: #dbe3e8;
  --estate-surface: #f5f8fa;
  --estate-red: #d11f34;
  max-inline-size: 1320px;
  margin-inline: auto;
  padding-block: 2rem;
}

.hwx-estates-view .hwx-lmdb-page-title {
  margin-block-end: 1.5rem;
  padding-inline-start: 1rem;
  border-inline-start: 4px solid var(--estate-brand);
}

.hwx-estates-view .hwx-lmdb-page-title .hwx-lmdb-page-title-text {
  margin: 0;
  color: var(--estate-ink);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  line-height: 1.2;
  text-wrap: balance;
}

/* Suchfilter: globale Template-Regeln nutzen IDs und !important; daher an der View-ID verankert. */
#hwx-lmdb-estates-list #hwx-lmdb-filter {
  margin-block: 0 2rem;
  padding: 1.5rem;
  border: 1px solid var(--estate-line);
  border-radius: .875rem;
  background: #fff;
}

#hwx-lmdb-estates-list #hwx-lmdb-filter .hwx-lmdb-filter-types {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  inline-size: 100%;
  gap: 1rem;
}

#hwx-lmdb-estates-list #hwx-lmdb-filter #hwx-lmdb-filter-search {
  inline-size: auto;
  min-inline-size: 0;
  margin: 0;
}

#hwx-lmdb-estates-list #hwx-lmdb-filter .hwx-lmdb-filter-label {
  display: block;
  margin-block-end: .5rem;
  color: var(--estate-ink);
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
}

#hwx-lmdb-estates-list #hwx-lmdb-filter .hwx-lmdb-filter-input-container,
#hwx-lmdb-estates-list #hwx-lmdb-filter #hwx-lmdb-filter-search .input-group {
  display: flex;
  flex-wrap: nowrap;
  inline-size: 100%;
  min-inline-size: 0;
}

/* Globale Regeln fixieren 40 px Höhe; die 44-px-Felder sollen bündig mit dem Zurücksetzen-Button enden. */
#hwx-lmdb-estates-list #hwx-lmdb-filter #hwx-lmdb-filter-search :is(.hwx-lmdb-filter-input-container, .input-group) {
  block-size: auto;
}

#hwx-lmdb-estates-list #hwx-lmdb-filter #hwx-lmdb-filter-search-input {
  flex: 1 1 auto;
  inline-size: 0;
  min-inline-size: 0;
  min-block-size: 2.75rem;
  border-color: #82918a;
  border-radius: .5rem 0 0 .5rem;
  font-size: 1rem;
}

#hwx-lmdb-estates-list #hwx-lmdb-filter #hwx-lmdb-filter-search-input::placeholder {
  color: var(--estate-muted);
}

#hwx-lmdb-estates-list #hwx-lmdb-filter #hwx-lmdb-filter-search-button {
  min-block-size: 2.75rem;
  padding: .625rem 1rem;
  border: 1px solid var(--estate-action);
  border-radius: 0 .5rem .5rem 0 !important;
  background-color: var(--estate-action) !important;
  color: #fff !important;
}

#hwx-lmdb-estates-list #hwx-lmdb-filter #hwx-lmdb-filter-reset {
  display: flex;
  align-items: flex-end;
  align-self: end;
  inline-size: auto;
  margin: 0;
}

#hwx-lmdb-estates-list #hwx-lmdb-filter #hwx-lmdb-filter-reset #hwx-lmdb-filter-reset-button {
  margin: 0;
}

#hwx-lmdb-estates-list #hwx-lmdb-filter #hwx-lmdb-filter-reset #hwx-lmdb-filter-reset-button {
  min-block-size: 2.75rem;
  padding: .625rem 1rem;
  border: 1px solid var(--estate-action);
  border-radius: .5rem !important;
  background-color: #fff !important;
  color: var(--estate-action) !important;
}

#hwx-lmdb-estates-list #hwx-lmdb-filter :is(button, .btn) :is(i, span) {
  color: inherit;
}

@media (hover: hover) {
  #hwx-lmdb-estates-list #hwx-lmdb-filter #hwx-lmdb-filter-search-button:hover {
    border-color: var(--estate-hover);
    background-color: var(--estate-hover) !important;
  }

  #hwx-lmdb-estates-list #hwx-lmdb-filter #hwx-lmdb-filter-reset #hwx-lmdb-filter-reset-button:hover {
    background-color: var(--estate-soft) !important;
    color: var(--estate-hover) !important;
  }
}

/* Raster */
.hwx-estates-view .hwx-lmdb-list-items {
  display: grid;
  inline-size: 100%;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 1.25rem;
  grid-auto-flow: row;
}

/* Alte Bannerbreiten dürfen keine impliziten Spalten erzeugen. */
.hwx-estates-view .hwx-lmdb-list-items > .hwx-lmdb-list-item.hwx-lmdb-list-item-adbanner {
  grid-column: 1 / -1;
  min-inline-size: 0;
}

/* Karte */
.hwx-estates-view .hwx-lmdb-list-items .hwx-estate-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-inline-size: 0;
  overflow: hidden;
  border: 1px solid var(--estate-line);
  border-radius: .875rem;
  background: #fff;
  color: var(--estate-text);
  box-shadow: 0 .45rem 1.2rem rgb(12 50 71 / 8%);
  animation: none;
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}

.hwx-estates-view .hwx-estate-card .is-empty {
  display: none;
}

.hwx-estates-view .hwx-estate-card__media {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  /* Fehlende oder nicht ladbare Bilder: ruhige Fläche mit Hauspiktogramm. */
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a7b4bd' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10.5 12 3l9 7.5'/%3E%3Cpath d='M5 9.5V21h14V9.5'/%3E%3Cpath d='M10 21v-6h4v6'/%3E%3C/svg%3E") center / 3rem no-repeat,
    var(--estate-surface);
}

.hwx-estates-view .hwx-estate-card__media img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  /* Verhindert das Browsersymbol für defekte Bilder; die Fläche darunter bleibt sichtbar. */
  color: transparent;
}

.hwx-estates-view .hwx-estate-card__offer {
  position: absolute;
  inset-block-end: .75rem;
  inset-inline-start: .75rem;
  padding: .25rem .625rem;
  border-radius: 9999px;
  background: #fff;
  color: var(--estate-action);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.4;
  text-transform: uppercase;
  box-shadow: 0 .125rem .5rem rgb(12 50 71 / 16%);
}

.hwx-estates-view .hwx-estate-card .hwx-badges-bar {
  position: absolute;
  inset-block-start: .75rem;
  inset-inline-start: .75rem;
  display: flex;
  gap: .375rem;
}

.hwx-estates-view .hwx-estate-card .hwx-badges-bar .hwx-lmdb-list-item-badge {
  display: none;
  position: static;
  padding: .25rem .5rem;
  border-radius: .25rem;
  background: var(--estate-red);
  color: #fff;
  font-size: .75rem;
  line-height: 1.25;
}

.hwx-estates-view .hwx-estate-card.is-new .hwx-badge-new,
.hwx-estates-view .hwx-estate-card.is-top .hwx-badge-top,
.hwx-estates-view .hwx-estate-card.is-tip .hwx-badge-tip {
  display: block;
}

.hwx-estates-view .hwx-estate-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-inline-size: 0;
  padding: 1.125rem 1.25rem 1.25rem;
  overflow-wrap: anywhere;
}

.hwx-estates-view .hwx-estate-card__type {
  margin: 0 0 .375rem;
  color: var(--estate-action);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.4;
  text-transform: uppercase;
}

.hwx-estates-view .hwx-estate-card__title {
  display: -webkit-box;
  margin: 0 0 .5rem;
  overflow: hidden;
  color: var(--estate-ink);
  font-size: 1.1875rem;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.hwx-estates-view .hwx-estate-card__title a {
  color: inherit;
  text-decoration: none;
}

/* Erweiterte Klickfläche: ein nativer Link pro Karte. */
.hwx-estates-view .hwx-estate-card__title a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.hwx-estates-view .hwx-estate-card__place {
  display: flex;
  gap: .375rem;
  margin: 0 0 1rem;
  color: var(--estate-muted);
  font-size: .8125rem;
  line-height: 1.5;
}

.hwx-estates-view .hwx-estate-card__place::before {
  content: "";
  flex: 0 0 .875rem;
  block-size: .875rem;
  margin-block-start: .2rem;
  background: currentcolor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a7 7 0 0 0-7 7c0 5.25 7 13 7 13s7-7.75 7-13a7 7 0 0 0-7-7Zm0 9.5A2.5 2.5 0 1 1 12 6.5a2.5 2.5 0 0 1 0 5Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a7 7 0 0 0-7 7c0 5.25 7 13 7 13s7-7.75 7-13a7 7 0 0 0-7-7Zm0 9.5A2.5 2.5 0 1 1 12 6.5a2.5 2.5 0 0 1 0 5Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.hwx-estates-view .hwx-estate-card__facts {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.5rem;
  margin: auto 0 0;
  padding-block-start: .875rem;
  border-block-start: 1px solid var(--estate-line);
  font-variant-numeric: tabular-nums;
}

.hwx-estates-view .hwx-estate-card__fact {
  display: flex;
  flex-direction: column-reverse;
  min-inline-size: 0;
}

.hwx-estates-view .hwx-estate-card__fact--price {
  margin-inline-end: auto;
}

.hwx-estates-view .hwx-estate-card__fact dt {
  color: var(--estate-muted);
  font-size: .75rem;
  font-weight: 400;
  line-height: 1.4;
}

.hwx-estates-view .hwx-estate-card__fact dd {
  margin: 0;
  color: var(--estate-ink);
  font-size: .9375rem;
  font-weight: 600;
  line-height: 1.35;
}

.hwx-estates-view .hwx-estate-card__fact--price dd {
  color: var(--estate-action);
  font-size: 1.125rem;
  font-weight: 700;
}

/* Fokus und Hover */
.hwx-estates-view :is(button, input):focus-visible {
  outline: 3px solid var(--estate-action);
  outline-offset: 3px;
}

.hwx-estates-view .hwx-estate-card:has(a:focus-visible) {
  outline: 3px solid var(--estate-action);
  outline-offset: 3px;
}

.hwx-estates-view .hwx-estate-card:has(a:focus-visible) a {
  outline: none;
  text-decoration: underline;
  text-underline-offset: .2em;
}

@media (hover: hover) {
  .hwx-estates-view .hwx-estate-card:hover {
    border-color: var(--estate-action);
    box-shadow: 0 .75rem 1.75rem rgb(12 50 71 / 14%);
    transform: translateY(-2px);
  }

  .hwx-estates-view .hwx-estate-card:hover .hwx-estate-card__title a {
    color: var(--estate-action);
    text-decoration: underline;
    text-underline-offset: .2em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hwx-estates-view .hwx-lmdb-list-items .hwx-estate-card {
    transition: none;
  }

  .hwx-estates-view .hwx-estate-card:hover {
    transform: none;
  }
}

@media (max-width: 575.98px) {
  .hwx-estates-view {
    padding-block: 1.5rem;
  }

  #hwx-lmdb-estates-list #hwx-lmdb-filter {
    margin-block-end: 1.5rem;
    padding: 1rem;
  }

  #hwx-lmdb-estates-list #hwx-lmdb-filter .hwx-lmdb-filter-types {
    grid-template-columns: minmax(0, 1fr);
  }

  #hwx-lmdb-estates-list #hwx-lmdb-filter #hwx-lmdb-filter-reset,
  #hwx-lmdb-estates-list #hwx-lmdb-filter #hwx-lmdb-filter-reset #hwx-lmdb-filter-reset-button {
    inline-size: 100%;
  }
}

.hwx-estates-view ::selection {
  background: var(--estate-action);
  color: #fff;
}
