/* カテゴリフィルタ */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 12px;
  font-size: 0.85rem;
}
    
/* PCは今のまま（必要なら既存のままでOK） */

@media (max-width: 768px) {
  .filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;

    flex-wrap: nowrap;        /* 1行固定 */
    overflow-x: auto;         /* 横スクロール */
    -webkit-overflow-scrolling: touch;

    padding-bottom: 6px;      /* スクロール時の余白 */
  }

  .filter-label {
    flex: 0 0 auto;           /* 「ジャンル：」も縮まない */
    white-space: nowrap;
  }

  .filter-chip {
    flex: 0 0 auto;           /* チップが折り返さない */
    white-space: nowrap;
  }

  /* スクロールバー非表示（WebKit系） */
  .filter-bar::-webkit-scrollbar {
    display: none;
  }
}

.filter-label {
  font-weight: bold;
  margin-right: 4px;
  align-self: center;
}

.filter-chip {
  border-radius: 999px;
  padding: 4px 10px;
  border: 1px solid #ccc;
  background: #fff;
  cursor: pointer;
  user-select: none;
}

.filter-chip.active {
  background: #1976d2;
  color: #fff;
  border-color: #1976d2;
}

/* ★ 人気記事リンク */
.popular {
  background: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  font-size: 0.85rem;
}

.popular-title {
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.9rem;
}

.popular-title span {
  font-size: 0.9rem;
}

.popular-list {
  list-style: none;    /* ← これが本命 */
  margin: 0;
  padding-left: 0;     /* 自動番号を消すのでリセット */
}

.popular-list li{
  padding: 3px 0;      /* 6px→3px くらいに */
  line-height: 1.35;   /* 1.5→1.35 くらいに */
}

.popular-list a {
  text-decoration: none;
  border-bottom: 1px dashed #1976d2;
  font-size: 0.85rem;
}

.popular-rank {
  font-size: 0.8rem;
  color: #999;
  margin-right: 2px;
}

@media (max-width: 640px) {
  .popular-list li {
    white-space: normal;
  }
}

/* グリッドレイアウト */
.grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 12px;
}
@media (min-width: 900px){
  .grid{ grid-template-columns: 1fr; } /* 今は縦並びなら不要 */
}

@media (max-width: 640px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

/* カード */
.card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: row;       /* 横並びにする */
  align-items: stretch;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  border: 1px solid #e0e0e0;
  transition: background 0.12s ease-out, box-shadow 0.12s ease-out;
}

.card:hover {
  background: #fafafa;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.thumb {
  background: #eceff1;
  width: 96px;
  height: 96px;
  flex: 0 0 96px;           /* 左側に固定幅として配置 */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #666;
}

.thumb span {
  opacity: 0.9;
  text-align: center;
}

.thumb span {
  opacity: 0.9;
}

.card-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.card-meta {
  font-size: 0.75rem;
  color: #888;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.meta-sep {
  opacity: 0.4;
}

.category-badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: #e3f2fd;
  color: #1565c0;
  font-size: 0.7rem;
  font-weight: 600;
}

.new-badge {
  padding: 2px 6px;
  border-radius: 999px;
  background: #ffeb3b;
  color: #8d6e00;
  font-size: 0.7rem;
  font-weight: 600;
}

.card-excerpt {
  font-size: 0.85rem;
  color: #555;
  margin-top: 4px;
  flex: 1;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 0.8rem;
}

.source-label {
  color: #999;
}

.readmore {
  text-decoration: none;
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #1976d2;
  color: #1976d2;
  font-weight: 500;
  white-space: nowrap;
}

.readmore:hover {
  background: #1976d2;
  color: #fff;
}

/* ★フッター */
footer {
  margin-top: 24px;
  font-size: 0.8rem;
  color: #777;
  text-align: center;
  padding-top: 12px;
  border-top: 1px solid #ddd;
}

.footer-copy {
  color: #aaa;
  font-size: 0.75rem;
}

.muted {
  color: #aaa;
}

.card-title a {
  color: #111;              /* 黒寄り */
  text-decoration: none;    /* 下線を消す */
  font-weight: 600;
  line-height: 1.4;
  display: inline;
}

/* ホバー時だけ「リンクだよ」と分かる */
.card-title a:hover {
  color: #1a73e8;           /* Googleっぽい青 */
  text-decoration: underline;
}

/* 一覧をカードグリッドに */
.grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 12px;
}
@media (max-width: 980px){
  .grid{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px){
  .grid{ grid-template-columns: 1fr; }
}

/* 縦カード */
.card{
  display:flex;
  flex-direction: column;
  border-radius: 12px;
}

/* サムネ：16:9で上に */
.thumb{
  width: 100%;
  height: auto;
  flex: none;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid #eee;
}
.thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display:block;
}

/* フッターのボタンを右下に寄せても崩れにくく */
.card-footer{
  margin-top: 10px;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 24px 0 8px;
  flex-wrap: wrap;
}

.page-link {
  display: inline-block;
  min-width: 40px;
  padding: 8px 12px;
  text-align: center;
  text-decoration: none;
  border: 1px solid #d8d8d8;
  border-radius: 8px;
  background: #fff;
  color: #333;
  font-size: 14px;
  line-height: 1.2;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.page-link:hover {
  background: #f5f5f5;
}

.page-link.is-current {
  background: #333;
  color: #fff;
  border-color: #333;
}

.page-link.prev,
.page-link.next {
  padding: 8px 14px;
}
