/* ========== 非カード共通（レイアウト／テキスト／サムネ等） ========== */

:root {
  /* ブログ調の落ち着いた配色（青アクセント＋モノトーン） */
  --color-bg: #ffffff;
  --color-text: #111827;
  --color-muted: #6b7280;
  --color-border: #e5e7eb;

  --color-primary: #2563eb; /* フォーカス・強調（既存のfocus色と統一） */
  --color-primary-ink: #ffffff; /* 反転文字 */
  --chip-bg: #eef2ff;
  --chip-ink: #3730a3;

  --color-footer: #483b0c;
}

html,
body {
  background: var(--color-bg);
  color: var(--color-text);
}
body {
  margin: 0px;
}

/* ページ全体を縦flexにする */
html,
body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
}

/* main を余った高さで押し広げる */
main {
  flex: 1;
}

/* グリッドレイアウト（YouTube風の自動段組） */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  /* grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); */
  gap: 16px;
  max-width: 1400px;
  margin: 24px auto;
  padding: 0 16px;
  grid-auto-flow: dense;
}

/* サムネイル（画像が来る前に高さを確保） */
.thumb {
  aspect-ratio: 16/9;
  background: #f2f3f5;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* テキスト部 */
.meta {
  padding: 10px 12px 14px;
  display: grid;
  gap: 6px;
}
.title {
  font-size: 16px;
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.desc {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* フッターのスタイル */
.site-footer {
  margin-top: 24px;
  padding: 24px 0 56px;
  border-top: 1px solid var(--color-border);
  color: var(--color-primary-ink);
  background: var(--color-footer);
  text-align: center;
}
.footer-links {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}
.footer-links a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted transparent;
}
.footer-links a:hover {
  border-bottom-color: currentColor;
}
.footer-links .dot {
  opacity: 0.6;
}

/* ダークモード（非カード側の色味） */
@media (prefers-color-scheme: dark) {
  .desc {
    color: #9aa1ac;
  }
}

/* モーション軽減（全体） */
@media (prefers-reduced-motion: reduce) {
  .card {
    transition: none;
  }
}

/* 幅が狭いときは必ず2列にする */
@media (max-width: 768px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-inline: 4px;
  }
}
