/* Card Grid Template */
.tmnl-grid {
    display: grid;
    gap: 20px;
    margin: 24px 0;
}
.tmnl-cols-1 { grid-template-columns: 1fr; }
.tmnl-cols-2 { grid-template-columns: repeat(2, 1fr); }
.tmnl-cols-3 { grid-template-columns: repeat(3, 1fr); }
.tmnl-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
    .tmnl-cols-2, .tmnl-cols-3, .tmnl-cols-4 {
        grid-template-columns: 1fr;
    }
}
@media (min-width: 769px) and (max-width: 1024px) {
    .tmnl-cols-3, .tmnl-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

.tmnl-card {
    background: var(--tmnl-bg, #fff);
    color: var(--tmnl-text, #334155);
    border: 1px solid var(--tmnl-border, #e2e8f0);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
}
.tmnl-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.tmnl-stars {
    color: #f5a623;
    font-size: 18px;
    letter-spacing: 1px;
}
.tmnl-source {
    font-size: 11px;
    background: var(--tmnl-badge-bg, #f1f5f9);
    color: var(--tmnl-badge-text, #64748b);
    padding: 2px 8px;
    border-radius: 4px;
}
.tmnl-card-body {
    flex: 1;
}
.tmnl-text {
    color: var(--tmnl-text, #334155);
    font-size: 14px;
    line-height: 1.7;
    margin: 0;
}
.tmnl-card-footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--tmnl-border, #f1f5f9);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.tmnl-author-info {
    display: flex;
    align-items: center;
    gap: 8px;
}
.tmnl-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.tmnl-author {
    font-weight: 600;
    font-size: 13px;
    color: var(--tmnl-author, #1e293b);
}
.tmnl-date {
    font-size: 12px;
    color: var(--tmnl-muted, #94a3b8);
}

/* X Embed card */
.tmnl-card .tmnl-embed-wrap {
    flex: 1;
}
.tmnl-card .tmnl-embed-wrap blockquote {
    margin: 0;
}

/* Color schemes */
.tmnl-color-light {
    --tmnl-bg: #fff;
    --tmnl-text: #334155;
    --tmnl-border: #e2e8f0;
    --tmnl-badge-bg: #f1f5f9;
    --tmnl-badge-text: #64748b;
    --tmnl-author: #1e293b;
    --tmnl-muted: #94a3b8;
}
.tmnl-color-dark {
    --tmnl-bg: #1e293b;
    --tmnl-text: #e2e8f0;
    --tmnl-border: #334155;
    --tmnl-badge-bg: #334155;
    --tmnl-badge-text: #94a3b8;
    --tmnl-author: #f1f5f9;
    --tmnl-muted: #64748b;
}
