/* 記事一覧・詳細。既存テーマ（Unify）の上に最小限だけ足す */

/* テーマの custom.css に要素セレクタでの指定がある。
     h1 { position: absolute; top: -20rem; font-size: 1rem; }
   これは SEO 用に layout が出す h1（「タイトル | サイト名」）を画面外へ
   飛ばすためのものだが、**ページ内のどの h1 にも効く**。
   記事の見出しはその巻き添えで上へずれるので、ここで打ち消す。
   テーマ側の h1 指定は他ページが依存しているため触らない。 */
.news-detail-title,
.news-list-heading {
  position: static;
  top: auto;
  left: auto;
}

/* ---------- 一覧 ---------- */
.news-list-heading {
  font-size: 24px;
  margin: 0;
}

.news-list-items {
  margin: 0 0 30px;
}

.news-list-item {
  border-bottom: 1px solid #eee;
}

.news-list-link {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 4px;
  color: inherit;
  text-decoration: none;
}

.news-list-link:hover,
.news-list-link:focus {
  background: #fafafa;
  color: inherit;
  text-decoration: none;
}

.news-list-thumb {
  flex: 0 0 140px;
}

.news-list-thumb img {
  width: 140px;
  height: 92px;
  object-fit: cover;
  border: 1px solid #eee;
}

.news-list-body {
  flex: 1 1 auto;
  min-width: 0;
}

.news-list-meta {
  display: block;
  font-size: 12px;
  color: #999;
  margin-bottom: 4px;
}

.news-list-category {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  background: #f0f0f0;
  border-radius: 2px;
  font-size: 11px;
  color: #666;
}

.news-list-title {
  display: block;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 6px;
}

.news-list-link:hover .news-list-title {
  text-decoration: underline;
}

.news-list-excerpt {
  display: block;
  font-size: 13px;
  color: #777;
  line-height: 1.7;
}

/* カテゴリ。テーマ側が右サイドバー（col-md-4）を別に出すため、
   こちらは本文カラムの中に横並びのチップとして置く。 */
.news-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 24px;
  padding: 0;
}

.news-categories li {
  margin: 0;
}

.news-categories a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid #e2e2e2;
  border-radius: 14px;
  color: #666;
  font-size: 13px;
  line-height: 1.6;
  text-decoration: none;
  white-space: nowrap;
}

.news-categories a:hover {
  background: #fafafa;
  border-color: #ccc;
  color: #333;
  text-decoration: none;
}

.news-categories li.active a {
  background: #f0f0f0;
  border-color: #ccc;
  color: #333;
  font-weight: 600;
}

.news-categories-count {
  color: #aaa;
  font-size: 11px;
}

/* ---------- 詳細 ---------- */
.news-detail-breadcrumb {
  font-size: 12px;
  color: #999;
  margin-bottom: 10px;
}

.news-detail-title {
  font-size: 26px;
  line-height: 1.5;
  margin: 0 0 12px;
}

.news-detail-date {
  font-size: 13px;
  color: #999;
  margin-bottom: 22px;
}

.news-detail-eyecatch {
  margin-bottom: 24px;
}

.news-detail-eyecatch img {
  max-width: 100%;
  height: auto;
}

/* 取り込んだ WordPress 記事は、当時のテーマ幅を前提に width/height が
   直接指定されている。はみ出さないよう上書きする。 */
.news-detail-body {
  font-size: 15px;
  line-height: 1.9;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.news-detail-body img {
  max-width: 100%;
  height: auto;
}

.news-detail-body p {
  margin-bottom: 1.4em;
}

.news-detail-body h1,
.news-detail-body h2,
.news-detail-body h3,
.news-detail-body h4,
.news-detail-body h5 {
  margin: 1.8em 0 0.8em;
  line-height: 1.5;
}

.news-detail-body h2 {
  font-size: 21px;
  border-bottom: 2px solid #eee;
  padding-bottom: 8px;
}

.news-detail-body h3 {
  font-size: 18px;
}

.news-detail-body ul,
.news-detail-body ol {
  margin: 0 0 1.4em 1.6em;
}

.news-detail-body li {
  margin-bottom: 0.4em;
}

.news-detail-body blockquote {
  border-left: 4px solid #eee;
  padding: 6px 0 6px 16px;
  color: #777;
  margin: 0 0 1.4em;
}

/* 表も当時の固定幅が入っているため、横スクロールで逃がす */
.news-detail-body table {
  max-width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.4em;
}

.news-detail-body th,
.news-detail-body td {
  border: 1px solid #ddd;
  padding: 8px 10px;
}

.news-detail-action {
  margin: 30px 0;
}

.news-detail-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
  padding: 16px 0;
  margin: 30px 0;
  font-size: 13px;
}

.news-detail-nav .next {
  margin-left: auto;
  text-align: right;
}

.news-related li {
  border-bottom: 1px solid #f2f2f2;
}

.news-related a {
  display: block;
  padding: 10px 2px;
  color: #555;
  text-decoration: none;
  font-size: 14px;
}

.news-related a:hover {
  background: #fafafa;
}

.news-related-date {
  display: inline-block;
  width: 84px;
  color: #aaa;
  font-size: 12px;
}

.news-detail-back {
  margin: 24px 0 0;
}

@media (max-width: 640px) {
  .news-list-link {
    gap: 12px;
  }

  .news-list-thumb {
    flex-basis: 96px;
  }

  .news-list-thumb img {
    width: 96px;
    height: 64px;
  }

  .news-detail-title {
    font-size: 20px;
  }

  .news-related-date {
    display: block;
    width: auto;
  }
}
