/* ─── CSS変数（ライト/ダークモード） ─────────────────────── */
:root {
  --bg: #f5f5f3;
  --bg-card: #ffffff;
  --text: #1a1a1a;
  --text-muted: #666;
  --border: #e0e0e0;
  --accent: #1a6b3a;
  --accent-light: #e8f5ed;
  --btn-bg: #eee;
  --btn-active-bg: #1a6b3a;
  --btn-active-text: #fff;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
}

[data-theme="dark"] {
  --bg: #121212;
  --bg-card: #1e1e1e;
  --text: #e8e8e8;
  --text-muted: #999;
  --border: #333;
  --accent: #4caf77;
  --accent-light: #1a2e22;
  --btn-bg: #2a2a2a;
  --btn-active-bg: #4caf77;
  --btn-active-text: #000;
  --shadow: 0 1px 4px rgba(0,0,0,0.4);
}

/* ─── ベース ─────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans JP', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
}

/* ─── ヘッダー ───────────────────────────────────────────── */
header {
  background: var(--bg-card);
  border-bottom: 2px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 10px 16px;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.site-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.5px;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ─── ボタン共通 ─────────────────────────────────────────── */
button { cursor: pointer; border: none; background: none; font-family: inherit; }

.icon-btn {
  background: var(--btn-bg);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.85rem;
  color: var(--text);
  transition: background 0.15s;
}
.icon-btn:hover { background: var(--border); }
.icon-btn:disabled { opacity: 0.3; cursor: default; }

/* ─── 言語バー ───────────────────────────────────────────── */
.lang-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.lang-btn {
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 0.8rem;
  background: var(--btn-bg);
  color: var(--text-muted);
  transition: all 0.15s;
}
.lang-btn:hover { background: var(--border); }
.lang-btn.active {
  background: var(--btn-active-bg);
  color: var(--btn-active-text);
  font-weight: 600;
}

/* ─── フィルターバー ─────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.filter-btn {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
  background: var(--btn-bg);
  color: var(--text-muted);
  transition: all 0.15s;
}
.filter-btn:hover { background: var(--border); }
.filter-btn.active {
  background: var(--btn-active-bg);
  color: var(--btn-active-text);
  font-weight: 600;
}

/* ─── ナビバー ───────────────────────────────────────────── */
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.date-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 600;
}

.sort-toggle {
  display: flex;
  gap: 4px;
}

.sort-btn {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
  background: var(--btn-bg);
  color: var(--text-muted);
}
.sort-btn.active {
  background: var(--btn-active-bg);
  color: var(--btn-active-text);
}

/* ─── メインコンテンツ ───────────────────────────────────── */
main {
  max-width: 860px;
  margin: 0 auto;
  padding: 16px;
}

/* ─── 記事カード ─────────────────────────────────────────── */
.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s;
  border-left: 4px solid var(--cat-color, var(--accent));
}
.article-card:hover { box-shadow: 0 3px 8px rgba(0,0,0,0.12); }

.article-headline {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 5px;
}
.article-headline a {
  color: var(--text);
  text-decoration: none;
}
.article-headline a:hover { color: var(--accent); text-decoration: underline; }

.article-summary {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 8px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.article-source {
  background: var(--accent-light);
  color: var(--accent);
  padding: 2px 7px;
  border-radius: 8px;
  font-weight: 600;
}

.article-category {
  background: var(--btn-bg);
  padding: 2px 7px;
  border-radius: 8px;
}

.article-time {
  margin-left: auto;
}

/* カテゴリ別ボーダー色 */
.cat-試合結果  { --cat-color: #e53935; }
.cat-代表チーム { --cat-color: #1565c0; }
.cat-リーグ    { --cat-color: #6a1b9a; }
.cat-選手      { --cat-color: #f57c00; }
.cat-テクノロジー { --cat-color: #00838f; }
.cat-ルール    { --cat-color: #558b2f; }
.cat-その他    { --cat-color: #757575; }

/* ─── ローディング・空状態 ───────────────────────────────── */
.loading {
  text-align: center;
  padding: 60px 16px;
  color: var(--text-muted);
  font-size: 1rem;
}

.no-articles {
  text-align: center;
  padding: 60px 16px;
  color: var(--text-muted);
}

/* ─── フッター ───────────────────────────────────────────── */
footer {
  max-width: 860px;
  margin: 20px auto;
  padding: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 2;
}

/* ─── レスポンシブ ───────────────────────────────────────── */
@media (max-width: 600px) {
  .site-title { font-size: 1.1rem; }
  .lang-bar, .filter-bar { gap: 4px; }
  .lang-btn, .filter-btn { padding: 3px 8px; font-size: 0.75rem; }
  main { padding: 10px; }
}
