:root {
  --paper: #f3efe6;
  --card: #faf7f1;
  --ink: #1c1915;
  --muted: #5e564c;
  --line: #ddd4c4;
  --pine: #234037;
  --pine-2: #1a312b;
  --lantern: #8c4a32;
  --chip: #efe8da;
  --focus: #8c4a32;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Palatino, "Palatino Linotype", "Iowan Old Style", Georgia, serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
}
a { color: var(--pine); }
a:hover { color: var(--lantern); }
img { max-width: 100%; height: auto; display: block; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.wrap { width: min(1080px, calc(100% - 2rem)); margin: 0 auto; }
.site-header {
  background: var(--pine);
  color: #f6f1e6;
}
.site-header a { color: inherit; text-decoration: none; }
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem 1.25rem;
  padding: .85rem 0;
}
.brand { font-weight: 700; letter-spacing: .01em; }
.brand small {
  display: block;
  font-weight: 400;
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .75;
}
nav { display: flex; flex-wrap: wrap; gap: .35rem .9rem; margin-left: auto; }
nav a { font-size: .95rem; border-bottom: 1px solid transparent; }
nav a[aria-current="page"], nav a:hover { border-bottom-color: #e7c7a4; }

main { padding: 1.5rem 0 2.5rem; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.15; margin: 0 0 .4rem; font-weight: 600; }
h2 { font-size: 1.35rem; line-height: 1.25; margin: 0 0 .35rem; font-weight: 600; }
.lede { font-size: 1.12rem; max-width: 40rem; color: var(--ink); }
.muted { color: var(--muted); }
.kicker {
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: .72rem;
  color: var(--lantern);
  margin: 0 0 .3rem;
}

.hero {
  display: grid;
  grid-template-columns: 1.3fr .7fr;
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 1.75rem;
}
.hero img {
  width: 100%;
  border-radius: 4px;
  box-shadow: 0 10px 28px rgba(28, 25, 21, .15);
}
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.btn {
  display: inline-block;
  background: var(--pine);
  color: #f6f1e6;
  text-decoration: none;
  padding: .55rem .9rem;
  border-radius: 4px;
  border: 1px solid var(--pine);
}
.btn.secondary { background: transparent; color: var(--pine); }
.btn:hover { background: var(--pine-2); color: #f6f1e6; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.card, .item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: .9rem 1rem 1rem;
}
.card p, .item p { margin: .25rem 0; }
.card a { font-weight: 600; }

.filters {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: .55rem;
  margin: 1rem 0 .7rem;
}
label.field { display: flex; flex-direction: column; gap: .2rem; font-size: .82rem; color: var(--muted); }
input[type="search"], select {
  background: white;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: .45rem .5rem;
  width: 100%;
}
.checks { display: flex; flex-wrap: wrap; gap: .7rem 1rem; font-size: .92rem; margin-bottom: .8rem; }
.count { margin: .2rem 0 .8rem; color: var(--muted); }
.results { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; }
.item h2 { font-size: 1.08rem; }
.tags { display: flex; flex-wrap: wrap; gap: .3rem; margin: .45rem 0; }
.tag {
  background: var(--chip);
  border-radius: 99px;
  padding: .1rem .5rem;
  font-size: .75rem;
  color: var(--muted);
}
.buy { font-weight: 600; }
.empty {
  grid-column: 1 / -1;
  padding: 1rem;
  border: 1px dashed var(--line);
  border-radius: 6px;
}

.prose { max-width: 40rem; }
.prose h2 { margin-top: 1.6rem; }
.prose p { margin: .6rem 0; }
.book-layout { display: grid; grid-template-columns: 220px 1fr; gap: 1.4rem; align-items: start; }
.note {
  background: #efe6d4;
  border-left: 3px solid var(--lantern);
  padding: .7rem .85rem;
  margin: 1rem 0;
}

footer.site {
  border-top: 1px solid var(--line);
  padding: 1.1rem 0 2rem;
  color: var(--muted);
  font-size: .88rem;
}
footer.site a { color: var(--pine); }

@media (max-width: 860px) {
  .hero, .book-layout, .grid, .results, .filters { grid-template-columns: 1fr; }
  nav { margin-left: 0; }
}
