/* Book notes (posts tagged "book"): design "B2 Sidebar". Loaded only on book posts (post.hbs).
   Layout: sidebar (cover, publisher line, buy link, sticky section list) beside the title, verdict and text.
   The site header and footer are untouched. */

.bn {
  --bn-ink: #333;
  --bn-black: #111;
  --bn-blue: #356EE9;
  --bn-blue-dk: #2a5bc7;
  --bn-tint: #f1f5fd;
  --bn-tint-2: #e3ebfb;
  --bn-grey: #666;
  --bn-rule: #E3E3E3;
  --bn-sans: 'Inter', sans-serif;
  --bn-serif: Georgia, 'Times New Roman', serif;
  color: var(--bn-ink);
}

.bn-wrap {
  max-width: 1040px; margin: 0 auto; padding: 48px 0 56px;
  display: grid; grid-template-columns: 250px minmax(0, 1fr);
  grid-template-areas: "side head" "side main"; column-gap: 56px;
}

/* ---------- Title block ---------- */
.bn-head { grid-area: head; min-width: 0; }
.bn-eyebrow, .bn-label {
  font: 700 11px/1.4 var(--bn-sans); letter-spacing: .1em; text-transform: uppercase; color: var(--bn-blue); margin: 0 0 10px;
}
.bn-label { color: var(--bn-grey); margin: 0 0 6px 10px; }
.bn .bn-title { font: 800 48px/1.1 var(--bn-sans); letter-spacing: -0.025em; color: var(--bn-black); margin: 0 0 6px; text-wrap: balance; }
.bn-author { font: 500 19px/1.4 var(--bn-sans); color: var(--bn-grey); margin: 0 0 26px; letter-spacing: -0.01em; }
.bn-verdict {
  font: italic 24px/1.5 var(--bn-serif); color: var(--bn-black); letter-spacing: 0;
  margin: 0 0 36px; max-width: 30em; padding-bottom: 32px; border-bottom: 1px solid var(--bn-rule);
}

