/* Learn: the Library */
.nav-links { flex: 1; justify-content: center; }
.hub-hero { background: var(--surface-dark); padding: 220px 0 3.5rem; }
.hub-hero .container, .lib .container { max-width: 1160px; }
.hub-hero h1 { font-size: clamp(2.4rem, 6vw, 4.6rem); color: var(--white); margin: 0.25rem 0 1.1rem; }
.hub-lede { color: rgba(255,255,255,0.8); font-size: 1.12rem; line-height: 1.7; max-width: 680px; }
.lib { padding: 2.5rem 0 4.5rem; background: #faf8f4; }
.lib-filter { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 2.25rem; }
.lib-chip { font-family: var(--font-display); font-weight: 800; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; padding: 0.55rem 0.95rem; border: 1.5px solid var(--ink); background: var(--white); color: var(--ink); cursor: pointer; }
.lib-chip[aria-pressed="true"] { background: var(--ink); color: var(--white); }
.lib-chip:focus-visible { outline: 2px solid var(--terra); outline-offset: 2px; }

/* A shelf: a heading, a row of books, and the plank they sit on */
.shelf { margin-bottom: 3.5rem; }
.shelf-head { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.shelf-head h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin: 0; }
.shelf-head p { margin: 0; color: #5d5850; }
.shelf-row { position: relative; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 2.25rem 1.75rem; align-items: start; padding-bottom: 0.25rem; }

/* A book: a cover standing on the shelf, with its card underneath */
.book { display: block; color: var(--ink); text-decoration: none; }
.book .cover {
  position: relative; display: flex; flex-direction: column; aspect-ratio: 3 / 4; padding: 1.3rem 1.2rem 1.2rem 1.6rem;
  color: var(--white); background: #8c8478;
  box-shadow: inset 7px 0 0 rgba(0,0,0,0.22), inset 9px 0 0 rgba(255,255,255,0.12), 0 14px 18px -10px rgba(0,0,0,0.45);
  transition: transform 0.25s, box-shadow 0.25s;
}
/* The plank sits on the slot, not the cover, so it stays put when a cover lifts on hover. */
.book .slot { position: relative; display: block; }
.book .slot::after { content: ''; position: absolute; left: -15px; right: -15px; bottom: -14px; height: 9px; background: #3b3128; box-shadow: 0 6px 10px -4px rgba(0,0,0,0.35); }
.book:hover .cover, .book:focus-visible .cover { transform: translateY(-6px) rotate(-1deg); box-shadow: inset 7px 0 0 rgba(0,0,0,0.22), inset 9px 0 0 rgba(255,255,255,0.12), 0 22px 24px -12px rgba(0,0,0,0.5); }
.book:focus-visible { outline: none; }
.book:focus-visible .cv-t { text-decoration: underline; }
.cover.c-terra { background: var(--terra); }
.cover.c-ink { background: #1b1b1b; }
.cover.c-pine { background: var(--pine); }
.cover.c-gold { background: var(--gold-raw); }
.cv-k { font-family: var(--font-display); font-weight: 800; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.75); padding-bottom: 0.6rem; border-bottom: 1px solid rgba(255,255,255,0.35); }
.c-ink .cv-k { color: var(--gold-hi); }
.cv-t { font-family: var(--font-display); font-weight: 900; font-size: clamp(1.45rem, 2.4vw, 1.9rem); line-height: 1.02; text-transform: uppercase; margin-top: 0.9rem; }
.cv-s { margin-top: auto; font-family: var(--font-display); font-weight: 700; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,0.75); }
.b-meta { display: block; margin-top: 1.6rem; font-family: var(--font-display); font-weight: 800; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--terra); }
.b-d { display: block; margin-top: 0.35rem; font-size: 0.92rem; line-height: 1.55; color: #5d5850; }

/* Empty slots: outlined, so the shelf reads as still filling up */
.book.ghost .cover { background: transparent; border: 2px dashed rgba(0,0,0,0.2); box-shadow: none; justify-content: center; align-items: center; text-align: center; }
.book.ghost .cv-t { color: rgba(0,0,0,0.35); font-size: 1rem; margin: 0; }
.book.ghost .slot::after { left: -17px; right: -17px; }

.lib .share { margin-top: 1rem; }
@media (max-width: 720px) {
  .hub-hero { padding: 160px 0 2.5rem; }
  .shelf-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 1rem; }
  .book .cover { padding: 1rem 0.85rem 0.9rem 1.2rem; }
  .cv-t { font-size: 1.15rem; }
  .b-d { font-size: 0.85rem; }
}

/* A series shelf: smaller covers so a whole run fits */
.shelf.series .shelf-row { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 2.25rem 1.5rem; }
.shelf.series .cv-t { font-size: clamp(1.1rem, 1.7vw, 1.4rem); }
.shelf.series .book .slot::after { left: -13px; right: -13px; }
.shelf.series .book .cover { padding: 1.1rem 1rem 1rem 1.35rem; }
.shelf.series .cv-k { font-size: 0.66rem; }
.shelf-foot { margin: 1.75rem 0 0; }
.shelf-foot a { font-family: var(--font-display); font-weight: 800; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--terra); text-decoration: none; }
.shelf-foot a:hover { text-decoration: underline; }
.cover.c-gold .cv-k { color: rgba(255,255,255,0.85); }

