/* HWS Blog – Frontend
   Farbe/Layout per CSS-Variablen aus den Plugin-Einstellungen:
   --hwsb-accent, --hwsb-cols, --hwsb-ratio
*/
.hwsb, .hwsb-recent {
  --hwsb-accent: #e30613;
  --hwsb-text: #4D4D4D;

  font-family: "Open Sans", "Segoe UI", system-ui, sans-serif;
  color: var(--hwsb-text);
}
.hwsb *, .hwsb *::before, .hwsb *::after,
.hwsb-recent *, .hwsb-recent *::before, .hwsb-recent *::after { box-sizing: border-box; }

/* ---------- Feste Kategorie-Buttons (oberhalb der Filterleiste) ---------- */
.hwsb-quickcats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.hwsb-qc {
  border: 1px solid #e0e0e0 !important;
  background: #fff !important;
  border-radius: 5px;
  padding: 9px 18px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--hwsb-text) !important;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.hwsb-qc:hover, .hwsb-qc:focus-visible {
  background: #fff !important;
  border-color: var(--hwsb-accent) !important;
  color: var(--hwsb-accent) !important;
}
.hwsb-qc.is-active {
  background: var(--hwsb-accent) !important;
  border-color: var(--hwsb-accent) !important;
  color: #fff !important;
}

.hwsb-active-cat {
  margin: 0 0 16px;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--hwsb-text);
}
.hwsb-active-cat[hidden] { display: none; }

/* ---------- Filterleiste ---------- */
.hwsb-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.hwsb-search {
  flex: 1 1 220px;
  min-width: 200px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  background: #fff;
}
.hwsb-search svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: #9a9a9a;
  pointer-events: none;
  stroke: currentColor !important;
  fill: none !important;
}
.hwsb-search__input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  padding: 10px 0 !important;
  border: none !important;
  background: transparent !important;
  font: inherit;
  font-size: 14px;
  color: var(--hwsb-text);
}
.hwsb-search__input:focus { outline: none !important; }
.hwsb-search:focus-within { outline: 2px solid var(--hwsb-accent); outline-offset: 1px; }

.hwsb-select {
  padding: 10px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  font: inherit;
  font-size: 14px;
  background: #fff;
  color: var(--hwsb-text);
}
.hwsb-reset {
  border: 1px solid #e0e0e0 !important;
  background: #fff !important;
  border-radius: 5px;
  padding: 10px 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--hwsb-text) !important;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.hwsb-reset:hover, .hwsb-reset:focus-visible {
  background: #fff !important;
  border-color: var(--hwsb-accent) !important;
  color: var(--hwsb-accent) !important;
}

.hwsb-count { font-size: 13px; color: #8a8a8a; margin: 0 0 12px; }

/* ---------- Raster + Kachel ---------- */
.hwsb-grid {
  display: grid;
  grid-template-columns: repeat(var(--hwsb-cols, 3), 1fr);
  gap: 26px;
}
@media (max-width: 900px) { .hwsb-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .hwsb-grid { grid-template-columns: 1fr; } }

.hwsb-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 5px;
  overflow: hidden;
  transition: box-shadow .2s ease, transform .2s ease;
}
.hwsb-card:hover {
  box-shadow: 0 10px 26px rgba(0,0,0,.09);
  transform: translateY(-3px);
}

.hwsb-card__thumb {
  display: block;
  aspect-ratio: var(--hwsb-ratio, 16/9);
  background: #f2f2f2;
  overflow: hidden;
}
.hwsb-card__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s cubic-bezier(.16,.84,.44,1);
}
.hwsb-card:hover .hwsb-card__thumb img { transform: scale(1.05); }
.hwsb-card__thumb-empty { display: block; width: 100%; height: 100%; background: #f2f2f2; }

.hwsb-card__body {
  display: flex;
  flex-direction: column;
  padding: 18px 20px 20px;
  flex: 1 1 auto;
}
.hwsb-card__cat {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--hwsb-accent);
  padding: 3px 10px;
  border-radius: 5px;
  text-decoration: none;
  margin-bottom: 10px;
}
.hwsb-card__title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--hwsb-text);
}
.hwsb-card__title a { color: inherit; text-decoration: none; }
.hwsb-card__title a:hover { color: var(--hwsb-accent); }

