/* Rising Maple free book pages (/books, written at build time by scripts/seo/books.ts from
   src/books/publicPages.ts). Loaded after /landing/home.css and /landing/learn.css: the grade pages'
   look, plus the book's cover, its first pages, the credit list and the cover cards. Mobile first. */
.btn-link { display: inline-flex; align-items: center; min-height: 48px; font-weight: 700; color: var(--heading); }
.center-actions { justify-content: center; }
.books .band .grade-links.center-links { justify-content: center; }
.books .band .price { margin-left: auto; margin-right: auto; text-align: center; }
.facts a { color: inherit; text-decoration: none; }

/* A book's header: words, then the cover (beside them on wide screens) */
.book-hero { display: grid; gap: 22px; }
.book-hero h1 { max-width: 15em; }
.by { margin-top: 10px; font-weight: 700; color: var(--muted); }
.book-cover img { width: 100%; max-width: 480px; border-radius: 18px; background: var(--paper); box-shadow: var(--card); }

/* The first pages: the picture and its words, like a page of the book */
.book-page { margin: 26px 0 0; background: var(--paper); border-radius: 22px; padding: 14px; box-shadow: var(--card); }
.book-page img { width: 100%; border-radius: 14px; background: var(--sky); }
.book-page figcaption { padding: 14px 8px 6px; font-size: 1.1875rem; line-height: 1.6; color: var(--ink); }
.book-page figcaption p + p { margin-top: 12px; }
.book-page.text-only figcaption { padding-top: 6px; font-size: 1.0625rem; }
.page-no { display: block; margin-bottom: 6px; font: 700 0.8125rem/1.2 var(--body); letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }

/* The credit the licence asks for */
.credits { margin: 24px 0 0; display: grid; gap: 10px; background: var(--paper); border-radius: 20px; padding: 18px 20px; box-shadow: 0 3px 0 var(--edge); }
.credits dt { font: 700 0.8125rem/1.3 var(--body); letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.credits dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.credits a { color: var(--heading); }
/* A note for grown-ups: soft tint, faint outline, a lightbulb badge beside the heading (no stripe, owner 2026-11-27) */
.tip { margin-top: 22px; padding: 18px 20px; background: var(--maple-wash); border: 1px solid #f6cdb4; border-radius: 20px; }
.tip h3 { display: flex; align-items: center; gap: 12px; font-size: 1.25rem; margin-bottom: 8px; }
.tip h3::before { content: ""; flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--paper) var(--i-bulb) center / 22px no-repeat; box-shadow: 0 3px 0 #f6cdb4; }

/* Cover cards: the index, the age pages and "More free books" */
.book-cards { margin-top: 26px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.book-cards a { display: flex; flex-direction: column; height: 100%; background: var(--paper); border-radius: 20px; padding: 10px 10px 14px; box-shadow: 0 4px 0 var(--edge); color: var(--heading); text-decoration: none; }
.book-cards a:hover h3, .book-cards a:hover h4 { text-decoration: underline; }
.book-cards .cover { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; border-radius: 14px; background: var(--sky); overflow: hidden; }
.book-cards .cover img { width: 100%; height: 100%; object-fit: contain; }
.book-cards h3, .book-cards h4 { margin-top: 10px; padding: 0 4px; font: 600 1.0625rem/1.25 var(--display); text-align: left; }
.book-cards h3::after { content: none; display: none; }
.book-cards .meta { margin-top: auto; padding: 6px 4px 0; font-size: 0.875rem; font-weight: 700; color: var(--muted); }
.level-lists h2 { margin-top: 48px; font-size: clamp(1.5rem, 5vw, 2rem); text-align: left; }
.level-lists h2:first-child { margin-top: 0; }
.level-lists h2::after { margin-left: 0; }
.level-lists h2 a { color: inherit; text-decoration: none; }
.level-lists h2 a:hover { text-decoration: underline; }
.level-note { margin-top: 8px; color: var(--muted); }

@media (min-width: 700px) {
  .book-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
}
@media (min-width: 900px) {
  .book-hero { grid-template-columns: 1.15fr 0.85fr; align-items: center; gap: 40px; }
  .book-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
