/* Blossom Library — Sahara ("Sun-Baked Simplicity") reskin.
   Tokens mirror BlossomLibrary/design/DESIGN.md: warm linen surfaces,
   burnt sienna primary, EB Garamond headlines over Manrope body,
   whitespace as the primary design tool. */

* { box-sizing: border-box; }

:root {
  --bg: #faf5ee;
  --surface: #ffffff;
  --surface-low: #f6f0e8;
  --surface-c: #f2ece4;
  --ink: #3a302a;
  --soft: #605850;
  --faint: #9a9088;
  --line: rgba(216, 208, 200, 0.6);
  --primary: #c2652a;
  --primary-deep: #a9551f;
  --primary-fixed: #fbe8d8;
  --tertiary: #8c3c3c;
  --tertiary-fixed: #fce0e0;
  --secondary-fixed: #eae2da;
  --shadow: 0 2px 16px rgba(58, 48, 42, 0.04);
  --serif: "EB Garamond", Georgia, "Noto Serif", serif;
  --sans: "Manrope", -apple-system, "Segoe UI", sans-serif;
  --mono: "Courier Prime", ui-monospace, monospace;
}

body { font: 15px/1.6 var(--sans); margin: 0; color: var(--ink);
  background: var(--bg); display: flex; flex-direction: column;
  min-height: 100vh; }
code { font-family: var(--mono); font-size: .85em; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; }

/* storefront chrome — emitted pages */
header.site { display: flex; align-items: center; gap: 1.5rem;
  padding: 0.9rem 2rem; border-bottom: 1px solid var(--line);
  background: rgba(250, 245, 238, 0.92); backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 20; }
header.site .logo img { display: block; height: 2.5rem; width: auto; }
header.site .logo:hover { background: none; }
header.site nav { margin-left: auto; display: flex; gap: 1.6rem;
  font-size: 0.9rem; }
header.site nav a { color: var(--ink); }
header.site nav a:hover { color: var(--primary); text-decoration: none; }
header.site nav a[aria-current="page"] { color: var(--faint); }

footer.site { border-top: 1px solid var(--line); padding: 1.2rem 2rem;
  display: flex; align-items: center; gap: 1.5rem;
  font-size: 0.8rem; color: var(--soft); }
footer.site nav { margin-left: auto; display: flex; gap: 1.5rem; }

@media (max-width: 640px) {
  header.site { padding: 0.7rem 1.2rem; }
  header.site nav { gap: 1rem; font-size: 0.82rem; }
}

/* bookdb dev chrome — unchanged role, warm-shifted */
.devbar { background: #2a2420; color: #d8d0c8; font: 12px var(--mono);
          padding: 6px 16px; }
.devbar a { color: #f0a878; margin-left: 12px; }
.layout-note { font: 12px var(--mono); color: var(--faint); margin: 8px 0; }

main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto;
  padding: 0 2rem 3.5rem; }
.muted { color: var(--soft); font-size: .85rem; }

.back { margin: 1.4rem 0 0; font-size: .85rem; }
.back a { color: var(--soft); }
.back a:hover { color: var(--primary); }

/* ── hero ── */
.bhero { display: grid; grid-template-columns: 300px 1fr; gap: 2.6rem 3rem;
  align-items: start; padding: 2.2rem 0 3rem;
  border-bottom: 1px solid var(--line); }
@media (max-width: 760px) {
  .bhero { grid-template-columns: 1fr; gap: 1.6rem; }
  .bhero .bhcov { max-width: 240px; }
}
.bhcov { position: relative; aspect-ratio: 8.5/11; background: var(--surface-c);
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 10px 34px rgba(58, 48, 42, 0.14); }
.bhcov img { position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; display: block; }

/* cover placeholder — same gradient treatment as the grid cards */
.ph { position: absolute; inset: 0; display: flex; flex-direction: column;
  justify-content: space-between; padding: 1.1rem; color: #fcf9f1;
  overflow: hidden; }