.hwsb-card__date {
  margin: 0 0 10px;
  font-size: 12.5px;
  color: #9a9a9a;
}
.hwsb-card__excerpt {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--hwsb-text);
  opacity: .9;
}
.hwsb-card__more {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--hwsb-accent);
  text-decoration: none;
}
.hwsb-card__more svg { flex: 0 0 auto; width: 14px; height: 14px; transition: transform .2s ease; stroke: currentColor !important; fill: none !important; }
.hwsb-card__more:hover svg { transform: translateX(3px); }

/* ---------- Zustände ---------- */
.hwsb-empty {
  padding: 30px;
  text-align: center;
  color: #8a8a8a;
  background: #f7f7f7;
  border-radius: 5px;
}
.hwsb-empty[hidden] { display: none; }
.hwsb-grid.is-loading { opacity: .45; pointer-events: none; }

/* ---------- Pagination ---------- */
.hwsb-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 30px;
}
.hwsb-pagination[hidden] { display: none; }
.hwsb-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid #e0e0e0 !important;
  border-radius: 5px;
  background: #fff !important;
  color: var(--hwsb-text) !important;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.hwsb-page:hover, .hwsb-page:focus-visible {
  background: var(--hwsb-accent) !important;
  border-color: var(--hwsb-accent) !important;
  color: #fff !important;
}
.hwsb-page:disabled { opacity: .35; pointer-events: none; }
.hwsb-page svg { flex: 0 0 auto; width: 16px; height: 16px; }
.hwsb-page svg, .hwsb-page svg path { stroke: currentColor !important; fill: none !important; }
.hwsb-page__label { font-size: 13px; color: #8a8a8a !important; }

/* ---------- Neueste Beiträge (kompakt) ---------- */
.hwsb-recent__h {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--hwsb-text);
  margin: 0 0 12px;
}
.hwsb-recent__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.hwsb-recent__list li { display: flex; flex-direction: column; gap: 2px; }
.hwsb-recent__list a {
  color: var(--hwsb-text);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  line-height: 1.4;
}
.hwsb-recent__list a:hover { color: var(--hwsb-accent); }
.hwsb-recent__date { font-size: 12px; color: #9a9a9a; }

/* ---------- Mobil ---------- */
@media (max-width: 600px) {
  .hwsb-filters { flex-direction: column; align-items: stretch; }
  .hwsb-search { flex: none; width: 100%; min-width: 0; }
  .hwsb-select, .hwsb-reset { width: 100%; }
}

/* ============================================================
   Einzelner Beitrag
   ============================================================ */
.hwsb-single {
  --hwsb-accent: #e30613;
  --hwsb-text: #4D4D4D;
  font-family: "Open Sans", "Segoe UI", system-ui, sans-serif;
  color: var(--hwsb-text);
  max-width: 1100px;
  margin: 0 auto;
  padding: 30px 20px 60px;
}
.hwsb-single *, .hwsb-single *::before, .hwsb-single *::after { box-sizing: border-box; }

.hwsb-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--hwsb-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .02em;
}
.hwsb-back svg { flex: 0 0 auto; width: 16px; height: 16px; transition: transform .2s ease; color: var(--hwsb-accent); stroke: currentColor !important; fill: none !important; }
.hwsb-back:hover { color: var(--hwsb-accent); }
.hwsb-back:hover svg { transform: translateX(-3px); }

.hwsb-single__top { margin-bottom: 22px; }
.hwsb-single__bottom { margin: 40px 0; }

.hwsb-single__hero {
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 30px;
  background: #f2f2f2;
  max-height: 460px;
}
.hwsb-single__hero img { display: block; width: 100%; height: 100%; max-height: 460px; object-fit: cover; }

.hwsb-single__head {
  max-width: var(--hwsb-content-w, 760px);
  margin: 0 auto 30px;
}
.hwsb-single__title {
  margin: 12px 0 10px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--hwsb-text);
  text-wrap: balance;
}
/* Feste Titel-Grössen je Gerät (HWS-Vorgabe), nicht clamp() */
@media (min-width: 1025px) { .hwsb-single__title { font-size: 2.5rem; } }
@media (min-width: 600px) and (max-width: 1024px) { .hwsb-single__title { font-size: 2rem; } }
@media (max-width: 599px) { .hwsb-single__title { font-size: 1.5rem; } }

