/* Unternehmensliste: lokal begrenzt. Kein eigenes Bereichsschema, daher das redaktionelle Blau des Design Systems. */
/* Selektor schlägt main>div.hwx-lmdb-list-basetiles; als Flex-Container richtete sich die Breite sonst nach dem Inhalt. */
main > div.hwx-companies-view {
  display: block;
  inline-size: 100%;
  --company-action: #164f9e;
  --company-hover: #103b76;
  --company-soft: #e3eaf3;
  --company-ink: #0c3247;
  --company-text: #303030;
  --company-muted: #596975;
  --company-line: #dbe3e8;
  --company-surface: #f5f8fa;
  --company-red: #d11f34;
  /* Marktplatz-Schema des Design Systems: Der Footer kennzeichnet Unternehmen mit Produkten. */
  --company-offer: #e8890c;
  --company-offer-action: #9e5d08;
  --company-offer-hover: #8b5207;
  --company-offer-soft: #fcf1e2;
  max-inline-size: 1320px;
  margin-inline: auto;
  padding-block: 2rem;
}

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

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

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

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

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

/* Feld und Suchen-Button bilden eine Einheit; der Fokus liegt am gemeinsamen Rahmen statt als Doppelrahmen am Feld. */
#hwx-lmdb-companies-list #hwx-lmdb-filter #hwx-lmdb-filter-search .input-group {
  overflow: hidden;
  border: 1px solid #7f8f9c;
  border-radius: .625rem;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}

#hwx-lmdb-companies-list #hwx-lmdb-filter #hwx-lmdb-filter-search .input-group:focus-within {
  border-color: var(--company-action);
  box-shadow: 0 0 0 1px var(--company-action), 0 0 0 5px rgb(22 79 158 / 18%);
}

#hwx-lmdb-companies-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;
  padding-inline: .875rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 1rem;
}

#hwx-lmdb-companies-list #hwx-lmdb-filter #hwx-lmdb-filter-search-input:focus {
  outline: none;
  box-shadow: none;
}

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

#hwx-lmdb-companies-list #hwx-lmdb-filter #hwx-lmdb-filter-search-button {
  min-block-size: 2.75rem;
  margin: 0;
  padding: .625rem 1.125rem;
  border: 0;
  border-radius: 0 !important;
  background-color: var(--company-action) !important;
  color: #fff !important;
  font-weight: 600;
  transition: background-color .15s ease;
}

/* Innen liegender Fokus: Die Gruppe schneidet Außenlinien ab. */
#hwx-lmdb-companies-list #hwx-lmdb-filter #hwx-lmdb-filter-search-button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -5px;
}

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

#hwx-lmdb-companies-list #hwx-lmdb-filter #hwx-lmdb-filter-reset #hwx-lmdb-filter-reset-button {
  /* Gleich hoch wie die Suchgruppe mit ihrem 1-px-Rahmen. */
  min-block-size: calc(2.75rem + 2px);
  margin: 0;
  padding: .625rem 1rem;
  border: 1px solid var(--company-line);
  border-radius: .625rem !important;
  background-color: #fff !important;
  color: var(--company-ink) !important;
  font-weight: 600;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

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

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

  #hwx-lmdb-companies-list #hwx-lmdb-filter #hwx-lmdb-filter-reset #hwx-lmdb-filter-reset-button:hover {
    border-color: var(--company-action);
    background-color: var(--company-soft) !important;
    color: var(--company-hover) !important;
  }
}

/* Zusätzliche Button-Filter (Hotels & Unterkünfte) stehen in einer eigenen Zeile. */
#hwx-lmdb-companies-list #hwx-lmdb-filter #hwx-lmdb-filter-tag {
  grid-column: 1 / -1;
  grid-row: 2;
  margin: 0;
}

#hwx-lmdb-companies-list #hwx-lmdb-filter .hwx-lmdb-filter-button-container {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

/* Die globale Regel adressiert diese Buttons über #hwx-lmdb-filter-tag und setzt background mit !important. */
#hwx-lmdb-companies-list #hwx-lmdb-filter .hwx-lmdb-filter-types > #hwx-lmdb-filter-tag .hwx-lmdb-filter-button-container button {
  min-block-size: 2.25rem;
  margin: 0;
  padding: .25rem .875rem;
  border: 1px solid var(--company-line);
  border-radius: 9999px !important;
  background: #fff !important;
  color: var(--company-ink) !important;
  font-size: .875rem;
  font-weight: 600;
}

#hwx-lmdb-companies-list #hwx-lmdb-filter .hwx-lmdb-filter-types > #hwx-lmdb-filter-tag .hwx-lmdb-filter-button-container button.active {
  border-color: var(--company-action);
  background: var(--company-action) !important;
  color: #fff !important;
}

