/* Shelf primitive — v78
 * Polymorphic collection view (books, docs, podcasts, media). */

.jny-shelf {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  background: var(--jny-surface-0, #0e1220);
  color: var(--jny-ink, #e4e4e4);
}

.jny-shelf .shelf-head {
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  background: var(--jny-surface-1, #141a2a);
  border-bottom: 1px solid var(--jny-border, #2a3148);
  flex-shrink: 0;
}
.jny-shelf .shelf-search {
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 10px;
  background: var(--jny-surface-2, #1a2238);
  color: var(--jny-ink, #e4e4e4);
  border: 1px solid var(--jny-border, #2a3148);
  border-radius: 8px;
  font: 13px/1.2 system-ui, sans-serif;
}
.jny-shelf .shelf-layout { display: inline-flex; gap: 4px; }
.jny-shelf .shelf-layout-btn {
  min-width: 36px;
  min-height: 36px;
  background: var(--jny-surface-2, #1a2238);
  color: var(--jny-ink-dim, #9ea4b7);
  border: 1px solid var(--jny-border, #2a3148);
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
}
.jny-shelf .shelf-layout-btn.is-active {
  background: var(--jny-accent, #c8a840);
  color: #1a0e05;
  border-color: var(--jny-accent, #c8a840);
}

.jny-shelf .shelf-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 10px;
  padding-bottom: var(--jny-kbd-h, 10px);
}

.jny-shelf[data-layout="grid"] .shelf-body {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.jny-shelf[data-layout="grid"] .shelf-item {
  background: var(--jny-surface-1, #141a2a);
  border: 1px solid var(--jny-border, #2a3148);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.jny-shelf[data-layout="grid"] .shelf-open {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  background: transparent;
  border: 0;
  color: inherit;
  text-align: left;
  cursor: pointer;
  width: 100%;
}
.jny-shelf[data-layout="grid"] .shelf-art {
  aspect-ratio: 1 / 1;
  width: 100%;
  object-fit: cover;
  background: var(--jny-surface-2, #1a2238);
  display: block;
}
.jny-shelf[data-layout="grid"] .shelf-art-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--jny-ink-dim, #9ea4b7);
}
.jny-shelf[data-layout="grid"] .shelf-meta {
  padding: 8px 10px 10px;
}
.jny-shelf[data-layout="grid"] .shelf-actions {
  display: flex;
  gap: 4px;
  padding: 0 8px 8px;
  flex-wrap: wrap;
}

.jny-shelf[data-layout="list"] .shelf-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.jny-shelf[data-layout="list"] .shelf-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--jny-surface-1, #141a2a);
  border: 1px solid var(--jny-border, #2a3148);
  border-radius: 8px;
  padding: 6px 10px;
}
.jny-shelf[data-layout="list"] .shelf-open {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  background: transparent;
  border: 0;
  color: inherit;
  text-align: left;
  cursor: pointer;
  min-width: 0;
}
.jny-shelf[data-layout="list"] .shelf-art {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  background: var(--jny-surface-2, #1a2238);
}
.jny-shelf[data-layout="list"] .shelf-art-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--jny-ink-dim, #9ea4b7);
}
.jny-shelf[data-layout="list"] .shelf-meta {
  min-width: 0;
  flex: 1 1 auto;
}
.jny-shelf[data-layout="list"] .shelf-actions {
  display: flex;
  gap: 4px;
}

.jny-shelf .shelf-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.jny-shelf .shelf-sub {
  font-size: 12px;
  color: var(--jny-ink-dim, #9ea4b7);
  line-height: 1.3;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.jny-shelf .shelf-badges {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.jny-shelf .shelf-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--jny-surface-2, #1a2238);
  color: var(--jny-ink-dim, #9ea4b7);
  border: 1px solid var(--jny-border, #2a3148);
}

.jny-shelf .shelf-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  min-height: 32px;
  background: var(--jny-surface-2, #1a2238);
  color: var(--jny-ink-dim, #9ea4b7);
  border: 1px solid var(--jny-border, #2a3148);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}
.jny-shelf .shelf-action:hover {
  background: var(--jny-accent, #c8a840);
  color: #1a0e05;
  border-color: var(--jny-accent, #c8a840);
}

.jny-shelf .shelf-empty {
  grid-column: 1 / -1;
  padding: 40px 20px;
  text-align: center;
  color: var(--jny-ink-dim, #9ea4b7);
}
.jny-shelf .shelf-empty-title { font-size: 15px; font-weight: 600; color: var(--jny-ink, #e4e4e4); }
.jny-shelf .shelf-empty-sub   { font-size: 13px; margin-top: 6px; }
.jny-shelf .shelf-empty-cta {
  margin-top: 12px;
  padding: 8px 16px;
  background: var(--jny-accent, #c8a840);
  color: #1a0e05;
  border: 0;
  border-radius: 8px;
  font: 600 13px/1 system-ui, sans-serif;
  cursor: pointer;
}
