/* 5 サイト共通の骨組み。色・文字・飾りは各サイトの style.css が変数と上書きで決める。
   明るい表示だけ（ダークモードの切り替えは書かない）・外部読み込みなし */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --ink: #1f1f1f;
  --sub: #555;
  --faint: #888;
  --rule: #ddd;
  --rule-strong: #1f1f1f;
  --accent: #1d3a6e;
  --accent-2: #b3322b;
  --accent-soft: #eef2f8;
  --link: var(--accent);
  --pr: #8a5a00;
  --pr-bg: #fff7e6;
  --radius: 0;
  --wrap: 1100px;
  --gutter: 28px;
  --serif: "Hiragino Mincho ProN", "Hiragino Mincho Pro", "Yu Mincho", YuMincho, "Noto Serif JP", "BIZ UDPMincho", serif;
  --sans: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
  --round: "Hiragino Maru Gothic ProN", "Hiragino Maru Gothic Pro", "Zen Maru Gothic", "M PLUS Rounded 1c", "BIZ UDPGothic", var(--sans);
  --ud: "BIZ UDPGothic", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
  --head: var(--sans);
  --body: var(--sans);
  --body-size: 17px;
  --lh: 1.95;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--body-size);
  line-height: var(--lh);
  letter-spacing: .03em;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-underline-offset: 4px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
