/* ============================================================
   放置される資産運用 — site stylesheet v2
   コンセプト「帳簿と文芸誌」
   題字=しっぽり明朝(マストヘッド風) / 本文=Zen角ゴシックNew /
   数字=IBM Plex Mono / 配色=生成りの紙・墨・弁柄(暗い朱)
   ============================================================ */

:root {
  --paper: #fcfaf5;
  --paper-raised: #ffffff;
  --ink: #322d26;
  --ink-muted: #8a8172;
  --line: #e8e2d4;
  --line-strong: #3a352c;
  --accent: #c04f2e;        /* 朱色(明るめの弁柄) */
  --accent-soft: #f9ede4;
  --table-stripe: #f7f3ea;
  --code-bg: #f3efe4;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #191713;
    --paper-raised: #201d18;
    --ink: #e9e4d8;
    --ink-muted: #97907f;
    --line: #37332a;
    --line-strong: #e9e4d8;
    --accent: #d98a70;
    --accent-soft: #2e2119;
    --table-stripe: #1f1c16;
    --code-bg: #262218;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Yu Gothic Medium", sans-serif;
  font-size: 15.5px;
  font-weight: 400;
  line-height: 2.0;
  letter-spacing: 0.02em;
  font-feature-settings: "palt";
}

.wrap {
  max-width: 41rem;
  margin: 0 auto;
  padding: 0 1.35rem;
}

::selection { background: var(--accent-soft); }

a { color: var(--ink); }

/* ---------- マストヘッド(題字) ---------- */

.site-header {
  text-align: center;
  padding: 3rem 0 0;
  margin-bottom: 3.5rem;
}

.site-mark {
  margin: 0 0 1rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  color: var(--ink-muted);
  text-transform: uppercase;
}

.mark-dot {
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 0.6em;
  vertical-align: 0.05em;
}

.site-title {
  display: inline-block;
  font-family: "Shippori Mincho", "Hiragino Mincho ProN", serif;
  font-size: 2.15rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.4;
}
.site-title:hover { color: var(--accent); }

.site-tagline {
  margin: 0.6rem 0 1.6rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.site-nav {
  display: flex;
  justify-content: center;
  gap: 2.25rem;
  padding: 0.8rem 0;
  border-top: 1px solid var(--line-strong);
  border-bottom: 3px double var(--line-strong);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}
.site-nav a:hover { color: var(--accent); }

/* ---------- 本文リンク(墨字+朱の下線) ---------- */

main a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
}
main a:hover { color: var(--accent); }

/* ---------- トップページ ---------- */

.home-intro { font-size: 0.97rem; }

.home-intro strong {
  font-family: "Shippori Mincho", "Hiragino Mincho ProN", serif;
  font-size: 1.1em;
  font-weight: 600;
}

.section-label {
  margin: 4rem 0 0.5rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  color: var(--ink-muted);
  text-transform: uppercase;
}
.section-label::after {
  content: "";
  display: block;
  margin-top: 0.6rem;
  border-bottom: 1px solid var(--line-strong);
}

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

.post-list li {
  display: flex;
  align-items: baseline;
  gap: 1.4rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--line);
}

.post-list time {
  flex: none;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.post-list a {
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
}
.post-list a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
}

/* ---------- 記事 ---------- */

.post-header {
  margin-bottom: 3rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--line);
}

.post-header time {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
  color: var(--ink-muted);
  letter-spacing: 0.1em;
}

.post-title {
  font-family: "Shippori Mincho", "Hiragino Mincho ProN", serif;
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.65;
  letter-spacing: 0.04em;
  margin: 0.75rem 0 0;
}

.post-content { font-size: 0.97rem; }

.post-content h2 {
  font-family: "Shippori Mincho", "Hiragino Mincho ProN", serif;
  font-size: 1.28rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 1.6;
  margin: 3.25rem 0 1rem;
}
.post-content h2::before {
  content: "";
  display: block;
  width: 1.9rem;
  border-top: 2px solid var(--accent);
  margin-bottom: 0.7rem;
}

.post-content h3 {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 2.25rem 0 0.75rem;
}

.post-content p { margin: 1.3rem 0; }