/* ---------- Sidebar ---------- */
.bn-side { grid-area: side; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.bn-book { background: var(--bn-tint); border-radius: 10px; padding: 22px; display: grid; gap: 14px; font-family: var(--bn-sans); }
.bn-cover { width: 100%; display: block; border-radius: 4px; box-shadow: 0 2px 6px rgba(0,0,0,.2), 0 16px 32px rgba(30,50,90,.18); }
.bn-book-meta { display: grid; gap: 12px; }
/* The book's MLA citation (feature-image caption), under the buy button as in the mockup */
.bn-cite { font: 12px/1.55 var(--bn-sans); color: var(--bn-grey); margin: 0; border-top: 1px solid var(--bn-tint-2); padding-top: 14px; overflow-wrap: break-word; }
.bn-cite i, .bn-cite em { font-style: italic; }
.bn-btn {
  display: block; font: 700 14px/1 var(--bn-sans); text-decoration: none; text-align: center;
  border: 2px solid var(--bn-blue); border-radius: 999px; padding: 11px 18px; background: var(--bn-blue); color: #fff !important;
}
.bn-btn:hover { background: var(--bn-blue-dk); border-color: var(--bn-blue-dk); }
.bn-btn[hidden], .bn-rail[hidden], .bn-author[hidden] { display: none; }

.bn-stick { position: sticky; top: 20px; }
.bn-rail { background: var(--bn-tint); border-radius: 10px; padding: 14px 12px; display: grid; gap: 10px; font-family: var(--bn-sans); }
.bn-rail ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.bn-rail ol a {
  display: flex; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 8px;
  font-size: 14px; font-weight: 600; line-height: 1.3; color: #888; text-decoration: none;
}
.bn-rail ol a:hover { color: var(--bn-black); }
.bn-rail ol a.on { background: #fff; color: var(--bn-black); }
.bn-rail ol a.on .bn-n { background: var(--bn-blue); color: #fff; border-color: var(--bn-blue); }
.bn-mini { display: none; align-items: center; gap: 10px; padding: 0 6px 10px; border-bottom: 1px solid var(--bn-tint-2); }
.bn-mini.on { display: flex; }
.bn-mini img { width: 34px; border-radius: 2px; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.bn-mini b { display: block; font-size: 13px; color: var(--bn-black); line-height: 1.25; }
.bn-mini a { font-size: 12px; font-weight: 700; color: var(--bn-blue); text-decoration: none; }
.bn-mini a[hidden] { display: none; }

.bn-n {
  flex: 0 0 auto; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  border: 1.5px solid currentColor; font: 700 12px/1 var(--bn-sans); font-variant-numeric: tabular-nums;
}

/* ---------- Text ---------- */
.bn-main { grid-area: main; min-width: 0; max-width: 660px; }
.bn .bn-text { max-width: none; margin: 0; line-height: 1.65; }
/* Posts tagged #show-toc get a flex .post-content from the site's code injection; book notes have their own section list */
.post-template .bn .bn-text.post-content { display: block; position: static; }
.bn-text a { color: var(--bn-blue); }
.bn .bn-text .bn-h {
  display: flex; align-items: center; gap: 12px; font: 800 25px/1.2 var(--bn-sans); letter-spacing: -0.02em;
  color: var(--bn-black); margin: 2.2em 0 .7em; scroll-margin-top: 20px;
}
.bn-text .bn-h strong { font-weight: inherit; }
.bn-text .bn-h .bn-n { color: var(--bn-blue); }
/* Quotes keep the site's big blue quote mark (code injection: blockquote::after, 120px, with a 5rem indent
   to make room for it); book notes only change the type to italic serif. */
.bn .bn-text blockquote:not(.kg-blockquote-alt) {
  border-left: 0; margin: 1.4em 0; position: relative;
  font: italic 25px/1.4 var(--bn-serif); color: var(--bn-black);
}
/* Emphasis inside an italic quote shows as upright type */
.bn .bn-text blockquote:not(.kg-blockquote-alt) em, .bn .bn-text blockquote:not(.kg-blockquote-alt) i { font-style: normal; }
/* When the quote opens with its own quotation mark, the big mark stands in for it (book-notes.js) */
.bn-q-open { display: none; }
.bn-sec.bn-who { background: var(--bn-tint); border-radius: 10px; padding: 4px 28px 14px; margin-top: 2.4em; }
.bn .bn-sec.bn-who .bn-h { margin-top: 1em; }
.bn-comments { margin-top: 3rem; }

/* ---------- After the post ---------- */
.bn-after { max-width: 1040px; margin: 0 auto; padding: 0 0 64px; display: grid; gap: 32px; }
/* Posts mentioning this book: the site's usual list (styles.css .article-link), at its usual width */
.bn-mentions { max-width: 720px; }
.bn-mentions .article-link a { color: var(--bn-black); }
.bn .bn-list-head { font: 800 18px/1.3 var(--bn-sans); color: var(--bn-black); margin: 0 0 14px; }
.bn-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.bn-card {
  display: grid; gap: 4px; align-content: start; padding: 14px 16px; border: 1px solid var(--bn-rule); border-radius: 10px;
  text-decoration: none; color: var(--bn-ink); font-family: var(--bn-sans);
}
.bn-card:hover { border-color: var(--bn-blue); }
.bn-card b { color: var(--bn-black); font-size: 15px; line-height: 1.3; }
.bn-card span, .bn-card .bn-card-author { font-size: 13px; font-weight: 400; color: var(--bn-grey); display: block; margin-top: 4px; }

/* The site-wide footer sign-up box would repeat the guide offer: hide it where the offer shows */
.tag-book .newsletter-block:has(form) { display: none; }

/* ---------- Phones and narrow windows ---------- */
@media (max-width: 890px) {
  /* The theme's fixed mobile header is about 60px tall */
  .bn-stick { top: 76px; }
  .bn .bn-text .bn-h { scroll-margin-top: 76px; }
}
@media (max-width: 800px) {
  .bn-wrap { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "side" "main"; padding: 24px 0 40px; }
  .bn .bn-title { font-size: 32px; }
  .bn-verdict { font-size: 19px; padding-bottom: 0; border: 0; margin-bottom: 20px; }
  .bn-book { grid-template-columns: 104px minmax(0, 1fr); gap: 14px 16px; padding: 16px; }
  .bn-book-meta { align-content: center; }
  .bn-cite { grid-column: 1 / -1; }
  .bn-side { margin-bottom: 8px; }
  .bn-stick { position: static; }
  .bn-mini { display: none !important; }
  .bn-rail ol { grid-template-columns: 1fr 1fr; }
  .bn-rail ol a { font-size: 13px; padding: 7px 8px; }
  .bn .bn-text { font-size: 17px; }
  .bn .bn-text blockquote:not(.kg-blockquote-alt) { font-size: 21px; }
  .bn-sec.bn-who { padding: 2px 18px 10px; }
  .bn-after { padding-bottom: 48px; gap: 24px; }
}