img { max-width: 100%; height: auto; display: block; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-narrow { max-width: 800px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: 4px 8px; z-index: 10; }

/* ---------- ヘッダー ---------- */
.masthead-row { display: flex; align-items: center; justify-content: space-between; gap: 6px 24px; flex-wrap: wrap; padding-top: 18px; padding-bottom: 14px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo-mark { display: inline-flex; flex: none; }
.logo-mark svg { display: block; height: 34px; width: auto; }
.logo-text { font-family: var(--head); font-weight: 700; font-size: 1.4rem; letter-spacing: .08em; line-height: 1.3; }
.tagline { margin: 0; color: var(--faint); font-size: .8rem; line-height: 1.6; }
.topic-nav ul { list-style: none; margin: 0; padding: 0; display: flex; overflow-x: auto; scrollbar-width: none; }
.topic-nav ul::-webkit-scrollbar { display: none; }
.topic-nav a { display: block; white-space: nowrap; padding: 10px 16px; font-size: .88rem; color: var(--ink); text-decoration: none; }
.topic-nav a:hover { color: var(--accent); text-decoration: underline; }

main { padding-bottom: 80px; }

/* ---------- 共通の部品 ---------- */
.kicker { display: inline-block; color: var(--accent); font-size: .76rem; font-weight: 700; letter-spacing: .08em; text-decoration: none; }
.kickers { margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.sec-title { font-family: var(--head); font-size: 1.3rem; font-weight: 700; margin: 0 0 22px; letter-spacing: .06em; line-height: 1.5; }
.card-meta, .card-meta time { color: var(--faint); font-size: .78rem; }
.empty-note { padding: 28px 0; color: var(--sub); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }

.breadcrumb { margin: 18px 0 0; font-size: .78rem; color: var(--faint); }
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 0; }
.breadcrumb li + li::before { content: "/"; margin: 0 8px; color: var(--rule); }
.breadcrumb a { color: var(--sub); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* カード（関連記事・タグの一覧） */
.card-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 36px 28px; }
.card-link { display: flex; flex-direction: column; gap: 10px; color: inherit; text-decoration: none; height: 100%; }
.card-link .thumb { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.card-body { display: flex; flex-direction: column; gap: 4px; }
.card-title { font-family: var(--head); font-weight: 700; font-size: 1.02rem; line-height: 1.6; }
.card-link:hover .card-title { text-decoration: underline; text-underline-offset: 4px; }

/* 行の一覧 */
.rows { list-style: none; margin: 0; padding: 0; }
.row a { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 16px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--rule); color: inherit; text-decoration: none; }
.row:first-child a { border-top: 1px solid var(--rule); }
.row-num { font-size: .8rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.row-main { display: flex; flex-direction: column; gap: 2px; }
.row-title { font-weight: 700; line-height: 1.6; font-size: .98rem; }
.row a:hover .row-title { text-decoration: underline; }
.row time { color: var(--faint); font-size: .76rem; white-space: nowrap; }

/* ---------- トップ: 大きな絵と導入 ---------- */
.hero { padding: 40px 0 44px; }
.hero-grid { display: grid; gap: 28px 48px; align-items: center; }
.hero-media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.hero-eyebrow { margin: 0 0 10px; font-size: .8rem; letter-spacing: .14em; color: var(--accent); font-weight: 700; }
.hero-title { font-family: var(--head); font-size: clamp(1.7rem, 4vw, 2.6rem); line-height: 1.45; margin: 0 0 18px; letter-spacing: .05em; font-weight: 700; }
.hero-lead { margin: 0; color: var(--sub); font-size: .96rem; line-height: 2; }
/* split: 文が左・絵が右 */
.hero-split .hero-grid { grid-template-columns: 1fr 1.15fr; }
.hero-split .hero-text { order: -1; }
/* stack: 絵が上・文が下の中央 */
.hero-stack .hero-grid { grid-template-columns: 1fr; text-align: center; }
.hero-stack .hero-text { max-width: 720px; margin: 0 auto; }
.hero-stack .hero-media img { aspect-ratio: 21 / 9; }
/* banner: 絵の上に文の箱を重ねる */
.hero-banner .hero-grid { grid-template-columns: 1fr; position: relative; }
.hero-banner .hero-media img { aspect-ratio: 16 / 7; }
.hero-banner .hero-text { position: absolute; left: calc(var(--gutter) + 32px); bottom: 32px; max-width: 520px; background: var(--surface); padding: 28px 32px; }

/* ---------- トップ: 決まり ---------- */
.policy { margin: 8px 0 56px; }
.policy-title { font-family: var(--head); font-size: 1rem; letter-spacing: .1em; margin: 0 0 16px; }
.policy-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1px solid var(--rule-strong); }
.policy-list li { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px 20px; border-bottom: 1px solid var(--rule); }
.policy-list li + li { border-left: 1px solid var(--rule); }
.policy-num { font-size: .74rem; color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .1em; }
.policy-head { font-family: var(--head); font-weight: 700; font-size: 1rem; line-height: 1.5; }
.policy-text { font-size: .84rem; color: var(--sub); line-height: 1.85; }

/* ---------- トップ: 分野 ---------- */
.topics { margin: 0 0 64px; }
.topic-list { list-style: none; margin: 0; padding: 0; }
.topic a { color: inherit; text-decoration: none; display: grid; }
.topic-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.topic-text { display: flex; flex-direction: column; gap: 4px; }
.topic-num { font-size: .76rem; color: var(--accent); font-weight: 700; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.topic-name { font-family: var(--head); font-weight: 700; font-size: 1.15rem; line-height: 1.5; }
.topic a:hover .topic-name { text-decoration: underline; text-underline-offset: 5px; }
.topic-desc { font-size: .86rem; color: var(--sub); line-height: 1.85; }
.topic-count { font-size: .76rem; color: var(--faint); margin-top: 2px; }
/* tiles: 絵つきの格子 */
.topics-tiles .topic-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 32px 24px; }
.topics-tiles .topic a { gap: 14px; }
/* chapters: 絵と文を横に並べた章立て */
.topics-chapters .topic-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 48px; }
.topics-chapters .topic a { grid-template-columns: 180px 1fr; gap: 20px; padding: 22px 0; border-bottom: 1px solid var(--rule); align-items: start; }
.topics-chapters .topic-img { aspect-ratio: 4 / 3; }
/* index: 表のような目次（絵は小さく） */
.topics-index .topic-list { border-top: 2px solid var(--rule-strong); }
.topics-index .topic a { grid-template-columns: 200px 1fr; gap: 24px; padding: 20px 0; border-bottom: 1px solid var(--rule); align-items: center; }
.topics-index .topic-img { aspect-ratio: 16 / 9; }

/* ---------- トップ: 新しい記事 ---------- */
.latest { margin: 0 0 64px; }
.latest-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px 44px; align-items: start; }
.feature-link { display: flex; flex-direction: column; gap: 14px; color: inherit; text-decoration: none; }
.feature-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.feature-text { display: flex; flex-direction: column; gap: 6px; }
.feature-title { font-family: var(--head); font-size: clamp(1.25rem, 2.4vw, 1.6rem); font-weight: 700; line-height: 1.55; }
.feature-link:hover .feature-title { text-decoration: underline; text-underline-offset: 6px; }
.feature-desc { color: var(--sub); font-size: .9rem; line-height: 1.9; }