/* Library covers: cloth-bound colors with gold foil, one color per series */
.cover.c-oxblood { background: #6b2620; }
.cover.c-navy { background: #1e3350; }
.cover.c-forest { background: #234a37; }
.cover.c-mustard { background: #8a6a1f; }
.cover.c-slate { background: #3d4650; }
.book .cover { background-image: linear-gradient(transparent 0 0.75rem, rgba(217,166,37,0.55) 0.75rem calc(0.75rem + 1px), transparent calc(0.75rem + 1px) calc(100% - 0.75rem - 1px), rgba(217,166,37,0.55) calc(100% - 0.75rem - 1px) calc(100% - 0.75rem), transparent calc(100% - 0.75rem)); }
.book .cv-k { display: flex; flex-direction: column; gap: 0.15rem; color: var(--gold-hi); border-bottom-color: rgba(217,166,37,0.45); }
.book .cv-k span:first-child { font-size: 1.05em; }
.book .cv-k span + span { color: rgba(255,255,255,0.78); font-weight: 700; }
.book .cv-s { color: rgba(217,166,37,0.9); }
.shelf .shelf-row { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 2.25rem 1.5rem; }
.shelf .cv-t { font-size: clamp(1.1rem, 1.7vw, 1.4rem); }
.shelf .book .slot::after { left: -13px; right: -13px; }
.shelf .book .cover { padding: 1.35rem 1rem 1.25rem 1.35rem; }
.shelf .cv-k { font-size: 0.66rem; }

/* Phones: three books to a shelf row, smaller covers and type */
@media (max-width: 720px) {
  .lib { padding-top: 1.75rem; }
  .shelf .shelf-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.75rem 0.7rem; }
  .shelf .book .slot::after { left: -6px; right: -6px; bottom: -10px; height: 7px; }
  .shelf .book .cover { padding: 0.6rem 0.45rem 0.55rem 0.7rem; box-shadow: inset 4px 0 0 rgba(0,0,0,0.22), inset 5px 0 0 rgba(255,255,255,0.12), 0 10px 12px -8px rgba(0,0,0,0.45); }
  .book .cover { background-image: linear-gradient(transparent 0 0.4rem, rgba(217,166,37,0.55) 0.4rem calc(0.4rem + 1px), transparent calc(0.4rem + 1px) calc(100% - 0.4rem - 1px), rgba(217,166,37,0.55) calc(100% - 0.4rem - 1px) calc(100% - 0.4rem), transparent calc(100% - 0.4rem)) !important; }
  .shelf .cv-k { font-size: 0.5rem; letter-spacing: 0.08em; padding-bottom: 0.3rem; }
  .shelf .cv-t { font-size: 0.82rem; line-height: 1.02; margin-top: 0.4rem; }
  .shelf .cv-s { font-size: 0.48rem; letter-spacing: 0.05em; }
  .shelf .b-meta { margin-top: 1.1rem; font-size: 0.6rem; letter-spacing: 0.05em; }
  .shelf .b-d { font-size: 0.74rem; line-height: 1.4; }
  .shelf-foot a { font-size: 0.68rem; }
}
@media (max-width: 420px) {
  .shelf .b-d { display: none; }
}
