/* ==========================================================
   DTKV NEWS – KONSOLIDIERTE FASSUNG
   ========================================================== */

/* ==========================================================
   WERKZEUGLEISTE: SUCHE, SORTIERUNG, ERGEBNISANZAHL
   ========================================================== */

.dtkv-news-toolbar {
  width: 100%;
}

.dtkv-news-filter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 16px;
  width: 100%;
  margin: 0;
}

.dtkv-news-filter__search {
  position: relative;
  min-width: 0;
}

.dtkv-news-filter__search-input,
.dtkv-news-filter__sort-select,
.dtkv-news-sidebar-select {
  width: 100%;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: var(--dtkv-surface, #ffffff) !important;
  border: 1px solid var(--dtkv-border-strong, #d8d0c4);
  border-radius: 8px !important;
  color: var(--dtkv-text, #1f1f1f);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  box-shadow: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.dtkv-news-filter__search-input {
  height: 48px;
  padding: 0 86px 0 16px;
  font-size: 15px;
  font-weight: 400;
}

.dtkv-news-filter__search-input::placeholder {
  color: var(--dtkv-secondary, #4a4a4a);
  opacity: 0.72;
}

.dtkv-news-filter__search-input:hover,
.dtkv-news-filter__sort-select:hover,
.dtkv-news-sidebar-select:hover {
  border-color: var(--dtkv-primary, #a9936f);
}

.dtkv-news-filter__search-input:focus,
.dtkv-news-filter__sort-select:focus,
.dtkv-news-sidebar-select:focus {
  border-color: var(--dtkv-primary, #a9936f);
  outline: none;
  box-shadow: 0 0 0 3px rgba(169, 147, 111, 0.14);
}

.dtkv-news-filter__search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-right: 42px;
  cursor: pointer;
  background:
    linear-gradient(45deg, transparent 46%, currentColor 47%, currentColor 53%, transparent 54%),
    linear-gradient(-45deg, transparent 46%, currentColor 47%, currentColor 53%, transparent 54%);
  color: var(--dtkv-secondary, #4a4a4a);
  opacity: 0.65;
}

.dtkv-news-filter__search-input::-webkit-search-cancel-button:hover {
  opacity: 1;
}

.dtkv-news-filter__search-button {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent !important;
  border: 0;
  border-radius: 0 8px 8px 0 !important;
  color: var(--dtkv-text, #1f1f1f) !important;
  cursor: pointer;
  box-shadow: none !important;
  transition: color 0.18s ease;
}

.dtkv-news-filter__search-button:hover,
.dtkv-news-filter__search-button:focus,
.dtkv-news-filter__search-button:active {
  background: transparent !important;
  color: var(--dtkv-primary, #a9936f) !important;
}

.dtkv-news-filter__search-button:focus-visible {
  outline: 2px solid var(--dtkv-primary, #a9936f);
  outline-offset: -3px;
}

.dtkv-news-filter__search-button svg {
  display: block;
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.dtkv-news-filter__sort,
.dtkv-news-select-wrap {
  position: relative;
}

.dtkv-news-filter__sort::after,
.dtkv-news-select-wrap::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 16px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  color: var(--dtkv-text, #1f1f1f);
  pointer-events: none;
  transform: translateY(-70%) rotate(45deg);
}

.dtkv-news-filter__sort-select {
  height: 48px;
  padding: 0 42px 0 16px;
  cursor: pointer;
}

.dtkv-news-results-count {
  margin: 10px 2px 0;
  color: var(--dtkv-secondary, #4a4a4a);
  font-size: 14px;
  line-height: 1.4;
}

/* ==========================================================
   LADEZUSTAND
   ========================================================== */

.dtkv-news-loop,
.dtkv-news-sidebar {
  transition: opacity 0.18s ease, filter 0.18s ease;
}

.dtkv-news-loop.is-loading,
.dtkv-news-sidebar.is-loading {
  opacity: 0.45;
  filter: grayscale(0.15);
  pointer-events: none;
}

.dtkv-news-filter.is-loading {
  cursor: progress;
}

.dtkv-news-filter.is-loading .dtkv-news-filter__search-button {
  pointer-events: none;
}

.dtkv-news-filter.is-loading .dtkv-news-filter__search-button svg {
  animation: dtkv-news-search-pulse 0.8s ease-in-out infinite alternate;
}

@keyframes dtkv-news-search-pulse {
  from { opacity: 0.4; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* ==========================================================
   FILTERSPALTE – ANALOG ZUM DOWNLOADBEREICH
   ========================================================== */

.dtkv-news-sidebar {
  display: flex;
  flex: 0 0 250px;
  flex-direction: column;
  gap: 16px;
  width: 250px;
  min-width: 250px;
}

.dtkv-news-sidebar__card {
  overflow: hidden;
  width: 100%;
  background: var(--dtkv-surface, #ffffff);
  border: 1px solid var(--dtkv-line, #e8e4de);
  border-radius: 12px;
  box-shadow: none;
}

.dtkv-news-sidebar__head {
  padding: 18px 20px 16px;
  background: var(--dtkv-surface, #ffffff);
  border-bottom: 1px solid var(--dtkv-line, #e8e4de);
}

.dtkv-news-sidebar__title {
  margin: 0;
  color: var(--dtkv-text, #1f1f1f);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}

.dtkv-news-sidebar__body {
  padding: 14px 16px 16px;
}

.dtkv-news-categories {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0;
  padding: 0;
}

.dtkv-news-categories__item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 0 18px;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--dtkv-line, #e8e4de);
  border-radius: 0;
  color: var(--dtkv-text, #1f1f1f);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.25;
  text-decoration: none;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.dtkv-news-categories__item:first-child {
  border-top: 0;
}

.dtkv-news-categories__item:hover:not(.is-active) {
  background: #fafaf9;
  color: var(--dtkv-text, #1f1f1f);
}

.dtkv-news-categories__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: var(--dtkv-secondary, #4a4a4a);
  opacity: 0.78;
}

.dtkv-news-categories__icon svg {
  display: block;
  width: 22px;
  height: 22px;
}

.dtkv-news-categories__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dtkv-news-categories__count {
  min-width: 22px;
  color: var(--dtkv-secondary, #4a4a4a);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  text-align: right;
  font-variant-numeric: tabular-nums;
  opacity: 0.78;
}

.dtkv-news-categories__item.is-active {
  width: auto;
  min-height: 52px;
  margin: 8px 10px;
  padding: 0 16px;
  background: var(--dtkv-primary, #a9936f);
  border: 0;
  border-radius: 8px;
  color: #ffffff;
}

.dtkv-news-categories__item.is-active:hover,
.dtkv-news-categories__item.is-active:focus-visible {
  background: var(--dtkv-accent, #8a7554);
  color: #ffffff;
}

.dtkv-news-categories__item.is-active .dtkv-news-categories__icon,
.dtkv-news-categories__item.is-active .dtkv-news-categories__count {
  color: #ffffff;
  opacity: 1;
}

.dtkv-news-sidebar-select {
  height: 46px;
  padding: 0 42px 0 14px;
  cursor: pointer;
}

.dtkv-news-sidebar-select:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.dtkv-news-sidebar__reset {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 8px;
  margin: 0 4px;
  color: var(--dtkv-secondary, #4a4a4a);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  transition: color 0.18s ease;
}

.dtkv-news-sidebar__reset:hover {
  color: var(--dtkv-primary, #a9936f);
}

.dtkv-news-sidebar__reset:focus-visible {
  outline: 2px solid var(--dtkv-primary, #a9936f);
  outline-offset: 3px;
}

.dtkv-news-sidebar__reset svg {
  width: 17px;
  height: 17px;
}

/* ==========================================================
   META-ZEILE IM LOOP ITEM
   ========================================================== */

.dtkv-news-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  color: var(--dtkv-primary, #a9936f);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.dtkv-news-meta__separator {
  opacity: 0.55;
}

/* ==========================================================
   LOOP-KARTEN – SICHERE GRUNDREGELN
   ========================================================== */

.dtkv-news-title,
.dtkv-news-excerpt {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
}

.dtkv-news-title {
  -webkit-line-clamp: 3;
}

.dtkv-news-excerpt {
  -webkit-line-clamp: 3;
}

.dtkv-news-image-wrap {
  overflow: hidden;
}

.dtkv-news-image-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==========================================================
   MOBILER FILTER
   ========================================================== */

button.dtkv-news-filter-toggle {
  display: none;
}

@media (max-width: 700px) {
  .dtkv-news-filter {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .dtkv-news-filter__search-input,
  .dtkv-news-filter__search-button,
  .dtkv-news-filter__sort-select {
    height: 46px;
  }

  .dtkv-news-filter__search-button {
    width: 46px;
  }

  .dtkv-news-results-count {
    margin-top: 9px;
    font-size: 13px;
  }

  .dtkv-news-sidebar {
    width: 100%;
    min-width: 0;
    flex-basis: auto;
  }

  .dtkv-news-sidebar__head {
    padding: 16px 18px 14px;
  }

  .dtkv-news-sidebar__title {
    font-size: 17px;
  }

  .dtkv-news-categories__item {
    grid-template-columns: 20px minmax(0, 1fr) auto;
    gap: 12px;
    min-height: 52px;
    padding: 0 16px;
    font-size: 14px;
  }

  .dtkv-news-categories__icon,
  .dtkv-news-categories__icon svg {
    width: 20px;
    height: 20px;
  }

  .dtkv-news-categories__count {
    font-size: 14px;
  }

  .dtkv-news-categories__item.is-active {
    margin: 8px;
  }

  .dtkv-news-card {
    height: auto;
    min-height: 0;
  }

  .dtkv-news-image-wrap {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .dtkv-news-content {
    padding: 18px;
  }

  .dtkv-news-title,
  .dtkv-news-excerpt {
    -webkit-line-clamp: 2 !important;
  }

  .dtkv-news-arrow {
    align-self: flex-end;
    margin-top: 12px;
  }

  button.dtkv-news-filter-toggle {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px !important;
    width: 100% !important;
    min-height: 50px !important;
    margin: 0 !important;
    padding: 0 16px !important;
    background: #ffffff !important;
    border: 1px solid var(--dtkv-border-strong, #d8d0c4) !important;
    border-radius: 10px !important;
    color: var(--dtkv-text, #1f1f1f) !important;
    font-family: inherit !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    text-align: left !important;
    text-transform: none !important;
    cursor: pointer;
    box-shadow: none !important;
  }

  button.dtkv-news-filter-toggle:hover,
  button.dtkv-news-filter-toggle:focus,
  button.dtkv-news-filter-toggle:active {
    background: var(--dtkv-primary-soft, #f3efe8) !important;
    border-color: var(--dtkv-primary, #a9936f) !important;
    color: var(--dtkv-text, #1f1f1f) !important;
  }

  button.dtkv-news-filter-toggle:focus-visible {
    outline: 2px solid var(--dtkv-primary, #a9936f);
    outline-offset: 2px;
  }

  .dtkv-news-filter-toggle__icon {
    display: block;
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s ease;
  }

  #dtkv-news-mobile-filters.dtkv-news-mobile-filters {
    display: none !important;
  }

  #dtkv-news-mobile-filters.dtkv-news-mobile-filters.is-open {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    padding-top: 20px;
  }

  button.dtkv-news-filter-toggle[aria-expanded="true"] .dtkv-news-filter-toggle__icon {
    transform: rotate(225deg) translate(-2px, -2px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dtkv-news-loop,
  .dtkv-news-sidebar,
  .dtkv-news-filter__search-button svg {
    transition: none;
    animation: none;
  }
}

/* ==========================================================
   SIDEBAR – TYPOGRAFIE UND ICON-HOVER ANGLEICHEN
   ========================================================== */

/* Globale H2-/Elementor-Regeln zuverlässig überschreiben. */
.dtkv-news-sidebar .dtkv-news-sidebar__title {
  margin: 0 !important;
  color: var(--dtkv-text, #1f1f1f) !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
}

/* Themenbezeichnungen analog zur Download-Sidebar etwas kräftiger. */
.dtkv-news-sidebar .dtkv-news-categories__item,
.dtkv-news-sidebar .dtkv-news-categories__label {
  font-weight: 500;
}

/* Ruhiger Farbwechsel der Icons. */
.dtkv-news-sidebar .dtkv-news-categories__icon {
  transition: color 0.18s ease, opacity 0.18s ease;
}

/* Inaktive Icons werden beim Hover gold. */
.dtkv-news-sidebar .dtkv-news-categories__item:hover:not(.is-active)
.dtkv-news-categories__icon {
  color: var(--dtkv-primary, #a9936f) !important;
  opacity: 1 !important;
}

/* Im aktiven Zustand bleiben Icon und Text weiss. */
.dtkv-news-sidebar .dtkv-news-categories__item.is-active
.dtkv-news-categories__icon,
.dtkv-news-sidebar .dtkv-news-categories__item.is-active:hover
.dtkv-news-categories__icon {
  color: #ffffff !important;
  opacity: 1 !important;
}

@media (max-width: 700px) {
  .dtkv-news-sidebar .dtkv-news-sidebar__title {
    font-size: 17px !important;
  }
}

/* ==========================================================
   GLOBALE ELEMENTOR-SEITENNUMMERIERUNG
   ========================================================== */

:is(.elementor-pagination, .e-loop__pagination) {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 32px 0 0;
  padding: 0;
}


/* Grundstil aller Elemente */

:is(.elementor-pagination, .e-loop__pagination) .page-numbers {
  position: relative;
  isolation: isolate;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 42px;
  height: 42px;
  margin: 0 !important;
  padding: 0 11px;

  background: transparent !important;
  border: 0 !important;
  border-radius: 8px;

  color: var(--dtkv-secondary, #4a4a4a) !important;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none !important;

  transition:
    color 0.18s ease,
    transform 0.18s ease;
}


/* ==========================================================
   SEITENZAHLEN ALS SECHSECKE
   ========================================================== */

:is(.elementor-pagination, .e-loop__pagination)
.page-numbers:not(.prev):not(.next):not(.dots) {
  width: 48px;
  min-width: 46px;
  height: 42px;
  padding: 0;

  border-radius: 0;
}


/* Äußere goldene Sechseck-Kontur */

:is(.elementor-pagination, .e-loop__pagination)
.page-numbers:not(.prev):not(.next):not(.dots)::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 0;

  background: var(--dtkv-primary, #a9936f);

  clip-path: polygon(
    24% 0,
    76% 0,
    100% 50%,
    76% 100%,
    24% 100%,
    0 50%
  );

  transition:
    background-color 0.18s ease,
    transform 0.18s ease;
}


/* Weiße Innenfläche */

:is(.elementor-pagination, .e-loop__pagination)
.page-numbers:not(.prev):not(.next):not(.dots)::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 1.5px;

  background: var(--dtkv-surface, #ffffff);

  clip-path: polygon(
    24% 0,
    76% 0,
    100% 50%,
    76% 100%,
    24% 100%,
    0 50%
  );

  transition: background-color 0.18s ease;
}


/* Hover */

:is(.elementor-pagination, .e-loop__pagination)
a.page-numbers:not(.prev):not(.next):not(.dots):hover {
  color: var(--dtkv-primary, #a9936f) !important;
  transform: translateY(-1px);
}

:is(.elementor-pagination, .e-loop__pagination)
a.page-numbers:not(.prev):not(.next):not(.dots):hover::after {
  background: var(--dtkv-primary-soft, #f3efe8);
}


/* Aktive Seite */

:is(.elementor-pagination, .e-loop__pagination)
.page-numbers.current {
  color: #ffffff !important;
  cursor: default;
}

:is(.elementor-pagination, .e-loop__pagination)
.page-numbers.current::before,
:is(.elementor-pagination, .e-loop__pagination)
.page-numbers.current::after {
  background: var(--dtkv-primary, #a9936f) !important;
}


/* Vorherige und nächste Seite */

:is(.elementor-pagination, .e-loop__pagination)
.page-numbers.prev,
:is(.elementor-pagination, .e-loop__pagination)
.page-numbers.next {
  min-width: 42px;
  padding: 0 10px;

  background: var(--dtkv-surface, #ffffff) !important;
  border: 1px solid var(--dtkv-line, #e8e4de) !important;
  color: var(--dtkv-primary, #a9936f) !important;
  font-size: 20px;
}

:is(.elementor-pagination, .e-loop__pagination)
.page-numbers.prev:hover,
:is(.elementor-pagination, .e-loop__pagination)
.page-numbers.next:hover {
  background: var(--dtkv-primary-soft, #f3efe8) !important;
  border-color: var(--dtkv-primary, #a9936f) !important;
  transform: translateY(-1px);
}


/* Auslassungspunkte */

:is(.elementor-pagination, .e-loop__pagination)
.page-numbers.dots {
  min-width: 26px;
  padding: 0;

  background: transparent !important;
  color: var(--dtkv-secondary, #4a4a4a) !important;
}


/* Tastaturfokus */

:is(.elementor-pagination, .e-loop__pagination)
.page-numbers:focus-visible {
  outline: 2px solid var(--dtkv-primary, #a9936f);
  outline-offset: 4px;
}


/* ==========================================================
   MOBILE
   ========================================================== */

@media (max-width: 700px) {
  :is(.elementor-pagination, .e-loop__pagination) {
    gap: 5px;
    margin-top: 24px;
  }

  :is(.elementor-pagination, .e-loop__pagination)
  .page-numbers:not(.prev):not(.next):not(.dots) {
    width: 48px;
    min-width: 44px;
    height: 40px;
  }

  :is(.elementor-pagination, .e-loop__pagination)
  .page-numbers.prev,
  :is(.elementor-pagination, .e-loop__pagination)
  .page-numbers.next {
    min-width: 40px;
    height: 40px;
  }
}