.about-strip { border-top: 1px solid var(--rule-strong); padding: 28px 0 0; }
.about-strip h2 { font-family: var(--head); font-size: 1.05rem; margin: 0 0 10px; letter-spacing: .08em; }
.about-strip p { margin: 0 0 10px; font-size: .88rem; color: var(--sub); line-height: 1.95; max-width: 52em; }
.about-links { display: flex; gap: 20px; flex-wrap: wrap; }

/* ---------- タグの一覧 ---------- */
.tag-head { display: grid; grid-template-columns: 1fr 320px; gap: 24px 40px; align-items: center; margin: 24px 0 40px; padding-bottom: 28px; border-bottom: 1px solid var(--rule-strong); }
.tag-head-label { margin: 0; font-size: .76rem; letter-spacing: .14em; color: var(--accent); font-weight: 700; }
.tag-head h1 { font-family: var(--head); font-size: clamp(1.6rem, 3.6vw, 2.2rem); margin: 4px 0 10px; line-height: 1.4; letter-spacing: .05em; }
.tag-head p { margin: 0; color: var(--sub); font-size: .92rem; }
.tag-head .tag-head-count { margin-top: 8px; color: var(--faint); font-size: .8rem; }
.tag-head-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

/* ---------- 記事 ---------- */
.article-head { max-width: 860px; margin: 28px 0 0; }
.article-head h1 { font-family: var(--head); font-size: clamp(1.55rem, 3.4vw, 2.25rem); line-height: 1.5; margin: 0 0 16px; letter-spacing: .04em; font-weight: 700; }
.lede { margin: 0 0 18px; color: var(--sub); font-size: .98rem; line-height: 1.95; }
.dates { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 0 0 16px; font-size: .78rem; color: var(--sub); }
.dates div { display: flex; gap: 6px; }
.dates dt { color: var(--faint); }
.dates dd { margin: 0; }
.pr-notice { display: flex; align-items: center; gap: 10px; margin: 0 0 24px; padding: 8px 12px; font-size: .82rem; color: var(--pr); background: var(--pr-bg); border-left: 3px solid var(--pr); }
.pr-tag { flex: none; font-size: .7rem; font-weight: 700; letter-spacing: .1em; border: 1px solid currentColor; padding: 0 6px; line-height: 1.6; }
.eyecatch { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

.article-body { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 0 56px; margin-top: 40px; align-items: start; }
.article-side { position: sticky; top: 20px; }
.article-content { max-width: 760px; min-width: 0; }
.toc { font-size: .84rem; }
.toc-title { margin: 0 0 8px; font-weight: 700; letter-spacing: .1em; font-size: .78rem; color: var(--faint); }
.toc ol { margin: 0; padding: 0 0 0 1.4em; }
.toc li { margin: 0 0 6px; line-height: 1.6; }
.toc a { color: var(--sub); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }

.field-notice { margin: 0 0 32px; padding: 16px 20px; background: var(--accent-soft); font-size: .86rem; line-height: 1.85; }
.field-notice p { margin: 0; }
.field-notice-title { font-weight: 700; margin-bottom: 4px !important; color: var(--accent); }

/* 本文 */
.prose > *:first-child { margin-top: 0; }
.prose p { margin: 0 0 1.4em; }
.prose h2 { font-family: var(--head); font-size: 1.4rem; line-height: 1.55; margin: 2.4em 0 .9em; letter-spacing: .04em; }
.prose h3 { font-family: var(--head); font-size: 1.12rem; line-height: 1.6; margin: 2em 0 .7em; }
.prose h4 { font-size: 1rem; margin: 1.6em 0 .5em; }
.prose ul, .prose ol { margin: 0 0 1.4em; padding-left: 1.5em; }
.prose li { margin: 0 0 .4em; }
.prose strong { font-weight: 700; }
.prose blockquote { margin: 0 0 1.4em; padding: 4px 0 4px 18px; border-left: 3px solid var(--rule); color: var(--sub); }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2.4em 0; }
.prose code { font-size: .9em; background: var(--accent-soft); padding: 1px 5px; }
.table-wrap { overflow-x: auto; margin: 0 0 1.6em; -webkit-overflow-scrolling: touch; }
.prose table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: .88rem; line-height: 1.7; font-variant-numeric: tabular-nums; }
.prose th, .prose td { border: 1px solid var(--rule); padding: 10px 12px; text-align: left; vertical-align: top; }
.prose th { background: var(--accent-soft); font-weight: 700; }