.ph::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 8px; background: linear-gradient(to right, rgba(0,0,0,.3), transparent); }
.ph::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.45), transparent 55%); }
.ph-0 { background: linear-gradient(to bottom, #7a591e, #45310b); }
.ph-1 { background: linear-gradient(to bottom, #6e3a2a, #3f1f14); }
.ph-2 { background: linear-gradient(to bottom, #4a5d3a, #2b3a20); }
.ph-3 { background: linear-gradient(to bottom, #5d4a6e, #332538); }
.ph-top, .ph-lang { position: relative; z-index: 1; font-family: var(--mono);
  font-size: .66rem; letter-spacing: .15em; color: #feca53; }
.ph-lang { align-self: flex-end; color: rgba(252,249,241,.8); }
.ph-title { position: relative; z-index: 1; margin: auto; text-align: center;
  font-family: var(--serif); font-weight: 700; font-size: 1.3rem;
  line-height: 1.25; color: #fff; }

.binfo .eyebrow { margin: 0 0 .5rem; font: 600 .72rem var(--mono);
  text-transform: uppercase; letter-spacing: .14em; color: var(--primary); }
.binfo h1 { margin: 0 0 .3rem; font-family: var(--serif); font-weight: 600;
  font-size: clamp(2.2rem, 5vw, 3.3rem); line-height: 1.08;
  letter-spacing: -0.01em; }
.subtitle { color: var(--soft); font-family: var(--serif); font-size: 1.3rem;
  font-style: italic; margin: 0 0 .7rem; }
.byline { color: var(--ink); margin: .4rem 0 .8rem; font-size: 1rem; }
.byline a { color: var(--ink); }
.byline a:hover { color: var(--primary); }
.lede { font-family: var(--serif); font-size: 1.22rem; line-height: 1.55;
  max-width: 56ch; color: var(--ink); }
.lede p { margin: 0 0 .6rem; }
.bmeta { font: 500 .78rem var(--mono); color: var(--faint); margin: 1rem 0 0; }
.bacts { display: flex; gap: .7rem; flex-wrap: wrap; align-items: center;
  margin-top: 1.3rem; }
.bnote { margin: .7rem 0 0; font: 500 .78rem var(--mono); color: var(--faint); }

.badges { margin: .4rem 0 .9rem; display: flex; gap: .4rem; flex-wrap: wrap; }
.badge, .chip { display: inline-block; background: var(--secondary-fixed);
  color: var(--ink); border-radius: 999px; padding: 2px 10px;
  font: 500 .72rem var(--sans); letter-spacing: .05em; text-transform: uppercase; }
.badge { background: var(--primary-fixed); color: var(--primary-deep); }
.chip.warn { background: var(--tertiary-fixed); color: var(--tertiary); }
.chip + .chip, .chip + .badge, .badge + .chip { margin-left: .35rem; }
.badges .chip, .badges .badge { margin: 0; }

.act { font: 600 .85rem var(--sans); padding: .55rem 1.15rem;
  border-radius: 8px; text-decoration: none;
  border: 1px solid var(--primary); color: var(--primary);
  background: var(--surface); transition: background .15s ease; }
.act:hover { background: var(--primary-fixed); text-decoration: none; }
.act.buy { background: var(--primary); color: #fff; }
.act.buy:hover { background: var(--primary-deep); }
.act.open { border-color: var(--faint); color: var(--soft); }
.act.open:hover { background: var(--surface-c); }

/* ── body ── */
.bwrap { display: grid; grid-template-columns: 2fr 1fr; gap: 3.4rem;
  padding-top: 2.6rem; }
@media (max-width: 900px) { .bwrap { grid-template-columns: 1fr; gap: 2.4rem; } }
.bcol, .bcol-side { min-width: 0; }  /* let scrollable children shrink */

.bsec { margin-bottom: 2.4rem; }
.bsec .slabel { margin-bottom: .7rem; }
.sec-head { display: flex; align-items: baseline; gap: 1rem; }
.sec-head .see { margin-left: auto; font-size: .85rem; white-space: nowrap; }

.bcol .desc { font-family: var(--serif); font-size: 1.15rem;
  line-height: 1.6; color: var(--ink); max-width: 62ch; }
.bcol .desc p { margin: 0 0 .9rem; }

/* preview stills strip */
.pstrip { display: flex; gap: .9rem; overflow-x: auto;
  padding: .2rem .2rem .8rem; scrollbar-width: thin; }
.sthumb { flex-shrink: 0; width: 7.2rem; aspect-ratio: 8.5/11;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; overflow: hidden;
  box-shadow: 0 2px 10px rgba(58,48,42,.06); }
.sthumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sthumb:hover { border-color: var(--primary); }

/* editions & formats */
.bed { margin-bottom: 1.6rem; }
.bed-head h3 { margin: 0 0 .3rem; font-size: 1.25rem; display: inline; }
.bed-head .chip { margin-left: .4rem; }
.bed-meta { color: var(--soft); font-size: .82rem; margin: .2rem 0 .9rem; }
.status-active { color: #2a7d2a; }
.status-announced, .status-forthcoming { color: var(--primary); }

.fmts { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem; }
.fmt { border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.15rem;
  background: var(--surface); box-shadow: var(--shadow);
  display: flex; flex-direction: column; }
.fmt .fhead { display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; }
.fmt .fhead strong { font-family: var(--serif); font-size: 1.05rem; }
.fmt .cat { font: 500 .68rem var(--sans); letter-spacing: .04em;
  text-transform: uppercase; color: var(--ink);
  background: var(--secondary-fixed); border-radius: 999px; padding: 2px 8px; }
.fmt .fprice { font-weight: 700; color: var(--ink); font-size: .9rem; }
.fmt .avail { font-size: .75rem; color: #2a7d2a; margin-left: auto; }
.isbn { font: .72rem var(--mono); color: var(--faint); margin: .35rem 0 0; }
.specs { list-style: none; padding: 0; margin: .6rem 0;
  font-size: .8rem; color: var(--soft); }
.specs li { padding: 1px 0; }
.pmore { font-size: .78rem; margin-top: auto; }
.pmore summary { color: var(--faint); cursor: pointer; font-family: var(--mono);
  font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.prices { width: 100%; border-collapse: collapse; font-size: .78rem;
  margin-top: .5rem; }
.prices td { border-top: 1px solid var(--line); padding: 4px; }
.prices .amt { font-weight: 700; color: var(--ink); }
.facts { display: flex; gap: .5rem; margin-top: auto; padding-top: .7rem;
  flex-wrap: wrap; }
.facts .act { font-size: .8rem; padding: .45rem .9rem; }

/* superseded editions — history, not store */
.edhist { margin-top: 1.1rem; font-size: .85rem; }
.edhist summary { font: 600 .72rem var(--mono); text-transform: uppercase;
  letter-spacing: .12em; color: var(--secondary); cursor: pointer; }
.edhist summary:hover { color: var(--primary); }
.edhist[open] summary { margin-bottom: .6rem; }
.ehrow { margin: 0 0 .45rem; }
.ehrow strong { font-weight: 600; }

.toc { font-size: .85rem; margin: .8rem 0 0; }
.toc summary { font: 600 .72rem var(--mono); text-transform: uppercase;
  letter-spacing: .12em; color: var(--secondary); cursor: pointer; }
.toc summary:hover { color: var(--primary); }
.toc[open] summary { margin-bottom: .8rem; }
.toc > :not(summary) { max-width: 62ch; }
.toc h2 { font-size: 1.1rem; margin: 1rem 0 .3rem; }
.toc p, .toc li { color: var(--soft); font-size: .85rem; }
.toc.excerpt > :not(summary) { font-family: var(--serif); font-size: 1.02rem;
  line-height: 1.6; color: var(--ink); }

.figures { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px; margin: .8rem 0; }
.figures figure { margin: 0; }
.figures img { width: 100%; border: 1px solid var(--line); border-radius: 8px; }
.figures figcaption { font-size: .72rem; color: var(--soft);
  line-height: 1.35; margin-top: 4px; }

/* side column */
.bcol-side .bsec { font-size: .9rem; }
.credit { margin: 0 0 .45rem; font-size: .85rem; }
.credit .role { color: var(--soft); }
.sib { margin: 0 0 .55rem; font-size: .9rem; }
.sib-note { color: var(--faint); font-size: .82rem; }

blockquote { margin: .6rem 0; font-family: var(--serif); font-style: italic;
  font-size: 1.1rem; line-height: 1.55; color: var(--ink); }
cite { display: block; font-style: normal; font-family: var(--sans);
  color: var(--soft); font-size: .8rem; margin-top: 4px; }
.kv { border-collapse: collapse; width: 100%; font-size: .82rem; }
.kv td { padding: 3px 6px 3px 0; vertical-align: top; }
.kv td:first-child { color: var(--soft); white-space: nowrap; }
