/* Poof Books: book page. Loaded after section.css. */

.crumbs { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 22px; font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--lilac); text-decoration: none; }
.crumbs a:hover { color: var(--cream); }
.crumbs [aria-current] { color: var(--muted); }

/* Layout: Wikipedia-style. Wide main column on the left, a thin infobox on the right. */
.bk { display: grid; grid-template-columns: minmax(0, 1fr) 320px; grid-template-areas: "head box" "main box"; column-gap: clamp(32px, 4vw, 64px); align-items: start; padding-top: 22px; padding-bottom: 88px; }
.bk-head { grid-area: head; min-width: 0; padding-bottom: 8px; }
.infobox { grid-area: box; }
.bk-main { grid-area: main; min-width: 0; max-width: 760px; }

.bk-head h1 { color: var(--cream); font-size: clamp(36px, 4.6vw, 58px); }
.bk-head .by { margin: 12px 0 0; font-size: 20px; color: var(--muted); }
.bk-head .by a { color: var(--lilac); text-decoration: none; font-weight: 600; }
.bk-head .by a:hover { color: var(--cream); }
.hook { margin: 22px 0 0; max-width: 680px; font-size: 21px; line-height: 1.55; font-weight: 500; color: var(--cream); }

/* Infobox */
.infobox { background: var(--surface); border: 1px solid var(--rule); border-radius: 18px; padding: 18px 18px 8px; font-size: 14.5px; }
.ib-title { margin: 0 0 14px; text-align: center; font-weight: 800; font-size: 17px; line-height: 1.3; color: var(--cream); }
.covers { display: flex; flex-direction: column; gap: 12px; }
.cover-frame { position: relative; aspect-ratio: 2 / 3; perspective: 1600px; }
.cover-frame .face { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: bottom center; border-radius: 4px; filter: drop-shadow(0 16px 26px rgba(0,0,0,.5)); backface-visibility: hidden; }
.cover-frame .back { transform: rotateY(180deg); }
.motion-on .cover-frame .face { transition: transform .6s ease; }
.cover-frame[data-face="back"] .front { transform: rotateY(-180deg); }
.cover-frame[data-face="back"] .back { transform: rotateY(0); }
.cover-flip { display: inline-flex; align-self: center; border: 1.5px solid var(--line); border-radius: 999px; padding: 3px; }
.cover-flip button { min-height: 36px; padding: 6px 16px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.cover-flip button[aria-pressed="true"] { background: var(--surface-raised); color: var(--cream); }
.ib-buy { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 16px 0 6px; text-align: center; }
.price-from { font-size: 22px; font-weight: 800; color: var(--pink); }
.price-note { font-size: 13px; color: var(--muted); }
.ib-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.ib-table th, .ib-table td { padding: 9px 0; border-top: 1px solid var(--rule); vertical-align: top; text-align: left; line-height: 1.4; }
.ib-table th { width: 42%; padding-right: 12px; font-weight: 600; color: var(--muted); }
.ib-table td { color: var(--cream); overflow-wrap: anywhere; }
.ib-table td a { color: var(--lilac); text-decoration: none; }
.ib-table td a:hover { color: var(--pink); }
.ib-table th span { display: block; font-weight: 400; font-size: 12.5px; color: var(--muted); opacity: .8; }
.ib-table .ib-note { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.ib-sub th { width: auto; padding-top: 16px; text-align: center; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--lilac); }
.ib-table .isbn { font-variant-numeric: tabular-nums; }
.ib-table .isbn .gap-inline { display: inline-block; margin-top: 4px; }
.ib-table .isbn > * { margin-left: 0; }
.ib-table .isbn { display: flex; flex-direction: column; align-items: flex-start; }

/* Curator pick, in the lead */
.bk-main .pick { margin-top: 26px; }
.pick .listen { margin-top: 12px; }
.pick .hear { min-height: 40px; padding: 8px 16px; }
.script { margin-top: 10px; font-size: 14.5px; color: var(--muted); }
.script summary { cursor: pointer; color: var(--lilac); font-weight: 600; padding: 6px 0; }
.script p { margin: 6px 0 0; line-height: 1.65; }
html:not(.sound-on) .script { display: none; }

/* Contents box */
.toc { display: inline-block; margin: 32px 0 0; padding: 14px 22px 14px 18px; border: 1px solid var(--rule); border-radius: 14px; background: var(--surface); }
.toc-h { margin: 0 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--lilac); }
.toc ol { margin: 0; padding-left: 22px; }
.toc li { padding: 3px 0; font-size: 15px; color: var(--muted); }
.toc a { color: var(--cream); text-decoration: none; }
.toc a:hover { color: var(--pink); }