.post-content ul, .post-content ol { padding-left: 1.4rem; }
.post-content li { margin: 0.45rem 0; }
.post-content ul li::marker { color: var(--accent); }

.post-content blockquote {
  margin: 1.9rem 0;
  padding: 0.2rem 0 0.2rem 1.2rem;
  border-left: 2px solid var(--accent);
  color: var(--ink-muted);
  font-size: 0.94rem;
}
.post-content blockquote p { margin: 0.5rem 0; }

.post-content hr {
  border: none;
  text-align: center;
  margin: 3.25rem 0;
}
.post-content hr::after {
  content: "＊";
  color: var(--ink-muted);
  font-size: 0.9rem;
  letter-spacing: 1em;
  padding-left: 1em;
}

.post-content strong { font-weight: 700; }

.post-content em { font-style: normal; font-weight: 700; }

/* ---------- 書籍紹介 ---------- */

.book-cta {
  display: flex;
  gap: 1.4rem;
  align-items: flex-start;
  margin: 1.75rem 0;
  padding: 1.4rem;
  border: 1px solid var(--line-strong);
  background: var(--paper-raised);
}

.book-cover {
  width: 108px;
  max-width: 30vw;
  height: auto;
  flex: none;
  border: 1px solid var(--line);
}

.book-cta p { margin: 0 0 0.6rem; font-size: 0.9rem; }

.book-title {
  font-family: "Shippori Mincho", "Hiragino Mincho ProN", serif;
  font-size: 1.05rem !important;
  font-weight: 600;
}

.book-meta { color: var(--ink-muted); font-size: 0.8rem !important; }

@media (max-width: 480px) {
  .book-cta { flex-direction: column; }
}

/* ---------- 表(成績簿) ---------- */

.post-content table {
  width: 100%;
  margin: 2rem 0;
  border-collapse: collapse;
  font-size: 0.86rem;
  line-height: 1.7;
  display: block;
  overflow-x: auto;
  font-variant-numeric: tabular-nums;
}

.post-content th {
  text-align: left;
  font-weight: 700;
  padding: 0.55rem 0.9rem;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
}

.post-content td {
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid var(--line);
}

.post-content tbody tr:last-child td { border-bottom: 1px solid var(--line-strong); }
.post-content tbody tr:nth-child(even) { background: var(--table-stripe); }

/* ---------- コード ---------- */

code {
  font-family: "IBM Plex Mono", "Menlo", monospace;
  font-size: 0.84em;
  background: var(--code-bg);
  padding: 0.12em 0.4em;
  border-radius: 3px;
}

pre {
  background: var(--code-bg);
  padding: 1rem 1.25rem;
  border-radius: 4px;
  overflow-x: auto;
  line-height: 1.65;
}
pre code { background: none; padding: 0; }

/* ---------- 記事フッター・サイトフッター ---------- */

.post-footer {
  margin-top: 4rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
}

.post-book-note {
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin: 0 0 1.4rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--line);
  background: var(--paper-raised);
}

.back-link {
  font-size: 0.84rem;
  color: var(--ink-muted) !important;
  text-decoration: none !important;
}
.back-link:hover { color: var(--accent) !important; }

.site-footer {
  margin-top: 5.5rem;
  padding: 1.75rem 0 3rem;
  border-top: 3px double var(--line-strong);
  font-size: 0.75rem;
  line-height: 1.9;
  color: var(--ink-muted);
  text-align: center;
  letter-spacing: 0.04em;
}

.footer-note { margin: 0 0 0.4rem; }
.footer-meta { margin: 0; font-family: "IBM Plex Mono", monospace; font-size: 0.7rem; }
.site-footer a { color: var(--ink-muted); }
.site-footer a:hover { color: var(--accent); }

/* ---------- モバイル ---------- */

@media (max-width: 480px) {
  body { font-size: 15px; }
  .site-header { padding-top: 2rem; margin-bottom: 2.5rem; }
  .site-title { font-size: 1.6rem; letter-spacing: 0.08em; }
  .site-nav { gap: 1.4rem; font-size: 0.78rem; }
  .post-title { font-size: 1.4rem; }
  .post-list li { flex-direction: column; gap: 0.15rem; }
}
