/* === 世界史マップ 共通CSS === */
:root {
  --bg-primary: #1a1a2e;
  --bg-secondary: #16213e;
  --bg-card: #1e2a45;
  --accent: #e94560;
  --accent-dark: #c73550;
  --text-primary: #e0e0e0;
  --text-secondary: #a0a0b0;
  --text-muted: #6a6a7a;
  --border: #2a3a5c;
  --link: #5dade2;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.8;
  min-height: 100vh;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === ナビゲーション === */
.global-nav {
  background: linear-gradient(135deg, #16213e 0%, #0f3460 100%);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-logo {
  font-size: 1.2rem;
  font-weight: bold;
  color: #fff;
  letter-spacing: 2px;
}
.nav-logo span { color: var(--accent); }
.nav-logo a { color: inherit; text-decoration: none; }

.nav-links {
  display: flex;
  gap: 20px;
  list-style: none;
}
.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: color 0.2s;
}
.nav-links a:hover { color: #fff; text-decoration: none; }

/* === パンくず === */
.breadcrumb {
  padding: 12px 24px;
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 1200px;
  margin: 0 auto;
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb span { margin: 0 6px; }

/* === メインコンテナ === */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

/* === ホームページ === */
.hero {
  text-align: center;
  padding: 60px 0 40px;
}
.hero h1 {
  font-size: 2.4rem;
  color: #fff;
  margin-bottom: 16px;
}
.hero h1 span { color: var(--accent); }
.hero p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 28px;
}

.cta-btn {
  display: inline-block;
  padding: 12px 32px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: bold;
  transition: background 0.2s;
  text-decoration: none;
}
.cta-btn:hover { background: var(--accent-dark); text-decoration: none; }

.section-title {
  font-size: 1.4rem;
  color: #fff;
  margin: 48px 0 20px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* カテゴリグリッド */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: transform 0.2s, border-color 0.2s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}
.category-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  text-decoration: none;
}

.cat-icon { font-size: 2rem; margin-bottom: 8px; }
.cat-name { font-size: 1.1rem; color: #fff; font-weight: bold; margin-bottom: 4px; }
.cat-count { font-size: 0.85rem; color: var(--text-secondary); }
.cat-bar {
  height: 3px;
  border-radius: 2px;
  margin-top: 12px;
}

/* 時代セクション */
.era-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.era-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s;
  display: block;
}
.era-card:hover { border-color: var(--accent); text-decoration: none; }
.era-label { font-size: 1rem; color: #fff; font-weight: bold; }
.era-range { font-size: 0.8rem; color: var(--text-secondary); margin-top: 4px; }
.era-count { font-size: 0.8rem; color: var(--accent); margin-top: 8px; }

/* 地域グリッド */
.region-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.region-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s;
}
.region-card:hover { border-color: var(--accent); text-decoration: none; }
.region-name { color: #fff; font-size: 0.9rem; }
.region-count { color: var(--text-muted); font-size: 0.8rem; }

/* === 記事ページ === */
.article-header {
  padding: 40px 0 24px;
}
.article-category {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  color: #fff;
  margin-bottom: 12px;
  text-decoration: none;
}
.article-category:hover { opacity: 0.9; text-decoration: none; }
.article-title {
  font-size: 2rem;
  color: #fff;
  line-height: 1.4;
  margin-bottom: 8px;
}
.article-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.article-meta a { color: var(--text-secondary); }
.article-meta a:hover { color: var(--link); }

.article-body {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  margin-top: 32px;
}

.article-main {}

.article-section {
  margin-bottom: 32px;
}
.article-section h2 {
  font-size: 1.15rem;
  color: var(--accent);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.article-section p {
  color: var(--text-primary);
  line-height: 1.9;
}

.terrain-box {
  background: var(--bg-card);
  border-left: 3px solid #1ABC9C;
  padding: 16px;
  border-radius: 0 8px 8px 0;
  font-size: 0.95rem;
}

.significance-box {
  background: var(--bg-card);
  border-left: 3px solid var(--accent);
  padding: 16px;
  border-radius: 0 8px 8px 0;
  font-size: 0.95rem;
}

/* ミニマップ */
.mini-map {
  height: 280px;
  border-radius: 8px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}

.map-link {
  display: block;
  text-align: center;
  padding: 8px;
  background: var(--bg-card);
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 24px;
}

/* サイドバー（記事右側） */
.article-sidebar {}

.sidebar-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}
.sidebar-section h3 {
  font-size: 0.95rem;
  color: #fff;
  margin-bottom: 12px;
}

.related-item {
  display: block;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
}
.related-item:last-child { border-bottom: none; }
.related-item:hover { color: var(--link); text-decoration: none; }
.related-year {
  font-size: 0.75rem;
  color: var(--accent);
}
.related-title {
  font-size: 0.9rem;
  color: var(--text-primary);
}
.related-item:hover .related-title { color: var(--link); }

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag-item {
  padding: 3px 10px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-decoration: none;
}
.tag-item:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

.source-list {
  list-style: none;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.source-list li {
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
.source-list li:last-child { border-bottom: none; }

/* === インデックスページ === */
.index-header {
  padding: 40px 0 24px;
}
.index-header h1 {
  font-size: 2rem;
  color: #fff;
  margin-bottom: 8px;
}
.index-header p {
  color: var(--text-secondary);
  font-size: 1rem;
}
.index-count {
  color: var(--accent);
  font-weight: bold;
}

.event-list {}
.event-list-item {
  display: flex;
  flex-direction: column;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}
.event-list-item:hover { background: rgba(233,69,96,0.05); }
.event-year-col {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: bold;
  margin-bottom: 4px;
}
.event-title-col {
  color: #fff;
  font-size: 1rem;
}
.event-desc-col {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.event-region-col {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 2px;
}

/* === フッター === */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 60px;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 12px;
  list-style: none;
}
.footer-links a { color: var(--text-secondary); }

/* === レスポンシブ === */
@media (max-width: 768px) {
  .article-body { grid-template-columns: 1fr; }
  .era-grid { grid-template-columns: repeat(2, 1fr); }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 1.8rem; }
  .article-title { font-size: 1.5rem; }
  .nav-links { display: none; }
}

@media (max-width: 480px) {
  .category-grid { grid-template-columns: 1fr; }
  .era-grid { grid-template-columns: 1fr; }
}