/* Sections: Wikipedia-style headings ruled underneath */
.bsec { padding-top: 44px; scroll-margin-top: 24px; }
.bsec h2 { margin: 0 0 20px; padding-bottom: 10px; border-bottom: 1px solid var(--line-subtle); font-size: clamp(24px, 2.6vw, 30px); font-weight: 800; }
.prose p { margin: 0 0 18px; font-size: 18px; line-height: 1.75; }

/* Reader reviews (Hyvor Talk) */
.rv-intro { margin: 0 0 18px; font-size: 17px; line-height: 1.6; color: var(--muted); }
.rv { min-height: 220px; }
.rv hyvor-talk-comments { display: block; }

@media (max-width: 900px) {
  .bk { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "box" "main"; }
  .infobox { margin-top: 24px; }
  .covers { width: min(260px, 70vw); margin: 0 auto; }
  .bk-main { max-width: none; }
}

/* First page: a page of the book */
.page-card { max-width: 680px; padding: clamp(28px, 5vw, 56px); background: #F4EFE6; color: #2A2238; border-radius: 4px; box-shadow: 0 18px 40px rgba(0,0,0,.4); }
.page-text { font-family: 'Literata', Georgia, serif; font-size: 18px; line-height: 1.8; }
.page-text p { margin: 0; text-indent: 1.5em; }
.page-text p:first-child { text-indent: 0; }
.page-src { margin: 24px 0 0; font-size: 13px; color: #6B6280; }

/* Author */
.author { display: flex; flex-wrap: wrap; gap: 20px 28px; align-items: flex-start; max-width: 860px; }
.author + .author { margin-top: 32px; }
.author-photo { width: 160px; height: 160px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; background: var(--surface); }
.author h3 { margin: 0 0 10px; font-size: 22px; }
.author > div { flex: 1 1 360px; min-width: 0; }
.author p { margin: 0 0 14px; font-size: 17px; line-height: 1.7; }
.author .gap-photo { flex: 0 0 160px; height: 160px; border-radius: 50%; display: flex; align-items: center; justify-content: center; text-align: center; }
/* Photo with the author's website link underneath */
.author > .author-pic { flex: 0 0 160px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.author-pic .gap-photo, .author-pic .author-photo { width: 160px; flex: 0 0 160px; }
.photo-credit { margin-top: -6px; font-size: 11.5px; color: var(--muted); text-align: center; line-height: 1.3; }
.author-site { font-size: 14px; font-weight: 600; color: var(--lilac); text-decoration: underline; text-underline-offset: 3px; text-align: center; }
.author-site:hover { color: var(--pink); }
.author-site:focus-visible { outline: 2px solid var(--lilac); outline-offset: 3px; border-radius: 4px; }

/* Reviews and awards */
.reviews { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.review { margin: 0; padding: 22px 24px; background: var(--surface); border: 1px solid var(--rule); border-radius: 18px; }
.review blockquote { margin: 0; font-size: 17px; line-height: 1.6; }
.review figcaption { margin-top: 12px; font-size: 14px; color: var(--lilac); font-weight: 600; }
.awards { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 10px; }
.award-name { font-weight: 600; }
.award-meta { color: var(--muted); }
.later { margin: 18px 0 0; font-size: 14px; color: var(--muted); }

/* Reading time */
.speeds { list-style: none; margin: 0; padding: 0; max-width: 640px; display: grid; gap: 14px; }
.speeds li { display: grid; grid-template-columns: 120px 1fr auto; align-items: center; gap: 16px; font-size: 16px; }
.speeds .bar { height: 10px; border-radius: 999px; background: var(--surface-raised); overflow: hidden; }
.speeds .bar span { display: block; height: 100%; border-radius: 999px; background: var(--lilac); }
.speeds li:nth-child(2) .bar span { background: var(--pink); }
.speeds .hrs { font-weight: 700; min-width: 90px; text-align: right; }
.note { margin: 16px 0 0; font-size: 14px; color: var(--muted); max-width: 640px; }
@media (max-width: 520px) { .speeds li { grid-template-columns: 1fr auto; } .speeds .bar { grid-column: 1 / -1; grid-row: 2; } }

/* Formats */
.table-wrap { overflow-x: auto; max-width: 860px; }
.formats { width: 100%; border-collapse: collapse; font-size: 15.5px; }
.formats th, .formats td { text-align: left; padding: 14px 16px 14px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.formats thead th { font-size: 12.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.formats tbody th { font-weight: 600; }
.formats tbody th span { display: block; font-weight: 400; font-size: 13.5px; color: var(--muted); }
.formats .isbn { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Details */
.details { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px 32px; max-width: 860px; }
.details dt { font-size: 12.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.details dd { margin: 4px 0 0; font-size: 17px; }

/* Draft-only: labelled gaps where the feed hasn't supplied data yet */
.gap { padding: 16px 18px; border: 1.5px dashed var(--line); border-radius: 12px; color: var(--muted); font-size: 14px; max-width: 640px; }
.gap + .gap { margin-top: 12px; }
.covers .gap { text-align: center; }
.gap-inline { color: var(--muted); font-size: 13px; border: 1px dashed var(--line); border-radius: 6px; padding: 2px 8px; }


/* Formats: plain-English size names, an (i) with the measurements, and a price + Buy on each */
.ib-table th .fmt-sub { position: relative; display: flex !important; flex-wrap: wrap; align-items: center; gap: 6px; opacity: 1; color: rgba(207,198,232,.8); }
.dim-i { display: inline-grid; place-items: center; width: 18px; height: 18px; padding: 0; border-radius: 50%; border: 1.5px solid var(--lilac); background: transparent; color: var(--lilac); font: italic 700 11px/1 Georgia, serif; cursor: help; }
.dim-i:hover, .dim-i[aria-expanded="true"] { background: var(--lilac); color: var(--on-pink); }
.dim-i:focus-visible { outline: 2px solid var(--cream); outline-offset: 2px; }
.dim-pop { position: absolute; opacity: 1; left: 0; top: calc(100% + 6px); z-index: 20; width: 220px; padding: 10px 12px; border-radius: 12px; background: var(--surface-raised); border: 1px solid var(--line); box-shadow: 0 14px 30px rgba(0,0,0,.45); font-size: 13px; line-height: 1.45; color: var(--cream); }
.dim-pop[hidden] { display: none; }
.ib-table th .fmt-sub .dim-pop, .ib-table th .dim-pop span { opacity: 1; font-size: 13px; }
.dim-pop b { display: block; font-weight: 700; color: var(--pink); }
.dim-pop span { display: block; color: var(--muted); }
.dim-pop span + span { color: var(--cream); margin-top: 2px; }
.ib-table .buy-line { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.ib-table .buy-line .money { font-weight: 700; color: var(--cream); }
.buy { min-height: 32px; padding: 4px 16px; border: 0; border-radius: 999px; background: var(--pink); color: var(--on-pink); font: inherit; font-size: 13.5px; font-weight: 800; cursor: pointer; }
.buy:hover { background: var(--cream); }
.buy:focus-visible { outline: 2px solid var(--cream); outline-offset: 2px; }
.buy.added { background: var(--lilac); }
.ib-checkout { margin-top: 6px; font-size: 14px; font-weight: 700; color: var(--pink) !important; text-decoration: none; }
.ib-checkout[hidden] { display: none; }

/* Commissioned review (curator's retelling with curators on, approved plain version with them off). */
.crev-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 14px; }
.crev-fig { width: 84px; height: auto; flex: none; }
.crev-head .listen { margin: 0 0 6px; }
.crev-head .hear .dur { font-weight: 400; opacity: .8; }
.crev .prose p { line-height: 1.7; }
.crev-note { margin: 14px 0 0; font-size: 13.5px; color: var(--muted); font-style: italic; }
html.words-off .crev:has(.hear[data-audio]:not([data-audio=""])) .crev-text { display: none; }

/* Folded long text: about 10 lines (18px × 1.75), fading to nothing, then "Read more". */
.fold-body.folded { max-height: 320px; overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent); mask-image: linear-gradient(to bottom, #000 55%, transparent); }
.fold-btn { display: inline-block; margin: 2px 0 0; padding: 6px 0; background: none; border: 0; font: inherit; font-size: 15px;
  font-weight: 600; color: var(--lilac); cursor: pointer; }
.fold-btn:hover { color: var(--pink); }
.fold-btn::after { content: " \2193"; }
.fold-btn[aria-expanded="true"]::after { content: " \2191"; }

/* Author pages (30 Oct 2026): bio, then the author's books, newest first. */
.author-page .bsec { max-width: 900px; }
.author-page .mini-books { margin-top: 8px; }
.author-page .mini-books .book .m { color: var(--muted); }
.author-page .mini-books .jacket { aspect-ratio: 2 / 3; display: flex; align-items: flex-end; }
.author-page .mini-books .jacket img { width: 100%; height: 100%; object-fit: contain; object-position: bottom center; }
/* Status above Formats (Blair, 31 Oct 2026): Available / Temporarily unavailable / Unavailable (Coming soon for forthcoming books). */
.ib-status .status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.ib-status .status::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: currentColor; }
.status-available { color: #7BE0A6; background: rgba(123, 224, 166, .12); }
.status-soon { color: var(--lilac); background: rgba(200, 170, 255, .12); }
.status-temp { color: #FFC56B; background: rgba(255, 197, 107, .12); }
.status-gone { color: var(--muted); background: rgba(255, 255, 255, .06); }
