/* Ortsliste: lokal begrenzt. Farben nach den Orte-Werten aus mod_lmdb_locations/cards.css; Ortskarte laut Design System. */
/* Selektor schlägt main>div.hwx-lmdb-list-basetiles; als Flex-Container richtete sich die Breite sonst nach dem Inhalt. */
main > div.hwx-locations-view {
  display: block;
  inline-size: 100%;
  --place-action: #164f9e;
  --place-hover: #103b76;
  --place-soft: #e3eaf3;
  --place-ink: #0c3247;
  --place-text: #303030;
  --place-muted: #596975;
  --place-line: #dbe3e8;
  --place-surface: #f5f8fa;
  --place-red: #d11f34;
  max-inline-size: 1320px;
  margin-inline: auto;
  padding-block: 2rem;
}

.hwx-locations-view :is(.hwx-lmdb-page-title, .hwx-lmdb-list-title) {
  margin-block-end: 1.5rem;
}

.hwx-locations-view .hwx-lmdb-page-title .hwx-lmdb-page-title-text,
.hwx-locations-view .hwx-lmdb-list-title h1.hwx-lmdb-list-title {
  margin: 0;
  color: var(--place-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-locations-list #hwx-lmdb-filter {
  margin-block: 0 2rem;
  padding: 1.5rem;
  border: 1px solid var(--place-line);
  border-radius: .875rem;
  background: #fff;
}

#hwx-lmdb-locations-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-locations-list #hwx-lmdb-filter #hwx-lmdb-filter-search {
  inline-size: auto;
  min-inline-size: 0;
  margin: 0;
}

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

#hwx-lmdb-locations-list #hwx-lmdb-filter .hwx-lmdb-filter-input-container,
#hwx-lmdb-locations-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-locations-list #hwx-lmdb-filter #hwx-lmdb-filter-search :is(.hwx-lmdb-filter-input-container, .input-group) {
  block-size: auto;
}

#hwx-lmdb-locations-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: #7f8f9c;
  border-radius: .5rem 0 0 .5rem;
  font-size: 1rem;
}

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

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

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

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

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

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

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

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

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

/* Karte: ohne Foto weiße Fläche mit Platzhalter, mit Foto (.has-image) Bild als Hauptfläche. */
.hwx-locations-view .hwx-lmdb-list-items .hwx-location-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  aspect-ratio: 4 / 5;
  min-inline-size: 0;
  overflow: hidden;
  border: 1px solid var(--place-line);
  border-radius: .875rem;
  background: #fff;
  color: var(--place-text);
  box-shadow: 0 .45rem 1.2rem rgb(12 50 71 / 8%);
  animation: none;
  isolation: isolate;
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}

.hwx-locations-view .hwx-location-card:not(.has-image)::before {
  content: "";
  flex: 1 1 4.5rem;
  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='M12 22s7-7.75 7-13a7 7 0 1 0-14 0c0 5.25 7 13 7 13Z'/%3E%3Ccircle cx='12' cy='9' r='2.5'/%3E%3C/svg%3E") center / 3rem no-repeat,
    var(--place-surface);
}

.hwx-locations-view .hwx-location-card:not(.has-image) .hwx-location-card__image {
  display: none;
}

.hwx-locations-view .hwx-location-card.has-image {
  border: 0;
  background: var(--place-ink);
}

.hwx-locations-view .hwx-location-card__image {
  position: absolute;
  inset: 0;
  z-index: -1;
  inline-size: 100%;
  max-inline-size: none;
  block-size: 100%;
  margin: 0;
  object-fit: cover;
  color: transparent;
  transition: transform .4s cubic-bezier(.16, 1, .3, 1), opacity .35s ease;
}

.hwx-locations-view .hwx-location-card__image.is-pending {
  opacity: 0;
}

.hwx-locations-view .hwx-location-card .is-empty {
  display: none;
}

.hwx-locations-view .hwx-location-card .hwx-badges-bar {
  position: absolute;
  /* Die globale Regel .hwx-lmdb-list-item-badges setzt top: 0 !important. */
  inset-block-start: .75rem !important;
  inset-inline-start: .75rem;
  display: flex;
  gap: .375rem;
}

.hwx-locations-view .hwx-location-card .hwx-badges-bar .hwx-lmdb-list-item-badge {
  display: none;
  position: static;
  padding: .25rem .5rem;
  border-radius: .25rem;
  background: var(--place-action);
  box-shadow: 0 0 0 1px rgb(255 255 255 / 35%);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  line-height: 1.25;
  text-transform: uppercase;
}

.hwx-locations-view .hwx-location-card .hwx-badges-bar .hwx-badge-new {
  background: var(--place-red);
}

/* Wie in der Terminliste: Tipp in der Bereichsfarbe, Top dunkel und dahinter. */
.hwx-locations-view .hwx-location-card .hwx-badges-bar .hwx-badge-tip {
  order: 1;
}

.hwx-locations-view .hwx-location-card .hwx-badges-bar .hwx-badge-top {
  order: 2;
  background: var(--place-ink);
}

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

.hwx-locations-view .hwx-location-card__body {
  display: flex;
  flex-direction: column;
  gap: .375rem;
  min-inline-size: 0;
  padding: 1rem 1.25rem 1.25rem;
  background: #fff;
}

