/* ========================================
   資格一覧.com 統合スタイルシート
======================================== */

:root {
  --color-primary: #1e5fa8;
  --color-primary-dark: #144a85;
  --color-accent: #f59e0b;
  --color-accent-dark: #d97706;
  --color-success: #10b981;
  --color-danger: #ef4444;
  --color-bg: #f7f9fc;
  --color-bg-card: #ffffff;
  --color-border: #e5e7eb;
  --color-text: #1f2937;
  --color-text-sub: #6b7280;
  --color-text-light: #9ca3af;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --radius: 8px;
  --container: 1100px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN",
    "BIZ UDPGothic", Meiryo, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.15s;
}
a:hover { color: var(--color-primary-dark); text-decoration: underline; }

img { max-width: 100%; height: auto; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

/* ========== ヘッダー ========== */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  font-size: 22px;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: -0.02em;
}
.logo a { color: inherit; text-decoration: none; }
.logo .dot { color: var(--color-accent); }

.global-nav {
  display: flex;
  gap: 28px;
  font-size: 14px;
  font-weight: 600;
}
.global-nav a { color: var(--color-text); }

.search-box {
  display: flex;
  align-items: center;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 14px;
  width: 240px;
}
.search-box input {
  border: none;
  background: transparent;
  outline: none;
  flex: 1;
  font-size: 14px;
  color: var(--color-text);
}

/* ========== パンくず ========== */
.breadcrumb {
  font-size: 13px;
  color: var(--color-text-sub);
  padding: 16px 0;
}
.breadcrumb a { color: var(--color-text-sub); }
.breadcrumb .sep { margin: 0 8px; color: var(--color-text-light); }

/* ========== カード ========== */
.card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

/* ========== セクション見出し ========== */
.section-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: 20px;
  padding-left: 14px;
  border-left: 5px solid var(--color-primary);
  line-height: 1.3;
}

/* ========== ボタン ========== */
.btn {
  display: inline-block;
  padding: 12px 24px;
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  border-radius: var(--radius);
  font-size: 15px;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}
