/* モノレキ — 共通スタイル
   方針: 読ませることだけを考える。装飾は最小。スマホ優先。 */

:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --ink: #1c1c1a;
  --ink-soft: #56544e;
  --ink-faint: #8a8880;
  --line: #e5e2da;
  --accent: #2f6b5f;
  --accent-soft: #eef4f2;
  --warn-bg: #fdf6ec;
  --warn-line: #e8d5b0;
  --maxw: 42rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16161a;
    --surface: #1e1e23;
    --ink: #ececea;
    --ink-soft: #b3b1aa;
    --ink-faint: #85837c;
    --line: #33333a;
    --accent: #7fc0ae;
    --accent-soft: #22302c;
    --warn-bg: #2a251c;
    --warn-line: #4d4331;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans",
    "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
  font-size: 17px;
  line-height: 1.9;
  letter-spacing: 0.02em;
}

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

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

/* ── ヘッダー ── */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.site-header .inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.site-title {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.site-title img {
  display: block;
  width: 8.2rem;
  height: auto;
}
.site-tagline {
  font-size: 0.8rem;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
}

/* ── 本体 ── */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

h1 {
  font-size: 1.6rem;
  line-height: 1.55;
  letter-spacing: 0.01em;
  margin: 0.5rem 0 0.75rem;
}

h2 {
  font-size: 1.18rem;
  line-height: 1.6;
  margin: 3rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

h3 {
  font-size: 1.02rem;
  margin: 2rem 0 0.5rem;
}

p { margin: 0 0 1.4rem; }

ul, ol { padding-left: 1.4em; margin: 0 0 1.5rem; }
li { margin-bottom: 0.5rem; }

.meta {
  font-size: 0.8rem;
  color: var(--ink-faint);
  margin-bottom: 2rem;
}

.lead {
  color: var(--ink-soft);
}

/* ── 囲み ── */
.note {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  margin: 2rem 0;
  font-size: 0.94rem;
  line-height: 1.85;
}
.note p:last-child { margin-bottom: 0; }
.note .label {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  margin-bottom: 0.5rem;
}

.callout {
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  margin: 2rem 0;
  font-size: 0.94rem;
}
.callout p:last-child { margin-bottom: 0; }

.formula {
  background: var(--accent-soft);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.98rem;
  text-align: center;
  line-height: 1.8;
}

/* ── 記事内の実行手順 ── */
.action-steps {
  list-style: none;
  counter-reset: action;
  padding: 0;
  margin: 1.8rem 0 2rem;
}
.action-steps li {
  counter-increment: action;
  position: relative;
  padding: 1rem 1rem 1rem 3.6rem;
  margin: 0 0 0.7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.action-steps li::before {
  content: counter(action);
  position: absolute;
  left: 1rem;
  top: 1rem;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--surface);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
}
.action-steps strong,
.action-steps span { display: block; }
.action-steps strong { font-size: 0.96rem; }
.action-steps span {
  margin-top: 0.15rem;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.7;
}

/* ── アプリ紹介（記事末尾） ── */
.app-box {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 8px;
  padding: 1.2rem 1.3rem;
  margin: 3.5rem 0 2rem;
  font-size: 0.92rem;
  line-height: 1.85;
  color: var(--ink-soft);
}
.app-box .label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  margin-bottom: 0.6rem;
}
.app-box p:last-child { margin-bottom: 0; }

/* ── 画像（あとから入れる用・すでに使える） ── */
figure {
  margin: 2.2rem 0;
}
figure img {
  display: block;
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
}
figcaption {
  font-size: 0.82rem;
  color: var(--ink-faint);
  line-height: 1.75;
  margin-top: 0.6rem;
}
.hero-img { margin: 1.2rem 0 2.5rem; }
.hero-img img { border-radius: 12px; }

/* ── 図解（SVG・サイトの色に自動で合う） ── */
.diagram {
  margin: 2.4rem 0;
}
.diagram svg {
  display: block;
  width: 100%;
  /* 横に広げすぎると文字が巨大になるので上限を置く */
  max-width: 27rem;
  margin: 0 auto;
  height: auto;
  overflow: visible;
}
.diagram figcaption {
  margin-top: 0.9rem;
}
.dg-label { font-size: 15px; fill: var(--ink); }
.dg-sub   { font-size: 13px; fill: var(--ink-faint); }
.dg-num   { font-size: 15px; fill: var(--ink-soft); }
.dg-strong{ font-size: 16px; fill: var(--ink); font-weight: 700; }
.dg-line  { stroke: var(--line); stroke-width: 1.5; fill: none; }
.dg-axis  { stroke: var(--ink-faint); stroke-width: 1; fill: none; }
.dg-bar   { fill: var(--accent); }
.dg-bar-2 { fill: var(--accent); opacity: 0.72; }
.dg-bar-3 { fill: var(--accent); opacity: 0.46; }
.dg-bar-4 { fill: var(--accent); opacity: 0.26; }
.dg-bar-0 { fill: var(--line); }
.dg-box   { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; }
.dg-fill  { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.5; }

/* ── 表 ── */
.table-wrap {
  overflow-x: auto;
  margin: 1.8rem 0;
  -webkit-overflow-scrolling: touch;
}
table {
  width: 100%;
  min-width: 20rem;
  border-collapse: collapse;
  font-size: 0.86rem;
  line-height: 1.7;
}
th, td {
  padding: 0.65rem 0.35rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
thead th {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-faint);
  border-bottom-width: 1.5px;
  white-space: nowrap;
}
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tfoot td {
  font-weight: 700;
  border-top: 1.5px solid var(--line);
  border-bottom: none;
}

/* ── 記事一覧 ── */
.article-list { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.article-list li {
  border-top: 1px solid var(--line);
  margin: 0;
}
.article-list li:last-child { border-bottom: 1px solid var(--line); }
.article-list a {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 0 0.9rem;
  align-items: start;
  padding: 1.1rem 0;
  text-decoration: none;
  color: var(--ink);
}
.article-list a:hover .t { text-decoration: underline; }
/* サムネイル。画像が無い記事でも崩れないよう、img が無ければ1カラムに戻す */
.article-list a:not(:has(.thumb)) { grid-template-columns: 1fr; }
.article-list .thumb {
  grid-row: span 2;
  display: block;
  width: 88px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 6px;
  background: var(--line);
}
.article-list .t {
  display: block;
  font-weight: 600;
  line-height: 1.6;
  margin-bottom: 0.25rem;
}
.article-list .d {
  display: block;
  font-size: 0.85rem;
  color: var(--ink-faint);
  line-height: 1.7;
}
@media (min-width: 600px) {
  .article-list a { grid-template-columns: 132px 1fr; gap: 0 1.2rem; }
  .article-list .thumb { width: 132px; }
}

/* ── 関連記事 ── */
.related {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.related h2 {
  border: none;
  padding: 0;
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
}
.related ul { list-style: none; padding: 0; margin: 0; }
.related li { margin-bottom: 0.6rem; font-size: 0.94rem; }

/* ── フッター ── */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 2rem 1.25rem 3rem;
  font-size: 0.82rem;
  color: var(--ink-faint);
  line-height: 1.9;
}
.site-footer .inner { max-width: var(--maxw); margin: 0 auto; }
.site-footer a { color: var(--ink-soft); }
.site-footer p { margin: 0 0 0.8rem; }

.back-home {
  display: inline-block;
  margin-top: 2.5rem;
  font-size: 0.9rem;
}

@media (min-width: 700px) {
  body { font-size: 17.5px; }
  h1 { font-size: 1.85rem; }
  main { padding-top: 3rem; }
}

/* ── 公式ページへのショートカット ── */
.src-link {
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 8px 8px 0;
  padding: 0.85rem 1rem;
  margin: 1.6rem 0;
  font-size: 0.9rem;
  line-height: 1.8;
}
.src-link .label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  margin-bottom: 0.25rem;
}
.src-link a {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.src-link .who {
  display: block;
  font-size: 0.82rem;
  color: var(--ink-faint);
  margin-top: 0.15rem;
}

/* ── 相談への導線（A8提携後に使う） ── */
.cta {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.3rem 1.25rem;
  margin: 2.4rem 0;
  background: var(--surface);
  text-align: center;
}
.cta .pr {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  margin-bottom: 0.7rem;
}
.cta .lead {
  font-size: 0.95rem;
  line-height: 1.8;
  margin: 0 0 1.1rem;
  text-align: left;
}
.cta-btn {
  display: block;
  background: var(--accent);
  color: var(--surface);
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.95rem 1.2rem;
  border-radius: 8px;
  line-height: 1.5;
}
.cta-btn:hover { opacity: 0.88; }
.cta .micro {
  display: block;
  margin-top: 0.7rem;
  font-size: 0.8rem;
  line-height: 1.9;
  color: var(--ink-faint);
}
.cta .micro span { white-space: nowrap; }
.cta .after {
  font-size: 0.85rem;
  line-height: 1.8;
  color: var(--ink-faint);
  margin: 1rem 0 0;
  text-align: left;
}

/* ── フッターのナビ ── */
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.2rem;
  margin-bottom: 1.2rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--line);
}
.footer-nav a { color: var(--ink-soft); text-decoration: none; }
.footer-nav a:hover { text-decoration: underline; }
