/* ── Card Grid ─────────────────────────────────────────── */
.zoo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* ── Card ──────────────────────────────────────────────── */
.zoo-card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}
.zoo-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
    text-decoration: none;
    color: inherit;
}

/* ── Thumbnail ─────────────────────────────────────────── */
.card-thumb {
    height: 180px;
    background: var(--bg-secondary);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    position: relative;
}
.card-thumb svg {
    width: 100%; height: 100%;
}
.card-thumb img {
    width: 100%; height: 100%; object-fit: cover;
}

/* ── Thumbnail SVG animations ──────────────────────────── */
.zoo-card:hover .ml-node   { animation: pulse-node 1.5s ease-in-out infinite; }
.zoo-card:hover .ml-edge   { animation: dash-edge 1.2s linear infinite; }
.zoo-card:hover .ml-region { animation: glow-region 0.8s ease-in-out infinite alternate; }

@keyframes pulse-node {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.5; }
}
@keyframes dash-edge {
    to { stroke-dashoffset: -20; }
}
@keyframes glow-region {
    to { opacity: 0.7; }
}

/* ── Card Body ─────────────────────────────────────────── */
.card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.card-title {
    font-size: 1rem; font-weight: 700; margin-bottom: 2px;
    display: flex; align-items: baseline; gap: 8px;
}
.card-year {
    font-size: 0.75rem; color: var(--text-muted); font-weight: 400;
}
.card-desc {
    font-size: 0.85rem; color: var(--text-secondary);
    margin-top: 6px; line-height: 1.45;
    display: -webkit-box; -webkit-line-clamp: 3;
    -webkit-box-orient: vertical; overflow: hidden;
    flex: 1;
}

/* ── Card Meta ─────────────────────────────────────────── */
.card-meta {
    display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
    margin-top: 12px; padding-top: 10px;
    border-top: 1px solid var(--border-default);
}
.badge {
    font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
    padding: 2px 8px; border-radius: 4px;
    letter-spacing: 0.04em;
}
.badge-task {
    color: #fff;
}
.badge-cat {
    background: rgba(255,255,255,0.08);
}
[data-theme="light"] .badge-cat {
    background: rgba(0,0,0,0.06);
}
.card-tags {
    display: flex; gap: 4px; margin-left: auto;
}
.tag {
    font-size: 0.68rem; color: var(--text-muted);
    border: 1px solid var(--border-default);
    padding: 1px 6px; border-radius: 3px;
}

/* ── Complexity Dots ───────────────────────────────────── */
.complexity-dots {
    display: flex; gap: 3px; margin-left: 8px;
}
.complexity-dots .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--border-default);
}
.complexity-dots .dot.active {
    background: var(--accent);
}

/* ── Skeleton Loading ──────────────────────────────────── */
.skeleton {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius);
    overflow: hidden;
}
.skeleton .skel-thumb {
    height: 180px;
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--border-default) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.6s infinite;
}
.skeleton .skel-body { padding: 16px; }
.skeleton .skel-line {
    height: 12px; border-radius: 4px; margin-bottom: 8px;
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--border-default) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.6s infinite;
}
.skeleton .skel-line.w60 { width: 60%; }
.skeleton .skel-line.w80 { width: 80%; }
.skeleton .skel-line.w40 { width: 40%; }

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── No Results ────────────────────────────────────────── */
.no-results {
    grid-column: 1 / -1; text-align: center;
    padding: 48px 0; color: var(--text-muted);
}
.no-results p { font-size: 1.1rem; }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 640px) {
    .zoo-grid { grid-template-columns: 1fr; }
    .card-thumb { height: 150px; }
}
