.purchase-chapters {
  display: grid;
  grid-template-columns: var(--pair);
  grid-template-rows: auto 1fr;
  column-gap: var(--gap);
  align-items: start;
}
.chapter-intro { grid-area: 1 / 1; }
.chapter-intro h2 { max-width: 17ch; }
.chapter-list { grid-area: 1 / 2 / 3; min-width: 0; background: var(--panel); border-radius: var(--radius); }
.chapter-action { grid-area: 2 / 1; padding-block-start: 1.4rem; }
.chapter-context { margin-block-start: clamp(1.4rem, 2.8vw, 2.4rem); max-width: 40ch; }
.chapter-progress {
  display: flex; align-items: center; gap: .7rem; margin: 0 0 .65rem;
  font-variant-numeric: tabular-nums; color: var(--quiet); font-size: .89rem;
}
.chapter-excerpt, .chapter-body { color: var(--muted); font-size: 1rem; line-height: 1.55; }
.chapter-excerpt { margin: 0; }
.chapter-row { position: relative; border-radius: var(--radius); }
.chapter-row[open] { background: var(--raised); }
/* The purchase action spans its grid column on both layouts. */
.chapter-cta {
  width: 100%; min-height: max(48px, var(--control-size)); color: #fff;
  background: linear-gradient(110deg, #59388a, #743c88 58%, #873a76);
  border-color: #ab75b6; border-radius: var(--radius);
}
@media (hover: hover) {
  .chapter-cta:hover { filter: brightness(1.12); }
}
.chapter-cta:active { filter: brightness(.94); }
.chapter-row summary {
  display: grid; grid-template-columns: 2ch minmax(0, 1fr) 1.2rem;
  align-items: center; gap: clamp(.8rem, 1.6vw, 1.6rem);
  list-style: none; cursor: pointer; padding: 1rem clamp(.9rem, 1.7vw, 1.5rem);
  min-height: 4rem; min-width: 0; color: var(--muted); line-height: 1.28;
}
.chapter-row summary::-webkit-details-marker { display: none; }
.chapter-row summary:focus-visible { outline-offset: 1px; }
.chapter-number { font-size: .86rem; font-variant-numeric: tabular-nums; color: var(--quiet); }
.chapter-title { overflow-wrap:anywhere; font-weight: 600; font-size: clamp(1.08rem, 1.75vw, 1.65rem); letter-spacing: -.025em; }
.chapter-toggle { position: relative; display: block; width: 1.05rem; height: 1.05rem; justify-self: end; }
.chapter-toggle::before, .chapter-toggle::after {
  position: absolute; inset: calc(50% - .6px) 0 auto; height: 1.2px; content: ""; background: currentColor;
}
.chapter-toggle::after { transform: rotate(90deg); }
.chapter-row[open] summary { color: var(--text); }
.chapter-row[open] .chapter-number { color: var(--accent); }
.chapter-row[open] .chapter-toggle::after { transform: rotate(0deg); }
.chapter-body { overflow-wrap:anywhere; margin: 0; max-width: 46ch; padding: 0 1.5rem 1.2rem; }
@media (hover: hover) {
  .chapter-row summary:hover { color: var(--text); }
}
@media (min-width: 50.01rem) {
  /* The visual excerpt sits next to the list. The native expanded text stays
     available in the disclosure for assistive technology and find-in-page. */
  .purchase-chapters.is-enhanced .chapter-body {
    position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
    clip-path: inset(50%); white-space: nowrap;
  }
}
@media (max-width: 50rem) {
  .purchase-chapters { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; }
  .chapter-intro, .chapter-list, .chapter-action { grid-area: auto; }
  .chapter-intro { margin-block-end: 1.25rem; }
  .chapter-intro h2 { max-width: none; }
  .chapter-context { display: none; }
  .chapter-row summary { min-height: 3.55rem; padding-block: .85rem; }
  .chapter-body { padding-inline: calc(2ch + clamp(.8rem, 1.6vw, 1.6rem) + clamp(.9rem, 1.7vw, 1.5rem)) 1rem; }
  .chapter-action { padding-block-start: 1.05rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .chapter-toggle::after { transition: transform .22s cubic-bezier(.22, 1, .36, 1); }
  .chapter-row summary { transition: color .18s ease; }
}
