/* The shelf.
 *
 * Five cards and nothing else. No numbering, no "start here", no progress
 * across the set — a teacher takes the one that fits the week and a reader
 * takes the cover they like, and both of those are choosing, which is the
 * condition under which any of this gets read at all.
 */

body.hub {
  background: var(--paper);
}

.wrap {
  max-width: 46rem;
  margin-inline: auto;
  padding-inline: var(--page-pad);
}

/* ---------------------------------------------------------------- masthead */

.masthead {
  padding: clamp(52px, 12vh, 128px) 0 clamp(28px, 5vh, 56px);
}

.masthead h1 {
  font-size: clamp(2.4rem, 8vw, 4rem);
  line-height: 1.02;
  margin: 0 0 0.5em;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.lede {
  font-size: clamp(1.1rem, 1rem + 0.6vw, 1.4rem);
  line-height: 1.5;
  margin: 0 0 1.4em;
  max-width: 32rem;
}

.meta {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--ink-soft);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin: 0;
}

/* ------------------------------------------------------------------- shelf */

.shelf {
  display: grid;
  gap: clamp(16px, 2.4vw, 26px);
  max-width: 72rem;
  margin-inline: auto;
  padding: 0 var(--page-pad) clamp(48px, 9vh, 96px);
  grid-template-columns: 1fr;
}

@media (min-width: 620px) {
  .shelf { grid-template-columns: repeat(2, 1fr); }
  /* The first card takes the full width — a shelf of five in a two-column
   * grid otherwise ends with one card sitting alone looking like a mistake. */
  .shelf .book:first-child { grid-column: 1 / -1; }
  .shelf .book:first-child { grid-template-columns: 1.2fr 1fr; display: grid; }
  .shelf .book:first-child .plate { aspect-ratio: auto; min-height: 20rem; }
}

@media (min-width: 1080px) {
  .shelf { grid-template-columns: repeat(3, 1fr); }
  .shelf .book:first-child { grid-column: 1 / span 2; }
}

.book {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  background: var(--paper);
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.book:hover { border-color: var(--ink-soft); }
.book:active { transform: translateY(1px); }
.book:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.book .plate {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--p-paper);
  overflow: hidden;
  isolation: isolate;
  border-bottom: 1px solid var(--rule);
}
.book .plate svg { display: block; width: 100%; height: 100%; }

/* The same paper grain the books use, so a cover and its pages look printed
 * on the same stock. */
.book .plate::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n' x='0' y='0' width='100%25' height='100%25' color-interpolation-filters='sRGB'><feTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='4' stitchTiles='stitch'/><feColorMatrix type='matrix' values='0 0 0 0 0.07 0 0 0 0 0.06 0 0 0 0 0.05 1.25 0.4 0 0 -0.28'/></filter><rect width='180' height='180' filter='url(%23n)'/></svg>");
  background-size: 180px 180px;
  mix-blend-mode: var(--p-blend);
  opacity: var(--p-grain-a);
}

.spine {
  padding: clamp(16px, 2.2vw, 26px);
}

.spine h2 {
  font-size: clamp(1.25rem, 1.1rem + 0.7vw, 1.7rem);
  margin: 0 0 0.35em;
  font-weight: 600;
  line-height: 1.12;
  text-wrap: balance;
}

.spine p {
  margin: 0 0 0.7em;
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.5;
}

.tick {
  font-family: var(--sans);
  font-size: 0.74rem !important;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 0 !important;
  opacity: 0.75;
}

/* --------------------------------------------------------------- colophon */

.colophon {
  border-top: 1px solid var(--rule);
  padding: clamp(40px, 8vh, 80px) 0 clamp(56px, 10vh, 110px);
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.colophon h3 {
  font-family: var(--sans);
  font-size: 0.74rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  margin: 2.4em 0 0.7em;
  color: var(--ink-soft);
}
.colophon h3:first-child { margin-top: 0; }

.colophon p { margin: 0 0 1em; max-width: 44rem; line-height: 1.6; }
.colophon .quiet { font-size: 0.88rem; opacity: 0.85; }
.colophon a { text-decoration-thickness: 1px; text-underline-offset: 2px; }
.colophon a:hover { color: var(--accent); }

@media print {
  :root { --paper: #fff; --ink: #000; --ink-soft: #333; --rule: #bbb;
          --p-paper: #fff; --p-ink: #000; --p-blend: normal; --p-grain-a: 0; }
  body.hub { background: #fff; }
  #ease { display: none; }
  .shelf { grid-template-columns: 1fr 1fr; }
  .book { break-inside: avoid; }
  .book .plate { aspect-ratio: 3 / 2; }
  .book .plate::after { display: none; }
  .colophon { break-before: page; }
}