.btn:hover { background: var(--color-primary-dark); text-decoration: none; color: #fff; }
.btn-accent { background: var(--color-accent); }
.btn-accent:hover { background: var(--color-accent-dark); }
.btn-block { display: block; width: 100%; text-align: center; }

/* ========== バッジ ========== */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.badge-national { background: #dbeafe; color: #1e40af; }
.badge-public   { background: #fef3c7; color: #92400e; }
.badge-private  { background: #f3e8ff; color: #6b21a8; }
.badge-easy     { background: #d1fae5; color: #065f46; }
.badge-mid      { background: #fef3c7; color: #92400e; }
.badge-hard     { background: #fee2e2; color: #991b1b; }

/* ========== 広告枠 ========== */
.ad-slot {
  background: #fafafa;
  border: 1px dashed #d4d4d8;
  color: #a1a1aa;
  text-align: center;
  padding: 30px 16px;
  font-size: 13px;
  border-radius: var(--radius);
  margin: 24px 0;
}

/* ========== フッター ========== */
.site-footer {
  background: #1f2937;
  color: #d1d5db;
  padding: 48px 0 24px;
  margin-top: 80px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-grid h4 { color: #fff; font-size: 14px; margin-bottom: 12px; }
.footer-grid ul { list-style: none; font-size: 13px; line-height: 2; }
.footer-grid a { color: #d1d5db; }
.footer-grid a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid #374151;
  padding-top: 24px;
  text-align: center;
  font-size: 12px;
  color: #9ca3af;
}

/* ========================================
   トップページ
======================================== */
.hero {
  background: linear-gradient(135deg, #1e5fa8 0%, #3b82f6 100%);
  color: #fff;
  padding: 64px 0 80px;
  text-align: center;
}
.hero h1 {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}
.hero .lead { font-size: 17px; opacity: 0.95; margin-bottom: 32px; }
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.hero-stat .num { font-size: 32px; font-weight: 800; display: block; }
.hero-stat .label { font-size: 13px; opacity: 0.9; }
.hero-search {
  max-width: 540px;
  margin: 0 auto;
  display: flex;
  background: #fff;
  border-radius: 999px;
  padding: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.hero-search input {
  flex: 1;
  border: none;
  outline: none;
  padding: 12px 20px;
  font-size: 15px;
  color: var(--color-text);
}
.hero-search button {
  background: var(--color-accent);
  color: #fff;
  border: none;
  padding: 12px 28px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
}

section { padding: 56px 0; }

/* カテゴリグリッド */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.category-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  transition: all 0.2s;
  text-decoration: none;
  color: var(--color-text);
}
.category-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}
.category-card .icon { font-size: 28px; display: block; margin-bottom: 8px; }
.category-card .name { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.category-card .count { font-size: 12px; color: var(--color-text-sub); }

/* ランキング */
.ranking-tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.tab {
  padding: 8px 18px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--color-text-sub);
}
.tab.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

.ranking-list {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.ranking-item {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  text-decoration: none;
  color: var(--color-text);
  transition: background 0.15s;
}
.ranking-item:last-child { border-bottom: none; }
.ranking-item:hover { background: #f9fafb; text-decoration: none; }
.rank-num {
  font-size: 20px;
  font-weight: 800;
  color: var(--color-primary);
  width: 40px;
  text-align: center;
}
.rank-num.top1 { color: #f59e0b; }
.rank-num.top2 { color: #94a3b8; }
.rank-num.top3 { color: #cd7f32; }
.rank-info { flex: 1; margin-left: 12px; }
.rank-name { font-weight: 700; font-size: 15px; margin-bottom: 2px; }
.rank-meta { font-size: 12px; color: var(--color-text-sub); }
.rank-score { font-size: 22px; font-weight: 800; color: var(--color-accent-dark); }
.rank-score small { font-size: 11px; color: var(--color-text-sub); font-weight: normal; }

/* 特集記事 */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.feature-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
  text-decoration: none;
  color: var(--color-text);
  transition: transform 0.2s, box-shadow 0.2s;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); text-decoration: none; }
.feature-thumb {
  height: 160px;
  background: linear-gradient(135deg, #93c5fd, #3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 38px;
}
.feature-thumb.t2 { background: linear-gradient(135deg, #fcd34d, #f59e0b); }
.feature-thumb.t3 { background: linear-gradient(135deg, #6ee7b7, #10b981); }
.feature-body { padding: 16px 18px; }
.feature-tag { font-size: 11px; color: var(--color-primary); font-weight: 700; margin-bottom: 6px; }
.feature-title { font-size: 15px; font-weight: 700; line-height: 1.5; }

/* 比較セクション */
.compare-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  align-items: center;
  margin-bottom: 12px;
}
.compare-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
}
.compare-card .name { font-weight: 700; margin-bottom: 4px; }
.compare-card .meta { font-size: 12px; color: var(--color-text-sub); }
.compare-vs { font-weight: 800; color: var(--color-accent); font-size: 18px; }
.compare-link { text-align: center; margin-top: 12px; }

/* ========================================
   カテゴリページ
======================================== */
.category-hero {
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  padding: 32px 0 36px;
}
.category-hero h1 {
  font-size: 30px;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}
.category-hero .desc {
  color: var(--color-text-sub);
  font-size: 15px;
  max-width: 720px;
  margin-bottom: 20px;
}
.category-stats {
  display: flex;
  gap: 32px;
  font-size: 14px;
  color: var(--color-text-sub);
}
.category-stats strong {
  color: var(--color-primary);
  font-size: 18px;
  font-weight: 800;
}

.layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 32px;
  padding: 32px 0;
}

.filter-bar {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.filter-group { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.filter-group label { color: var(--color-text-sub); font-weight: 600; }
.filter-group select {
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  background: #fff;
  color: var(--color-text);
}

.subcategory-tabs { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.subcategory-tabs .tab {
  padding: 8px 18px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--color-text-sub);
}
.subcategory-tabs .tab.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

.shikaku-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.shikaku-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: var(--color-text);
  transition: all 0.2s;
  display: block;
}
.shikaku-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  transform: translateY(-2px);
}
.shikaku-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.shikaku-card .name { font-size: 17px; font-weight: 800; margin-bottom: 8px; line-height: 1.4; }
.shikaku-card .summary {
  font-size: 13px;
  color: var(--color-text-sub);
  line-height: 1.6;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.shikaku-card .stats {
  display: flex;
  gap: 16px;
  font-size: 12px;
  border-top: 1px dashed var(--color-border);
  padding-top: 12px;
}
.shikaku-card .stat { flex: 1; }
.shikaku-card .stat-label {
  display: block;
  color: var(--color-text-light);
  font-size: 11px;
  margin-bottom: 2px;
}
.shikaku-card .stat-value { font-weight: 700; color: var(--color-text); }
.shikaku-card .stat-value.hl { color: var(--color-accent-dark); }

.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 32px;
  flex-wrap: wrap;
}
.pagination a, .pagination span {
  padding: 8px 14px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
  color: var(--color-text);
  font-weight: 600;
  text-decoration: none;
}
.pagination a:hover { background: #f3f4f6; text-decoration: none; }
.pagination .current { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

.sidebar > * { margin-bottom: 24px; }
.sidebar h3 {
  font-size: 14px;
  font-weight: 800;
  padding-bottom: 8px;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--color-primary);
}
.sidebar .card { padding: 18px; }
.sidebar .mini-list { list-style: none; font-size: 13px; }
.sidebar .mini-list li { padding: 8px 0; border-bottom: 1px solid var(--color-border); }
.sidebar .mini-list li:last-child { border-bottom: none; }
.sidebar .mini-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--color-text);
}
.sidebar .mini-list .num {
  background: var(--color-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
}

/* ========================================
   詳細ページ
======================================== */
.shikaku-hero {
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  padding: 32px 0;
}
.shikaku-hero-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  align-items: start;
}
.shikaku-hero h1 {
  font-size: 30px;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}
.shikaku-tags { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.shikaku-lead {
  color: var(--color-text-sub);
  font-size: 15px;
  line-height: 1.8;
  margin-bottom: 20px;
}

.score-panel {
  background: linear-gradient(135deg, #1e5fa8, #3b82f6);
  color: #fff;
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}
.score-panel .label { font-size: 12px; opacity: 0.9; letter-spacing: 0.05em; }
.score-panel .score { font-size: 48px; font-weight: 800; line-height: 1.1; margin: 4px 0; }
.score-panel .score small { font-size: 18px; }
.score-panel .rank { font-size: 13px; opacity: 0.95; margin-bottom: 16px; }
.score-panel .breakdown {
  border-top: 1px solid rgba(255,255,255,0.25);
  padding-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  font-size: 11px;
}
.score-panel .breakdown div span {
  display: block;
  font-size: 16px;
  font-weight: 700;
  margin-top: 2px;
}

.keydata-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 20px;
}
.keydata {
  background: var(--color-bg);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.keydata .label { font-size: 11px; color: var(--color-text-sub); margin-bottom: 4px; }
.keydata .value {
  font-size: 22px;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1.2;
}
.keydata .value small { font-size: 12px; color: var(--color-text-sub); font-weight: normal; }

.toc {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 32px;
}
.toc-title { font-size: 14px; font-weight: 800; color: var(--color-text-sub); margin-bottom: 12px; }
.toc ol { list-style: none; counter-reset: toc-counter; }
.toc ol li {
  counter-increment: toc-counter;
  padding: 6px 0 6px 28px;
  position: relative;
  font-size: 14px;
}
.toc ol li::before {
  content: counter(toc-counter);
  position: absolute;
  left: 0;
  top: 6px;
  width: 22px;
  height: 22px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.article h2 {
  font-size: 22px;
  font-weight: 800;
  margin: 40px 0 16px;
  padding: 12px 16px;
  background: linear-gradient(90deg, var(--color-primary), transparent 90%);
  color: #fff;
  border-radius: var(--radius);
}
.article h2:first-child { margin-top: 0; }
.article h3 {
  font-size: 18px;
  font-weight: 800;
  margin: 28px 0 12px;
  padding-left: 12px;
  border-left: 4px solid var(--color-accent);
}
.article p { font-size: 15px; line-height: 1.9; margin-bottom: 16px; }
.article ul, .article ol { margin: 12px 0 16px 24px; font-size: 15px; line-height: 1.9; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 14px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.data-table th, .data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}
.data-table th {
  background: var(--color-bg);
  font-weight: 700;
  color: var(--color-text-sub);
  font-size: 13px;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table .pct { font-weight: 700; }
.data-table .pct.up { color: var(--color-success); }
.data-table .pct.down { color: var(--color-danger); }

.chart-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  margin: 16px 0 24px;
}
.chart-title { font-size: 14px; font-weight: 700; color: var(--color-text-sub); margin-bottom: 16px; }
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 200px;
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 4px;
}
.bar {
  flex: 1;
  background: linear-gradient(180deg, #3b82f6, #1e5fa8);
  border-radius: 4px 4px 0 0;
  position: relative;
  transition: opacity 0.2s;
  min-height: 4px;
}
.bar:hover { opacity: 0.85; }
.bar .val {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 700;
  color: var(--color-primary);
  white-space: nowrap;
}
.bar-labels { display: flex; gap: 10px; margin-top: 6px; }
.bar-labels span { flex: 1; text-align: center; font-size: 11px; color: var(--color-text-sub); }
.chart-insight {
  background: #fef3c7;
  border-left: 4px solid var(--color-accent);
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 13px;
  margin-top: 16px;
  line-height: 1.6;
}

.cta-box {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 2px solid var(--color-accent);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin: 32px 0;
}
.cta-box h4 { font-size: 18px; font-weight: 800; margin-bottom: 8px; color: #92400e; }
.cta-box p { font-size: 14px; margin-bottom: 16px; color: #78350f; }

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.related-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 14px;
  text-decoration: none;
  color: var(--color-text);
  transition: all 0.2s;
}
.related-card:hover { border-color: var(--color-primary); text-decoration: none; transform: translateY(-2px); }
.related-card .name { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.related-card .meta { font-size: 11px; color: var(--color-text-sub); }

.sidebar .card.sticky { position: sticky; top: 80px; }

/* ========================================
   レスポンシブ
======================================== */
@media (max-width: 900px) {
  .layout, .shikaku-hero-grid { grid-template-columns: 1fr; }
  .shikaku-grid { grid-template-columns: 1fr; }
  .keydata-grid { grid-template-columns: repeat(2, 1fr); }
  .related-grid { grid-template-columns: 1fr; }
  .category-hero h1, .shikaku-hero h1 { font-size: 22px; }
  .article h2 { font-size: 18px; }
  .feature-grid { grid-template-columns: 1fr; }
  .compare-row { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .global-nav { display: none; }
  .search-box { width: 160px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .section-title { font-size: 18px; }
  .hero h1 { font-size: 24px; }
  .hero .lead { font-size: 14px; }
  .hero-stats { gap: 24px; }
  .hero-stat .num { font-size: 24px; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
}
