.book-hero {
  border-bottom: 1px solid var(--line);
}

.book-hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 68px;
  align-items: center;
  padding-top: 72px;
  padding-bottom: 60px;
}

.book-hero h1 {
  max-width: 900px;
  margin: 0;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: clamp(3rem, 7vw, 5.2rem);
  line-height: 1;
  letter-spacing: 0;
}

.book-cover-link {
  display: block;
  width: 100%;
  line-height: 0;
  box-shadow: 0 18px 44px rgb(23 33 31 / 18%);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.book-cover-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 23px 52px rgb(23 33 31 / 22%);
}

.book-cover-link:focus-visible {
  outline: 3px solid var(--rust);
  outline-offset: 5px;
}

.book-cover-link img {
  display: block;
  width: 100%;
  height: auto;
}

.draft-notice {
  max-width: 760px;
  margin: 30px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.book-actions {
  margin: 24px 0 0;
}

.book-toc {
  padding-top: 68px;
  padding-bottom: 84px;
}

.book-section-head {
  padding-bottom: 26px;
}

.part-list {
  border-top: 2px solid var(--ink);
}

.book-part {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(0, 1.5fr);
  gap: 48px;
  padding: 34px 0 42px;
  border-bottom: 1px solid var(--line);
}

.part-heading h3 {
  max-width: 310px;
  margin: 4px 0 0;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.55rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.part-number {
  margin: 0;
  color: var(--rust);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

.chapter-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.chapter-list li {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) max-content;
  gap: 16px;
  align-items: baseline;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.chapter-list .chapter-number {
  color: var(--rust);
  font-size: 0.79rem;
  font-weight: 700;
}

.chapter-title {
  color: var(--ink);
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.35;
  text-decoration-color: var(--rust);
}

.chapter-title:hover {
  color: var(--green-dark);
}

.chapter-status {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.footer-inner p:last-child {
  text-align: right;
}

.downloads-hero {
  padding: 66px 0 58px;
  border-bottom: 1px solid var(--line);
  background: #eef2ef;
}

.downloads-hero-inner {
  max-width: 900px;
}

.downloads-hero h1 {
  max-width: 850px;
  margin: 0;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: clamp(2.7rem, 6vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.downloads-hero .lead {
  max-width: 790px;
}

.downloads-section {
  padding-top: 62px;
  padding-bottom: 84px;
}

.downloads-head {
  padding-bottom: 26px;
}

.download-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 2px solid var(--ink);
}

.download-list li {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 72px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.download-number {
  color: var(--rust);
  font-size: 0.79rem;
  font-weight: 700;
}

.download-list strong {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.08rem;
  line-height: 1.3;
}

.download-actions {
  display: flex;
  gap: 8px;
}

.download-actions a {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  min-width: 126px;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.download-actions a:hover {
  border-color: var(--rust);
  color: var(--green-dark);
  background: #ffffff;
}

.download-actions small {
  margin-left: 4px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
}

/* Shared reading shell for generated chapter pages. */
.chapter-shell {
  width: min(760px, calc(100% - 40px));
  margin: 0 auto;
}

.chapter-content {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.08rem;
  line-height: 1.72;
}

.chapter-content img,
.chapter-content svg {
  display: block;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
}

.chapter-content figure {
  margin: 38px 0;
}

.chapter-content figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.82rem;
  line-height: 1.5;
}

.chapter-content .keypoint,
.chapter-content .warning,
.chapter-content .sideline,
.chapter-content .casestudy,
.chapter-content .historicalnote,
.chapter-content .studyandlearn {
  margin: 30px 0;
  padding: 20px 22px;
  border-left: 4px solid var(--gold);
  background: #ffffff;
}

.aifiguredescription,
[data-ai-only="true"] {
  display: none;
}

@media (max-width: 820px) {
  .book-hero-layout {
    grid-template-columns: minmax(0, 1fr) 190px;
    gap: 36px;
  }

  .book-part {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .part-heading h3 {
    max-width: none;
  }
}

@media (max-width: 620px) {
  .book-hero-layout {
    grid-template-columns: 1fr;
    gap: 16px;
    padding-top: 34px;
    padding-bottom: 24px;
  }

  .book-cover-link {
    width: 110px;
  }

  .book-toc {
    padding-top: 48px;
    padding-bottom: 58px;
  }

  .downloads-hero {
    padding-top: 40px;
    padding-bottom: 38px;
  }

  .downloads-section {
    padding-top: 46px;
    padding-bottom: 58px;
  }

  .download-list li {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    padding: 15px 0;
  }

  .download-actions {
    grid-column: 2;
    flex-wrap: wrap;
  }

  .download-actions a {
    min-width: 118px;
  }

  .chapter-list li {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
  }

  .chapter-status {
    grid-column: 2;
  }

  .footer-inner {
    flex-direction: column;
    gap: 6px;
  }

  .footer-inner p:last-child {
    text-align: left;
  }
}
