/* Page head */
.page {
  padding: 42px 0 22px;
}
h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 3.6vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.sub {
  margin: 0;
  font-size: 16px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 70ch;
}

/* Books grid */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 20px;
  padding-bottom: 42px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.cover {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  background: linear-gradient(180deg, var(--surface), var(--surface-3));
  border-bottom: 1px solid var(--line);
}
.cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.content {
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.title {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.3;
}
.author {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stars {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  white-space: nowrap;
}

.stars svg {
  height: 14px;
  width: auto;
  display: block;
}

.stars .off {
  fill: var(--star-off);
}
.stars .on {
  fill: var(--star-on);
}

.pill {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--soft);
  white-space: nowrap;
}

.pill--reading {
  color: #1f6a45;
  border-color: rgba(52, 144, 93, 0.32);
  background: rgba(80, 184, 117, 0.14);
}

.pill--to-read {
  color: #7a5e10;
  border-color: rgba(196, 154, 37, 0.35);
  background: rgba(244, 198, 80, 0.16);
}

.pill--done {
  color: #59606b;
  border-color: rgba(105, 112, 124, 0.28);
  background: rgba(111, 119, 133, 0.1);
}

.pill--dropped {
  color: #7a3e44;
  border-color: rgba(181, 98, 108, 0.32);
  background: rgba(218, 122, 132, 0.14);
}

.pill--neutral {
  color: #59606b;
  border-color: rgba(105, 112, 124, 0.28);
  background: rgba(111, 119, 133, 0.1);
}

.note {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
  flex: 1;
}

.actions {
  padding: 0 14px 14px;
  display: flex;
}

.actions > .btn {
  width: 100%;
  flex: 1;
  justify-content: center;
}

.ghost {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

/* Empty / error */
.state {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--surface-4));
  padding: 18px;
  margin-top: 18px;
  color: var(--muted);
  line-height: 1.6;
}
#state {
  display: none;
}

/* Responsive */
@media (max-width: 1100px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 820px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .links {
    display: none;
  }
}
@media (max-width: 520px) {
  .grid {
    grid-template-columns: 1fr;
  }
}
