/* public/css/book.css — public discovery surfaces: /book, /browse, /subject, /author.
   Uses the existing design tokens from site.css so these pages belong to the
   same family as the rest of the site rather than looking bolted on. */

.book-page { padding: 8px 0 48px; }

/* ── Breadcrumbs ─────────────────────────────────────────────────────────── */
.crumbs {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  font-size: .9rem; color: var(--ink-2, #45505F); margin: 4px 0 18px;
}
.crumbs a { color: var(--ink-2, #45505F); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs__current { color: var(--ink); font-weight: 600; }

/* ── Book hero ───────────────────────────────────────────────────────────── */
.book-hero {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  align-items: start;
  margin-bottom: 40px;
}
.book-hero__cover img {
  width: 100%; height: auto; border-radius: 12px;
  box-shadow: var(--card-shadow);
  background: var(--surface-2);
}
.book-hero__nocover {
  width: 100%; aspect-ratio: 2/3; border-radius: 12px;
  background: var(--surface-2); display: grid; place-items: center; font-size: 3rem;
}
.book-hero__title { font-size: var(--h1); line-height: 1.15; margin: 0 0 8px; }
.book-hero__author { margin: 0 0 14px; font-size: 1.05rem; color: var(--ink-2); }
.book-hero__author a { color: inherit; }

.book-hero__facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.fact {
  font-size: .78rem; letter-spacing: .04em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2);
}
.fact--free { background: var(--accent); color: var(--accent-ink); font-weight: 600; }

.book-hero__desc { line-height: 1.65; margin: 0 0 20px; max-width: 62ch; }

.book-hero__cta { margin: 20px 0 18px; }
.book-read { font-size: 1.05rem; padding: 12px 28px; min-height: 48px; }
.book-hero__gate { margin: 8px 0 0; font-size: .88rem; color: var(--ink-2); }

.subject-chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 18px; }
.subject-chips a {
  display: inline-block; font-size: .85rem; padding: 5px 12px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2); text-decoration: none;
}
.subject-chips a:hover { background: var(--brand); color: var(--brand-ink); }

.book-hero__source { font-size: .85rem; color: var(--ink-2); margin: 0; }

/* ── Related shelves ─────────────────────────────────────────────────────── */
.book-related { margin: 36px 0; }
.book-related h2 { font-size: var(--h2); margin: 0 0 14px; }

.related-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr));
}
.related-grid--wide { gap: 20px; }
.related-card a {
  display: flex; flex-direction: column; gap: 6px;
  text-decoration: none; color: inherit;
}
.related-card img {
  width: 100%; aspect-ratio: 2/3; object-fit: cover;
  border-radius: 8px; background: var(--surface-2);
}
.related-card__nocover {
  width: 100%; aspect-ratio: 2/3; border-radius: 8px; background: var(--surface-2);
  display: grid; place-items: center; font-size: 1.8rem;
}
.related-card__title { font-size: .92rem; line-height: 1.3; font-weight: 600; overflow-wrap: anywhere; }
.related-card__author { font-size: .82rem; color: var(--ink-2); }
.related-card a:hover .related-card__title { text-decoration: underline; }

/* ── Browse + lists ──────────────────────────────────────────────────────── */
.list-head { margin: 0 0 24px; }
.list-head h1 { margin: 0 0 6px; }

.subject-grid {
  list-style: none; padding: 0; margin: 0 0 36px;
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
}
.subject-grid a {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--radius-md);
  background: var(--surface); border: 1px solid var(--border);
  text-decoration: none; color: inherit; min-height: 48px;
}
.subject-grid a:hover { border-color: var(--brand); }
.subject-grid__name { font-weight: 600; }
.subject-grid__count { font-size: .82rem; color: var(--ink-2); }

.source-list { line-height: 1.9; padding-left: 18px; }

.pager { display: flex; gap: 14px; align-items: center; justify-content: center; margin: 32px 0 0; }
.pager__page { color: var(--ink-2); font-size: .9rem; }

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .book-hero { grid-template-columns: 1fr; gap: 20px; }
  .book-hero__cover { max-width: 200px; margin-inline: auto; }
  .book-hero__title { font-size: 1.5rem; }
  .book-read { width: 100%; }
  .related-grid { grid-template-columns: repeat(auto-fill, minmax(min(120px, 100%), 1fr)); gap: 12px; }
}
