/* Shared base styles for all News Bias pages.
   Page-specific styles stay in each page's inline <style>. */
:root {
    --primary: #2563eb;
    --bg: #f8fafc;
    --card: #ffffff;
    --text: #1e293b;
    --muted: #64748b;
    --border: #e2e8f0;
    --line: #cbd5e1;
    --accent: #0ea5e9;
    --page-width-reading: 760px;
    --page-width-standard: 880px;
    --page-width-dashboard: 1400px;
}
@media (prefers-color-scheme: dark) {
    :root {
        --primary: #3b82f6;
        --bg: #0f172a;
        --card: #1e293b;
        --text: #f1f5f9;
        --muted: #94a3b8;
        --border: #334155;
        --line: #475569;
        --accent: #38bdf8;
    }
}

* { box-sizing: border-box; }
body { font-family: system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); margin: 0; padding: 20px; overflow-x: hidden; }
.container { width: 100%; max-width: var(--page-width-standard); margin: 0 auto; min-width: 0; }
.container.standard { max-width: var(--page-width-standard); }
.container.reading { max-width: var(--page-width-reading); }
.container.dashboard { max-width: var(--page-width-dashboard); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

header { margin-bottom: 1.5rem; }
h1 { font-size: 1.75rem; margin: 0 0 0.25rem; }
.subtitle { color: var(--muted); margin: 0; font-size: 0.9375rem; line-height: 1.5; }
.loading { color: var(--muted); font-style: italic; }
.error { color: #dc2626; }
.empty-state { color: var(--muted); font-style: italic; }

/* Reusable compact control styles (chips/buttons). */
.ui-chip {
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--muted);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.ui-chip:hover { border-color: var(--primary); color: var(--primary); }
.ui-chip.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }

.ui-btn {
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    cursor: pointer;
}
.ui-btn:hover { border-color: var(--primary); color: var(--primary); }
.ui-btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.ui-btn.primary:hover { opacity: 0.92; color: #fff; }

/* Global sticky navigation (rendered by <news-nav> from /nav.js) */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
    padding: 0.7rem 0;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(180%) blur(10px);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--border);
}
.site-nav .nav-brand { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 800; font-size: 1.05rem; letter-spacing: -0.01em; color: var(--text); text-decoration: none; }
.site-nav .nav-brand:hover { text-decoration: none; }
.nav-logo { width: 0.7rem; height: 0.7rem; border-radius: 3px; background: linear-gradient(135deg, var(--primary), var(--accent, #38bdf8)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); flex-shrink: 0; }
.nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem; }
.nav-links a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.9rem; padding: 0.4rem 0.7rem; border-radius: 8px; transition: color 0.15s, background 0.15s; }
.nav-links a:hover { color: var(--text); background: color-mix(in srgb, var(--text) 7%, transparent); text-decoration: none; }
.nav-links a.active { color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); }

/* Avoid layout shift before the <news-nav> web component upgrades */
news-nav { display: block; min-height: 3.15rem; }

@media (max-width: 640px) {
    body { padding: 12px; }
    .site-nav { gap: 0.5rem; padding: 0.6rem 0; }
    .nav-brand-text { display: none; }
    .nav-links a { padding: 0.35rem 0.55rem; font-size: 0.85rem; }
}
