/* book.css — novel-style layout */

@import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:ital,wght@0,400;0,600;1,400&family=Libre+Baskerville:wght@400;700&display=swap');

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
   margin: 0;
   background: #ece6d8;
   color: #2b2620;
   font-family: 'Crimson Pro', Georgia, 'Times New Roman', serif;
   font-size: 20px;
   line-height: 1.7;
}

.chapter_image {
   display: block;
   width: min(92%, 720px);
   height: auto;
   margin: 0 auto 34px auto;
   border: 0;
}
.book {
   max-width: 640px;
   margin: 0 auto;
   padding: 70px 32px 90px;
   background: #fbf8f1;
   box-shadow: 0 0 0 1px rgba(0,0,0,0.04), 0 30px 70px -30px rgba(40,30,15,0.35);
   min-height: 100vh;
}

.book_title {
   text-align: center;
   font-family: 'Libre Baskerville', Georgia, serif;
   font-size: 0.95rem;
   letter-spacing: 0.18em;
   text-transform: uppercase;
   color: #8a6b3f;
   margin-bottom: 6px;
}

.book_subtitle {
   text-align: center;
   font-style: italic;
   font-size: 0.95rem;
   color: #6c6557;
   margin-bottom: 36px;
}

.chapter {
   text-align: center;
   font-family: 'Libre Baskerville', Georgia, serif;
   font-size: 0.85rem;
   letter-spacing: 0.3em;
   text-transform: uppercase;
   color: #9c3b1f;
   margin-top: 50px;
}

h1 {
   text-align: center;
   font-family: 'Libre Baskerville', Georgia, serif;
   font-weight: 700;
   font-size: 2rem;
   margin: 10px 0 44px;
   color: #2b2620;
}

h1::after {
   content: "";
   display: block;
   width: 60px;
   height: 2px;
   background: #c2502f;
   margin: 18px auto 0;
}

p {
   margin: 0 0 22px;
   text-indent: 1.6em;
}

p:first-of-type,
.chapter_end + p,
h1 + p {
   text-indent: 0;
}

.dialog {
   margin: 0 0 22px;
   text-indent: 0;
   font-style: italic;
   color: #3a342a;
}

.quote {
   margin: 28px auto;
   padding: 16px 24px;
   max-width: 460px;
   text-align: center;
   font-family: 'Libre Baskerville', Georgia, serif;
   font-style: italic;
   font-size: 1.05rem;
   color: #5b4326;
   border-top: 1px solid #d3c6ad;
   border-bottom: 1px solid #d3c6ad;
}

.cc-body {
   margin: 26px 0;
   padding: 18px 20px;
   background: #221e18;
   color: #f3efe2;
   border-radius: 6px;
   font-family: Consolas, 'Courier New', monospace;
   font-size: 0.85rem;
   line-height: 1.7;
   overflow-x: auto;
   white-space: nowrap;
   text-indent: 0;
}

.ln { display: inline-block; width: 1.6em; color: #756c58; user-select: none; }
.tag { color: #e0664a; }
.attr { color: #6fb6a8; }
.str { color: #d99a35; }
.txt { color: #f3efe2; }

.memory {
   margin: 50px 0 10px;
   padding: 26px 28px;
   background: #f4efe3;
   border-left: 4px solid #26534a;
   border-radius: 4px;
}

.memory h2 {
   margin: 0 0 10px;
   font-family: 'Libre Baskerville', Georgia, serif;
   font-size: 1rem;
   letter-spacing: 0.08em;
   text-transform: uppercase;
   color: #26534a;
}

.memory p {
   margin: 0;
   text-indent: 0;
   font-size: 0.95rem;
   color: #3a342a;
}

.chapter_end {
   text-align: center;
   margin: 60px 0 0;
   font-family: 'Libre Baskerville', Georgia, serif;
   font-size: 0.78rem;
   letter-spacing: 0.25em;
   text-transform: uppercase;
   color: #a89b80;
}

.chapter_end::before,
.chapter_end::after {
   content: "❧";
   margin: 0 14px;
   color: #c2502f;
}

.nav {
   max-width: 640px;
   margin: 26px auto 0;
   display: flex;
   justify-content: space-between;
   align-items: center;
   padding: 0 4px;
}

.nav a {
   text-decoration: none;
   color: #6c6557;
   font-family: 'Libre Baskerville', Georgia, serif;
   font-size: 0.85rem;
   letter-spacing: 0.04em;
   border-bottom: 1px solid transparent;
   transition: border-color 160ms ease, color 160ms ease;
}

.nav a:hover {
   color: #c2502f;
   border-color: #c2502f;
}

@media (max-width: 700px) {
   .book { padding: 48px 22px 70px; }
   h1 { font-size: 1.6rem; }
   body { font-size: 18px; }
}

/* Chapter image — full by default, click top portion zooms big */
.chapter_image_wrap {
   width: min(92%, 720px);
   margin: 0 auto 34px auto;
   cursor: zoom-in;
   border-radius: 8px;
   overflow: hidden;
   transition: height 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

.chapter_image_wrap.is_open {
   height: 480px;
   cursor: zoom-out;
}

.chapter_image {
   display: block;
   width: 100%;
   height: auto;
   border: 0;
   transition: transform 600ms cubic-bezier(0.16, 1, 0.3, 1),
               width 600ms cubic-bezier(0.16, 1, 0.3, 1);
   transform-origin: top center;
}

.chapter_image_wrap.is_open .chapter_image {
   transform: scale(1.7);
   transform-origin: top center;
}

.home_pill {
   display: inline-block;
   padding: 8px 18px;
   border-radius: 999px;
   background: #fff7df;
   border: 1px solid #d7b56d;
   color: #221e18;
   text-decoration: none;
}

.home_pill:hover {
   background: #f1d994;
}

