/* ==========================================================
   Список новостей #index_news
   Разметка карточки:
   <p><b>дата</b><span.newstype/><a.newslink/><span.anons/></p>
   ========================================================== */

#index_news {
  --news-accent: #B08A3C;       /* бренд, для декоративных элементов и hover крупного текста */
  --news-accent-text: #7a5a14;  /* тот же оттенок, но с контрастом ~6:1 для мелкого текста */
  /*--news-text: #222;*/
  --news-text: #314152;
  --news-muted: #5c5c5c;
  --news-line: #e4e4e4;
}

/* ---------- Карточка ---------- */
#index_news .text p:has(.newstype) {
  position: relative;            /* нужно для кликабельной области всей карточки */
  display: grid;
  grid-template-columns: max-content 1fr;
  align-items: center;
  column-gap: 30px;
  margin: 0;
  padding: 50px 0;
  border-bottom: 1px solid var(--news-line);
}
#index_news .text p:has(.newstype)[hidden] {
  display: none;
}
#index_news .text p:has(.newstype).is-last { border-bottom: none; }

/* ---------- Дата ---------- */
#index_news .text p:has(.newstype) > b {
  font-size: 0.875rem;           /* 14px */
  font-weight: 500;
  color: var(--news-muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- Тег ---------- */
/* контейнер для одного или нескольких тегов */
.newstags {
  justify-self: start;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.newstype {
  justify-self: start;
  display: inline-block;
  min-width: 120px;
  margin: 0;
  padding: 2px 15px;
  font-size: 0.75rem;            /* 12px */
  font-weight: 550;
  line-height: 1.5;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  color: var(--news-muted, #5c5c5c);
  border: 1px solid #c9c9c9;
  border-radius: 20px;
  background: transparent;
}
/* «Новый сервис» чуть заметнее остальных */
.newstype[data-type="новый сервис"]/*, #index_news .news-filter button[data-type="новый сервис"]*/ {
  /*color: var(--news-accent-text, #7a5a14);*/
  color: var(--news-accent, #B08A3C);
  border-color: var(--news-accent, #B08A3C);
  background: rgba(176, 138, 60, .08);
}
.newstype[data-type="кейс"]/*, #index_news .news-filter button[data-type="кейс"]*/ {
  color: rgba(37, 122, 13, 1);
  border-color: rgba(37, 122, 13, 1);
  background: rgba(37, 122, 13, .08);
}
.newstype[data-type="экспертиза"]/*, #index_news .news-filter button[data-type="экспертиза"]*/ {
  color: #d84547;
  border-color: #d84547;
  background: rgba(216, 69, 71, .08);
}

/*#index_news .news-filter button[data-type="экспертиза"][aria-pressed="true"] {
  border-color: rgba(216, 69, 71, 1);
  background: rgba(216, 69, 71, 1);
}*/

/* ---------- Заголовок ---------- */
#index_news .text a.newslink {
  grid-column: 1 / -1;
  display: block;
  margin: 14px 0 12px;
  font-size: 1.5rem;             /* 24px */
  font-weight: 600;              /* 550 работает только с variable-шрифтом */
  line-height: 1.3;
  /*text-wrap: balance;*/
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  color: var(--news-text);
  transition: color .2s ease, text-decoration-color .2s ease;
}
/* вся карточка кликабельна, в разметке остаётся одна ссылка */
#index_news .text a.newslink::after {
  content: "";
  position: absolute;
  inset: 0;
}
#index_news .text p:has(.newstype):hover a.newslink,
#index_news .text a.newslink:focus-visible {
  color: var(--news-accent);
  text-decoration-color: currentColor;
}
/* фокус рисуем вокруг всей карточки */
#index_news .text a.newslink:focus-visible {
  outline: none;
}
#index_news .text p:has(> a.newslink:focus-visible) {
  outline: 2px solid var(--news-accent);
  outline-offset: 4px;
  border-radius: 4px;
}

/* ---------- Описание ---------- */
#index_news .text .anons {
  grid-column: 1 / -1;
  display: block;
  max-width: 75ch;
  font-size: 0.9375rem;          /* 15px */
  line-height: 1.6;
  color: #555;
}

/* ---------- Фильтр ---------- */
#index_news .news-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 8px;
  padding: 0;
}
#index_news .news-filter button,
#index_news .news-more button {
  /*min-height: 40px;*/
  /*padding: 6px 18px 5px;*/
  padding: 3px 15px 2px;
  line-height: 1.5;
  font: inherit;
  font-size: 0.8125rem;          /* 13px */
  font-weight: 550;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--news-muted);
  background: transparent;
  border: 1px solid #c9c9c9;
  border-radius: 20px;
  cursor: pointer;
  transition: color .2s ease, background-color .2s ease, border-color .2s ease;
}
#index_news .news-filter button:hover,
#index_news .news-more button:hover {
  color: var(--news-text);
  border-color: var(--news-text);
}
#index_news .news-filter button[aria-pressed="true"] {
  color: #fff;
  background: var(--news-text);
  border-color: var(--news-text);
}
#index_news .news-filter button:focus-visible,
#index_news .news-more button:focus-visible {
  outline: 2px solid var(--news-accent);
  outline-offset: 3px;
}
#index_news .news-filter .count {
  margin-left: 10px;
  font-weight: 500;
  opacity: .4;
  font-variant-numeric: tabular-nums;
}

#index_news .news-status {
  margin: 0 0 4px;
  font-size: 0.8125rem;
  /*color: var(--news-muted);*/
  color: #999;
}

/* ---------- «Показать ещё» ---------- */
#index_news .news-more {
  display: flex;
  justify-content: center;
  padding: 36px 0 8px;
}
#index_news .news-more[hidden] {
  display: none;
}
#index_news .news-more button {
  min-width: 220px;
}

.morecount { opacity: 0.4; margin-left: 5px; }

/* ---------- Мобильная версия ---------- */
@media (max-width: 600px) {
  #index_news .text p:has(.newstype) {
    column-gap: 16px;
    padding: 36px 0;
  }
  .newstype {
    min-width: 0;
  }
  #index_news .text a.newslink {
    font-size: 1.25rem;          /* 20px */
  }
  #index_news .news-more button {
    width: 100%;
  }
}

/* ---------- Без анимаций, если пользователь так настроил систему ---------- */
/*@media (prefers-reduced-motion: reduce) {
  #index_news .text a.newslink,
  #index_news .news-filter button,
  #index_news .news-more button {
    transition: none;
  }
}*/
