/* R2 — 내 서재 카드. 홈 레일과 같은 3:4 인물 사진 + 이름 겹쳐 쓰기 꼴. */
.shelf-cards {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
.shelf-cards * { box-sizing: border-box; }

.shelf-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--panel, #1b1924);
  border: 1px solid var(--line, #353140);
  border-radius: 14px;
  overflow: hidden;
}

.shelf-card-open {
  display: block;
  width: 100%;
  padding: 0;
  background: none;
  border: 0;
  text-align: left;
}
.shelf-card-image {
  position: relative;
  width: 100%;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: #211d29;
}
.shelf-card-image img,
.shelf-card-image > *:not(.shelf-card-overlay) {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.shelf-card-overlay {
  display: block;
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 26px 10px 8px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .85));
  color: var(--gold, #e5c58c);
  font-size: 14px;
  font-weight: 700;
}

.shelf-card-info {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.shelf-card-title {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
  word-break: keep-all;
  overflow-wrap: break-word;
}
.shelf-card-line {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted, #aba5b9);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.shelf-card-time {
  font-size: 12px;
  color: var(--muted, #aba5b9);
}
.shelf-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.shelf-card-actions button {
  box-sizing: border-box;
  min-height: 36px;
  font-size: 13px;
}
.shelf-card-delete {
  margin-left: auto;
  color: #d98a97;
}

.shelf-empty {
  grid-column: 1/-1;
  text-align: center;
  padding: 60px 20px;
  border: 1px dashed var(--line, #353140);
  border-radius: 16px;
}
.shelf-empty p {
  font-size: 16px;
  margin: 8px 0 18px;
}
.shelf-empty .moon {
  font-size: 34px;
  color: var(--gold, #e5c58c);
}

@media (max-width: 767px) {
  .shelf-cards {
    /* ★홈 카드 목록과 같게 2열 — 1열이면 카드 하나가 화면을 다 먹는다(2026-09-26 375 실측) */
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 10px;
    gap: 14px;
  }
  .shelf-card-overlay { font-size: 14px; }
  .shelf-card-actions button { width: 100%; }
  .shelf-card-delete { margin-left: 0; }
}
