/* Books page (/books/). Loaded only on that page, see partials/head.html. */

.books { padding-bottom: 3rem; }
.books-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* Year links, with a count beside each */
.year-nav {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  column-gap: 1.25rem;
  margin: 1.75rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}
.year-nav a {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}
.year-nav a span + span { color: var(--text-muted); }

.books-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.books-section h2 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Lately: four big covers */
.lately {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-top: 1rem;
}
.lately a { display: flex; flex-direction: column; color: inherit; }
.lately a:hover { text-decoration: none; }
.lately .cover {
  display: flex;
  align-items: flex-end;
  aspect-ratio: 2 / 3;
  min-height: 0;
  overflow: hidden;
  margin-bottom: 0.6rem;
}
.lately .cover img { width: 100%; height: auto; max-height: 100%; object-fit: contain; object-position: bottom; }
.lately .cover-blank { font-size: 2.5rem; }
.lately cite { color: var(--link); font-size: 0.95rem; line-height: 1.3; }
.lately a:hover cite { text-decoration: underline; }

/* Year lists. The heading sticks to the top of the screen while its
   books scroll under it. */
.year { margin-top: 3rem; }
.year-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.75rem 0 0.6rem;
  margin-bottom: 1rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.year-head h2 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.year-head .count,
.year-head nav {
  font-family: var(--font-mono);
  font-size: 0.75rem;
}
.year-head .count { color: var(--text-muted); }
.year-head nav { display: flex; gap: 1rem; margin-left: auto; white-space: nowrap; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.book-list { list-style: none; }
.book-list li {
  display: grid;
  grid-template-columns: 2.75rem 1fr;
  align-items: start;
}
.book-list li + li { margin-top: 0.7rem; }
.book-list .month {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding-top: 0.2rem;
}
.book-list a { display: flex; gap: 0.9rem; color: inherit; }
.book-list a:hover { text-decoration: none; }
.book-list .cover { flex: none; width: 2.5rem; }
.book-list .cover img { width: 100%; height: auto; display: block; }
.book-list .cover-blank { height: 3.6rem; font-size: 1.1rem; }
.book-list .text { display: flex; flex-direction: column; line-height: 1.35; padding-top: 0.1rem; }
.book-list cite { color: var(--link); }
.book-list a:hover cite { text-decoration: underline; }

cite { font-style: normal; }
.books .by { color: var(--text-muted); font-size: 0.85rem; }
.lately .by {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.2rem;
}

.cover img { border-radius: 2px; box-shadow: 0 0 0 1px var(--border); }
.cover-blank {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: var(--code-bg);
  color: var(--text-muted);
  border-radius: 2px;
}

@media (max-width: 520px) {
  .year-nav { grid-template-columns: repeat(3, 1fr); }
  .lately { grid-template-columns: repeat(2, 1fr); row-gap: 1.75rem; }
  .book-list li { grid-template-columns: 2.25rem 1fr; }
  .year-head { gap: 0.5rem; }
  .year-head nav { gap: 0.75rem; }
}