/* 広告の枠 */
.ad-box { position: relative; margin: 2em 0; padding: 22px 22px 18px; border: 1px solid var(--rule); background: var(--surface); }
.ad-label { position: absolute; top: -10px; left: 16px; background: var(--pr); color: #fff; font-size: .7rem; font-weight: 700; letter-spacing: .1em; padding: 0 8px; line-height: 20px; }
.ad-lead { margin: 0 0 10px !important; font-size: .88rem; color: var(--sub); }
.ad-box a { font-weight: 700; }
.ad-name { display: block; margin-top: 6px; font-size: .74rem; color: var(--faint); }
.ad-imp { position: absolute; width: 1px; height: 1px; border: 0; opacity: 0; }

/* よくある質問・出典・この記事について */
.faq, .sources { margin: 56px 0 0; }
.faq h2, .sources h2 { font-family: var(--head); font-size: 1.25rem; margin: 0 0 18px; letter-spacing: .06em; }
.qa { padding: 16px 0; border-top: 1px solid var(--rule); }
.qa:last-child { border-bottom: 1px solid var(--rule); }
.qa p { margin: 0; display: grid; grid-template-columns: 2em 1fr; }
.qa-q { font-weight: 700; margin-bottom: 6px !important; }
.qa-a { color: var(--sub); font-size: .94rem; }
.qa-mark { font-family: var(--head); color: var(--accent); font-weight: 700; }
.qa-a .qa-mark { color: var(--faint); }
.sources-note { font-size: .82rem; color: var(--faint); margin: 0 0 10px; }
.sources ol { margin: 0; padding-left: 1.4em; font-size: .86rem; line-height: 1.8; }
.sources li { margin: 0 0 6px; }
.operator-box { margin: 48px 0 0; padding: 20px 22px; border: 1px solid var(--rule); font-size: .86rem; line-height: 1.9; }
.operator-box p { margin: 0; }
.operator-name { font-weight: 700; margin-bottom: 4px !important; }

.related { margin: 72px 0 0; padding-top: 32px; border-top: 1px solid var(--rule-strong); }

/* ---------- 固定ページ ---------- */
.page h1 { font-family: var(--head); font-size: clamp(1.5rem, 3.2vw, 2rem); margin: 28px 0 28px; letter-spacing: .05em; line-height: 1.5; }
.page-updated { margin-top: 40px; font-size: .8rem; color: var(--faint); }
.notfound { padding: 60px 0; }
.notfound h1 { font-family: var(--head); }

/* フォーム */
.form { margin: 28px 0 0; padding: 26px; border: 1px solid var(--rule); background: var(--surface); }
.form p { margin: 0 0 18px; }
.form label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 6px; }
.form input, .form select, .form textarea { width: 100%; font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: var(--radius); background: #fff; color: var(--ink); }
.form textarea { min-height: 200px; resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.form button { font: inherit; font-weight: 700; padding: 12px 36px; border: 0; border-radius: var(--radius); background: var(--accent); color: #fff; cursor: pointer; }
.form button:hover { filter: brightness(1.1); }
.req { margin-left: 8px; font-size: .7rem; color: var(--accent-2); border: 1px solid currentColor; padding: 0 5px; vertical-align: .1em; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- フッター ---------- */
.site-footer { padding: 48px 0 28px; font-size: .86rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 28px 40px; }
.footer-about p { margin: 12px 0 0; color: var(--sub); line-height: 1.9; font-size: .82rem; }
.logo-small .logo-text { font-size: 1.1rem; }
.logo-small .logo-mark svg { height: 26px; }
.footer-head { margin: 0 0 8px; font-weight: 700; font-size: .8rem; letter-spacing: .1em; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0 0 4px; }
.site-footer nav a { color: var(--sub); text-decoration: none; }
.site-footer nav a:hover { text-decoration: underline; }
.copy { margin: 32px 0 0; padding-top: 16px; border-top: 1px solid var(--rule); color: var(--faint); font-size: .74rem; }

/* ---------- 狭い画面 ---------- */
@media (max-width: 960px) {
  .article-body { grid-template-columns: 1fr; }
  .article-side { position: static; margin-bottom: 28px; padding: 16px 18px; border: 1px solid var(--rule); }
  .policy-list { grid-template-columns: repeat(2, 1fr); }
  .policy-list li:nth-child(3) { border-left: 0; }
  .topics-chapters .topic-list { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  :root { --gutter: 18px; --body-size: 16px; }
  .masthead-row { padding-top: 14px; padding-bottom: 10px; }
  .logo-text { font-size: 1.2rem; }
  .logo-mark svg { height: 28px; }
  .tagline { display: none; }
  .hero { padding: 20px 0 32px; }
  .hero-split .hero-grid { grid-template-columns: 1fr; }
  .hero-split .hero-text { order: 0; }
  .hero-banner .hero-media img { aspect-ratio: 4 / 3; }
  .hero-banner .hero-text { position: static; max-width: none; padding: 22px 0 0; background: none; }
  .hero-stack .hero-media img { aspect-ratio: 16 / 9; }
  .policy-list { grid-template-columns: 1fr; }
  .policy-list li + li { border-left: 0; }
  .topics-chapters .topic a, .topics-index .topic a { grid-template-columns: 112px 1fr; gap: 14px; }
  .topics-chapters .topic-img, .topics-index .topic-img { aspect-ratio: 1 / 1; }
  .topic-desc { font-size: .8rem; }
  .latest-grid { grid-template-columns: 1fr; }
  .tag-head { grid-template-columns: 1fr; }
  .tag-head-img { order: -1; }
  .footer-grid { grid-template-columns: 1fr; }
  .form { padding: 18px; }
  .row a { grid-template-columns: auto 1fr; }
  .row time { grid-column: 2; }
}

/* 日本語の見出しを文節で折り返す（対応するブラウザだけ。ほかは普通に折り返す） */
h1, h2, h3, .hero-title, .feature-title, .card-title, .row-title, .topic-name, .policy-head { word-break: auto-phrase; text-wrap: pretty; }
.hero-title, .article-head h1, .tag-head h1 { text-wrap: balance; }
