/* SW Zielgruppen-Filter – Frontend
   Farben greifen auf Avada-Variablen zurück, Fallbacks passen zur Seite. */

.sw-zg {
  --sw-zg-gap: 30px;
  --sw-zg-radius: 4px;
  --sw-zg-border: #e8e8e8;
  --sw-zg-bg: #fff;
  --sw-zg-title: var(--awb-color5, #6fbf73);
  --sw-zg-text: var(--awb-color8, #333);
  --sw-zg-muted: #555;
  --sw-zg-accent: var(--awb-color4, #f7941d);
  --sw-zg-focus: #1a73e8;
  margin: 3em 0 1em;
  clear: both;
}

.sw-zg__title {
  text-align: center;
  color: var(--sw-zg-title);
  margin: 0 0 1.2em;
}

.sw-zg__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--sw-zg-gap);
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.sw-zg--cols-1 .sw-zg__grid { grid-template-columns: 1fr; }
.sw-zg--cols-2 .sw-zg__grid { grid-template-columns: repeat(2, 1fr); }
.sw-zg--cols-3 .sw-zg__grid { grid-template-columns: repeat(3, 1fr); }
.sw-zg--cols-4 .sw-zg__grid { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .sw-zg--cols-3 .sw-zg__grid,
  .sw-zg--cols-4 .sw-zg__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .sw-zg { --sw-zg-gap: 20px; }
  .sw-zg__grid,
  .sw-zg--cols-2 .sw-zg__grid,
  .sw-zg--cols-3 .sw-zg__grid,
  .sw-zg--cols-4 .sw-zg__grid { grid-template-columns: 1fr; }
}

.sw-zg__item { margin: 0; padding: 0; }

.sw-zg__card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--sw-zg-bg);
  border: 1px solid var(--sw-zg-border);
  border-radius: var(--sw-zg-radius);
  overflow: hidden;
  transition: box-shadow .2s ease, transform .2s ease;
}
.sw-zg__card:hover,
.sw-zg__card:focus-within {
  box-shadow: 0 8px 24px rgba(0,0,0,.10);
  transform: translateY(-2px);
}

.sw-zg__media { display: block; line-height: 0; }
.sw-zg__img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  max-width: 100%;
}

.sw-zg__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 18px 20px 22px;
  color: var(--sw-zg-text);
}

.sw-zg__heading {
  margin: 0 0 .5em;
  font-size: 1.25em;
  line-height: 1.3;
}
.sw-zg__link {
  color: var(--sw-zg-text);
  text-decoration: none;
}
/* Gesamte Karte klickbar – über Pseudo-Element des Titel-Links */
.sw-zg__link::after {
  content: "";
  position: absolute;
  inset: 0;
}
.sw-zg__link:hover { color: var(--sw-zg-accent); }
.sw-zg__link:focus { outline: none; }
.sw-zg__link:focus-visible::after {
  outline: 3px solid var(--sw-zg-focus);
  outline-offset: 2px;
  border-radius: var(--sw-zg-radius);
}

.sw-zg__excerpt {
  flex: 1;
  margin: 0 0 1em;
  font-size: .95em;
  line-height: 1.6;
  color: var(--sw-zg-muted);
}

.sw-zg__more {
  color: var(--sw-zg-accent);
  font-weight: 600;
  font-size: .9em;
}
.sw-zg__more::after { content: " \203A"; }

.sw-zg__all { text-align: center; margin: 2em 0 0; }
.sw-zg__all-link { display: inline-block; }

.sw-zg__empty { text-align: center; color: var(--sw-zg-muted); }

.sw-zg-notice {
  background: #fff3cd;
  border: 1px solid #ffe69c;
  padding: 10px 14px;
  border-radius: 4px;
  color: #664d03;
}

@media (prefers-reduced-motion: reduce) {
  .sw-zg__card { transition: none; }
  .sw-zg__card:hover, .sw-zg__card:focus-within { transform: none; }
}

@media print {
  .sw-zg__card { box-shadow: none; break-inside: avoid; }
  .sw-zg__all { display: none; }
}
