/*
 * agentum-widgets.css — Widget-specific styles for the RL blog series.
 * Extracted from agentum/css/style.css. Only widget rules; no body/typography/layout
 * since Hugo provides its own.
 *
 * CSS custom properties used here (--canvas-bg, --border, --bg, --fg, --accent,
 * --muted) are defined in the agentum JS modules' host page.  We re-declare
 * sensible defaults so the widgets look correct inside the Hugo/Ananke theme
 * without requiring the full agentum stylesheet.
 */

/* Defaults for the custom properties the widgets rely on */
:root {
    --agentum-canvas-bg: #f3f4f6;
    --agentum-border: #e5e7eb;
    --agentum-bg: #fafafa;
    --agentum-fg: #1a1a1a;
    --agentum-accent: #2563eb;
    --agentum-muted: #6b7280;
}

@media (prefers-color-scheme: dark) {
    :root {
        --agentum-canvas-bg: #1f2937;
        --agentum-border: #374151;
        --agentum-bg: #111827;
        --agentum-fg: #f9fafb;
        --agentum-accent: #60a5fa;
        --agentum-muted: #9ca3af;
    }
}

/* Widget containers */
.widget {
    background: var(--canvas-bg, var(--agentum-canvas-bg));
    border: 1px solid var(--border, var(--agentum-border));
    border-radius: 8px;
    padding: 1rem;
    margin: 1.5rem 0;
}

.widget canvas {
    display: block;
    margin: 0 auto;
    border-radius: 4px;
}

.widget-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 0.75rem;
    font-family: system-ui, sans-serif;
    font-size: 0.85rem;
}

.widget-controls button {
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--border, var(--agentum-border));
    border-radius: 4px;
    background: var(--bg, var(--agentum-bg));
    color: var(--fg, var(--agentum-fg));
    cursor: pointer;
    font-size: 0.85rem;
}

.widget-controls button:hover {
    border-color: var(--accent, var(--agentum-accent));
}

.widget-controls label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--muted, var(--agentum-muted));
}

.widget-controls input[type="range"] {
    width: 80px;
}

.widget-stats {
    font-family: 'SF Mono', monospace;
    font-size: 0.8rem;
    color: var(--muted, var(--agentum-muted));
    margin-top: 0.5rem;
}

/* Compare widget: side-by-side */
.compare-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.compare-panel {
    flex: 1;
    min-width: 250px;
    text-align: center;
}

.compare-panel h4 {
    font-family: system-ui, sans-serif;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: var(--muted, var(--agentum-muted));
}

/* Feature explorer checkboxes */
.feature-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0;
    font-family: system-ui, sans-serif;
    font-size: 0.85rem;
}

.feature-toggles label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border, var(--agentum-border));
    border-radius: 4px;
    cursor: pointer;
}

.feature-toggles label:has(input:checked) {
    border-color: var(--accent, var(--agentum-accent));
    background: color-mix(in srgb, var(--accent, var(--agentum-accent)) 10%, transparent);
}

/* Assumptions table (post 4) */
.assumptions-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.875rem;
}

.assumptions-table th {
    background: var(--canvas-bg, var(--agentum-canvas-bg));
    border: 1px solid var(--border, var(--agentum-border));
    padding: 0.65rem 0.85rem;
    text-align: left;
    font-weight: 600;
    color: var(--muted, var(--agentum-muted));
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.75rem;
}

.assumptions-table td {
    border: 1px solid var(--border, var(--agentum-border));
    padding: 0.65rem 0.85rem;
    vertical-align: top;
    line-height: 1.5;
}

.assumptions-table tr:nth-child(even) td {
    background: color-mix(in srgb, var(--canvas-bg, var(--agentum-canvas-bg)) 50%, transparent);
}

.assumptions-table td:first-child {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-weight: 600;
    white-space: nowrap;
}

.tag {
    display: inline-block;
    padding: 0.1em 0.45em;
    border-radius: 3px;
    font-size: 0.75em;
    font-family: system-ui, sans-serif;
    font-weight: 500;
}

.tag-none { background: color-mix(in srgb, #22c55e 15%, transparent); color: #16a34a; }
.tag-full { background: color-mix(in srgb, #ef4444 15%, transparent); color: #dc2626; }

@media (prefers-color-scheme: dark) {
    .tag-none { color: #4ade80; }
    .tag-full { color: #f87171; }
}

@media (max-width: 600px) {
    .assumptions-table { font-size: 0.8rem; }
    .assumptions-table th, .assumptions-table td { padding: 0.5rem 0.6rem; }
}
