/* CampbellStocks Bookshelf. Loaded only by the Book pages. Works with hs-base.css / hs-sections.css. */
.hb {
  --hb-red: #EA1E20; --hb-red-d: #c91618; --hb-ink: #111827; --hb-muted: #5b6472; --hb-line: #dcdfe4;
  --hb-card: #ffffff; --hb-soft: #f1f3f6; --hb-serif: Georgia, 'Times New Roman', serif;
  max-width: 1240px; margin: 0 auto; padding: 18px 16px 40px; color: var(--hb-ink);
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
}
body.dark-mode .hb { --hb-ink: #eaeef2; --hb-muted: #a3acb9; --hb-line: #2f3345; --hb-card: #1a1a28; --hb-soft: #232336; }
.hb *, .hb *::before, .hb *::after { box-sizing: border-box; }
.hb a { color: inherit; text-decoration: none; }
.hb img { max-width: 100%; display: block; }
.hb button { font: inherit; cursor: pointer; }
.hb a:focus-visible, .hb button:focus-visible, .hb input:focus-visible, .hb select:focus-visible { outline: 3px solid rgba(234, 30, 32, .45); outline-offset: 2px; }
.hb-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- hero ---------- */
.hb-hero {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 26px; padding: 30px 22px; border-radius: 18px; color: #fff; overflow: hidden; position: relative;
  background: radial-gradient(1000px 420px at 85% -10%, rgba(234, 30, 32, .38), transparent 60%), linear-gradient(135deg, #0f172a 0%, #1e293b 55%, #271a2c 100%);
}
.hb-hero > * { min-width: 0; }
.hb-eyebrow { margin: 0 0 10px; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #fca5a5; display: flex; align-items: center; gap: 8px; }
.hb-hero h1 { margin: 0 0 10px; font-size: clamp(1.9rem, 5vw, 3rem); line-height: 1.08; font-weight: 800; letter-spacing: -.8px; }
.hb-lead { margin: 0 0 20px; max-width: 540px; color: #cbd5e1; font-size: 1.05rem; line-height: 1.55; }
.hb-hero-search { display: flex; align-items: center; gap: 8px; max-width: 520px; padding: 6px 6px 6px 16px; background: #fff; border-radius: 999px; color: #111827; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.hb-hero-search i { color: #6b7280; }
.hb-hero-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 1rem; padding: 10px 4px; color: #111827; }
.hb-hero-search button { border: 0; border-radius: 999px; background: var(--hb-red); color: #fff; font-weight: 700; padding: 11px 20px; }
.hb-hero-search button:hover { background: var(--hb-red-d); }
.hb-stats { display: flex; flex-wrap: wrap; gap: 8px 22px; list-style: none; margin: 20px 0 0; padding: 0; color: #cbd5e1; font-size: .92rem; }
.hb-stats strong { color: #fff; font-size: 1.15rem; }

.hb-feature { position: relative; display: grid; grid-template-columns: 120px 1fr; gap: 18px; align-items: center; padding: 18px; border-radius: 16px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(6px); }
.hb-feature-flag { position: absolute; top: -11px; left: 18px; background: var(--hb-red); color: #fff; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 5px 12px; border-radius: 999px; }
.hb-feature-cover { position: relative; display: block; aspect-ratio: 2 / 3; border-radius: 6px; overflow: hidden; box-shadow: 0 18px 34px rgba(0, 0, 0, .45); transform: rotate(-2deg); transition: transform .3s; background: #334155; }
.hb-feature-cover:hover { transform: rotate(0) scale(1.03); }
.hb-feature-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hb-feature h2 { margin: 8px 0 2px; font-family: var(--hb-serif); font-size: 1.3rem; line-height: 1.25; }
.hb-feature h2 a:hover { color: #fca5a5; }
.hb-feature .hb-by { color: #fca5a5; }
.hb-feature .hb-sum { color: #cbd5e1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hb-feature-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

@media (min-width: 900px) {
  .hb-hero { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); padding: 44px 44px; gap: 40px; align-items: center; }
  .hb-feature { grid-template-columns: 150px 1fr; padding: 22px; }
}
@media (max-width: 480px) {
  .hb-hero { padding: 24px 16px; border-radius: 14px; }
  .hb-feature { grid-template-columns: 96px 1fr; gap: 14px; padding: 14px; }
  .hb-feature h2 { font-size: 1.1rem; }
}

/* ---------- buttons, badges, covers ---------- */
.hb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: 999px; font-weight: 700; font-size: .93rem; border: 2px solid transparent; transition: background .2s, color .2s, border-color .2s, transform .15s; text-decoration: none; }
.hb-btn:hover { transform: translateY(-1px); }
.hb-btn-red { background: var(--hb-red); color: #fff !important; }
.hb-btn-red:hover { background: var(--hb-red-d); }
.hb-btn-line { background: transparent; border-color: var(--hb-line); color: var(--hb-ink); }
.hb-btn-line:hover { border-color: var(--hb-red); color: var(--hb-red); }
.hb-btn-block { width: 100%; }

.hb-badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #fff; background: #475569; }
.hb-badge.hb-book-review { background: var(--hb-red); }
.hb-badge.hb-investor-library { background: #0f766e; }
.hb-badge.hb-author-interview { background: #b45309; }

.hb-cover, .hb-mini-cover, .hb-book-cover { position: relative; display: block; aspect-ratio: 2 / 3; overflow: hidden; background: linear-gradient(160deg, #334155, #0f172a); }
.hb-cover img, .hb-mini-cover img, .hb-book-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.hb-fallback { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 14px; text-align: center; color: #fff; font-family: var(--hb-serif); }
.hb-fallback b { font-size: 1rem; line-height: 1.25; }
.hb-fallback small { font-family: 'Inter', sans-serif; font-size: .75rem; color: #cbd5e1; }

/* ---------- section heads ---------- */
.hb-section { margin: 34px 0 0; }
.hb-sec-head { display: flex; align-items: flex-end; gap: 10px; margin: 0 0 16px; }
.hb-sec-head h2 { margin: 0; font-size: 1.55rem; font-weight: 800; letter-spacing: -.3px; line-height: 1.15; }
.hb-dash { flex: none; width: 22px; height: 4px; background: var(--hb-red); margin-bottom: 9px; }
.hb-rule { flex: 1; height: 3px; background: var(--hb-line); margin-bottom: 9px; border-radius: 2px; }

/* ---------- editor's picks row ---------- */
.hb-row { display: flex; gap: 16px; overflow-x: auto; padding: 4px 2px 14px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.hb-mini { flex: none; width: 138px; scroll-snap-align: start; display: block; }
.hb-mini-cover { border-radius: 6px; box-shadow: 0 8px 20px rgba(0, 0, 0, .18); transition: transform .25s, box-shadow .25s; }
.hb-mini:hover .hb-mini-cover { transform: translateY(-4px); box-shadow: 0 14px 26px rgba(0, 0, 0, .28); }
.hb-mini-title { display: block; margin: 10px 0 2px; font-family: var(--hb-serif); font-weight: 700; font-size: .98rem; line-height: 1.25; }
.hb-mini-by { display: block; font-size: .82rem; color: var(--hb-muted); }
.hb-mini:hover .hb-mini-title { color: var(--hb-red); }

/* ---------- topic tiles ---------- */
.hb-topics { display: flex; flex-wrap: wrap; gap: 10px; }
.hb-topic-tile { display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 12px; background: var(--hb-card); border: 1px solid var(--hb-line); font-weight: 700; transition: border-color .2s, transform .2s, box-shadow .2s; }
.hb-topic-tile span { background: var(--hb-soft); color: var(--hb-muted); font-size: .78rem; padding: 2px 8px; border-radius: 999px; }
.hb-topic-tile:hover { border-color: var(--hb-red); transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0, 0, 0, .08); }

/* ---------- tools ---------- */
.hb-tools { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 0 0 14px; }
.hb-search { position: relative; display: flex; align-items: center; background: var(--hb-card); border: 1px solid var(--hb-line); border-radius: 999px; padding: 0 12px 0 16px; }
.hb-search i { color: var(--hb-muted); }
.hb-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--hb-ink); font: inherit; padding: 13px 8px; }
.hb-clear-q { border: 0; background: transparent; color: var(--hb-muted); font-size: 1.5rem; line-height: 1; padding: 0 6px; }
.hb-sort select { width: 100%; padding: 13px 16px; border-radius: 999px; border: 1px solid var(--hb-line); background: var(--hb-card); color: var(--hb-ink); font: inherit; }
.hb-tool-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: 999px; border: 1px solid var(--hb-line); background: var(--hb-card); color: var(--hb-ink); font-weight: 700; font-size: .92rem; white-space: nowrap; transition: border-color .2s, color .2s, background .2s; }
.hb-tool-btn:hover { border-color: var(--hb-red); color: var(--hb-red); }
.hb-tool-btn[aria-pressed="true"] { background: var(--hb-red); border-color: var(--hb-red); color: #fff; }
.hb-tool-btn span { background: rgba(0, 0, 0, .08); border-radius: 999px; padding: 1px 8px; font-size: .78rem; }
.hb-tool-btn[aria-pressed="true"] span { background: rgba(255, 255, 255, .25); }
@media (min-width: 760px) {
  .hb-tools { grid-template-columns: minmax(220px, 1fr) 170px auto auto; align-items: center; }
}
@media (max-width: 759px) {
  .hb-tools { grid-template-columns: 1fr 1fr; }
  .hb-search { grid-column: 1 / -1; }
}

.hb-chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; }
.hb-chips::-webkit-scrollbar { display: none; }
.hb-chip { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 8px 15px; border-radius: 999px; border: 1px solid var(--hb-line); background: var(--hb-card); color: var(--hb-ink); font-weight: 600; font-size: .9rem; transition: background .2s, color .2s, border-color .2s; }
.hb-chip span { color: var(--hb-muted); font-size: .78rem; }
.hb-chip:hover { border-color: var(--hb-red); color: var(--hb-red); }
.hb-chip.is-on { background: var(--hb-ink); border-color: var(--hb-ink); color: var(--hb-card); }
.hb-chip.is-on span { color: inherit; opacity: .7; }
.hb-chips-topics .hb-chip { font-size: .84rem; padding: 6px 13px; background: var(--hb-soft); }
.hb-chips-topics .hb-chip.is-on { background: var(--hb-red); border-color: var(--hb-red); color: #fff; }

.hb-status { margin: 4px 0 14px; min-height: 1.2em; font-size: .92rem; color: var(--hb-muted); }

/* ---------- card grid ---------- */
.hb-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; }
@media (min-width: 640px) { .hb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 18px; } }
@media (min-width: 980px) { .hb-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .hb-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .hb-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } .hb-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.hb-card { position: relative; display: flex; flex-direction: column; background: var(--hb-card); border: 1px solid var(--hb-line); border-radius: 12px; overflow: hidden; transition: transform .25s, box-shadow .25s, border-color .25s; }
.hb-card:hover { transform: translateY(-4px); box-shadow: 0 16px 30px rgba(0, 0, 0, .14); border-color: transparent; }
.hb-card[hidden] { display: none; }
.hb-cover-wrap { position: relative; }
.hb-cover-wrap .hb-cover { border-radius: 0; }
.hb-cover-wrap .hb-badge { position: absolute; left: 10px; bottom: 10px; z-index: 3; box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.hb-save { position: absolute; top: 10px; right: 10px; z-index: 3; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .95); color: #6b7280; font-size: 1.05rem; display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 10px rgba(0, 0, 0, .25); transition: transform .15s, color .15s; }
.hb-save:hover { transform: scale(1.1); color: var(--hb-red); }
.hb-save[aria-pressed="true"] { color: var(--hb-red); }
.hb-save.hb-save-inline { position: static; box-shadow: none; border: 2px solid rgba(255, 255, 255, .35); background: transparent; color: #fff; }
.hb-save.hb-save-inline[aria-pressed="true"] { color: #fff; background: var(--hb-red); border-color: var(--hb-red); }
.hb-body { padding: 12px 14px 16px; display: flex; flex-direction: column; flex: 1; }
.hb-topic { font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--hb-red); }
.hb-title { margin: 4px 0 2px; font-family: var(--hb-serif); font-size: 1.08rem; line-height: 1.28; font-weight: 700; }
.hb-title a:hover { color: var(--hb-red); }
.hb-by { margin: 0 0 6px; font-size: .86rem; color: var(--hb-muted); }
.hb-sum { margin: 0 0 10px; font-size: .88rem; line-height: 1.5; color: var(--hb-muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hb-more { margin-top: auto; font-weight: 700; font-size: .86rem; color: var(--hb-red); display: inline-flex; align-items: center; gap: 6px; }
.hb-more i { transition: transform .2s; }
.hb-more:hover i { transform: translateX(4px); }
.hb-card.hb-pulse { animation: hbpulse 1.6s ease 1; }
@keyframes hbpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(234, 30, 32, 0); } 30% { box-shadow: 0 0 0 6px rgba(234, 30, 32, .45); } }
@media (max-width: 480px) { .hb-sum { -webkit-line-clamp: 2; } .hb-title { font-size: 1rem; } }

.hb-nores { text-align: center; padding: 44px 16px; border: 2px dashed var(--hb-line); border-radius: 14px; margin-top: 8px; }
.hb-nores[hidden] { display: none; }
.hb-nores > i { font-size: 2.4rem; color: var(--hb-muted); }
.hb-nores h3 { margin: 10px 0 4px; }
.hb-nores p { margin: 0 0 16px; color: var(--hb-muted); }
.hb-moretoo { text-align: center; margin: 26px 0 0; }
.hb-moretoo [hidden] { display: none; }
.hb-all { text-align: center; margin: 22px 0 0; }

/* ---------- note, empty ---------- */
.hb-note { margin: 40px 0 0; padding: 22px 24px; border-radius: 14px; background: var(--hb-soft); border-left: 4px solid var(--hb-red); }
.hb-note h2 { margin: 0 0 6px; font-size: 1.1rem; }
.hb-note p { margin: 0; color: var(--hb-muted); line-height: 1.6; font-size: .94rem; }
.hb-note a { color: var(--hb-red); text-decoration: underline; }
.hb-empty { text-align: center; padding: 60px 16px; max-width: 560px; margin: 24px auto; }
.hb-empty-art { font-size: 3rem; color: var(--hb-red); }
.hb-empty h1, .hb-empty h2 { margin: 8px 0; }
.hb-empty p { color: var(--hb-muted); line-height: 1.6; }
.hb-empty a { color: var(--hb-red); text-decoration: underline; }

/* ---------- single book ---------- */
.hb-crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .86rem; color: var(--hb-muted); margin: 0 0 18px; }
.hb-crumbs a:hover { color: var(--hb-red); }
.hb-book { display: grid; gap: 28px; }
.hb-book-side { max-width: 260px; margin: 0 auto; width: 100%; }
.hb-book-cover { border-radius: 8px; box-shadow: 0 22px 40px rgba(0, 0, 0, .3); }
.hb-side-actions { display: grid; gap: 10px; margin: 20px 0 0; }
.hb-share { display: flex; align-items: center; gap: 8px; margin: 16px 0 0; font-size: .86rem; color: var(--hb-muted); }
.hb-share span { font-weight: 700; margin-right: 4px; }
.hb-share a, .hb-share button { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid var(--hb-line); background: var(--hb-card); color: var(--hb-ink); transition: color .2s, border-color .2s; }
.hb-share a:hover, .hb-share button:hover { color: var(--hb-red); border-color: var(--hb-red); }
.hb-share button.is-done { background: #16a34a; border-color: #16a34a; color: #fff; }
.hb-side-note { margin: 12px 0 0; font-size: .78rem; color: var(--hb-muted); line-height: 1.5; }
.hb-side-note a { text-decoration: underline; }
.hb-save-wide { cursor: pointer; }
.hb-save-wide[aria-pressed="true"] { background: var(--hb-red); border-color: var(--hb-red); color: #fff; }

.hb-tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 10px; }
.hb-topic-pill { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--hb-line); font-size: .78rem; font-weight: 700; color: var(--hb-muted); }
.hb-topic-pill:hover { border-color: var(--hb-red); color: var(--hb-red); }
.hb-book-main h1 { margin: 0 0 6px; font-family: var(--hb-serif); font-size: clamp(1.8rem, 4.4vw, 2.7rem); line-height: 1.12; letter-spacing: -.5px; }
.hb-book-author { margin: 0 0 6px; font-size: 1.1rem; color: var(--hb-muted); }
.hb-book-author strong { color: var(--hb-ink); }
.hb-meta { margin: 0 0 20px; font-size: .88rem; color: var(--hb-muted); }
.hb-meta a { color: var(--hb-red); font-weight: 600; }
.hb-standfirst { margin: 0 0 22px; padding: 0 0 0 16px; border-left: 4px solid var(--hb-red); font-family: var(--hb-serif); font-size: 1.25rem; line-height: 1.5; font-weight: 600; }
.hb-review { max-width: 720px; font-size: 1.12rem; line-height: 1.7; }
.hb-review img { height: auto; border-radius: 8px; margin: 18px auto; }
.hb-review h2, .hb-review h3 { font-family: var(--hb-serif); margin: 1.6em 0 .5em; line-height: 1.25; }
.hb-review a { color: var(--hb-red); text-decoration: underline; }
.hb-disclaimer { display: flex; gap: 12px; align-items: flex-start; margin: 30px 0 0; padding: 14px 16px; border-radius: 10px; background: var(--hb-soft); max-width: 720px; font-size: .9rem; color: var(--hb-muted); }
.hb-disclaimer i { color: var(--hb-red); font-size: 1.2rem; margin-top: 2px; }
.hb-disclaimer p { margin: 0; line-height: 1.55; }
@media (min-width: 860px) {
  .hb-book { grid-template-columns: 280px minmax(0, 1fr); gap: 44px; align-items: start; }
  .hb-book-side { position: sticky; top: 84px; margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hb *, .hb *::before, .hb *::after { animation: none !important; transition: none !important; }
}
