/* Each illustrated story page keeps its picture, caption and matching text together. */
.story-page {
  padding: clamp(1rem, 3vw, 2rem);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: center;
}

.story-page[hidden] { display: none; }

.page-image {
  position: relative;
  z-index: 1;
  margin: 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
}

.page-image img {
  display: block;
  width: 100%;
  flex: 1 1 auto;
  min-height: clamp(340px, 34vw, 470px);
  object-fit: cover;
  border-radius: 1rem;
  box-shadow: 0 16px 40px rgba(55, 38, 10, .16);
}

.page-image figcaption {
  padding: .7rem .25rem 0;
  color: var(--muted);
  font-size: .85rem;
  line-height: 1.45;
}

.page-copy {
  z-index: 1;
  max-width: none;
  margin: 0;
}

.page-copy > p:not(.eyebrow) {
  font-size: clamp(1.05rem, 1.7vw, 1.25rem);
  line-height: 1.7;
}

.story-page > .talk-card {
  grid-column: 1 / -1;
  width: 100%;
  margin-top: 0;
  padding: 1rem 1.4rem;
}

.story-page > .talk-card p {
  margin: .35rem 0 0;
  font-size: clamp(1rem, 1.7vw, 1.2rem);
}

@media (max-width: 760px) {
  .page-dots { flex-wrap: wrap; }
  .story-page {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .page-image { order: 1; }
  .page-image img {
    flex: none;
    min-height: 0;
    aspect-ratio: 16 / 9;
  }
  .page-copy { order: 2; }
  .story-page > .talk-card { order: 3; }
}

.tenali-reading-tools {
  margin: 1.25rem 0 3rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--paper);
}

.tenali-reading-tools > summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: .7rem 1rem;
  color: var(--teal);
  font-weight: 800;
  cursor: pointer;
  list-style-position: inside;
}

.tenali-reading-tools > summary::after {
  content: "Open";
  margin-left: auto;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
}

.tenali-reading-tools[open] > summary::after { content: "Close"; }

.tenali-reading-tools .reader-tools {
  position: static;
  max-width: none;
  margin: 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0 0 1rem 1rem;
  box-shadow: none;
  backdrop-filter: none;
}

.chapter-finish {
  margin: 2rem 0;
  padding: clamp(1.4rem, 3vw, 2.2rem);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: var(--paper);
}

.chapter-finish h2 { margin-bottom: 1rem; }
.chapter-finish-actions { display: flex; flex-wrap: wrap; gap: .7rem; }

.next-chapter-preview {
  display: grid;
  gap: .2rem;
  margin-top: 1.3rem;
  padding: 1rem 1.2rem;
  border-left: 5px solid var(--gold);
  border-radius: .3rem 1rem 1rem .3rem;
  background: #fff5d9;
}

.next-chapter-preview span,
.next-chapter-preview small { color: var(--muted); }
.next-chapter-preview span { font-size: .72rem; font-weight: 850; letter-spacing: .1em; }
.next-chapter-preview strong { font: 700 clamp(1.25rem, 2.5vw, 1.8rem)/1.25 Georgia, serif; }
