/* ── ふみかげ。 共通スタイル ────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500&display=swap');

:root {
  --bg:        #FDFAF2;
  --bg2:       #FAF5E8;
  --text:      #3a2e22;
  --text-light:#7a6a58;
  --link:      #5c4433;
  --link-hover:#a0522d;
  --border:    rgba(120,90,60,0.12);
  --serif:     'Noto Sans JP', sans-serif;
  --max-width: 700px;
}

/* ── reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── スマホ向け：文字サイズ・太さを読みやすく ── */
@media (max-width: 640px) {
  body {
    font-weight: 400;
  }
  #novel p {
    font-size: 16px;
    font-weight: 400;
    line-height: 2.4;
  }
  .story-link,
  .tanpatsu-link {
    font-size: 16px;
  }
  .story-link .r18-badge {
    height: 1.4em;
    vertical-align: -0.45em;
  }
}

/* ── body ── */
html {
  background: var(--bg);
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-weight: 300;
  /* font-size はブラウザ設定に従う — px指定しない */
  line-height: 1.9;
  min-height: 100vh;
  padding: 0 0 80px;
}

/* ── subtle bg blobs ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(circle 200px at 5% 10%,  oklch(72% 0.09 12  / 0.10) 0%, transparent 100%),
    radial-gradient(circle 150px at 95% 20%,  oklch(70% 0.07 160 / 0.09) 0%, transparent 100%),
    radial-gradient(circle 180px at 8%  60%,  oklch(72% 0.09 260 / 0.08) 0%, transparent 100%),
    radial-gradient(circle 120px at 92% 75%,  oklch(72% 0.09 12  / 0.08) 0%, transparent 100%);
}

/* ── page header (manually added via header.html or replicated in each file) ── */
/* ── but we style it if a matching element exists ── */

/* ── novel content wrapper ── */
#novel {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 60px 28px 0;
}

/* ── site header area ── */
#novel .site-header,
.site-header {
  text-align: center;
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

/* ── story title ── */
#novel h1,
#novel h2,
#novel h3 {
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 36px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

#novel h1::after,
#novel h2::after,
#novel h3::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 28px;
  height: 2px;
  background: oklch(72% 0.09 12);
  border-radius: 2px;
}

/* ── body paragraphs ── */
#novel p {
  margin-bottom: 0;
  line-height: 2.2;
  color: var(--text);
  text-wrap: pretty;
  /* font-size はブラウザ設定に従う — px指定しない */
}

/* ── inline links inside novel body ── */
#novel a,
#novel A {
  color: var(--link);
  text-decoration: none;
}

#novel a:hover,
#novel A:hover {
  color: var(--link-hover);
}

/* ── NEXT / PREV navigation inside #novel ── */
#novel div[align="right"],
#novel div[align="left"],
#novel div[align="center"] {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: unset !important;
  display: flex;
  justify-content: flex-end;
}

#novel div[align="right"] a,
#novel div[align="left"] a,
#novel div[align="center"] a {
  font-size: inherit;
  color: var(--link);
  text-decoration: none;
  letter-spacing: 0.04em;
}

#novel div[align="right"] a:hover,
#novel div[align="left"] a:hover,
#novel div[align="center"] a:hover {
  color: var(--link-hover);
}

/* ── footer ── */
#footer {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 28px 0;
  border-top: 1px solid var(--border);
  margin-top: 48px;
}

#footer ul {
  list-style: none;
  display: flex;
  gap: 20px;
}

#footer ul li a,
#footer ul li A {
  font-size: 0.85em;
  color: var(--text-light);
  text-decoration: none;
  letter-spacing: 0.1em;
}

#footer ul li a:hover,
#footer ul li A:hover {
  color: var(--link);
}

/* ── index page specific ── */
.index-wrapper {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 60px 28px 100px;
}

.index-site-header {
  text-align: center;
  margin-bottom: 56px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.index-site-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 2px;
  background: oklch(72% 0.09 12);
  border-radius: 2px;
}

.index-site-title {
  font-size: 2.2rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--text);
  margin-bottom: 10px;
}

.index-site-logo {
  width: 320px;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.index-site-subtitle {
  font-size: 0.80rem;
  color: var(--text-light);
  letter-spacing: 0.1em;
  line-height: 1.8;
  margin-bottom: 0.8em;
}
.index-site-subtitle:last-child {
  margin-bottom: 0;
}

.index-site-label {
  font-size: 0.97rem;
}

.index-section-heading {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.06em;
  margin-top: 52px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.index-section-heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* series block */
.series-block {
  margin-bottom: 28px;
  background: var(--bg2);
  border-radius: 10px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.series-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 14px 20px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
}

.series-pip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
}

.series-title-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  flex: 1;
}

.series-count {
  font-size: 0.72rem;
  color: var(--text-light);
}

.series-toggle {
  font-size: 0.75rem;
  color: var(--text-light);
  flex-shrink: 0;
}

.series-toggle.open { transform: rotate(180deg); }

.series-list { display: none; padding: 10px 0; }
.series-list.open { display: block; }

.story-link {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 20px 5px 36px;
  text-decoration: none;
  color: var(--link);
  font-size: 0.88rem;
}

.story-link:hover { color: var(--link-hover); }

.story-nolink {
  color: var(--text-light);
  cursor: default;
}
.story-nolink:hover { color: var(--text-light); }

.series-inner-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 4px 36px;
  font-size: 0.97rem;
  color: var(--text-light);
  letter-spacing: 0.08em;
}
.series-inner-divider::before,
.series-inner-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.series-inner-divider::before { flex: none; width: 0; }

.story-num {
  font-size: 0.68rem;
  color: var(--text-light);
  min-width: 20px;
}

/* tanpatsu */
.tanpatsu-grid { display: flex; flex-direction: column; }

.tanpatsu-link {
  display: block;
  padding: 5px 0;
  color: var(--link);
  text-decoration: none;
  font-size: 0.88rem;
  border-bottom: 1px solid transparent;
}

.tanpatsu-link:hover { color: var(--link-hover); }

.index-footer {
  text-align: center;
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 0.68rem;
  color: var(--text-light);
  letter-spacing: 0.1em;
}
