/* =============================================================
   デジタル庁デザインシステム（DADS）準拠トークン
   出典: @digital-go-jp/design-tokens（primitive値を抜粋してsemanticへ割当）
   ブランド確定後も、原則この :root だけの調整で反映可能。
   ============================================================= */
:root {
  /* --- DADS primitive（抜粋） --- */
  --dads-blue-50: #e8f1fe;
  --dads-blue-100: #d9e6ff;
  --dads-blue-200: #c5d7fb;
  --dads-blue-800: #0031d8;
  --dads-blue-900: #0017c1; /* キーカラー */
  --dads-blue-1000: #00118f;
  --dads-blue-1100: #000071;
  --dads-gray-50: #f2f2f2;
  --dads-gray-100: #e6e6e6;
  --dads-gray-200: #cccccc;
  --dads-gray-300: #b3b3b3;
  --dads-gray-536: #767676; /* 白背景でAA合格の最小グレー */
  --dads-gray-700: #4d4d4d;
  --dads-gray-800: #333333;
  --dads-gray-900: #1a1a1a;
  --dads-green-200: #9bd4b5;
  --dads-green-800: #197a4b;
  --dads-green-bg: #e6f5ec;
  --dads-yellow-100: #fff0b3;
  --dads-yellow-300: #ffd43d;
  --dads-yellow-900: #927200;
  --dads-red-200: #ffbbbb;
  --dads-red-900: #ce0000;
  --dads-red-bg: #fdeeee;

  /* --- semantic --- */
  --bg: #ffffff;
  --bg-subtle: var(--dads-gray-50);
  --surface: #ffffff;
  --fg: var(--dads-gray-900);
  --muted: var(--dads-gray-536);
  --muted-strong: var(--dads-gray-700);
  --border: var(--dads-gray-200);
  --border-subtle: var(--dads-gray-100);
  --accent: var(--dads-blue-900);
  --accent-strong: var(--dads-blue-1000);
  --accent-fg: #ffffff;
  --accent-soft: var(--dads-blue-50);
  --ok: var(--dads-green-800);
  --warn: var(--dads-yellow-900);
  --danger: var(--dads-red-900);
  --chip-bg: var(--dads-gray-50);

  --radius: 8px;
  --radius-sm: 4px;
  --radius-lg: 12px;
  --maxw: 820px;
  --maxw-wide: 1120px;
  --space: 20px;

  /* DADSはNoto Sans JP。ウェイトは 400/700 の2種のみ用いる */
  font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.7; /* DADS 本文 標準 170% */
  font-size: 16px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--space);
}
.container--wide {
  max-width: var(--maxw-wide);
}

a {
  color: var(--accent);
  text-underline-offset: 2px;
}
a:hover {
  color: var(--accent-strong);
}

/* =============================================================
   header / footer（フラット・白背景＋境界線）
   ============================================================= */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
.site-header .container {
  max-width: var(--maxw-wide);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 1.12rem;
  text-decoration: none;
  color: var(--fg);
}
.brand::before {
  content: "";
  width: 20px;
  height: 20px;
  border-radius: var(--radius-sm);
  background: var(--accent);
}
.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}
.site-nav a {
  margin-left: 18px;
  font-size: 0.94rem;
  color: var(--muted-strong);
  text-decoration: none;
}
.site-nav a:hover {
  color: var(--accent);
  text-decoration: underline;
}
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 56px;
  padding: 32px 0 56px;
  background: var(--bg-subtle);
  color: var(--muted-strong);
  font-size: 0.9rem;
}
.site-footer .container {
  max-width: var(--maxw-wide);
}
.footer-nav {
  margin: 8px 0 12px;
}
.footer-nav a {
  margin-right: 18px;
  color: var(--accent);
}
.site-footer .operator {
  font-weight: 700;
  color: var(--fg);
  margin: 0 0 4px;
}
.site-footer .disclaimer {
  max-width: 62ch;
  margin: 0;
  color: var(--muted);
}

/* =============================================================
   breadcrumb
   ============================================================= */
.breadcrumb {
  padding-top: 16px;
  font-size: 0.85rem;
  color: var(--muted-strong);
}
.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  margin: 0;
}
.breadcrumb a {
  color: var(--accent);
}
.breadcrumb li:not(:last-child)::after {
  content: "›";
  margin-left: 6px;
  color: var(--dads-gray-300);
}

main.container {
  padding-top: 8px;
  padding-bottom: 24px;
}

/* =============================================================
   typography（DADS: weightは400/700のみ）
   ============================================================= */
h1,
h2,
h3,
h4 {
  font-weight: 700;
}
h1 {
  font-size: clamp(1.625rem, 1.2rem + 1.6vw, 2rem); /* 26–32px */
  line-height: 1.4;
  margin: 12px 0 8px;
}
h2 {
  font-size: 1.5rem; /* 24px */
  line-height: 1.4;
  margin: 40px 0 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--border);
}
h3 {
  font-size: 1.125rem; /* 18px */
  margin: 24px 0 8px;
}
p {
  margin: 12px 0;
}
strong {
  font-weight: 700;
}

