/**
 * Content Hub — layout adapted from the "News-Übersicht Variante C" mockup,
 * colors and shapes taken from the KBO CI
 * (EXT:kbo_sitepackage Resources/Private/Scss/global/_colors.scss):
 *   #97bf0d  $color-primary        #004489  $color-secondary
 *   #4d4e53  $color-gray-dark      #747474  $color-tertiary / copy text
 *   #dcdcdc  $color-gray-light     #f3f3f3  $color-gray-lighter
 *   #f7f7f7  $color-gray-ultralight
 */

/* The sitepackage reset hides [aria-hidden="true"] visually to keep focusable
   elements out of hidden containers. Our decorative SVGs (chevron, magnifier)
   use aria-hidden in its standard meaning — hidden for assistive technology
   only — and must stay visible. */
.sz-contenthub svg[aria-hidden="true"] {
  visibility: visible;
}

/* The sitepackage frame (.frame-default) only centers via "margin: 0 auto"
   at max-width 1280px — on narrower viewports the plugins would touch the
   screen edges. 1312px = 1280px + 2 × 16px, below that the auto margins
   fall short of 16px. */
@media (max-width: 1312px) {
  .sz-contenthub {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* ── Category select (kbo-select from the mockup) ───────── */

.sz-contenthub-filter__selects {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
  margin-bottom: 1.125rem;
}

.sz-contenthub-select {
  position: relative;
}

.sz-contenthub-select__button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-width: 220px;
  padding: 0.75rem 1.375rem;
  border: 1px solid #dcdcdc;
  border-radius: 999px;
  background: #ffffff;
  color: #747474;
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: border-color 0.3s ease, color 0.3s ease;
}

.sz-contenthub-select--active .sz-contenthub-select__button {
  color: #4d4e53;
  font-weight: 600;
}

.sz-contenthub-select__chevron {
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.sz-contenthub-select--open .sz-contenthub-select__chevron {
  transform: rotate(180deg);
}

.sz-contenthub-select__panel {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 260px;
  width: max-content;
  max-width: calc(100vw - 2rem);
  background: #ffffff;
  border: 1px solid #dcdcdc;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  padding: 0.5rem;
  z-index: 50;
}

.sz-contenthub-select--open .sz-contenthub-select__panel {
  display: block;
}

.sz-contenthub-select__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.sz-contenthub-select__option {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.75rem;
  border-radius: 8px;
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 0.9375rem;
  color: #4d4e53;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.sz-contenthub-select__option:hover {
  background: #f7f7f7;
}

.sz-contenthub-select__option::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid #dcdcdc;
  background: transparent;
  flex-shrink: 0;
}

.sz-contenthub-select__input:checked + .sz-contenthub-select__option {
  font-weight: 600;
  background: #a8d40e;
  color: #ffffff;
}

.sz-contenthub-select__input:checked + .sz-contenthub-select__option::before {
  border-color: #dcdcdc;
  background: #a8d40e;
  box-shadow: inset 0 0 0 2px #ffffff;
}

.sz-contenthub-select__input:focus-visible + .sz-contenthub-select__option {
  outline: #97bf0d auto 1px;
}

.sz-contenthub-select__option--all {
  border-bottom: 1px solid #dcdcdc;
  border-radius: 8px 8px 0 0;
  margin-bottom: 0.25rem;
  font-style: italic;
  color: #747474;
}

/* the reset row has no radio indicator and never shows the selected highlight */
.sz-contenthub-select__option--all::before {
  display: none;
}

.sz-contenthub-select__input:checked + .sz-contenthub-select__option--all {
  background: transparent;
  font-weight: 400;
  color: #747474;
}

/* ── Search ─────────────────────────────────────────────── */

.sz-contenthub-filter__search {
  max-width: 640px;
}

.sz-contenthub-filter__search .form-row {
  position: relative;
  display: flex;
  align-items: stretch;
}

.sz-contenthub-filter__search .form-control {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  padding: 0.875rem 5.5rem 0.875rem 1.375rem;
  border: 1px solid #dcdcdc;
  border-radius: 999px;
  background: #ffffff;
  color: #4d4e53;
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 0.9375rem;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.sz-contenthub-filter__search .form-control:focus {
  border-color: #dcdcdc;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

/* purely decorative magnifier inside the input, like in the mockup */
.sz-contenthub-search-icon {
  position: absolute;
  right: 1.375rem;
  top: 38%;
  transform: translateY(-50%);
  color: #4d4e53;
  pointer-events: none;
}

.sz-contenthub-filter__search .js-sz-contenthub-reset {
  position: absolute;
  right: 2.75rem;
  top: 42%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #747474;
  cursor: pointer;
}

.sz-contenthub-filter__search .js-sz-contenthub-reset.d-none {
  display: none;
}

.sz-contenthub-filter__search .icon-clear svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

/* ── Tag box with pills ─────────────────────────────────── */

.sz-contenthub-tagbox {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding: 0.875rem 1.125rem;
  background: #ffffff;
  border: 1px solid #dcdcdc;
  border-radius: 12px;
  margin-bottom: 1.125rem;
}

.sz-contenthub-tagbox__label {
  font-size: 0.6875rem;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #747474;
}

.sz-contenthub-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sz-contenthub-chips__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.sz-contenthub-chips__chip {
  padding: 0.375rem 0.875rem;
  border: 1px solid #dcdcdc;
  border-radius: 999px;
  background: #ffffff;
  color: #4d4e53;
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: color 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
}

.sz-contenthub-chips__chip:hover {
  background: #f7f7f7;
}

.sz-contenthub-chips__input:checked + .sz-contenthub-chips__chip {
  background: #a8d40e;
  border-color: #dcdcdc;
  color: #ffffff;
}

.sz-contenthub-chips__input:focus-visible + .sz-contenthub-chips__chip {
  outline: #97bf0d auto 1px;
}

/* ── Active filter badges ───────────────────────────────── */

.sz-contenthub-selected-categories__content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem;
  margin: 0.75rem 0;
}

.sz-contenthub-selected-categories__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: #a8d40e;
  border: 1px solid #dcdcdc;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #ffffff;
  cursor: pointer;
}

.sz-contenthub-selected-categories__badge-remove {
  opacity: 0.75;
  transition: opacity 0.3s ease;
}

.sz-contenthub-selected-categories__badge:hover .sz-contenthub-selected-categories__badge-remove {
  opacity: 1;
}

.sz-contenthub-selected-categories__badge--remove-all {
  background: #ffffff;
  border-color: #dcdcdc;
  color: #4d4e53;
}

.sz-contenthub-selected-categories__badge--remove-all:hover {
  background: #f3f3f3;
}

/* ── Result summary + header ────────────────────────────── */

.sz-contenthub-summary {
  font-size: 0.8125rem;
  color: #747474;
}

.sz-contenthub-summary strong {
  color: #4d4e53;
  font-weight: 600;
}

.sz-contenthub-result-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.25rem 0 1.125rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #dcdcdc;
}

