/* ==========================================================
   政策ウォッチ — スタイルシート
   日本語の長文を読ませるサイトなので、行間と1行の文字数を優先。
   ========================================================== */

:root {
  --bg:          #ffffff;
  --bg-subtle:   #f6f7f9;
  --bg-inset:    #eef1f5;
  --text:        #1b2027;
  --text-muted:  #5a6472;
  --text-faint:  #8b95a3;
  --border:      #dfe3e9;
  --accent:      #1b4f8a;
  --accent-soft: #e8f0f9;
  --quote-bar:   #b9c6d6;
  --radius: 8px;
  --wrap: 760px;
  --font: system-ui, -apple-system, "Segoe UI", "Hiragino Kaku Gothic ProN",
          "Yu Gothic", Meiryo, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:          #14181d;
    --bg-subtle:   #1b2026;
    --bg-inset:    #222831;
    --text:        #e4e8ed;
    --text-muted:  #a3adba;
    --text-faint:  #78838f;
    --border:      #2d343d;
    --accent:      #7fb3e8;
    --accent-soft: #1c2a3a;
    --quote-bar:   #3c4856;
  }
}
:root[data-theme="dark"] {
  --bg:          #14181d;
  --bg-subtle:   #1b2026;
  --bg-inset:    #222831;
  --text:        #e4e8ed;
  --text-muted:  #a3adba;
  --text-faint:  #78838f;
  --border:      #2d343d;
  --accent:      #7fb3e8;
  --accent-soft: #1c2a3a;
  --quote-bar:   #3c4856;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.85;
  text-align: justify;
  word-break: normal;
  overflow-wrap: anywhere;
  line-break: strict;
}

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

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

.skip-link {
  position: absolute; left: -9999px;
  background: var(--accent); color: #fff; padding: 8px 16px;
}
.skip-link:focus { left: 8px; top: 8px; z-index: 100; }

/* ---------- 非公式であることの明示 ---------- */
/* ドメイン名に gov を含むため、公的機関と誤認されないよう全ページ先頭に出す。
   目立ちすぎず、しかし読み飛ばされない程度の強さを狙っている。 */
.unofficial-banner {
  background: var(--bg-inset);
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .76rem;
  line-height: 1.6;
  padding: 7px 0;
  text-align: center;
}

/* ---------- ヘッダー ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky; top: 0; z-index: 20;
}
.header-inner { padding-top: 14px; padding-bottom: 10px; }

.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: inherit;
}
.brand-mark {
  width: 6px; height: 30px; border-radius: 3px;
  background: var(--accent); flex: none;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.brand-name { font-size: 1.2rem; font-weight: 700; letter-spacing: .02em; }
.brand-tag { font-size: .74rem; color: var(--text-muted); }

.site-nav {
  display: flex; flex-wrap: wrap; gap: 4px 14px;
  margin-top: 10px; font-size: .86rem;
}
.site-nav a {
  color: var(--text-muted); text-decoration: none;
  padding: 3px 0; border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- 一覧 ---------- */
.page-intro { margin: 28px 0 20px; }
.page-intro h1 { font-size: 1.5rem; margin: 0 0 6px; line-height: 1.5; }
.intro-text { color: var(--text-muted); font-size: .92rem; margin: 0; }

.article-list { list-style: none; margin: 0; padding: 0; }

.article-card {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.card-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: .76rem; color: var(--text-faint); margin-bottom: 8px;
}
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 99px;
  font-size: .72rem; line-height: 1.6; white-space: nowrap;
}
.badge-cat { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.badge-src { background: var(--bg-inset); color: var(--text-muted); }

.card-title { font-size: 1.12rem; line-height: 1.6; margin: 0 0 6px; }
.card-title a { color: var(--text); text-decoration: none; }
.card-title a:hover { color: var(--accent); text-decoration: underline; }
.card-lead { margin: 0; font-size: .9rem; color: var(--text-muted); }

.article-list.compact .article-card { padding: 12px 0; }

.empty-state {
  padding: 40px 20px; text-align: center; color: var(--text-muted);
  background: var(--bg-subtle); border-radius: var(--radius);
}
.empty-state code {
  background: var(--bg-inset); padding: 2px 6px; border-radius: 4px;
  font-size: .88em;
}

/* ---------- ページ送り ---------- */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin: 28px 0; font-size: .9rem;
}
.pagination a {
  padding: 8px 14px; border: 1px solid var(--border);
  border-radius: var(--radius); text-decoration: none;
}
.page-status { color: var(--text-faint); font-size: .84rem; }

