/* Фильтр статей по году и фамилии + бейджи новых публикаций (29.09.2026)
   Разметка: modules/mod_article_filter.php, логика: js/article_filter.js */

[hidden],
.is-hidden {
  display: none !important;
}

/* -------- ПАНЕЛЬ -------- */
.art-filter {
  margin: 0 0 22px;
  padding: 14px 16px 6px;
  background: #fff;
  border: 1px solid #dfe3e8;
  border-top: 3px solid #f90;
  font-family: 'Roboto', sans-serif;
  color: #1b3658;
}

.art-filter__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-bottom: 10px;
}

.art-filter__title {
  font-family: 'Oswald', sans-serif;
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: .02em;
}

.art-filter__search {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 240px;
  max-width: 340px;
  padding: 0 10px;
  border: 1px solid #cfd6de;
  color: #8a94a0;
}

.art-filter__search:focus-within {
  border-color: #f90;
}

.art-filter__search input {
  flex: 1;
  min-width: 0;
  height: 34px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
  color: #1b3658;
}

.art-filter__count {
  font-size: 14px;
  color: #54595d;
}

.art-filter__count b {
  color: #1b3658;
}

.art-filter__reset {
  font-size: 14px;
  color: #f90 !important;
  text-decoration: underline;
}

.art-filter__row {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid #eef0f3;
}

.art-filter__label {
  flex: 0 0 72px;
  padding-top: 5px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: #8a94a0;
}

.art-filter__years {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}

.art-filter__decade {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.art-filter__dec {
  margin-right: 2px;
  font-size: 12px;
  color: #8a94a0;
}

/* -------- ЧИПЫ -------- */
.af-chip,
.af-letter {
  display: inline-block;
  border: 1px solid #cfd6de;
  background: #fff;
  color: #1b3658 !important;
  font-size: 14px;
  line-height: 1;
  text-decoration: none !important;
  transition: border-color .15s, background .15s;
}

.af-chip {
  padding: 6px 8px;
}

.af-letter {
  min-width: 30px;
  padding: 7px 4px;
  text-align: center;
  font-weight: 700;
}

.art-filter__letters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.af-chip:hover,
.af-letter:hover {
  border-color: #f90;
}

.af-chip.is-active,
.af-letter.is-active {
  background: #1b3658;
  border-color: #1b3658;
  color: #fff !important;
}

/* нет статей при текущем выборе - приглушаем, но оставляем кликабельным */
.af-chip.is-off:not(.is-active) {
  opacity: .35;
}

/* фамилия есть в найденных статьях */
.af-chip.is-hit {
  border-color: #f90;
  background: #fff4e0;
  box-shadow: inset 3px 0 0 #f90;
  font-weight: 500;
}

.af-chip.is-hit:hover {
  background: #ffe8bf;
}

/* выбранная персона: синяя плашка с оранжевой чертой снизу */
.af-person.is-active {
  box-shadow: inset 0 -3px 0 #f90;
  font-weight: 500;
}

/* буква, на которую есть фамилии из найденных статей */
.af-letter {
  position: relative;
}

.af-letter.has-hit:not(.is-active) {
  border-color: #f90;
  background: #fff4e0;
}

.af-letter.has-hit::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50% !important;
  background: #f90;
}

.af-letter.is-off:not(.is-active) {
  opacity: .35;
}

/* год выбран без буквы - подпись над списком фамилий */
.art-filter__persons.is-year-list::before {
  content: 'В статьях этого года:';
  flex-basis: 100%;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: #8a94a0;
}

.af-person small {
  margin-left: 3px;
  font-size: 11px;
  color: #8a94a0;
}

.af-person.is-active small {
  color: #cfd6de;
}

.art-filter__persons {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0 0 8px 84px;
  padding-top: 4px;
}

.art-filter__none {
  font-size: 14px;
  color: #8a94a0;
}

/* -------- РЕЗУЛЬТАТЫ НА /articles -------- */
.af-results {
  margin-bottom: 10px;
}

.panda-category__product--top .af-results .panda__articles-excerpt .panda__articles-desc {
  padding: 0;
  font-size: inherit;
  color: inherit;
}

/* -------- БЕЙДЖИ НОВЫХ -------- */
.cat-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border-radius: 13px !important;
  background: yellowgreen;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 26px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}

.art-new-flag {
  position: absolute;
  top: 8px;
  left: 0;
  z-index: 2;
  padding: 4px 8px;
  background: yellowgreen;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* -------- МОБИЛЬНЫЙ -------- */
@media (max-width: 767px) {
  .art-filter {
    padding: 12px 12px 4px;
  }

  .art-filter__search {
    max-width: none;
    flex-basis: 100%;
    order: 3;
  }

  .art-filter__search input {
    font-size: 16px; /* iOS не зумит поле */
  }

  .art-filter__row {
    flex-direction: column;
    gap: 6px;
  }

  .art-filter__label {
    flex: none;
    padding: 0;
  }

  .art-filter__persons {
    margin-left: 0;
  }

  .art-filter__years {
    gap: 6px;
  }
}
