/* ============================================================
   Books page  |  Minimalist Redesign (mirrors allposts.css)
   Palette: dark #1a1a1a · bg-alt #242424 · gold #d4af37
   ============================================================ */

/* ── Custom properties ────────────────────────────────────── */
:root {
  --c-bg:         #1a1a1a;
  --c-bg-alt:     #242424;
  --c-fg:         #e8e8e8;
  --c-fg-muted:   rgba(232, 232, 232, 0.72);
  --c-fg-light:   rgba(232, 232, 232, 0.20);
  --c-gold:       #d4af37;
  --c-gold-dim:   rgba(212, 175, 55, 0.18);
  --c-gold-faint: rgba(212, 175, 55, 0.07);
  --c-border:     rgba(212, 175, 55, 0.14);
  --c-blue:       #4a9eff;
  --c-blue-dim:   rgba(74, 158, 255, 0.18);
  --radius:       3px;
  --ease:         cubic-bezier(0.4, 0, 0.2, 1);
  --dur:          0.22s;
  --font-mono:    'Courier New', 'Consolas', monospace;
}

/* ── Intro text (page body content from books.md) ──────────── */
.books-intro {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--c-fg-muted);
  margin-bottom: 2.4rem;
  width: 100%;
}

/* ── Books wrapper ─────────────────────────────────────────── */
.books-container {
  width: 100%;
  padding: 0 0 4rem;
}

/* ── Category tag-filter ──────────────────────────────────── */
.cat-nav {
  display: flex;
  flex-wrap: wrap;            /* tags wrap to next line instead of scrolling */
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2.8rem;
  /* no border-bottom — tags are free-floating pills */
}

.cat-nav__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.38rem 0.9rem;
  background: transparent;
  border: 1px solid var(--c-border);
  border-radius: 20px;        /* pill shape */
  color: var(--c-fg-muted);
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--dur) var(--ease),
              background var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
  outline: none;
}
.cat-nav__btn:hover,
.cat-nav__btn:focus-visible {
  color: var(--c-fg);
  border-color: rgba(212, 175, 55, 0.40);
  background: var(--c-gold-faint);
}
.cat-nav__btn:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: 2px;
}
.cat-nav__btn.is-active {
  color: var(--c-bg);                          /* dark text on gold fill */
  background: var(--c-gold);
  border-color: var(--c-gold);
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.30);
}

/* Book count badge */
.cat-nav__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.05em 0.42em;
  background: rgba(0, 0, 0, 0.15);
  color: inherit;
  border-radius: 20px;
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0;
  min-width: 1.4em;
  transition: background var(--dur) var(--ease);
}
.cat-nav__btn:not(.is-active) .cat-nav__count {
  background: var(--c-gold-dim);
  color: var(--c-gold);
}

/* ── Book panels ───────────────────────────────────────────── */
.book-panels { position: relative; }

.book-panel {
  display: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity var(--dur) var(--ease),
              transform var(--dur) var(--ease);
}
.book-panel.is-active {
  display: block;
  animation: panelIn var(--dur) var(--ease) forwards;
}

@keyframes panelIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Book list — 2-column grid (mirrors .post-list) ────────── */
.book-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 3.2rem;
  align-items: start;
}

/* ── Individual book entry ─────────────────────────────────── */
.book-entry {
  display: grid;
  grid-template-columns: 4.4rem 1fr;  /* year is narrower than a full date */
  gap: 0 1.6rem;
  padding: 1.4rem 0 1.4rem 0.8rem;
  border-bottom: 1px solid var(--c-border);
  border-left: 2px solid transparent;
  transition: border-left-color 0.26s var(--ease);
}
.book-entry:hover,
.book-entry:focus-within {
  border-left-color: var(--c-gold);
}
.book-entry:last-child {
  border-bottom: none;
}

/* Year column */
.book-entry__year {
  display: block;
  padding-top: 0.22rem;
  font-family: var(--font-mono);
  font-size: 0.71rem;
  color: var(--c-fg-muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
  user-select: none;
}

/* Content column */
.book-entry__body { min-width: 0; }

.book-entry__title-row {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.5em;
  margin-bottom: 0.3rem;
}

.book-entry__title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--c-fg);
}

/* Currently Reading badge */
.book-status-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.65em;
  color: #fff;
  background: linear-gradient(135deg, var(--c-blue), #357abd);
  padding: 0.3em 0.75em;
  border-radius: 20px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 6px rgba(74, 158, 255, 0.3);
  animation: subtle-pulse 2.4s ease-in-out infinite;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 0.15rem;
}

@keyframes subtle-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.82; }
}

/* In-progress highlight — blue left accent instead of gold */
.book-entry.book-in-progress {
  border-left-color: rgba(74, 158, 255, 0.4);
}
.book-entry.book-in-progress:hover,
.book-entry.book-in-progress:focus-within {
  border-left-color: var(--c-blue);
}

/* Author line */
.book-entry__author {
  display: block;
  font-size: 0.86rem;
  color: var(--c-gold);
  font-style: italic;
  margin-bottom: 0.45rem;
}

/* Category tags */
.book-entry__cats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.6rem;
}

.book-tag {
  display: inline-block;
  padding: 0.1em 0.6em;
  background: var(--c-gold-faint);
  border: 1px solid var(--c-border);
  color: var(--c-fg-muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--radius);
  transition: color var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              background var(--dur) var(--ease);
}
.book-entry:hover .book-tag,
.book-entry:focus-within .book-tag {
  color: var(--c-gold);
  border-color: rgba(212, 175, 55, 0.35);
  background: rgba(212, 175, 55, 0.1);
}

/* Comment / notes */
.book-entry__comments {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.65;
  color: var(--c-fg-muted);
  font-style: italic;
  padding-left: 0.8em;
  border-left: 2px solid var(--c-border);
}

/* ── Empty state ───────────────────────────────────────────── */
.book-panel__empty {
  padding: 2.8rem 0 2rem;
  text-align: center;
  color: var(--c-fg-light);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}
.book-panel__empty::before {
  content: '—';
  display: block;
  font-size: 1.3rem;
  margin-bottom: 0.7rem;
  color: var(--c-border);
}

/* ── Year dividers (span both grid columns) ────────────────── */
.year-marker {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 2rem 0 0.2rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--c-gold);
  text-transform: uppercase;
}
.year-marker::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--c-border);
}

/* ── Responsive ────────────────────────────────────────────── */

/* Collapse to single column below ~900px */
@media (max-width: 900px) {
  .book-list {
    grid-template-columns: 1fr;
    column-gap: 0;
  }
  .year-marker {
    grid-column: 1;
  }
}

@media (max-width: 680px) {
  .cat-nav__btn {
    padding: 0.55rem 0.85rem 0.65rem;
    font-size: 0.72rem;
  }
  .book-entry {
    grid-template-columns: 1fr;
    gap: 0.1rem;
    padding: 1.2rem 0 1.2rem 0.6rem;
  }
  .book-entry__year {
    font-size: 0.67rem;
    margin-bottom: 0.3rem;
  }
}

@media (max-width: 420px) {
  .books-container { padding-bottom: 3rem; }
  .cat-nav { margin-bottom: 1.8rem; gap: 0.4rem; }
  .cat-nav__btn { font-size: 0.68rem; padding: 0.32rem 0.75rem; }
}
