/* ===========================================================
   news.html ＋ news/<slug>/index.html 共用スタイル
   規格：implementation-plan.md 第 4 節 2-1／redesign-proposal の頁首帯＋白カード。
   ・色は tokens.css の語意層／既存の実測パレット（--title-ink・--ink-dark・
     --ink-brown・--link-ink など）だけを使う。生の色値は書かない。
   ・.band / .panel / .stitle / .pill / .divider / .reveal / .lift は
     site.css の共通コンポーネントをそのまま使い、ここでは news 固有の
     見た目（年 chips・カード・展開本文・独立ページの記事枠）だけを足す。
   ・.disco-tabs / .disco-tab（discography.css）と同じ考え方で年 chips を
     作っている（.news-chips / .news-chip）。
   =========================================================== */

.news-panel {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

/* ---------- 年チップ（ALL + 年ごと。選択状態は URL hash #y2025 に連動） ---------- */
.news-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: var(--tile-bg);
  border-radius: var(--r-pill);
  padding: 6px;
  align-self: flex-start;
}
.news-chip {
  height: 34px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  color: var(--title-ink);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.news-chip.is-active {
  background: var(--btn-bg);
  color: var(--btn-ink);
  font-family: var(--font-btn);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .06em;
}
.news-chip:hover:not(.is-active) { color: var(--link-ink-hover); }

/* ---------- 一覧 ---------- */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.news-item {
  background: var(--tile-bg);
  border-radius: var(--r-box);
  overflow: hidden;
}
/* hash によるタブ絞り込みで隠す。[hidden] は UA スタイルシート由来で
   優先度が低く、.news-item に background 等の宣言があると負けて見え続ける
   ことがあるため明示的に上書きする（disco-tile と同じ理由）。 */
.news-item[hidden] { display: none; }

.news-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 26px;
  cursor: pointer;
}
.news-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.news-date {
  font-size: 14px;
  font-weight: 700;
  color: var(--title-ink);
  letter-spacing: .02em;
}
.news-list h2, .news-article-head h2 {
  font-size: 19px;
  font-weight: 700;
  color: var(--ink-dark);
  line-height: 1.5;
  letter-spacing: .01em;
}
.news-excerpt {
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-brown);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.news-more {
  flex: none;
  font-family: var(--font-btn);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--title-ink);
  white-space: nowrap;
}
.news-item.is-open .news-more { color: var(--ink-dark); }
/* 展開時：摘要が本文冒頭と同じ文なら重複するので消す（一覧の折りたたみ表示は変えない）。
   news.html の excerptIsBodyLead() が付ける .is-dup と対になる。 */
.news-item.is-open .news-excerpt.is-dup { display: none; }

.news-body { padding: 0 26px 24px; }
.news-body .article-body { border-top: 1px dashed var(--divider); padding-top: 18px; }

.news-empty {
  text-align: center;
  font-size: 14px;
  color: var(--ink-on-bg);
  padding: 24px 0 4px;
}

/* ---------- 展開本文・独立ページ記事：共通の Markdown 出力スタイル ----------
   js/site.js の berryMd（クライアント側）と tools/build_news_pages.py の
   berry_md（ビルド時・独立ページ用）は同じ規則で HTML を組むので、
   出力クラス（article-body / article-img / article-link）も共通にしてある。 */
.article-body {
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink-dark);
  white-space: pre-wrap;
  word-break: break-word;
}
.article-body p { margin: 0 0 1.6em; }
.article-body p:last-child { margin-bottom: 0; }
.article-body ul, .article-body ol { margin: 0 0 1.6em; padding-left: 1.6em; }
.article-body ul:last-child, .article-body ol:last-child { margin-bottom: 0; }
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body li { margin: 0; }
.article-body li::marker { color: var(--pink-line); }
.article-body strong { font-weight: 700; }
.article-body a { color: var(--link-ink); }
.article-img { margin: 18px 0 0; }
.article-img img {
  display: block;
  max-width: min(100%, 560px);
  width: 100%;
  height: auto;
  border-radius: var(--r-sm);
}
.article-link { margin-top: 10px; word-break: break-all; }
.article-link a { color: var(--link-ink); }

/* ---------- 独立ページ（news/<slug>/index.html）の記事枠 ---------- */
.news-article {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.news-article-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
}
.news-article-head .news-date { text-align: center; }
.news-article-foot {
  display: flex;
  justify-content: center;
  padding-top: 8px;
}

@media (max-width: 600px) {
  .news-head { padding: 18px 18px; }
  .news-body { padding: 0 18px 20px; }
  .news-article-head h2 { font-size: 18px; }
  /* スマホは幅に余裕が無いので 560px 上限を外して画面幅いっぱいに広げる */
  .article-img img { max-width: 100%; }
}

