/* ロンの開発日々エッセイ — 絵本のページ */
:root {
  --paper: #fbf6ec;
  --paper-edge: #efe5d2;
  --ink: #3b3226;
  --ink-soft: #6d6153;
  --accent: #c8735a;
  --accent-2: #5b8a8a;
  --gold: #d9a441;
  --quote-bg: #f5ecdb;
  --shadow: rgba(80, 60, 30, 0.10);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #25211c;
    --paper-edge: #2f2a23;
    --ink: #ece3d3;
    --ink-soft: #b9ad9b;
    --quote-bg: #332d25;
    --shadow: rgba(0, 0, 0, 0.35);
  }
}
* { box-sizing: border-box; }
html { background: var(--paper-edge); }
body {
  margin: 0;
  background: var(--paper-edge);
  color: var(--ink);
  font-family: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Yu Gothic", sans-serif;
  font-size: 18px;
  line-height: 2.05;
  letter-spacing: 0.03em;
}
.book {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 16px 96px;
}
.page {
  background: var(--paper);
  border-radius: 14px;
  box-shadow: 0 2px 18px var(--shadow);
  padding: 56px 52px 64px;
  margin-bottom: 36px;
}
@media (max-width: 600px) {
  body { font-size: 17px; }
  .page { padding: 36px 20px 44px; }
}
.hand { font-family: "Klee One", "Zen Maru Gothic", serif; }

/* 扉 */
.cover { text-align: center; }
.cover .book-title {
  font-family: "Klee One", serif;
  font-size: 2.1em;
  line-height: 1.5;
  margin: 28px 0 8px;
  font-weight: 600;
}
.cover .book-subtitle { color: var(--ink-soft); margin: 0; }
.cover .book-question { color: var(--accent); margin: 4px 0 0; font-family: "Klee One", serif; }
.cover .book-author { margin-top: 28px; color: var(--ink-soft); font-family: "Klee One", serif; }
.preface { margin-top: 8px; }
.preface p { margin: 0 0 1em; }

/* 挿絵 */
.illust { margin: 36px -12px; text-align: center; }
.illust img { width: 100%; height: auto; border-radius: 12px; display: block; }
.illust figcaption {
  font-family: "Klee One", serif;
  color: var(--ink-soft);
  font-size: 0.88em;
  margin-top: 10px;
}

/* 目次 */
.toc-title { font-family: "Klee One", serif; font-size: 1.4em; text-align: center; margin: 0 0 24px; }
.toc { list-style: none; margin: 0; padding: 0; }
.toc li { border-top: 1px dashed var(--ink-soft); }
.toc li:last-child { border-bottom: 1px dashed var(--ink-soft); }
.toc a {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 18px 4px;
  color: var(--ink);
  text-decoration: none;
}
.toc a:hover .toc-name { color: var(--accent); }
.toc-thumb { width: 120px; flex: 0 0 120px; border-radius: 8px; }
.toc-no { font-family: "Klee One", serif; color: var(--accent); font-size: 0.95em; }
.toc-name { font-family: "Klee One", serif; font-size: 1.15em; line-height: 1.6; display: block; }
.toc-line { color: var(--ink-soft); font-size: 0.85em; line-height: 1.7; display: block; }
.toc-date { color: var(--ink-soft); font-size: 0.8em; }
@media (max-width: 600px) {
  .toc-thumb { width: 88px; flex-basis: 88px; }
}

/* 本文 */
.ep-no { font-family: "Klee One", serif; color: var(--accent); text-align: center; margin: 0; }
.ep-title { font-family: "Klee One", serif; font-size: 1.75em; line-height: 1.55; text-align: center; margin: 6px 0 12px; font-weight: 600; }
.ep-date { text-align: center; color: var(--ink-soft); font-size: 0.85em; margin: 0 0 12px; }
.chapter { font-family: "Klee One", serif; font-size: 1.25em; margin: 48px 0 12px; }
.chapter::before { content: "✦ "; color: var(--gold); }
.page p { margin: 0 0 1.1em; }
.letter {
  background: var(--quote-bg);
  border-left: 4px solid var(--accent-2);
  border-radius: 6px;
  margin: 24px 0;
  padding: 16px 22px;
  font-family: "Klee One", serif;
  font-size: 1.05em;
}
.letter-from { display: block; font-size: 0.78em; color: var(--ink-soft); margin-top: 6px; }
.signature { text-align: right; font-family: "Klee One", serif; margin-top: 40px; }
.nav { display: flex; justify-content: space-between; font-family: "Klee One", serif; margin-top: 8px; }
.nav a { color: var(--accent-2); text-decoration: none; }
.nav a:hover { text-decoration: underline; }
.end-mark { text-align: center; color: var(--gold); letter-spacing: 0.6em; margin: 40px 0 0; }

/* 右上の「絵本で読む」（別のウインドウで、本だけのページを開く） */
.book-launch {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px 8px 10px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--accent);
  text-decoration: none;
  font-family: "Klee One", serif;
  font-size: 15px;
  box-shadow: 0 3px 14px var(--shadow);
  animation: bl-bob 4s ease-in-out infinite;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.book-launch:hover { transform: translateY(-2px); box-shadow: 0 6px 18px var(--shadow); animation-play-state: paused; }
.book-launch svg { width: 30px; height: 30px; }
.bl-page { fill: #fbf6ec; stroke: var(--accent); stroke-width: 2.4; stroke-linejoin: round; }
.bl-star { fill: var(--gold); animation: bl-tw 2.6s ease-in-out infinite; }
@keyframes bl-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes bl-tw { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
@media (max-width: 600px) {
  .book-launch { top: 10px; right: 10px; padding: 7px; }
  .bl-label { display: none; }
}

/* 少しだけ動く: ページはふわっと現れ、挿絵はゆっくり浮かぶ */
.page { animation: page-in 0.9s ease-out both; }
.illust img { transition: transform 0.4s ease; }
.illust img:hover { transform: translateY(-3px) rotate(-0.4deg); }
@keyframes page-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .page, .book-launch, .bl-star { animation: none; }
  .illust img, .book-launch { transition: none; }
}

/* 2026-09-30 夜 — 額縁の中で読むときの手当て（🌹 のブラッシュアップ 5 点） */
/* ② ④ タイトルは、言葉のまとまりの切れ目でだけ改行する（まとまりの途中で折り返さない） */
.nb { display: inline-block; }
/* ① もくじの最初の絵の上を詰める */
.cover .illust { margin-top: 0; }
@media (max-width: 600px) {
  .book { padding-top: 16px; }
  .page.cover { padding-top: 20px; }
  .cover .book-title { font-size: 1.75em; }
}
/* ③ 額縁の中では、外側のスクロールに合わせて frame.js が top を動かす */
.in-frame .book-launch { position: absolute; transition: top 0.12s linear, transform 0.2s ease, box-shadow 0.2s ease; }
