/* /books/ section. Builds on the site's main.9.css tokens and classes. */

/* ── Covers ─────────────────────────────────────────────────────────────── */
.book-cover {
  display: block; width: 100%; aspect-ratio: 2 / 3; object-fit: cover;
  border-radius: 4px 10px 10px 4px;
  outline: 1px solid rgba(255,255,255,.14); outline-offset: -1px;
  box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, -6px 0 0 -3px rgba(0,0,0,.18), var(--sh-lg);
}
.book-cover-fallback {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 12% 11%; background: linear-gradient(160deg, var(--navy-mid), var(--navy) 70%);
  color: #fff; overflow: hidden; border: 1px solid rgba(255,255,255,.12);
}
.book-cover-fallback::before {
  content: ''; position: absolute; top: 9%; left: 11%; right: 11%; height: 4px; background: var(--orange);
}
.bcf-title { font-family: var(--ff-head); font-size: clamp(1.4rem, 3.2vw, 2.3rem); line-height: 1.08; }
.bcf-rule { display: block; width: 36px; height: 2px; background: var(--orange); margin: 14px 0 10px; }
.bcf-author { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.75); }

/* ── Book hero ─────────────────────────────────────────────────────────── */
.book-hero-grid {
  position: relative; display: grid; grid-template-columns: minmax(200px, 300px) 1fr;
  gap: 56px; align-items: center;
}
.book-hero-text .h1 { color: #fff; margin-bottom: 10px; }
.book-subtitle { font-family: var(--ff-head); font-style: italic; font-size: 1.3rem; color: rgba(255,255,255,.82); margin-bottom: 18px; line-height: 1.35; }
.book-hero-text .lead { margin-bottom: 22px; }
.book-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.book-facts li {
  font-size: .8rem; font-weight: 500; color: rgba(255,255,255,.85);
  border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.06);
  padding: 5px 13px; border-radius: var(--r-pill);
}
.book-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn-note { font-weight: 500; opacity: .85; }
.book-soon { color: rgba(255,255,255,.7); font-size: .95rem; margin: 0; }

/* ── Two-column content blocks ─────────────────────────────────────────── */
.book-two-col { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: start; }
.book-outcomes {
  background: var(--cream); border: 1px solid var(--g200); border-radius: var(--r-lg); padding: 30px 32px;
}
.book-outcomes h3 { font-family: var(--ff-head); font-weight: 400; font-size: 1.35rem; margin-bottom: 4px; }
.book-outcomes .check-list { margin-bottom: 0; }

/* ── Contents ──────────────────────────────────────────────────────────── */
.book-toc { counter-reset: none; border-top: 1px solid var(--g300); }
.book-toc li {
  display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: baseline;
  padding: 15px 2px; border-bottom: 1px solid var(--g300);
}
.toc-num { font-family: var(--ff-head); font-size: 1.25rem; color: var(--orange); }
.toc-title { font-size: 1.02rem; color: var(--g800); }

/* ── Reader comments ───────────────────────────────────────────────────── */
.book-praise-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; }
.book-quote { margin: 0; background: #fff; border: 1px solid var(--g200); border-radius: var(--r-lg); padding: 26px 28px; box-shadow: var(--sh-sm); }
.book-quote blockquote p { font-family: var(--ff-head); font-size: 1.12rem; line-height: 1.5; color: var(--g800); margin-bottom: 16px; }
.book-quote figcaption { font-size: .88rem; color: var(--g700); }
.book-quote figcaption span { display: block; color: var(--g600); }

/* ── Author ────────────────────────────────────────────────────────────── */
.book-author-inner { display: grid; grid-template-columns: 220px 1fr; gap: 44px; align-items: start; max-width: 940px; }
.book-author-inner.no-photo { grid-template-columns: 1fr; max-width: 760px; }
.book-author-photo { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-lg); box-shadow: var(--sh-md); }
.book-author .section-h { margin-bottom: 6px; }
.book-author-role { font-weight: 600; color: var(--navy); margin-bottom: 16px; }
.book-author .section-p { margin-bottom: 14px; }
.book-author-links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 6px; }
.book-author-links a { color: var(--blue); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ── Editions and details ──────────────────────────────────────────────── */
.book-current { margin-top: 18px; padding: 14px 18px; border-left: 3px solid var(--orange); background: var(--cream); color: var(--g800); border-radius: 0 var(--r) var(--r) 0; }
.book-changelog { margin-bottom: 30px; list-style: none; padding: 0; }
.book-changelog > li { padding: 0 0 16px 18px; border-left: 2px solid var(--g200); position: relative; }
.book-changelog > li::before { content: ''; position: absolute; left: -6px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--orange); }
.cl-head { margin-bottom: 4px; color: var(--g800); }
.cl-head time { color: var(--g600); font-size: .9rem; margin-left: 6px; }
.book-changelog ul { list-style: disc; margin-left: 1.1em; color: var(--g700); font-size: .95rem; }
.book-details { width: 100%; border-collapse: collapse; font-size: .93rem; }
.book-details caption { text-align: left; font-family: var(--ff-head); font-size: 1.25rem; margin-bottom: 10px; color: var(--text); }
.book-details th, .book-details td { text-align: left; padding: 10px 0; border-bottom: 1px solid var(--g200); vertical-align: top; }
.book-details th { width: 38%; font-weight: 600; color: var(--g700); padding-right: 16px; }
.book-details td { color: var(--g800); }

