/* Spread site pages: the shelf (index.html) and each book's page (template/book.html). */
:root { --ink: #1d1c1a; --muted: #6f6a62; --bg: #f4f2ee; --accent: #e8331f; --blue: #1b3fd0; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 "Albert Sans", system-ui, sans-serif; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
header { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 28px 0 20px; flex-wrap: wrap; }
.logo { margin: 0; font: 400 32px/1 "Libre Caslon Text", Georgia, serif; letter-spacing: -.01em; }
.logo span { color: var(--accent); font-style: italic; }
.tagline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tag { margin: 0; color: var(--muted); }
.demo { padding: 4px 10px; border: 1px solid rgba(232,51,31,.35); border-radius: 999px; color: #b8260f; font-size: 12px; font-weight: 500; letter-spacing: .04em; white-space: nowrap; }
.book { border-radius: 14px; }
.saved[hidden] { display: none; }
.saved { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; padding: 12px 16px; border-radius: 12px; background: #fff; border: 1px solid rgba(29,28,26,.12); font-size: 15px; }
.saved::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; background: #d9a400; box-shadow: 0 0 0 4px rgba(217,164,0,.18); animation: pulse 1.4s ease-in-out infinite; }
.saved.is-live::before { background: #1f9d55; box-shadow: 0 0 0 4px rgba(31,157,85,.18); animation: none; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .saved::before { animation: none; } }
section.share { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; padding: 36px 0 56px; }
@media (max-width: 800px) { section.share { grid-template-columns: 1fr; } }
.share h2 + p { margin: 0 0 14px; color: var(--muted); }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row + .row { margin-top: 10px; }
.url { flex: 1 1 220px; min-width: 0; padding: 10px 12px; border: 1px solid rgba(29,28,26,.14); border-radius: 10px; background: #fff; font: inherit; color: var(--ink); }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border: 1px solid rgba(29,28,26,.14); border-radius: 999px; background: #fff; color: var(--ink); font: inherit; font-weight: 500; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: rgba(29,28,26,.4); }
.btn:focus-visible, .url:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.btn--dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn--wa { background: #1f9d55; border-color: #1f9d55; color: #fff; }
.btn svg { width: 18px; height: 18px; }
.share pre { margin: 0 0 10px; }
h2 { font: 400 28px/1.1 "Libre Caslon Display", "Libre Caslon Text", Georgia, serif; margin: 0 0 10px; }
pre { margin: 12px 0 0; padding: 16px; overflow-x: auto; background: #fff; border: 1px solid rgba(29,28,26,.1); border-radius: 10px; font: 13px/1.6 ui-monospace, "SF Mono", Menlo, monospace; }
p.note { color: var(--muted); margin: 12px 0 0; }
footer { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 24px 0 40px; border-top: 1px solid rgba(29,28,26,.1); color: var(--muted); font-size: 13px; }
footer p { margin: 0; max-width: 560px; }
footer strong { color: var(--ink); font-weight: 500; }
footer a { color: var(--ink); }

/* header links */
.logo a { color: inherit; text-decoration: none; }
.crumb { margin: 0 0 18px; font-size: 14px; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--ink); }
.book-page .book { margin-bottom: 8px; }
.edit-link[hidden] { display: none; }

/* shelf */
.shelf-intro { max-width: 620px; margin: 8px 0 28px; color: var(--muted); }
.shelf { list-style: none; margin: 0 0 56px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 36px 28px; }
.shelf a { display: block; color: var(--ink); text-decoration: none; }
.shelf-cover {
  position: relative; aspect-ratio: 3 / 4; border-radius: 3px 6px 6px 3px; overflow: hidden;
  display: flex; flex-direction: column; padding: 9% 10% 10% 13%; gap: 6%;
  box-shadow: 0 1px 2px rgba(0,0,0,.15), 0 14px 28px -10px rgba(20,16,10,.35);
  transition: transform .25s ease, box-shadow .25s ease;
}
.shelf-cover::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to right, rgba(0,0,0,.28), rgba(255,255,255,.1) 2%, rgba(0,0,0,.08) 4%, transparent 7%); pointer-events: none; }
.shelf a:hover .shelf-cover, .shelf a:focus-visible .shelf-cover { transform: translateY(-4px); box-shadow: 0 1px 2px rgba(0,0,0,.15), 0 22px 36px -12px rgba(20,16,10,.4); }
.shelf a:focus-visible { outline: none; }
.shelf a:focus-visible .shelf-title { text-decoration: underline; }
.shelf-cover img { flex: 1; min-height: 0; width: 100%; object-fit: contain; }
.shelf-cover span { font: 400 clamp(16px, 2vw, 22px)/1 "Libre Caslon Display", "Libre Caslon Text", Georgia, serif; }
.shelf-title { margin: 14px 0 2px; font: 400 20px/1.2 "Libre Caslon Text", Georgia, serif; }
.shelf-meta { margin: 0; font-size: 13px; color: var(--muted); }
.shelf-empty { color: var(--muted); }
