/*
 * Performance Capability — Hand Books
 * Cards (used across the site), library archive, single page, topic page.
 * Page chrome (hero, section-label, store-strip) comes from products.css.
 */

:root {
  --hb-red: #8B1A1A;
  --hb-red-light: #a82020;
  --hb-ink: #111;
  --hb-dark: #1a1a1a;
  --hb-mid: #2d2d2d;
  --hb-grey: #666;
  --hb-light: #999;
  --hb-paper: #f0ece4;
  --hb-gold: #c9a84c;
}

/* ─── Card ─────────────────────────────────────────────────── */
.hb-shelf {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 40px 24px;
}
.hb-card { display: flex; flex-direction: column; min-width: 0; }
.hb-card__cover { display: block; text-decoration: none; }

/* Fixed 3:4 frame — reserves space so the grid never jumps while covers load. */
.hb-cover {
  position: relative; overflow: hidden;
  aspect-ratio: 3 / 4; width: 100%;
  background: var(--hb-mid);
  box-shadow: 0 8px 28px rgba(0,0,0,.5);
  transition: box-shadow .3s;
}
.hb-cover img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; display: block; margin: 0; max-width: none;
  transition: transform .4s ease;
}
.hb-card:hover .hb-cover { box-shadow: 0 16px 44px rgba(0,0,0,.7); }
.hb-card:hover .hb-cover img { transform: scale(1.03); }
.hb-cover__none {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.25); font-family: "Barlow Condensed", sans-serif;
  letter-spacing: .2em; text-transform: uppercase; font-size: .7rem;
}

.hb-badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  font-family: "Barlow Condensed", sans-serif; font-weight: 700;
  font-size: .62rem; letter-spacing: .18em; text-transform: uppercase;
  padding: 5px 9px; color: #fff; background: var(--hb-red);
}
.hb-badge--soon { background: rgba(17,17,17,.85); color: var(--hb-gold); border: 1px solid rgba(201,168,76,.5); }

