/* books.charlessieg.com: page layouts. Typeset cover cards on shelves, grouped by author, carry the design. */

/* Page heads */
.page-head { padding-top: clamp(1.75rem, 5vw, 3rem); padding-bottom: 1.5rem; }
.page-head h1 { font-size: clamp(2.4rem, 7.5vw, 4.4rem); line-height: 1.02; max-width: 18ch; }
.lead { font-size: 1.25rem; line-height: 1.5; color: var(--ink-soft); max-width: var(--measure); margin: 0.9rem 0 0; }
.count { font: 600 1.15rem/1.2 var(--serif); font-variant-numeric: tabular-nums lining-nums; letter-spacing: 0.02em; color: var(--accent); margin: 1.1rem 0 0.35rem; }
.note { color: var(--ink-soft); max-width: var(--measure); margin: 0; font-size: 0.95rem; }

/* Home */
.hero { padding-top: clamp(2.5rem, 8vw, 5.5rem); padding-bottom: clamp(1.5rem, 4vw, 3rem); border-bottom: 1px solid var(--rule); }
.hero__title { font-size: clamp(4.5rem, 21vw, 12rem); line-height: 0.9; letter-spacing: -0.01em; color: var(--ink); }
.hero__line { font-size: clamp(1.25rem, 2.6vw, 1.6rem); line-height: 1.4; max-width: 30rem; margin: 1.25rem 0 0.5rem; }
.hero__note { color: var(--ink-soft); max-width: 34rem; margin: 0; }

.shelves { display: grid; gap: 3rem; padding-top: 2rem; }
.shelf__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 1rem; border-bottom: 2px solid var(--ink); padding-bottom: 0.6rem; }
.shelf__head h2 { font-size: clamp(1.8rem, 4.5vw, 2.5rem); }
.shelf__head h2 a { text-decoration: none; }
.shelf__head h2 a:hover { text-decoration: underline; text-decoration-thickness: 0.06em; }
.shelf__head .count { margin: 0; }
.series__title { font: 600 1.15rem/1.3 var(--serif); letter-spacing: 0.02em; color: var(--ink-soft); margin: 1.6rem 0 0.2rem; }
.shelf__row { list-style: none; display: grid; gap: 1.4rem 1.1rem; margin: 1.1rem 0 0; grid-template-columns: repeat(auto-fill, minmax(6.8rem, 1fr)); }
.shelf__row:not(.shelf__row--compact) { grid-template-columns: minmax(0, 1fr); gap: 0; margin-top: 0.4rem; }

/* The cover: the book's own front cover, self-hosted, in its real shape. The author's color shows behind it while it loads. */
.cover-img {
  display: block; width: 100%; height: auto; border-radius: 2px 4px 4px 2px; background: var(--cover);
  box-shadow: 0 0 0 1px var(--rule), 0 1px 3px rgb(0 0 0 / 0.3);
}
.shelf__row--compact { align-items: end; }

/* The cover card: a typeset stand-in for a cover, in the author's color. Decoration only (aria-hidden). It shows only when a book has no cover file. */
.cover {
  container-type: inline-size; position: relative; display: block;
  aspect-ratio: 2 / 3; width: 100%; overflow: hidden; border-radius: 3px 6px 6px 3px;
  background: var(--cover); color: var(--cover-ink);
  box-shadow: inset 5px 0 0 rgb(0 0 0 / 0.28), inset 6px 0 0 rgb(255 255 255 / 0.12), 0 1px 2px rgb(0 0 0 / 0.25);
}
/* The container-query units (cqw) of the face's contents measure the .cover above them, so padding sits on the face, not the card. */
.cover__face { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 17cqw 8cqw 8cqw 12cqw; }
.cover__title { font: 600 12cqw/1.12 var(--serif); text-wrap: balance; overflow-wrap: anywhere; }
.cover__author { font: 600 7cqw/1.2 var(--sans); letter-spacing: 0.09em; text-transform: uppercase; }
.cover__year { position: absolute; right: 8cqw; top: 6cqw; font: 600 7cqw/1 var(--sans); font-variant-numeric: lining-nums; opacity: 0.9; }

.book--compact { min-width: 0; }
.book--compact .book__link { display: block; max-width: 8.5rem; border-radius: 4px; }
.book--compact .book__link:hover .cover { box-shadow: inset 5px 0 0 rgb(0 0 0 / 0.28), inset 6px 0 0 rgb(255 255 255 / 0.12), 0 0 0 3px var(--accent); }
.book--compact .book__link:hover .cover-img, .book--compact .book__link:focus-visible .cover-img { box-shadow: 0 0 0 3px var(--accent); }
.book--compact .book__no { margin: 0.35rem 0 0; font-size: 0.9rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.book__title { font: 600 1.05rem/1.25 var(--serif); }

/* A full entry on an author page: cover at the left, facts and links at the right. */
.book:not(.book--compact) { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 0 clamp(1rem, 3vw, 1.75rem); padding: 1.4rem 0; border-bottom: 1px solid var(--rule); align-items: start; }
.book:not(.book--compact) .book__title { font-size: clamp(1.45rem, 3.8vw, 2rem); line-height: 1.1; }
.book__subtitle { margin: 0.3rem 0 0; font: italic 1.05rem/1.35 var(--serif); color: var(--ink-soft); max-width: var(--measure); }
.book__facts { display: flex; flex-wrap: wrap; gap: 0.15rem 0; list-style: none; margin: 0.55rem 0 0; font-size: 0.95rem; line-height: 1.45; color: var(--ink-soft); }
.book__facts li:not(:last-child)::after { content: ""; display: inline-block; width: 1px; height: 0.9em; margin: 0 0.7em; background: var(--rule); vertical-align: -0.08em; }
.book__note { margin: 0.7rem 0 0; max-width: var(--measure); font-size: 1rem; }
.book__links { display: flex; flex-wrap: wrap; gap: 0.3rem 1.4rem; margin: 0.8rem 0 0; font-size: 0.95rem; }
.book:target { background: color-mix(in srgb, var(--accent) 12%, var(--paper)); }
@media (min-width: 40rem) { .book:not(.book--compact) { grid-template-columns: 8rem minmax(0, 1fr); } }

/* Authors page */
.authors { list-style: none; display: grid; gap: 0; border-top: 1px solid var(--rule); }
.author { position: relative; padding: 1.3rem 0 1.3rem 1.2rem; border-bottom: 1px solid var(--rule); }
.author__band { position: absolute; left: 0; top: 1.3rem; bottom: 1.3rem; width: 4px; border-radius: 2px; background: var(--cover); }
.author__name { font-size: clamp(1.6rem, 4.4vw, 2.3rem); }
.author__name a { text-decoration: none; }
.author__name a:hover { text-decoration: underline; text-decoration-thickness: 0.06em; }
.author__count { margin: 0.2rem 0 0; color: var(--ink-soft); }

/* About and 404 */
.prose section { margin-top: 2rem; }
.prose h2 { font-size: 1.6rem; margin-bottom: 0.6rem; }
.prose p { max-width: var(--measure); }
.missing { list-style: none; display: grid; gap: 0.4rem; margin-top: 1.4rem; font-size: 1.15rem; }
