
/* =========================
   RESET
========================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* =========================
   BODY
========================= */
body {
  background: #0f0a06;
  font-family: "IM Fell English", serif;
  color: #2b1a10;
}

#chapterImage img {
  width: 100%;
  max-width: 600px;

  height: 600px;        /* fixed frame size */
  object-fit: contain;  /* IMPORTANT: no cropping */

  display: block;
  margin-top: 20px;

  border: 0px solid rgba(0,0,0,0.3);
}

/* =========================
   2-COLUMN LAYOUT (THIS IS THE CORRECT ONE)
========================= */
.layout {
  display: grid;

  grid-template-columns: 220px 1fr;

  min-height: 100vh;
}

/* =========================
   LEFT: INDEX
========================= */
.sidebar {
  background: #e7d3b0;
  padding: 20px;

  border-right: 1px solid rgba(0,0,0,0.2);
  overflow-y: auto;
}

/* links */
.sidebar a {
  display: block;
  margin-bottom: 8px;
  padding: 6px;

  text-decoration: none;
  color: #2b1a10;

  background: rgba(255,255,255,0.25);
}

.sidebar a:hover {
  background: rgba(0,0,0,0.1);
}

/* =========================
   RIGHT: READER PAGE
========================= */
.page {
  background: #efe2c5;
  padding: 60px;

  display: block;
  overflow: visible;
}

/* IMPORTANT: DO NOT force #ch1 visible */
/* =========================
   TEXT STYLE (FIXED SPACING)
========================= */
.page p {
  line-height: 1.4;
  font-size: 16px;
  white-space: normal;
  margin-bottom: 9px;
}

/* =========================
   IMAGE AT END OF TEXT
========================= */
.page img {
  width: 100%;
  margin-top: 15px;
  border: 1px solid rgba(0,0,0,0.3);
}


html {
  scroll-padding-top: 0px;
}



/* =========================
   CHAPTER BUTTONS (INK / MANUSCRIPT STYLE)
========================= */

.sidebar button {
  width: 100%;
  text-align: left;

  padding: 10px 12px;
  margin-bottom: 10px;

  font-family: "IM Fell English", serif;
  font-size: 16px;

  color: #2b1a10;

  background: rgba(255, 255, 255, 0.25);

  border: 1px solid rgba(0, 0, 0, 0.15);
  border-left: 4px solid rgba(43, 26, 16, 0.5);

  cursor: pointer;

  transition: all 0.2s ease;

  letter-spacing: 0.3px;
}

/* hover effect (subtle ink darkening) */
.sidebar button:hover {
  background: rgba(0, 0, 0, 0.08);
  border-left: 4px solid #2b1a10;

  transform: translateX(3px);
}

/* active/pressed feel */
.sidebar button:active {
  transform: translateX(1px);
}

#chapterTitle {
  margin-bottom: 30px;
}



/* =========================
   CENTER CHAPTER IMAGES
========================= */

#chapterImage {
  display: flex;
  justify-content: center;

  margin-top: 25px;
}

#chapterImage img {
  display: block;

  width: 100%;
  max-width: 1000px;

  height: auto;
  max-height: 600px;

  object-fit: contain;
}

.wax-return {
  position: fixed;
  top: 20px;
  right: 20px;

  width: 62px;
  height: 62px;

  border-radius: 50%;

  /* base wax red */
  background: radial-gradient(circle at 30% 30%,
    #b30000 0%,
    #7a0000 55%,
    #4a0000 100%);

  /* inset “pressed into paper” effect */
  box-shadow:
    inset 2px 3px 6px rgba(0,0,0,0.55),
    inset -2px -2px 5px rgba(255,140,140,0.18),
    0 2px 4px rgba(0,0,0,0.25);

  display: block;

  position: fixed;
}

/* engraved star motif */
.wax-return::before {
  content: "✦";

  position: absolute;
  inset: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 26px;
  color: rgba(30, 0, 0, 0.55);

  text-shadow:
    inset 0 1px 0 rgba(255,255,255,0.2),
    0 1px 1px rgba(0,0,0,0.35);

  pointer-events: none;
}

/* subtle indentation ring in paper */
.wax-return::after {
  content: "";
  position: absolute;
  inset: -4px;

  border-radius: 50%;

  box-shadow:
    inset 0 0 10px rgba(0,0,0,0.25);

  pointer-events: none;
}