.hwsb-single__date { margin: 0; font-size: 13.5px; color: #9a9a9a; }

.hwsb-single__content {
  max-width: var(--hwsb-content-w, 760px);
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.75;
}
.hwsb-single__content > * + * { margin-top: 1.1em; }
.hwsb-single__content h2 { font-size: 1.5rem; font-weight: 700; color: var(--hwsb-text); margin-top: 1.8em; }
.hwsb-single__content h3 { font-size: 1.2rem; font-weight: 700; color: var(--hwsb-text); margin-top: 1.6em; }
.hwsb-single__content a { color: var(--hwsb-accent); }
.hwsb-single__content img { max-width: 100%; height: auto; border-radius: 5px; display: block; }
.hwsb-single__content ul, .hwsb-single__content ol { padding-left: 1.4em; }
.hwsb-single__content blockquote {
  margin: 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--hwsb-accent);
  color: #6b6b6b;
  font-style: italic;
}

/* ============================================================
   Favoriten-Slider ([hws_blog_featured])
   ============================================================ */
.hwsb-featured {
  --hwsb-accent: #e30613;
  --hwsb-text: #4D4D4D;
  position: relative;
  padding: 10px 0;
  font-family: "Open Sans", "Segoe UI", system-ui, sans-serif;
}
.hwsb-featured__inner { max-width: var(--hwsb-featured-width, 1280px); margin: 0 auto; padding: 0 20px; position: relative; }
.hwsb-featured__h {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--hwsb-text);
  margin: 0 0 26px;
}

/* Eck-Dreieck links unten, überlappt bewusst die erste Karte - nur Desktop */
.hwsb-featured__deco {
  display: none;
  position: absolute;
  left: 0;
  bottom: 0;
  width: var(--hwsb-deco-size, 320px);
  max-width: 90%;
  opacity: var(--hwsb-deco-opacity, 0.85);
  z-index: 5;
  pointer-events: none;
  line-height: 0;
}
.hwsb-featured__deco svg { display: block; width: 100%; height: auto; }
.hwsb-featured__deco svg path { fill: var(--hwsb-accent); }
@media (min-width: 1025px) { .hwsb-featured__deco { display: block; } }

/* Automatisch endlos sliedender Streifen - per JS Transform bewegt (hwsb-frontend.js),
   Karten am Ende sind Klone der ersten fuer den nahtlosen Kreis-Lauf. Zusaetzlich
   dezente Pfeile links/rechts, nur bei Hover sichtbar, fuer manuelles Vor/Zurueck. */
.hwsb-featured__slider { position: relative; overflow: hidden; }
.hwsb-featured__track {
  display: flex;
  gap: 24px;
  will-change: transform;
}
.hwsb-featured__item { flex: 0 0 calc((100% - 2 * 24px) / 3); min-width: 0; }
@media (max-width: 1024px) { .hwsb-featured__item { flex-basis: calc((100% - 24px) / 2); } }
@media (max-width: 640px)  { .hwsb-featured__item { flex-basis: 100%; } }

.hwsb-featured__nav {
  position: absolute;
  top: 50%;
  z-index: 5;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: none;
  padding: 0;
  font-size: 26px;
  line-height: 1;
  color: var(--hwsb-accent, #e30613);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
  transition: opacity .2s ease, transform .2s ease;
}
.hwsb-featured__slider:hover .hwsb-featured__nav { opacity: 1; pointer-events: auto; }
.hwsb-featured__nav--prev { left: 2px; }
.hwsb-featured__nav--next { right: 2px; }
.hwsb-featured__nav:hover { transform: translateY(-50%) scale(1.15); }
@media (max-width: 640px) {
  /* Auf dem Handy gibt es keinen Hover - Pfeile bleiben dauerhaft sichtbar,
     sonst waeren sie auf einem Touch-Geraet nie erreichbar. */
  .hwsb-featured__nav { opacity: 1; pointer-events: auto; }
}

/* Punkte unterhalb des Sliders - rein visueller Hinweis "das ist ein Slider",
   nicht anklickbar (der Slider laeuft automatisch, siehe hwsb-frontend.js). */
.hwsb-featured__dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}
.hwsb-featured__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d8d5d0;
  transition: background .25s ease, transform .25s ease;
}
.hwsb-featured__dot.is-active {
  background: var(--hwsb-accent, #e30613);
  transform: scale(1.25);
}

.hwsb-related { margin-top: 60px; padding-top: 40px; border-top: 1px solid #ececec; }
.hwsb-related__h {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--hwsb-text);
  margin: 0 0 22px;
}