/* =============================================================
   hero（トップ）— フラット、左揃え、強い見出し
   ============================================================= */
.hero {
  padding: 40px 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.hero .eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--dads-blue-200);
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}
.hero h1 {
  font-size: clamp(1.875rem, 1.2rem + 2.6vw, 2.8rem);
  margin: 0 0 12px;
}
.hero .summary-lead {
  max-width: 62ch;
  font-size: 1.0625rem; /* 17px */
  color: var(--muted-strong);
  margin: 0;
}

/* section head */
.section {
  margin: 40px 0;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--border);
}
.section-head h2 {
  margin: 0;
  border: none;
  padding: 0;
}
.section-count {
  font-size: 0.85rem;
  color: var(--muted);
}

/* =============================================================
   card grid（フラット：境界線ベース、影・浮き無し）
   ============================================================= */
.card-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--surface);
  transition: border-color 0.12s ease, background 0.12s ease;
}
.card:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.card-type {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
}
.card-title {
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.5;
  margin: 0;
}
.card-title a {
  color: var(--fg);
  text-decoration: none;
}
/* stretched link: カード全体をクリック可能に */
.card-title a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
.card:hover .card-title a {
  color: var(--accent);
  text-decoration: underline;
}
.card-summary {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted-strong);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-foot {
  margin-top: auto;
  padding-top: 4px;
}

/* =============================================================
   freshness badge（角丸控えめのタグ）
   ============================================================= */
.freshness {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}
.freshness--verified {
  background: var(--dads-green-bg);
  color: var(--ok);
  border-color: var(--dads-green-200);
}
.freshness--needs_check {
  background: var(--dads-yellow-100);
  color: var(--warn);
  border-color: var(--dads-yellow-300);
}
.freshness--stale {
  background: var(--dads-red-bg);
  color: var(--danger);
  border-color: var(--dads-red-200);
}
.freshness--retired,
.freshness--unknown {
  background: var(--chip-bg);
  color: var(--muted-strong);
  border-color: var(--border);
}

/* =============================================================
   meta chips
   ============================================================= */
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  margin: 10px 0;
  font-size: 0.85rem;
  color: var(--muted-strong);
}
.chip {
  background: var(--chip-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  font-size: 0.8rem;
}

/* =============================================================
   callout blocks（フラット：境界線＋淡色背景、影無し）
   ============================================================= */
.block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 20px 0;
  background: var(--surface);
}
.block--conclusion {
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
}
.block h2 {
  margin-top: 0;
  border: none;
  font-size: 1.125rem;
}

dl.kv {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 16px;
  margin: 0;
}
dl.kv dt {
  color: var(--muted-strong);
  font-size: 0.9rem;
}
dl.kv dd {
  margin: 0;
}

/* =============================================================
   tables（フラット・境界線ベース）
   ============================================================= */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.92rem;
}
.table-wrap table {
  border: none;
}
th,
td {
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}
thead th {
  background: var(--bg-subtle);
  font-weight: 700;
  border-bottom: 2px solid var(--border);
}
tbody tr:last-child td {
  border-bottom: none;
}

/* =============================================================
   CTA / buttons（フラット・塗り／枠、影無し、hoverは色変化）
   ============================================================= */
.cta {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-fg);
  text-decoration: none;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  transition: background 0.12s ease, border-color 0.12s ease;
}
.cta:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: var(--accent-fg);
}
.cta:disabled,
.cta[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
.cta--secondary {
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--accent);
}
.cta--secondary:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.editorial-note {
  font-size: 0.85rem;
  color: var(--muted-strong);
  border-left: 3px solid var(--border);
  padding-left: 12px;
  margin: 12px 0;
}

.sources-list {
  font-size: 0.9rem;
  padding-left: 18px;
}
.sources-list li {
  margin: 4px 0;
}

.vote-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.vote-options button {
  border: 1px solid var(--accent);
  background: var(--surface);
  color: var(--accent);
  border-radius: var(--radius);
  padding: 8px 14px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  transition: background 0.12s ease;
}
.vote-options button:hover {
  background: var(--accent-soft);
}

/* legacy list (fallback) */
.internal-links {
  list-style: none;
  padding: 0;
}
.internal-links li {
  margin: 6px 0;
}

.summary-lead {
  font-size: 1.0625rem;
  color: var(--fg);
}
.text-muted {
  color: var(--muted);
}

/* form inputs */
input,
textarea {
  width: 100%;
  max-width: 480px;
  font: inherit;
  color: var(--fg);
  padding: 10px 12px;
  border: 1px solid var(--dads-gray-536);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
input:focus,
textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
label {
  font-weight: 700;
  font-size: 0.92rem;
}

/* accessibility: DADSは明確なフォーカスインジケータを重視 */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .site-nav a {
    margin-left: 0;
    margin-right: 14px;
  }
  .hero {
    padding-top: 28px;
  }
}