.hb-card__body { padding-top: 16px; display: flex; flex-direction: column; flex: 1; }
.hb-card__eyebrow {
  display: flex; justify-content: space-between; gap: 8px;
  font-family: "Barlow Condensed", sans-serif; font-weight: 600;
  font-size: .6rem; letter-spacing: .22em; text-transform: uppercase;
  margin-bottom: 6px;
}
.hb-card__topic { color: var(--hb-accent, var(--hb-red)); }
.hb-card__no { color: var(--hb-grey); white-space: nowrap; }
.hb-card__title {
  font-family: "Barlow Condensed", sans-serif; font-weight: 900;
  font-size: 1.08rem; line-height: 1.05; text-transform: uppercase;
  margin: 0 0 4px;
}
.hb-card__title a { color: #fff; text-decoration: none; transition: color .2s; }
.hb-card__title a:hover { color: var(--hb-gold); }
.hb-card__strap {
  font-family: "Playfair Display", Georgia, serif; font-style: italic;
  font-size: .76rem; color: var(--hb-light); margin: 0 0 10px;
}
.hb-card__desc { font-size: .78rem; line-height: 1.65; color: rgba(240,236,228,.55); margin: 0 0 14px; flex: 1; }
.hb-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.hb-card__price { font-family: "Barlow Condensed", sans-serif; font-weight: 600; font-size: .85rem; color: var(--hb-paper); }

/* ─── Buttons ──────────────────────────────────────────────── */
.hb-btn {
  font-family: "Barlow Condensed", sans-serif; font-weight: 700;
  font-size: .88rem; letter-spacing: .2em; text-transform: uppercase;
  padding: 18px 40px; text-decoration: none; display: inline-block;
  border: 1px solid transparent; cursor: pointer; line-height: 1.2;
  transition: background .2s, color .2s, border-color .2s;
}
.hb-btn--primary { background: var(--hb-red); color: #fff; }
.hb-btn--primary:hover { background: var(--hb-red-light); color: #fff; }
.hb-btn--ghost { border-color: rgba(255,255,255,.2); color: var(--hb-paper); background: transparent; }
.hb-btn--ghost:hover { border-color: #fff; color: #fff; }
.hb-btn--sm {
  padding: 9px 14px; font-size: .7rem; letter-spacing: .16em;
  background: transparent; color: var(--hb-paper); border-color: rgba(255,255,255,.22);
}
.hb-btn--sm:hover { background: var(--hb-red); border-color: var(--hb-red); color: #fff; }
.hb-btn.is-disabled { opacity: .5; cursor: default; pointer-events: none; }

/* ─── Library (/handbooks/) ────────────────────────────────── */
/* Compact hero: content sits below the fixed 68px site header at any height. */
.pc-products-archive .hero--compact { height: auto; min-height: 440px; padding-top: 140px; }
.pc-handbooks .hero__title, .pc-topic .hero__title { max-width: 820px; font-size: clamp(2.3rem, 4.6vw, 4.2rem); }

.hb-needs { background: var(--hb-ink); padding: 40px 64px 8px; }
.hb-needs__inner {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px;
}
.hb-need {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 22px 22px; text-decoration: none;
  background: var(--hb-dark); border: 1px solid rgba(255,255,255,.08);
  transition: border-color .2s, background .2s;
}
.hb-need:hover, .hb-need.is-active { border-color: var(--hb-red); background: #1f1414; }
.hb-need__q {
  font-family: "Barlow Condensed", sans-serif; font-weight: 800;
  font-size: 1.12rem; line-height: 1.1; text-transform: uppercase; color: #fff;
}
.hb-need__go { color: var(--hb-red); font-size: 1.3rem; }

.hb-rail, .hb-library, .hb-inside, .hb-offers { padding: 56px 64px; background: var(--hb-ink); }
.hb-rail + .hb-rail { padding-top: 8px; }
.hb-shelf--rail {
  grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: calc((100% - 72px) / 4);
  overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px;
  scrollbar-width: thin; scrollbar-color: var(--hb-mid) transparent;
}
.hb-shelf--rail > .hb-card { scroll-snap-align: start; }

.hb-filters {
  max-width: 1200px; margin: 0 auto 36px;
  display: grid; grid-template-columns: 1fr 1fr 1.4fr 1fr auto; gap: 14px; align-items: end;
}
.hb-field { display: flex; flex-direction: column; gap: 6px; }
.hb-field > span {
  font-family: "Barlow Condensed", sans-serif; font-weight: 600;
  font-size: .64rem; letter-spacing: .22em; text-transform: uppercase; color: var(--hb-light);
}
.hb-field select, .hb-field input {
  width: 100%; height: 48px; padding: 0 14px;
  background: var(--hb-dark); color: var(--hb-paper);
  border: 1px solid rgba(255,255,255,.14); border-radius: 0;
  font-family: "Barlow", sans-serif; font-size: .92rem;
}
.hb-field select:focus, .hb-field input:focus { outline: 2px solid var(--hb-red); outline-offset: 0; border-color: var(--hb-red); }
.hb-filters__go { height: 48px; padding: 0 26px; }
.hb-filters__go.is-js-hidden { display: none; }
.hb-filters:has(.is-js-hidden) { grid-template-columns: 1fr 1fr 1.4fr 1fr; }

.hb-results { max-width: 1200px; margin: 0 auto; transition: opacity .2s; }
.hb-results.is-loading { opacity: .45; }
.hb-results__head { margin-bottom: 26px; }
.hb-results__title {
  font-family: "Barlow Condensed", sans-serif; font-weight: 900;
  font-size: clamp(1.8rem, 3.2vw, 2.6rem); text-transform: uppercase; color: #fff; margin: 0 0 8px;
}
.hb-results__meta { font-size: .9rem; color: rgba(240,236,228,.55); margin: 0; }
.hb-results__meta a, .hb-more__all a { color: var(--hb-gold); text-decoration: none; }
.hb-results__meta a:hover { color: #fff; }

.hb-pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 52px; }
.hb-page {
  min-width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: .9rem;
  color: var(--hb-paper); text-decoration: none; border: 1px solid rgba(255,255,255,.14);
}
.hb-page:hover { border-color: #fff; }
.hb-page.is-current { background: var(--hb-red); border-color: var(--hb-red); color: #fff; }

.hb-more__all {
  max-width: 1200px; margin: 40px auto 0; text-align: right;
  font-family: "Barlow Condensed", sans-serif; font-weight: 700;
  font-size: .78rem; letter-spacing: .2em; text-transform: uppercase;
}

/* ─── Single (/handbooks/<slug>/) ──────────────────────────── */
.pc-handbook .hb-crumbs {
  max-width: 1200px; margin: 0 auto; padding: 116px 64px 0;
  font-family: "Barlow Condensed", sans-serif; font-weight: 600;
  font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--hb-grey);
  display: flex; flex-wrap: wrap; gap: 10px;
}
.pc-handbook .hb-crumbs a { color: var(--hb-light); text-decoration: none; }
.pc-handbook .hb-crumbs a:hover { color: #fff; }
.pc-handbook .hb-crumbs [aria-current] { color: rgba(240,236,228,.6); }

.pc-handbook .hb-hero {
  max-width: 1200px; margin: 0 auto; padding: 40px 64px 72px;
  display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 72px; align-items: center;
}
.pc-handbook .hb-hero__cover .hb-cover { max-width: 380px; box-shadow: 0 24px 60px rgba(0,0,0,.6); }
.pc-handbook .hero__eyebrow {
  font-family: "Barlow Condensed", sans-serif; font-weight: 600;
  font-size: .72rem; letter-spacing: .32em; text-transform: uppercase;
  color: var(--hb-accent, var(--hb-red)); margin-bottom: 18px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.pc-handbook .hero__eyebrow::before { content: ""; display: block; width: 36px; height: 1px; background: currentColor; }
.pc-handbook .hb-no { color: var(--hb-grey); letter-spacing: .2em; }
.pc-handbook .hb-title {
  font-family: "Barlow Condensed", sans-serif; font-weight: 900;
  font-size: clamp(2.6rem, 5vw, 4.6rem); line-height: .93;
  text-transform: uppercase; color: #fff; margin: 0 0 16px;
}
.pc-handbook .hb-subtitle { font-family: "Playfair Display", Georgia, serif; font-style: italic; font-size: 1.15rem; color: var(--hb-light); margin: 0 0 24px; }
.pc-handbook .hb-lead { font-size: 1.08rem; line-height: 1.8; color: rgba(240,236,228,.78); max-width: 580px; margin: 0 0 16px; }
.pc-handbook .hb-for { font-size: .95rem; line-height: 1.7; color: rgba(240,236,228,.6); max-width: 580px; margin: 0 0 32px; }
.pc-handbook .hb-for strong { color: var(--hb-paper); font-weight: 500; }
.pc-handbook .hb-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.pc-handbook .hb-facts {
  margin: 26px 0 0; font-family: "Barlow Condensed", sans-serif; font-weight: 600;
  font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; color: var(--hb-light);
}
.hb-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
.hb-chip {
  font-family: "Barlow Condensed", sans-serif; font-weight: 600; font-size: .64rem;
  letter-spacing: .18em; text-transform: uppercase; text-decoration: none;
  color: var(--hb-light); border: 1px solid rgba(255,255,255,.12); padding: 6px 12px;
}
.hb-chip:hover { color: #fff; border-color: rgba(255,255,255,.4); }

.pc-handbook .hb-inside { background: var(--hb-dark); }
.pc-handbook .hb-inside .section-label, .pc-handbook .hb-body .section-label { max-width: 760px; }
.hb-inside__list { max-width: 760px; margin: 0 auto; padding: 0; list-style: none; counter-reset: idea; }
.hb-inside__list li {
  counter-increment: idea; position: relative; padding: 18px 0 18px 64px;
  border-top: 1px solid rgba(255,255,255,.07);
  font-size: 1.05rem; line-height: 1.6; color: var(--hb-paper);
}
.hb-inside__list li::before {
  content: counter(idea, decimal-leading-zero); position: absolute; left: 0; top: 14px;
  font-family: "Barlow Condensed", sans-serif; font-weight: 900; font-size: 1.6rem; color: var(--hb-red);
}

.pc-handbook .hb-body { background: var(--hb-dark); padding: 24px 64px 80px; }
.pc-handbook .hb-inside + .hb-body { padding-top: 24px; }
.pc-handbook .hb-content { max-width: 760px; margin: 0 auto; font-size: 1.02rem; line-height: 1.9; color: rgba(240,236,228,.78); }
.pc-handbook .hb-content > * + * { margin-top: 1.2em; }
.pc-handbook .hb-content h2, .pc-handbook .hb-content h3 {
  font-family: "Barlow Condensed", sans-serif; font-weight: 800; text-transform: uppercase;
  color: #fff; line-height: 1.05; margin-top: 1.8em;
}
.pc-handbook .hb-content h2 { font-size: 1.9rem; }
.pc-handbook .hb-content h3 { font-size: 1.35rem; }
.pc-handbook .hb-content a { color: var(--hb-gold); }
.pc-handbook .hb-content ul, .pc-handbook .hb-content ol { padding-left: 1.3em; }
.pc-handbook .hb-content blockquote { border-left: 2px solid var(--hb-red); padding-left: 20px; font-family: "Playfair Display", Georgia, serif; font-style: italic; color: var(--hb-paper); }
.pc-handbook .hb-content img { max-width: 100%; height: auto; }
.pc-handbook .hb-body__cta { max-width: 760px; margin: 48px auto 0; }

.hb-offers { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; max-width: 1328px; margin: 0 auto; }
.hb-offer { background: var(--hb-dark); border: 1px solid rgba(255,255,255,.07); padding: 40px; }
.hb-offer .section-label { margin: 0 0 18px; }
.hb-offer__title { font-family: "Barlow Condensed", sans-serif; font-weight: 900; font-size: 1.9rem; line-height: 1; text-transform: uppercase; color: #fff; margin: 0 0 12px; }
.hb-offer p { font-size: .95rem; line-height: 1.75; color: rgba(240,236,228,.65); margin: 0 0 22px; }
.hb-offer--sample { border-color: rgba(139,26,26,.5); }
.hb-sample-form { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.hb-sample-form input {
  height: 50px; padding: 0 14px; background: var(--hb-ink); color: var(--hb-paper);
  border: 1px solid rgba(255,255,255,.14); border-radius: 0; font-size: .95rem; font-family: "Barlow", sans-serif;
}
.hb-sample-form button { grid-column: 1 / -1; }
.hb-sample-form__msg { grid-column: 1 / -1; margin: 0 !important; min-height: 1em; font-size: .85rem !important; }
.hb-sample-form__done { color: var(--hb-paper) !important; }
.hb-sample-form__done a { color: var(--hb-gold); }
.hb-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

/* ─── Topic page ───────────────────────────────────────────── */
.hb-article-list { max-width: 1200px; margin: 0 auto; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 40px; }
.hb-article-list li { display: flex; justify-content: space-between; gap: 20px; padding: 16px 0; border-top: 1px solid rgba(255,255,255,.07); }
.hb-article-list a { color: #fff; text-decoration: none; font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 1.1rem; text-transform: uppercase; }
.hb-article-list a:hover { color: var(--hb-gold); }
.hb-article-list span { color: var(--hb-grey); font-size: .8rem; white-space: nowrap; }

/* ─── Related (end of articles) + diagnostic recommendations ─ */
.hb-related, .hb-reco {
  margin: 56px 0 8px; padding: 36px 32px; background: var(--hb-ink);
  border-top: 2px solid var(--hb-red); color: var(--hb-paper);
  font-family: "Barlow", sans-serif; font-weight: 300;
}
.hb-related__label {
  font-family: "Barlow Condensed", sans-serif; font-weight: 700;
  font-size: .74rem; letter-spacing: .26em; text-transform: uppercase; color: var(--hb-red);
  margin-bottom: 24px;
}
.hb-shelf--compact { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 20px; max-width: none; }
.hb-reco { margin: 40px 0; text-align: left; }

/* ─── Responsive ───────────────────────────────────────────── */
@media (max-width: 1200px) {
  .hb-needs { padding-left: 40px; padding-right: 40px; }
  .hb-rail, .hb-library, .hb-inside, .hb-offers { padding-left: 40px; padding-right: 40px; }
  .pc-handbook .hb-crumbs, .pc-handbook .hb-hero, .pc-handbook .hb-body { padding-left: 40px; padding-right: 40px; }
  .pc-handbook .hb-hero { gap: 56px; }
}
@media (max-width: 1024px) {
  .hb-shelf { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hb-shelf--rail { grid-auto-columns: calc((100% - 48px) / 3); }
  .hb-filters, .hb-filters:has(.is-js-hidden) { grid-template-columns: 1fr 1fr; }
  .hb-field--search { grid-column: 1 / -1; order: -1; }
}
@media (max-width: 900px) {
  .hb-needs { padding: 32px 28px 4px; }
  .hb-rail, .hb-library, .hb-inside, .hb-offers { padding: 44px 28px; }
  .hb-shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 18px; }
  .hb-shelf--rail { grid-auto-columns: 42%; }
  .hb-shelf--compact { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 14px; }
  .pc-handbook .hb-crumbs { padding: 100px 28px 0; }
  .pc-handbook .hb-hero { grid-template-columns: 1fr; gap: 40px; padding: 32px 28px 56px; }
  .pc-handbook .hb-hero__cover .hb-cover { max-width: 280px; }
  .pc-handbook .hb-body { padding: 24px 28px 64px; }
  .hb-article-list { grid-template-columns: 1fr; }
  .hb-more__all { text-align: left; margin-top: 32px; }
}
@media (max-width: 640px) {
  .pc-products-archive .hero--compact { min-height: 360px; padding-top: 110px; }
  .pc-handbooks .hero__title, .pc-topic .hero__title { font-size: clamp(1.9rem, 8.5vw, 2.6rem); }
  .hb-needs { padding: 28px 18px 0; }
  .hb-needs__inner { grid-template-columns: 1fr; gap: 10px; }
  .hb-need { padding: 18px; }
  .hb-need__q { font-size: 1rem; }
  .hb-rail, .hb-library, .hb-inside, .hb-offers { padding: 36px 18px; }
  .hb-shelf { gap: 28px 12px; }
  .hb-shelf--rail { grid-auto-columns: 58%; }
  .hb-shelf--compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hb-card__title { font-size: .95rem; }
  .hb-card__desc { font-size: .74rem; }
  .hb-card__eyebrow { flex-direction: column; gap: 2px; }
  .hb-btn--sm { padding: 8px 10px; font-size: .64rem; letter-spacing: .12em; }
  .hb-filters, .hb-filters:has(.is-js-hidden) { grid-template-columns: 1fr 1fr; gap: 10px; }
  .pc-handbook .hb-crumbs { padding: 92px 18px 0; font-size: .64rem; }
  .pc-handbook .hb-hero { padding: 24px 18px 48px; gap: 32px; }
  .pc-handbook .hb-hero__cover .hb-cover { max-width: 220px; }
  .pc-handbook .hb-actions { flex-direction: column; }
  .pc-handbook .hb-btn { text-align: center; padding: 16px 24px; }
  .pc-handbook .hb-body { padding: 16px 18px 52px; }
  .hb-inside__list li { padding-left: 48px; font-size: .96rem; }
  .hb-offer { padding: 28px 22px; }
  .hb-sample-form { grid-template-columns: 1fr; }
  .hb-related, .hb-reco { padding: 28px 18px; }
}
@media (max-width: 360px) {
  .hb-shelf { grid-template-columns: 1fr; }
}

/* The theme's phone rules force every <p> to 1rem !important; keep card text at card size. */
@media (max-width: 768px) {
  .hb-card p.hb-card__desc  { font-size: .76rem !important; line-height: 1.6 !important; }
  .hb-card p.hb-card__strap { font-size: .72rem !important; line-height: 1.4 !important; }
}

/* ─── Products page: Hand Book tab (classic book cards + filter bar) ─── */
.pc-products-archive .books-section .hb-filters { margin-bottom: 28px; }
.pc-products-archive .book-cover.cover--handbook { aspect-ratio: 3 / 4; }
.pc-products-archive .book-cover__hit { position: absolute; inset: 0; display: block; z-index: 1; }
.pc-products-archive .book-cover .hb-badge { z-index: 3; }
.pc-products-archive a.book-title { display: block; text-decoration: none; transition: color .2s; }
.pc-products-archive a.book-title:hover { color: var(--hb-gold); }
.pc-products-archive .book-cover__overlay-cta.is-disabled { opacity: .6; cursor: default; }
.pc-products-archive .hb-results .books-grid { margin-top: 8px; }
