/* Filters for post loops (filter.php): what all filter elements share. The elements' own look is in their Breakdance design settings. */

[data-wk-filter-loop] {
  transition: opacity 0.2s ease;
}

[data-wk-filter-loop].wk-filter-loading {
  opacity: 0.45;
  pointer-events: none;
}

/* "Nulstil" only shows while something in its group is chosen. */
[data-wk-filter-reset]:not([data-wk-filter-active]) {
  display: none !important;
}

.wk-filter-empty {
  margin: 0;
  padding: 40px 0;
  text-align: center;
  opacity: 0.7;
}

.wk-filter-live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Shown once something is chosen in the group; hidden until then. */
[data-wk-filter-show][hidden],
[data-wk-filter-loop][hidden] {
  display: none !important;
}

[data-wk-filter-show]:not([hidden]),
[data-wk-filter-loop][data-wk-filter-hide-until]:not([hidden]) {
  animation: wk-filter-in 0.35s ease both;
}

@keyframes wk-filter-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-wk-filter-show]:not([hidden]),
  [data-wk-filter-loop][data-wk-filter-hide-until]:not([hidden]) {
    animation: none;
  }
}

/* "Vis loader mens der hentes": Figma "Loading" (508:1175), Black, Large: a 30px ring at 10%
   in a 100px area, in place of the content while results are fetched. */
.wk-filter-loader {
  display: none;
}

.wk-filter-busy > :not(.wk-filter-loader) {
  display: none !important;
}

.wk-filter-busy > .wk-filter-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100px;
}

.wk-filter-loader span {
  width: 30px;
  height: 30px;
  background: url("icons/loader.png") center / contain no-repeat;
  opacity: 0.1;
  animation: wk-filter-spin 0.9s linear infinite;
}

@keyframes wk-filter-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .wk-filter-loader span {
    animation-duration: 2.4s;
  }
}
