/* Shelfmark. Paper, ink, and a yellow highlighter. System fonts only: nothing is loaded from third parties. */
:root {
  --paper: #eef0ea;
  --card: #fafbf7;
  --ink: #18222b;
  --muted: #5a6672;
  --line: #d2d7cd;
  --hl: #ffd84a;
  --link: #2a4a9b;
  --danger: #a32a2a;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "URW Palladio L", P052, "Book Antiqua", serif;
  --sans: system-ui, -apple-system, "Segoe UI", "Noto Sans", "DejaVu Sans", sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141b22;
    --card: #1b242d;
    --ink: #e8ebe4;
    --muted: #97a3ad;
    --line: #2d3843;
    --link: #a3b9f2;
    --danger: #f08a8a;
  }
}

* { box-sizing: border-box; }
html { font: 100%/1.5 var(--sans); background: var(--paper); color: var(--ink); }
body { margin: 0; }
.wrap { max-width: 62rem; margin: 0 auto; padding: 0 1.25rem; }
main.wrap { padding-top: 2rem; padding-bottom: 4rem; min-height: 70vh; }
.narrow { max-width: 40rem; }
a { color: var(--link); text-underline-offset: .15em; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

h1, h2, .brand, .what, .cover-t { font-family: var(--serif); }
h1 { font-size: 2.25rem; line-height: 1.15; margin: 0 0 .5rem; font-weight: 600; text-wrap: balance; }
h1 a { color: inherit; text-decoration: none; }
h2 { font-size: 1.35rem; margin: 2.5rem 0 1rem; font-weight: 600; }
p { margin: 0 0 1rem; }
.meta { color: var(--muted); font-size: .875rem; }
.meta span + span, .meta a + span { margin-left: .75rem; }
.empty { color: var(--muted); padding: 1rem 0; }
.flash { background: var(--hl); color: #18222b; padding: .6rem 1rem; border-radius: 3px; }

/* header */
.top { border-bottom: 3px solid var(--ink); background: var(--card); }
.top .wrap { display: flex; align-items: center; gap: 1rem 1.5rem; flex-wrap: wrap; padding-top: .75rem; padding-bottom: .75rem; }
.brand { font-size: 1.6rem; font-weight: 700; color: var(--ink); text-decoration: none; letter-spacing: -.01em;
  background: linear-gradient(transparent 58%, var(--hl) 58%, var(--hl) 92%, transparent 92%); padding: 0 .2em; }
@media (prefers-color-scheme: dark) { .brand { background: none; border-bottom: 4px solid var(--hl); } }
.find { flex: 1 1 14rem; }
.top nav { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.top nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 500; }
.top nav a:not(.btn):hover { text-decoration: underline; text-decoration-color: var(--hl); text-decoration-thickness: 3px; }
.foot { display: flex; gap: 1.5rem; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 1.25rem; padding-bottom: 2rem; color: var(--muted); font-size: .875rem; }

/* forms and buttons */
input, select, textarea, button { font: inherit; color: inherit; }
input:not([type=checkbox]), select, textarea {
  width: 100%; padding: .5rem .65rem; background: var(--card); border: 1px solid var(--muted); border-radius: 3px; }
textarea { resize: vertical; }
.form { display: grid; gap: 1rem; margin-bottom: 1rem; }
.form label { display: grid; gap: .3rem; font-weight: 500; font-size: .9rem; }
.form .row { display: flex; gap: 1rem; flex-wrap: wrap; }
.form .row > label { flex: 1 1 10rem; }
.form .checks label { display: flex; gap: .5rem; align-items: center; font-weight: 400; }
.form .btn { justify-self: start; }
.btn { display: inline-block; padding: .45rem .95rem; border: 1.5px solid var(--ink); border-radius: 3px; background: transparent;
  color: var(--ink); font-weight: 600; font-size: .9rem; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--hl); color: #18222b; border-color: #18222b; }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: var(--hl); color: #18222b; }
.btn.on { background: var(--hl); color: #18222b; border-color: #18222b; }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.danger:hover { background: var(--danger); color: #fff; }
.linkish { background: none; border: 0; padding: 0; color: var(--link); text-decoration: underline; cursor: pointer; font-size: .875rem; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: center; margin: 1.5rem 0; }
.actions form { display: flex; gap: .5rem; align-items: center; }
.actions select { width: auto; max-width: 22rem; }

/* the highlighter: ratings are marked the way you'd mark a line in a paperback */
.stars { background: linear-gradient(transparent 12%, var(--hl) 12%, var(--hl) 88%, transparent 88%); color: #18222b;
  padding: 0 .3em; letter-spacing: .05em; white-space: nowrap; border-radius: 1px; }
.big-stars { font-size: 1.6rem; }
.tag { font-size: .75rem; border: 1px solid var(--muted); color: var(--muted); border-radius: 2px; padding: 0 .35em; white-space: nowrap; }
.tags { display: inline-flex; flex-wrap: wrap; gap: .35rem; vertical-align: middle; }
.meta .tags { margin-left: .75rem; }
a.tag { text-decoration: none; }
a.tag:hover { background: var(--hl); color: #18222b; border-color: #18222b; }
p.tags .tag { font-size: .875rem; padding: .1em .5em; }
.tag span { opacity: .7; margin-left: .25em; }

/* covers. The text underneath is the fallback when there's no image. */
.cover { position: relative; display: flex; flex-direction: column; justify-content: space-between; flex: none;
  width: 7.25rem; aspect-ratio: 2 / 3; padding: .6rem .55rem; overflow: hidden; text-decoration: none;
  background: hsl(var(--h) 32% 30%); color: #f4f2ea; border-radius: 2px 4px 4px 2px;
  box-shadow: inset 5px 0 0 hsl(var(--h) 32% 22%), 0 1px 2px rgb(0 0 0 / .35); }
.cover-t { font-size: .85rem; line-height: 1.2; font-weight: 600; overflow-wrap: anywhere; padding-left: .3rem;
  display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.cover-a { font-size: .65rem; opacity: .85; padding-left: .3rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover.sm { width: 4rem; padding: .35rem .3rem; }
.cover.sm .cover-t { font-size: .55rem; -webkit-line-clamp: 6; }
.cover.sm .cover-a { display: none; }
.cover.lg { width: 100%; max-width: 13rem; padding: 1.1rem 1rem; }
.cover.lg .cover-t { font-size: 1.35rem; -webkit-line-clamp: 7; }
.cover.lg .cover-a { font-size: .85rem; }
a.cover:hover { outline: 3px solid var(--hl); outline-offset: 1px; }

/* a shelf: covers stand on a board. Every cover is the same height, so the boards are one repeating background. */
.shelf { --ch: 10.875rem; --gap: 1.75rem; display: flex; flex-wrap: wrap; column-gap: .9rem; row-gap: var(--gap);
  padding: 0 .5rem 4px;
  background: repeating-linear-gradient(to bottom, transparent 0 var(--ch), var(--ink) var(--ch) calc(var(--ch) + 4px),
    transparent calc(var(--ch) + 4px) calc(var(--ch) + var(--gap))); }
.shelf:has(.shelf-item) { --gap: 3rem; padding-bottom: 2.5rem; }
.shelf-item { position: relative; height: var(--ch); }
.shelf-item form { position: absolute; top: calc(100% + 8px); left: 0; }

.hero { padding: 2.5rem 0 1.5rem; max-width: 44rem; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 3.75rem); line-height: 1.05; margin-bottom: 1rem; }
.hero p { font-size: 1.15rem; max-width: 34rem; }
.hero .btn { margin-right: .5rem; }

/* diary entries and reviews */
.entry { display: flex; gap: 1rem; padding: 1.1rem 0; border-top: 1px solid var(--line); }
.entry-body { min-width: 0; flex: 1; }
.entry-head { margin-bottom: .4rem; }
.who { font-weight: 600; color: var(--ink); }
.what { font-size: 1.1rem; font-weight: 600; color: var(--ink); text-decoration-color: var(--line); }
.review { font-family: var(--serif); font-size: 1.05rem; line-height: 1.6; margin-bottom: .5rem; max-width: 38rem; overflow-wrap: anywhere; }
.review.full { font-size: 1.15rem; margin: 1.25rem 0; }
details.review summary, .logbox summary { font-family: var(--sans); font-size: .9rem; cursor: pointer; color: var(--link); }
.logbox { margin: 1.5rem 0; padding: 1rem 1.25rem; background: var(--card); border: 1px solid var(--line); border-radius: 3px; }
.logbox summary { font-weight: 600; font-size: 1rem; color: var(--ink); }
.logbox[open] summary { margin-bottom: 1rem; }

/* book page */
.book { display: grid; grid-template-columns: 13rem 1fr; gap: 2.5rem; align-items: start; }
.book aside { display: grid; gap: .75rem; }
.byline { font-size: 1.1rem; color: var(--muted); }
.desc { max-width: 38rem; margin-bottom: 1rem; }
.avg { margin: .5rem 0 0; font-size: .9rem; }
.hist { display: flex; align-items: flex-end; gap: 2px; height: 3rem; border-bottom: 2px solid var(--ink); }
.hist span { flex: 1; min-height: 1px; background: var(--muted); }
@media (max-width: 40rem) {
  .book { grid-template-columns: 1fr; gap: 1.5rem; }
  .book aside { max-width: 13rem; }
  h1 { font-size: 1.8rem; }
}

/* profile */
.profile { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.bio { max-width: 38rem; }
.tabs { display: flex; gap: 1.5rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 1rem 0 2rem; }
.tabs a { padding: .5rem 0; color: var(--muted); text-decoration: none; font-weight: 600; border-bottom: 4px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current] { color: var(--ink); border-color: var(--hl); }
.diary { width: 100%; border-collapse: collapse; }
.diary th { text-align: left; font-size: .8rem; color: var(--muted); font-weight: 500; padding: .4rem .5rem; }
.diary td { padding: .65rem .5rem; border-top: 1px solid var(--line); vertical-align: baseline; }
.diary .when { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.diary .what { margin-right: .5rem; }

/* plain lists */
.results, .lists, .people { list-style: none; padding: 0; margin: 0; }
.results li, .lists li { display: flex; gap: 1rem; padding: .9rem 0; border-top: 1px solid var(--line); align-items: flex-start; }
.results form { margin-top: .4rem; }
.people li { padding: .9rem 0; border-top: 1px solid var(--line); }
.people p { margin: .25rem 0 0; }
.people .what { margin-right: .75rem; }
.list-covers { display: flex; width: 9rem; height: 4.5rem; flex: none; background: var(--line); border-radius: 2px; overflow: hidden; }
.list-covers img { height: 100%; width: 20%; object-fit: cover; }
.invites { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.invites li { padding: .9rem 0; border-top: 1px solid var(--line); display: grid; gap: .4rem; }
.invites input { font-family: ui-monospace, monospace; font-size: .85rem; }
.pager { display: flex; gap: 1.5rem; padding: 1.5rem 0; font-weight: 600; }
