/* 『因果の否定』小説サイト 共通CSS（zaha.flow-money.com と共通のデザイン言語）
   黒地・明朝・金の細枠。外部フォント／外部スクリプト不使用。 */

:root {
  --bg: #2a2a2a;
  --bg-soft: #323234;
  --text: #efe7d6;
  --muted: #b3a78d;
  --gold: #c9a227;
  --gold-dim: #7d6419;
  --line: #55503a;
}

* { box-sizing: border-box; }
html { background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Mincho ProN", "Hiragino Mincho Pro",
    "YuMincho", "Yu Mincho", "Noto Serif JP", "Noto Serif CJK JP", serif;
  line-height: 2.0;
  letter-spacing: 0.02em;
}

a { color: var(--gold); }
a:hover { text-decoration: none; }

.wrap { max-width: 780px; margin: 0 auto; padding: 0 20px 72px; }

header.site { text-align: center; padding: 40px 8px 4px; }
header.site .series { color: var(--gold); font-size: 0.85rem; letter-spacing: 0.3em; margin: 0 0 10px; }
header.site h1 { font-size: 1.55rem; font-weight: 600; letter-spacing: 0.06em; margin: 0; line-height: 1.6; }
header.site .date { color: var(--muted); font-size: 0.88rem; margin: 8px 0 0; }

nav.prevnext {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding: 12px 0; font-size: 0.92rem;
}
nav.prevnext.top { border-bottom: 1px solid var(--line); margin-bottom: 28px; }
nav.prevnext.bottom { border-top: 1px solid var(--line); margin-top: 36px; }
nav.prevnext a { text-decoration: none; }
nav.prevnext .spacer { flex: 0 0 auto; visibility: hidden; }

article.chapter p { margin: 0 0 1.1em; }
article.chapter p.chap {
  color: var(--muted); text-align: center; letter-spacing: 0.2em;
  margin-bottom: 2em;
}
article.chapter h3 {
  font-size: 1.12rem; font-weight: 600; letter-spacing: 0.05em;
  margin: 2.2em 0 1em; color: var(--text);
}
article.chapter h3::before { content: "◆"; color: var(--gold); font-size: 0.8em; margin-right: 0.6em; }

/* ルビ（読み辞書方式で生成。表示OFF切替は body.ruby-off で rt を消す） */
rt { color: var(--muted); font-size: 0.52em; letter-spacing: 0; }
body.ruby-off rt { display: none; }

footer.site {
  border-top: 1px solid var(--gold-dim); margin-top: 48px; padding-top: 20px;
  text-align: center; color: var(--muted); font-size: 0.88rem;
}
footer.site p { margin: 0.35em 0; }

/* 目次ページ・固定ページ用 */
h2.toc-head {
  font-size: 1.2rem; font-weight: 600; letter-spacing: 0.08em;
  margin: 2em 0 0.8em; padding-bottom: 0.3em;
  border-bottom: 1px solid var(--gold-dim);
}
ul.toc { list-style: none; margin: 0 0 1.5em; padding: 0; }
ul.toc li { padding: 0.3em 0; border-bottom: 1px dotted var(--line); }
ul.toc li a { text-decoration: none; color: var(--text); }
ul.toc li a:hover { color: var(--gold); }
ul.toc li.plain { color: var(--muted); }
div.promo {
  border: 1px solid var(--gold-dim); background: var(--bg-soft);
  padding: 16px 20px; margin: 40px 0 0; text-align: center;
}
div.promo p { margin: 0.4em 0; }
div.promo .promo-title { color: var(--gold); letter-spacing: 0.1em; }
article.plain h2 {
  font-size: 1.15rem; font-weight: 600; margin: 1.8em 0 0.7em;
  padding-bottom: 0.25em; border-bottom: 1px solid var(--line);
}
article.plain ul { margin: 0 0 1.1em; padding-left: 1.4em; }
article.plain li { margin: 0.3em 0; }

/* サイト共通ナビ（2026-11-22 ユーザビリティ改善） */
nav.sitebar { display: flex; flex-wrap: wrap; gap: 4px 20px; align-items: baseline; padding: 14px 2px 10px; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
nav.sitebar .brand { color: var(--text); font-weight: 600; text-decoration: none; letter-spacing: 0.08em; margin-right: 6px; }
nav.crumbs { padding: 10px 2px 0; font-size: 0.82rem; color: var(--muted); }
nav.crumbs a { color: var(--muted); }
footer.site .footnav { font-size: 0.95rem; margin-bottom: 10px; }

header.site .work-title { font-size: clamp(0.88rem, 4.2vw, 1.3rem); font-weight: 600; letter-spacing: 0.16em; margin: 0 0 10px; line-height: 1.6; color: var(--gold); white-space: nowrap; }
header.site .work-title a { color: var(--gold); text-decoration: none; }
header.site .work-title .wt-sep { margin: 0 0.1em; }

/* 配色テーマ（2026-11-22 raguna要望：読者が右上のボタンで切替、選択は端末に保存） */
html[data-theme="paper"] { --bg: #faf6ec; --bg-soft: #f1e9d8; --text: #2a2620; --muted: #7a6f5c; --gold: #2b4c9a; --gold-dim: #9db1d8; --line: #ddd2ba; }
html[data-theme="sepia"] { --bg: #f0e3c8; --bg-soft: #e7d7b4; --text: #3b2d1c; --muted: #8a7350; --gold: #9a4a1f; --gold-dim: #c99b6a; --line: #d8c49a; }
html[data-theme="night"] { --bg: #0a1020; --bg-soft: #111a30; --text: #dde5f2; --muted: #93a3c0; --gold: #8fb4ff; --gold-dim: #4a648f; --line: #26334f; }
html[data-theme="mid"] { --bg: #151515; --bg-soft: #1d1d1f; --line: #403b25; }
.theme-switch { position: fixed; top: 10px; right: 10px; z-index: 50; display: flex; gap: 6px; align-items: center; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; font-size: 0.72rem; color: var(--muted); letter-spacing: 0.1em; }
.theme-switch button { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); padding: 0; cursor: pointer; flex: 0 0 auto; }
.theme-switch button[data-set=""] { background: linear-gradient(135deg, #2a2a2a 55%, #c9a227 45%); }
.theme-switch button[data-set="paper"] { background: linear-gradient(135deg, #faf6ec 55%, #2b4c9a 45%); }
.theme-switch button[data-set="sepia"] { background: linear-gradient(135deg, #f0e3c8 55%, #9a4a1f 45%); }
.theme-switch button[data-set="night"] { background: linear-gradient(135deg, #0a1020 55%, #8fb4ff 45%); }
.theme-switch button[data-set="mid"] { background: linear-gradient(135deg, #151515 55%, #c9a227 45%); }
.theme-switch button[aria-pressed="true"] { border-color: var(--gold); }
@media (max-width: 640px) { .wrap { padding-top: 36px; } }

/* 手動広告ユニット（2026-11-22） */
.ad-slot { margin: 30px 0; }
.ad-label { display: block; font-size: 0.68rem; color: var(--muted); letter-spacing: 0.25em; margin-bottom: 6px; }
