/* --- The shelf bar: what the grid is showing, and the cookbooks behind it ----
   Sits inside <main>, above the count note. See js/shelf.js. The `.sh-` prefix
   is this file's alone — grep before adding another. */

#shelfBar { margin-bottom: 18px; }

/* ---------- what you make ⇄ what it asks for ---------- */
.sh-switch {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  margin-bottom: 14px;
  background: var(--surface-3);
  border-radius: 999px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.sh-switch::-webkit-scrollbar { display: none; }
.sh-switch button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 15px;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.sh-switch button:hover { color: var(--text); }
.sh-switch button.on {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-card);
  cursor: default;
}
.sh-switch button .ic { width: 15px; height: 15px; }

/* ---------- the heading ---------- */
.sh-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.sh-head h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--text);
}
.sh-head h2 .ic { width: 19px; height: 19px; color: var(--accent); }
.sh-head .sh-count { font-size: 12.5px; color: var(--text-muted); font-weight: 550; }
.sh-head.in { align-items: center; }

.sh-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.sh-back:hover { background: var(--surface-3); color: var(--text); }
.sh-back .ic { width: 14px; height: 14px; }

.sh-credit {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 13px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
}
.sh-credit .ic { width: 15px; height: 15px; flex: none; margin-top: 1px; }
.sh-credit b { color: var(--text-soft); font-weight: 700; }
.sh-credit.private {
  border-color: color-mix(in srgb, var(--amber) 34%, transparent);
  background: color-mix(in srgb, var(--amber) 8%, transparent);
}
.sh-credit.private .ic { color: var(--amber); }

/* ---------- book & section chips, scoped to what's on screen ---------- */
.sh-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
}

/* ---------- what a search on your own shelf didn't look at ---------- */
.sh-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-muted);
}
.sh-hint > .ic { width: 16px; height: 16px; flex: none; color: var(--text-muted); }
.sh-hint b { color: var(--text); font-weight: 750; }
.sh-hint button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.sh-hint button:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--green-dark); }
.sh-hint button .ic { width: 13px; height: 13px; }

/* ---------- the cookbooks ---------- */
.sh-packs {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.sh-packs-h {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.sh-packs-h b {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 750;
  color: var(--text);
}
.sh-packs-h b .ic { width: 16px; height: 16px; color: var(--text-muted); }
.sh-packs-h span { font-size: 12px; color: var(--text-muted); }

.sh-packrow {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 12px;
}

.sh-pack {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 11px 12px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.sh-pack:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: 0 10px 26px -12px rgba(22,26,49,.22);
}

/* three pages of the book, fanned — enough to say what kind of book it is */
.sh-shots { display: flex; flex: none; }
.sh-shots img {
  width: 42px;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid var(--surface);
  background: var(--surface-3);
}
.sh-shots img + img { margin-left: -20px; }
.sh-noshot {
  width: 52px; height: 54px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--text-muted);
}
.sh-noshot .ic { width: 22px; height: 22px; }

.sh-pbody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
/* A cookbook's name is the thing you're picking between, so it wraps to two
   lines rather than becoming "Stealth Health Cookbo…" */
.sh-pbody b {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sh-pbody i { font-size: 11.5px; font-style: normal; color: var(--text-soft); }
.sh-pbody small { font-size: 11.5px; color: var(--text-muted); }

.sh-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.sh-badge .ic { width: 11px; height: 11px; }
.sh-badge.private { background: color-mix(in srgb, var(--amber) 15%, transparent); color: var(--amber); }
.sh-badge.on { background: var(--accent-soft); color: var(--green-dark); }

.sh-go { flex: none; color: var(--text-muted); }
.sh-go .ic { width: 16px; height: 16px; }
.sh-pack:hover .sh-go { color: var(--accent); }

@media (max-width: 640px) {
  .sh-head h2 { font-size: 18px; }
  .sh-packrow { grid-template-columns: 1fr; }
}