/* ── FAQ ───────────────────────────────────────────────────────────────── */
.book-faq-item { background: #fff; border: 1px solid var(--g200); border-radius: var(--r); margin-bottom: 12px; }
.book-faq-item summary {
  list-style: none; cursor: pointer; padding: 18px 22px; font-weight: 700; color: var(--text);
  display: flex; justify-content: space-between; gap: 16px; align-items: center;
}
.book-faq-item summary::-webkit-details-marker { display: none; }
.book-faq-item summary::after { content: '+'; font-size: 1.3rem; font-weight: 400; color: var(--orange); line-height: 1; }
.book-faq-item[open] summary::after { content: '–'; }
.book-faq-item summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: var(--r); }
.book-faq-item p { padding: 0 22px 20px; color: var(--g700); }

/* ── Quiet next step ───────────────────────────────────────────────────── */
.book-next { border-top: 1px solid var(--g200); }
.book-next p { text-align: center; color: var(--g700); margin: 0; }
.book-next a { color: var(--blue); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ── Hub: list of books ────────────────────────────────────────────────── */
.books-list .container { display: grid; gap: 40px; }
.book-card {
  display: grid; grid-template-columns: 180px 1fr; gap: 36px; align-items: center;
  padding: 32px; border: 1px solid var(--g200); border-radius: var(--r-lg); background: #fff; box-shadow: var(--sh-sm);
  max-width: 900px;
}
.book-card h2 { font-family: var(--ff-head); font-weight: 400; font-size: 1.9rem; line-height: 1.15; margin-bottom: 6px; }
.book-card h2 a:hover { color: var(--blue); }
.book-card-sub { font-family: var(--ff-head); font-style: italic; color: var(--g700); font-size: 1.1rem; margin-bottom: 10px; }
.book-card-line { color: var(--g700); margin-bottom: 10px; }
.book-card-meta { font-size: .85rem; color: var(--g600); margin-bottom: 18px; }
.book-card .btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.book-card-cover .book-cover { box-shadow: -4px 0 0 -2px rgba(0,0,0,.15), var(--sh-md); }
.book-card-cover .bcf-title { font-size: 1.35rem; }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .book-hero-grid { grid-template-columns: 220px 1fr; gap: 36px; }
  .book-two-col { grid-template-columns: 1fr; gap: 36px; }
}
@media (max-width: 720px) {
  .book-hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .book-hero-cover { max-width: 200px; }
  .book-author-inner { grid-template-columns: 1fr; gap: 24px; }
  .book-author-photo { max-width: 160px; }
  .book-card { grid-template-columns: 110px 1fr; gap: 20px; padding: 20px; align-items: start; }
  .book-card h2 { font-size: 1.45rem; }
  .book-card-cover .bcf-title { font-size: .95rem; }
  .book-card-cover .bcf-author { font-size: .55rem; }
  .book-outcomes { padding: 24px 22px; }
  .book-details th { width: 42%; }
}
@media (max-width: 420px) {
  .book-card { grid-template-columns: 1fr; }
  .book-card-cover { max-width: 140px; }
  .book-actions .btn { width: 100%; }
}

/* ── Contents: front and back matter ───────────────────────────────────── */
.book-toc-extra { border-top: none; }
.book-toc-extra:first-of-type { border-top: 1px solid var(--g300); }
.book-toc-extra .toc-title { color: var(--g700); font-style: italic; }
.book-toc-extra + .book-toc { border-top: none; }
.book-toc-head { font-family: var(--ff-body); font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--g600); margin: 30px 0 0; padding-bottom: 8px; border-bottom: 1px solid var(--g300); }
.book-toc-head + .book-toc-extra { border-top: none; }

/* ── Companion sheets ──────────────────────────────────────────────────── */
.book-sheets { border-top: 1px solid var(--g200); margin-top: 18px; }
.book-sheets li { display: grid; grid-template-columns: 1fr auto; gap: 4px 18px; align-items: center; padding: 14px 2px; border-bottom: 1px solid var(--g200); }
.sheet-name { font-weight: 600; color: var(--g800); }
.sheet-note { grid-column: 1; font-size: .88rem; color: var(--g600); }
.sheet-link, .sheet-soon { grid-column: 2; grid-row: 1 / span 2; font-size: .9rem; }
.sheet-link { color: var(--blue); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.sheet-soon { color: var(--g600); }

/* spacing under the intro heading */
.book-intro .section-h { margin-bottom: 16px; }
.book-intro .section-p + .section-p { margin-top: 10px; }
