/* =====================================================================
   news-list-filter — 追加スタイル
   （既存 style.css の末尾に追記、または別ファイルで読み込み）
   既存の .news-list / .news-item / .news-row などはそのまま利用します。
   ===================================================================== */

/* ---------- カテゴリ絞り込みバー ------------------------------------- */
.news-filter-bar {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 22px;
}
.news-filter {
  appearance: none; cursor: pointer; background: transparent;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 18px;
  font-family: inherit; font-size: 13px; font-weight: 600;
  letter-spacing: .04em; color: var(--ink-dim);
  transition: background .18s, color .18s, border-color .18s;
}
html[lang="ja"] .news-filter { letter-spacing: .06em; }
.news-filter:hover { border-color: var(--accent); color: var(--ink); }
.news-filter.is-active {
  background: var(--accent); border-color: var(--accent);
  color: var(--accent-ink); pointer-events: none;
}

/* ---------- カテゴリラベルとタイトルの重なり防止 --------------------- */
/* 既存 style.css の .news-cat は固定幅のため、長いカテゴリ名がはみ出して
   タイトルに重なる。幅は「最小幅」として扱い、中身に応じて伸ばす。   */
.news-filtered .news-row {
  display: flex; align-items: center; gap: 20px;
}
.news-filtered .news-date { flex: 0 0 auto; }
.news-filtered .news-cat {
  flex: 0 0 auto;
  width: auto;            /* 固定幅の解除 */
  min-width: 150px;       /* 列としての揃えは維持 */
  max-width: 260px;
  box-sizing: border-box;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.news-filtered .news-title {
  flex: 1 1 auto; min-width: 0;
}
.news-filtered .news-chev { flex: 0 0 auto; }

@media (max-width: 620px) {
  /* 日付・カテゴリ・タイトルを縦並びに */
  .news-filtered .news-row {
    flex-wrap: wrap;
    gap: 6px 10px;
    align-items: flex-start;
  }
  .news-filtered .news-date { flex: 0 0 100%; }
  .news-filtered .news-cat {
    flex: 0 0 auto;
    min-width: 0; max-width: 100%;
    white-space: normal; overflow: visible; text-overflow: clip;
  }
  .news-filtered .news-title { flex: 0 0 100%; }
  .news-filtered .news-row .news-chev {
    position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  }
  .news-filtered .news-item { position: relative; }
}

/* ---------- 年アコーディオン（去年以前） ---------------------------- */
.news-archive { border-top: 1px solid var(--line); }
.news-year { border-bottom: 1px solid var(--line); }
.news-year-head {
  width: 100%; appearance: none; background: var(--accent-soft); border: 0; cursor: pointer;
  display: flex; align-items: center; gap: 16px;
  padding: 24px 8px; text-align: left; color: inherit;
  transition: background .2s, padding-left .2s;
}
/* 西暦行はオンマウスで色を変えない（常に article のホバー色） */
.news-year-head:hover { background: var(--accent-soft); padding-left: 8px; }

/* 過去の西暦行は上下の余白を少し広く */
.news-year.is-past > .news-year-head { padding-top: 34px; padding-bottom: 34px; }
.news-year-label {
  font-size: 20px; font-weight: 700; color: var(--accent);
  letter-spacing: .04em; font-variant-numeric: tabular-nums;
}
.news-year-count { font-size: 13px; color: var(--ink-faint); letter-spacing: .05em; }
.news-year-head .news-chev {
  margin-left: auto; color: var(--ink-faint); width: 16px; height: 16px;
  transition: transform .28s cubic-bezier(.3,.7,.4,1);
}
.news-year.open .news-year-head .news-chev { transform: rotate(90deg); color: var(--accent); }

.news-year-body {
  overflow: hidden; max-height: 0;
  transition: max-height .5s cubic-bezier(.3,.7,.4,1);
}
.news-year.open .news-year-body { max-height: 20000px; }
/* 年内リストは上ボーダーを重ねない */
.news-year-body .news-list { border-top: 0; }
.news-year-body .news-item:last-child { border-bottom: 0; }

/* 絞り込みで隠れた項目・空の年 */
.news-item[hidden], .news-year[hidden] { display: none; }

.news-empty {
  padding: 40px 8px; color: var(--ink-faint);
  border-bottom: 1px solid var(--line); font-size: 15px;
}

@media (max-width: 620px) {
  .news-filter { padding: 7px 14px; font-size: 12.5px; }
  .news-year-head { padding: 20px 4px; gap: 12px; }
  .news-year-head:hover { padding-left: 4px; }
  .news-year.is-past > .news-year-head { padding-top: 28px; padding-bottom: 28px; }
  .news-year-label { font-size: 18px; }
}