/* Die Überlagerung hängt am Textblock: Der Text steht auch bei langen Titeln auf deckender Fläche. */
.hwx-locations-view .has-image .hwx-location-card__body {
  padding-block-start: 3.5rem;
  background: linear-gradient(180deg, rgb(12 50 71 / 0%), rgb(12 50 71 / 82%) 3.25rem, rgb(12 50 71 / 94%));
}

.hwx-locations-view .hwx-location-card__chips {
  display: none;
  flex-wrap: wrap;
  gap: .375rem;
  margin: 0 0 .25rem;
  padding: 0;
  list-style: none;
}

.hwx-locations-view .hwx-location-card:is(.has-event, .has-job) .hwx-location-card__chips {
  display: flex;
}

.hwx-locations-view .hwx-location-card__chips li {
  display: none;
  padding: .125rem .625rem;
  border-radius: 9999px;
  background: var(--place-soft);
  color: var(--place-ink);
  font-size: .75rem;
  font-weight: 700;
  line-height: 1.5;
}

.hwx-locations-view .has-image .hwx-location-card__chips li {
  background: #fff;
}

.hwx-locations-view .has-event .hwx-location-card__chip--event,
.hwx-locations-view .has-job .hwx-location-card__chip--job {
  display: block;
}

.hwx-locations-view .hwx-location-card__title {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--place-ink);
  font-size: 1.1875rem;
  line-height: 1.25;
  overflow-wrap: break-word;
  hyphens: auto;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

/* Global erhält der Link position: relative; dann deckte a::after nur den Titel statt der Karte ab. */
.hwx-locations-view .hwx-location-card__title a {
  position: static;
  color: inherit;
  text-decoration: none;
}

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

.hwx-locations-view .hwx-location-card__place {
  margin: 0;
  color: var(--place-muted);
  font-size: .875rem;
  line-height: 1.4;
}

.hwx-locations-view .has-image .hwx-location-card__title,
.hwx-locations-view .has-image .hwx-location-card__place {
  color: #fff;
}

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

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

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

@media (hover: hover) {
  .hwx-locations-view .hwx-location-card:hover {
    box-shadow: 0 .75rem 1.75rem rgb(12 50 71 / 14%);
    transform: translateY(-2px);
  }

  .hwx-locations-view .hwx-location-card:not(.has-image):hover {
    border-color: var(--place-action);
  }

  .hwx-locations-view .hwx-location-card:hover .hwx-location-card__image {
    transform: scale(1.04);
  }

  .hwx-locations-view .hwx-location-card:hover .hwx-location-card__title a {
    text-decoration: underline;
    text-underline-offset: .2em;
  }
}

/* Nachladen: eine Platzhalter-Reihe während der Anfrage, danach gestaffeltes Einblenden. */
.hwx-locations-view .hwx-location-loading {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  grid-template-rows: auto;
  grid-auto-rows: 0;
  gap: 0 1.25rem;
  margin-block-start: 1.25rem;
  overflow: hidden;
}

.hwx-locations-view .hwx-lmdb-filter-list[aria-busy="true"] ~ .hwx-location-loading {
  display: grid;
  /* Verzögert, damit schnelle Antworten keinen Platzhalter aufblitzen lassen. */
  animation: hwx-location-ghost-in .2s ease .12s backwards;
}

.hwx-locations-view .hwx-location-ghost {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid var(--place-line);
  border-radius: .875rem;
  background: var(--place-surface);
}

.hwx-locations-view .hwx-location-ghost::before {
  content: "";
  position: absolute;
  inset: auto 1.25rem 1.25rem;
  block-size: 2.75rem;
  background:
    linear-gradient(var(--place-line) 0 0) 0 0 / 72% .9rem no-repeat,
    linear-gradient(var(--place-line) 0 0) 0 100% / 40% .75rem no-repeat;
}

.hwx-locations-view .hwx-location-ghost::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgb(255 255 255 / 70%) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: hwx-location-ghost-shimmer 1.5s ease-in-out infinite;
}

.hwx-locations-view .hwx-lmdb-list-items .hwx-location-card.is-entering {
  animation: hwx-location-enter .45s cubic-bezier(.16, 1, .3, 1) backwards;
}

@keyframes hwx-location-enter {
  from {
    opacity: 0;
    transform: translateY(.875rem);
  }
}

@keyframes hwx-location-ghost-in {
  from {
    opacity: 0;
  }
}

@keyframes hwx-location-ghost-shimmer {
  to {
    transform: translateX(100%);
  }
}

@media (max-width: 575.98px) {
  .hwx-locations-view .hwx-location-ghost {
    aspect-ratio: 4 / 3;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hwx-locations-view .hwx-lmdb-filter-list[aria-busy="true"] ~ .hwx-location-loading,
  .hwx-locations-view .hwx-location-ghost::after,
  .hwx-locations-view .hwx-lmdb-list-items .hwx-location-card.is-entering {
    animation: none;
  }

  .hwx-locations-view .hwx-location-ghost::after {
    display: none;
  }

  .hwx-locations-view .hwx-lmdb-list-items .hwx-location-card,
  .hwx-locations-view .hwx-location-card__image {
    transition: none;
  }

  .hwx-locations-view .hwx-location-card:hover,
  .hwx-locations-view .hwx-location-card:hover .hwx-location-card__image {
    transform: none;
  }
}

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

  .hwx-locations-view .hwx-lmdb-list-items .hwx-location-card {
    aspect-ratio: 4 / 3;
  }

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

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

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

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