/* Series cards. OWNER: cards agent. Uses tokens only. */

/* ---------- Layout helpers ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 24px 18px;
  margin: 0; padding: 0; list-style: none;
}
.update-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 14px;
}
.compact-list { display: grid; gap: 4px; }
@media (max-width: 480px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
}

/* ---------- Shared parts ---------- */
.sc { position: relative; min-width: 0; }
.sc-cover {
  position: relative; display: block; overflow: hidden;
  aspect-ratio: 3 / 4; border-radius: var(--r-md);
  background: var(--raised);
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}
.sc-cover img { width: 100%; height: 100%; object-fit: cover; }
.sc-cover.is-broken img { visibility: hidden; }
.sc-cover.is-broken { background: color-mix(in srgb, var(--raised) 70%, var(--accent) 8%); }
.sc-body { min-width: 0; }
.sc-title {
  font-family: var(--font-display); font-weight: 650; letter-spacing: -0.01em;
  font-size: var(--step-0); line-height: 1.3; text-wrap: pretty;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sc-title a { color: var(--text); }
.sc-title a:hover { color: var(--accent); }
.sc-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px;
  font-size: var(--step--1); color: var(--text-2);
}
.sc-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); flex: none; }
.sc-rating { display: inline-flex; align-items: center; gap: 4px; color: var(--text); font-weight: 600; }
.sc-rating svg { color: var(--accent); fill: currentColor; width: 14px; height: 14px; }
.sc-time { color: var(--text-3); font-size: var(--step--1); white-space: nowrap; }

/* Hover: the cover lifts. Reduced motion is neutralised globally by base.css; also drop the offset. */
@media (hover: hover) {
  .sc:hover .sc-cover, .sc:focus-within .sc-cover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
  }
}
@media (prefers-reduced-motion: reduce) {
  .sc:hover .sc-cover, .sc:focus-within .sc-cover { transform: none; }
}

/* ---------- Grid variant ---------- */
.sc-grid { display: flex; flex-direction: column; gap: 10px; }
.sc-grid .sc-body { display: grid; gap: 6px; }
.sc-type {
  position: absolute; top: 8px; left: 8px;
  padding: 3px 8px; border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(6px);
  color: var(--text); font-size: 0.75rem; font-weight: 600; line-height: 1.3;
}
.sc-latest { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 8px; min-width: 0; }
.sc-chapter {
  font-size: var(--step--1); font-weight: 600; color: var(--text-2);
  white-space: nowrap;
}
.sc-chapter:hover { color: var(--accent); }

/* ---------- Update variant (horizontal) ---------- */
.sc-update {
  display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 14px;
  padding: 12px; border-radius: var(--r-lg);
  background: var(--surface);
}
.sc-update .sc-body { display: flex; flex-direction: column; gap: 6px; }
.sc-update .sc-title { font-size: var(--step-1); }
.sc-update:hover .sc-cover, .sc-update:focus-within .sc-cover { box-shadow: none; }
.sc-chapters { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 2px; }
.sc-chapters a {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; min-height: 32px;
  padding: 4px 8px; margin-inline: -8px; border-radius: var(--r-sm);
  font-size: var(--step--1); color: var(--text-2);
  transition: background 0.2s var(--ease-out), color 0.2s;
}
.sc-chapters a:hover { background: var(--raised); color: var(--text); }
.sc-ch-num { font-weight: 600; color: var(--text); white-space: nowrap; }
.sc-chapters .sc-time { margin-left: auto; }
.sc-new {
  padding: 1px 7px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font-size: 0.6875rem; font-weight: 700; line-height: 1.5;
}
@media (max-width: 420px) {
  .sc-update { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; padding: 10px; }
  .sc-update .sc-title { font-size: var(--step-0); }
}
.sc-none { font-size: var(--step--1); color: var(--text-3); }

/* ---------- Compact variant ---------- */
.sc-compact {
  display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; align-items: center;
  padding: 8px; border-radius: var(--r-md);
  transition: background 0.2s var(--ease-out);
}
.sc-compact:hover { background: var(--surface); }
.sc-compact .sc-cover { border-radius: var(--r-sm); }
.sc-compact .sc-body { display: grid; gap: 4px; }
.sc-compact .sc-title { font-size: var(--step--1); font-family: var(--font-body); font-weight: 600; letter-spacing: 0; }
.sc-compact:hover .sc-cover, .sc-compact:focus-within .sc-cover { transform: none; box-shadow: none; }

/* ---------- Skeletons ---------- */
.sc-skeleton .sc-cover { box-shadow: none; }
.sk-line { height: 14px; border-radius: var(--r-sm); }
.sk-line.sk-sm { height: 11px; }
.sc-skeleton .sc-body { display: grid; gap: 8px; align-content: start; }
.sc-update.sc-skeleton .sk-line.sk-sm:nth-child(n + 3) { height: 24px; }