.sz-contenthub-result-header__note {
  font-size: 0.6875rem;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #747474;
}

/* ── Card grid ──────────────────────────────────────────── */

.sz-contenthub-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.sz-contenthub-item {
  display: flex;
  min-width: 0;
}

@media (min-width: 750px) {
  .sz-contenthub-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .sz-contenthub-item--wide {
    grid-column: span 2;
  }
}

@media (min-width: 980px) {
  .sz-contenthub-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ── Card ───────────────────────────────────────────────── */

.sz-contenthub-card {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  background: #ffffff;
  border: 1px solid #dcdcdc;
  border-radius: 4px;
  overflow: hidden;
}

.sz-contenthub-card--blog {
  border-color: #dcdcdc;
}

.sz-contenthub-card__media {
  position: relative;
}

.sz-contenthub-card__thumbnail {
  overflow: hidden;
}

.sz-contenthub-card__thumbnail img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.6s ease;
}

/* mirrors %zoomable-image / $img-hover-scale-factor from the sitepackage */
.sz-contenthub-card:hover .sz-contenthub-card__thumbnail img {
  transform: scale(1.2);
}

/* Items without an own thumbnail get a placeholder in the image's aspect
   ratio: it keeps the card grid uniform and anchors the blog badge, which
   would otherwise overlay the card body. */
.sz-contenthub-card__thumbnail--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f3f3;
  color: #dcdcdc;
}

.sz-contenthub-card__badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.3125rem 0.625rem;
  background: #97bf0d;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  border-radius: 2px;
  z-index: 1;
}

.sz-contenthub-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1 1 auto;
  padding: 1.25rem 1.375rem 1.375rem;
}

/* deliberate exception to the #dcdcdc border unification: blog accent stays green */
.sz-contenthub-card--blog .sz-contenthub-card__body {
  border-left: 3px solid #97bf0d;
}

.sz-contenthub-item--wide .sz-contenthub-card__body {
  padding: 1.5rem 1.75rem 1.625rem;
}

.sz-contenthub-card__meta {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #4d4e53;
}

.sz-contenthub-card__meta-separator {
  margin: 0 0.25rem;
  color: #747474;
  font-weight: 400;
}

.sz-contenthub-card__title {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.25;
  font-weight: 600;
  color: #4d4e53;
}

.sz-contenthub-item--wide .sz-contenthub-card__title {
  font-size: 1.625rem;
}

.sz-contenthub-card__author {
  padding-top: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #4d4e53;
}

.sz-contenthub-card__footer {
  margin-top: auto;
  padding-top: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sz-contenthub-card__date {
  font-size: 0.6875rem;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #747474;
}

/* mirrors %bottom-green-bar from the sitepackage */
.sz-contenthub-card__bar {
  width: 28px;
  height: 2px;
  background: #97bf0d;
}

.sz-contenthub-card__link {
  position: absolute;
  inset: 0;
  z-index: 1;
  text-decoration: none;
}

/* ── Load more ──────────────────────────────────────────── */

.sz-contenthub-loadmore {
  margin-top: 2.25rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
}

.sz-contenthub-loadmore__note {
  font-size: 0.75rem;
  color: #747474;
}

/* ── Empty result ───────────────────────────────────────── */

.sz-contenthub-empty {
  padding: 1.5rem 0;
  color: #747474;
}

/* ── Loading indicator ──────────────────────────────────── */

/* Anchor for the absolutely positioned loading indicator */
.sz-contenthub-filter {
  position: relative;
}

/* Overlays the top of the result list below the filter instead of
   taking up layout space, so appearing/disappearing never shifts
   the surrounding content. */
.sz-contenthub-loading {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 2;
  justify-content: center;
  padding: 1.5rem 0;
  color: #747474;
  font-size: 2.5rem;
}

.sz-contenthub-loading.is-visible {
  display: flex;
}