/* ---------- 記事 ---------- */
.article { margin: 28px 0 40px; }
.article-header { margin-bottom: 24px; }
.article-title {
  font-size: 1.62rem; line-height: 1.55; margin: 8px 0 14px;
  letter-spacing: .01em;
}
.article-lead {
  font-size: 1.02rem; color: var(--text-muted);
  padding-left: 14px; border-left: 3px solid var(--accent);
  margin: 0;
}
.article-body p { margin: 0 0 1.5em; }

.article-background {
  margin: 32px 0; padding: 20px;
  background: var(--bg-subtle); border-radius: var(--radius);
}
.article-background h2 { font-size: 1rem; margin: 0 0 10px; color: var(--accent); }
.article-background p { margin: 0 0 1em; font-size: .94rem; }
.article-background p:last-child { margin-bottom: 0; }

/* ---------- 根拠（このサイトの中核） ---------- */
.article-evidence {
  margin: 36px 0; padding: 20px;
  border: 1px solid var(--border); border-radius: var(--radius);
}
.article-evidence h2 { font-size: 1rem; margin: 0 0 6px; }
.evidence-note {
  font-size: .82rem; color: var(--text-faint); margin: 0 0 16px;
}
.evidence-list { margin: 0; padding-left: 1.4em; }
.evidence-item { margin-bottom: 18px; }
.evidence-item:last-child { margin-bottom: 0; }
.evidence-statement { margin: 0 0 6px; font-size: .92rem; font-weight: 600; }
.evidence-quote {
  margin: 0; padding: 8px 0 8px 14px;
  border-left: 3px solid var(--quote-bar);
  font-size: .88rem; color: var(--text-muted);
}
.evidence-quote::before { content: "「"; }
.evidence-quote::after  { content: "」"; }

/* ---------- 出典 ---------- */
.article-footer { margin-top: 32px; }
.source-box {
  padding: 18px; background: var(--accent-soft);
  border-radius: var(--radius);
}
.source-box h2 { font-size: .94rem; margin: 0 0 10px; }
.source-line { margin: 0 0 8px; font-size: .92rem; }
.source-org { font-weight: 600; margin-right: 8px; }
.source-license, .source-disclaimer {
  margin: 6px 0 0; font-size: .8rem; color: var(--text-muted);
}
.generated-note {
  margin: 16px 0 0; font-size: .78rem; color: var(--text-faint);
}

.related { margin: 40px 0; padding-top: 24px; border-top: 1px solid var(--border); }
.related h2 { font-size: 1.05rem; margin: 0 0 4px; }

/* ---------- 広告 ---------- */
.ad-slot {
  margin: 28px 0; padding: 4px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  min-height: 60px;
}
/* 広告枠。インライン style 属性を使わずCSSで指定する（CSP対策） */
ins.adsbygoogle { display: block; }

.ad-label {
  display: block; font-size: .68rem; color: var(--text-faint);
  letter-spacing: .12em; padding: 4px 0;
}

/* ---------- 固定ページ ---------- */
.static-page { margin: 28px 0 48px; }
.static-page h1 { font-size: 1.5rem; line-height: 1.5; margin: 0 0 20px; }
.static-page h2 {
  font-size: 1.06rem; margin: 32px 0 10px;
  padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.static-page h3 { font-size: .98rem; margin: 22px 0 8px; }
.static-page p  { margin: 0 0 1.3em; font-size: .95rem; }
.static-page ul, .static-page ol { margin: 0 0 1.3em; padding-left: 1.5em; font-size: .95rem; }
.static-page li { margin-bottom: .5em; }
.static-page table {
  width: 100%; border-collapse: collapse; font-size: .9rem; margin: 0 0 1.3em;
}
.static-page th, .static-page td {
  border: 1px solid var(--border); padding: 8px 10px; text-align: left;
}
.static-page th { background: var(--bg-subtle); }
.updated-note {
  margin-top: 32px; font-size: .78rem; color: var(--text-faint);
}

/* ---------- フッター ---------- */
.site-footer {
  margin-top: 48px; padding: 28px 0 40px;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
  font-size: .82rem; color: var(--text-muted);
}
.footer-note { margin: 0 0 16px; line-height: 1.8; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 14px; }
.footer-nav a { color: var(--text-muted); }
.copyright { margin: 0; color: var(--text-faint); font-size: .78rem; }

/* ---------- 画面が広いとき ---------- */
@media (min-width: 700px) {
  body { font-size: 16.5px; }
  .header-inner { display: flex; align-items: center; justify-content: space-between; }
  .site-nav { margin-top: 0; }
  .article-title { font-size: 1.85rem; }
  .page-intro h1 { font-size: 1.7rem; }
}