/* Raster */
.hwx-companies-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-companies-view .hwx-lmdb-list-items > .hwx-lmdb-list-item.hwx-lmdb-list-item-adbanner {
  grid-column: 1 / -1;
  min-inline-size: 0;
}

/* Karte: Logos sind sehr unterschiedlich, daher unbeschnitten auf weißer Fläche. */
.hwx-companies-view .hwx-lmdb-list-items .hwx-company-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-inline-size: 0;
  overflow: hidden;
  border: 1px solid var(--company-line);
  border-radius: .875rem;
  background: #fff;
  color: var(--company-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-companies-view .hwx-company-card__media {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  aspect-ratio: 16 / 9;
  border-block-end: 1px solid var(--company-line);
  background: #fff;
}

.hwx-companies-view .hwx-company-card:not(:has(.hwx-company-card__logo)) .hwx-company-card__media {
  background: var(--company-soft);
}

/* Absolut, damit große Bilder das Seitenverhältnis der Fläche nicht aufbrechen. */
.hwx-companies-view .hwx-company-card__logo {
  position: absolute;
  inset: 1.25rem;
  inline-size: calc(100% - 2.5rem);
  max-inline-size: none;
  block-size: calc(100% - 2.5rem);
  margin: 0;
  object-fit: contain;
  color: transparent;
}

/* Fotos füllen die Fläche randlos wie der Anfangsbuchstabe ohne Logo. */
.hwx-companies-view .hwx-company-card.is-photo .hwx-company-card__logo {
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}

.hwx-companies-view .hwx-company-card__media:has(.hwx-company-card__logo) .hwx-company-card__initial {
  display: none;
}

.hwx-companies-view .hwx-company-card__initial {
  color: var(--company-action);
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1;
}

.hwx-companies-view .hwx-company-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-companies-view .hwx-company-card .hwx-badges-bar .hwx-lmdb-list-item-badge {
  display: none;
  position: static;
  padding: .25rem .5rem;
  border-radius: .25rem;
  background: var(--company-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-companies-view .hwx-company-card .hwx-badges-bar .hwx-badge-new {
  background: var(--company-red);
}

/* Wie in Termin- und Ortsliste: Tipp in der Bereichsfarbe, Top dunkel und dahinter. */
.hwx-companies-view .hwx-company-card .hwx-badges-bar .hwx-badge-tip {
  order: 1;
}

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

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

.hwx-companies-view .hwx-company-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: .375rem;
  min-inline-size: 0;
  padding: 1rem 1.25rem 1.25rem;
}

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

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

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

.hwx-companies-view .has-event .hwx-company-card__chip--event,
.hwx-companies-view .has-job .hwx-company-card__chip--job {
  display: block;
}

/* Footer für Unternehmen mit Produkten; die Klickfläche der Karte liegt darüber. */
.hwx-companies-view .hwx-company-card .hwx-company-card__offers {
  display: none;
  align-items: center;
  gap: .5rem;
  margin: 0;
  padding: .75rem 1.25rem;
  border-block-start: 3px solid var(--company-offer);
  background: var(--company-offer-soft);
  color: var(--company-offer-action);
  font-size: .9375rem;
  font-weight: 700;
  line-height: 1.3;
  transition: background-color .2s ease, color .2s ease;
}

.hwx-companies-view .hwx-company-card.has-product .hwx-company-card__offers {
  display: flex;
}

.hwx-companies-view .hwx-company-card__offers span {
  background: transparent;
  color: inherit;
}

.hwx-companies-view .hwx-company-card__offers-arrow {
  margin-inline-start: auto;
  transition: transform .2s ease;
}

.hwx-companies-view .hwx-company-card__title {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--company-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-companies-view .hwx-company-card__title a {
  position: static;
  color: inherit;
  text-decoration: none;
}

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

.hwx-companies-view .hwx-company-card .hwx-company-card__details {
  margin: 0;
  color: var(--company-muted);
  font-size: .875rem;
  line-height: 1.4;
}

/* Seitennavigation */
.hwx-companies-view .hwx-lmdb-list-pagination {
  margin-block-start: 2rem;
}

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

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

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

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

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

  .hwx-companies-view .hwx-company-card:hover .hwx-company-card__offers {
    background: var(--company-offer-hover);
    color: #fff;
  }

  .hwx-companies-view .hwx-company-card:hover .hwx-company-card__offers-arrow {
    transform: translateX(.1875rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hwx-companies-view .hwx-lmdb-list-items .hwx-company-card,
  .hwx-companies-view .hwx-company-card__offers,
  .hwx-companies-view .hwx-company-card__offers-arrow,
  #hwx-lmdb-companies-list #hwx-lmdb-filter :is(.input-group, button) {
    transition: none;
  }

  .hwx-companies-view .hwx-company-card:hover {
    transform: none;
  }
}

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

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

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

  #hwx-lmdb-companies-list #hwx-lmdb-filter #hwx-lmdb-filter-tag {
    grid-row: auto;
  }

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

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