/* The Narrative Gap
   Professional news analysis — Foreign Affairs meets The Economist */

@import url('/static/fonts/fonts.css');

:root {
    /* Core palette */
    --navy: #0f172a;
    --navy-light: #1e293b;
    --surface: #ffffff;
    --surface-alt: #f8fafc;
    --bg: #f1f5f9;
    --accent: #d97706;
    --accent-hover: #b45309;
    --accent-light: #fef3c7;

    /* Text */
    --text: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #f8fafc;

    /* Borders */
    --border: #e2e8f0;
    --border-strong: #cbd5e1;

    /* Semantic */
    --green: #15803d;
    --green-bg: #f0fdf4;
    --amber: #a16207;
    --amber-bg: #fef9c3;
    --red: #b91c1c;
    --red-bg: #fef2f2;

    /* Category accents */
    --cat-military: #dc2626;
    --cat-economic: #2563eb;
    --cat-diplomatic: #7c3aed;
    --cat-geopolitical: #0891b2;
    --cat-humanitarian: #db2777;
    --cat-legal: #4f46e5;
    --cat-social: #059669;
    --cat-technological: #6366f1;
    --cat-criminal: #9333ea;
    --cat-political: #ea580c;
    --cat-environmental: #16a34a;
    --cat-terrorist: #dc2626;

    /* Typography */
    --font-display: 'Lora', Georgia, 'Times New Roman', serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-mono: ui-monospace, Menlo, Consolas, monospace;

    /* Layout */
    --max-width: 64rem;
    --content-width: 48rem;
    --spacing: 1.5rem;
    --radius: 0.5rem;
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
    --shadow-hover: 0 8px 24px rgba(15, 23, 42, 0.12);
}

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg);
    line-height: 1.65;
    margin: 0;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-hover); text-decoration: none; }
a:hover { color: var(--accent); }

main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--spacing);
}

/* ============================================
   HEADER
   ============================================ */

.site-header {
    background: var(--navy);
    border-bottom: 3px solid var(--accent);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing);
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
}

.brand-mark {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent);
    background: rgba(217, 119, 6, 0.1);
    border: 1px solid rgba(217, 119, 6, 0.3);
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    letter-spacing: 0.05em;
}

.brand-name {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-inverse);
    letter-spacing: -0.01em;
}

/* Nav */
.main-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-decoration: none;
    transition: color 0.15s;
}

.nav-link:hover { color: var(--text-inverse); }

.nav-donate {
    background: var(--accent);
    color: var(--text-inverse) !important;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.375rem 1rem;
    border-radius: 2rem;
    transition: background 0.15s;
}

.nav-donate:hover { background: var(--accent-hover); }

/* Search */
.search-container { position: relative; }

#site-search {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 2rem;
    color: var(--text-inverse);
    font-family: var(--font-body);
    font-size: 0.8125rem;
    padding: 0.375rem 0.875rem;
    width: 12rem;
    outline: none;
    transition: background 0.15s, border-color 0.15s, width 0.2s;
}

#site-search::placeholder { color: var(--text-muted); }

#site-search:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--accent);
    width: 16rem;
}

#search-results {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    min-width: 20rem;
    background: var(--navy-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    z-index: 200;
    max-height: 24rem;
    overflow-y: auto;
}

.search-result {
    display: block;
    padding: 0.625rem 0.875rem;
    color: var(--text-muted) !important;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.1s;
}

.search-result:last-child { border-bottom: none; }
.search-result:hover { background: rgba(255, 255, 255, 0.08); color: var(--text-inverse) !important; }

.search-title {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
}

.search-meta {
    display: block;
    font-size: 0.6875rem;
    color: rgba(148, 163, 184, 0.7);
    margin-top: 0.125rem;
}

.search-empty {
    padding: 0.75rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

/* Dropdown */
.nav-dropdown { position: relative; }

.nav-trigger {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    padding: 0.5rem 0;
    transition: color 0.15s;
}

.nav-trigger:hover { color: var(--text-inverse); }
.caret { font-size: 0.625rem; margin-left: 0.125rem; }

.dropdown-panel {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    padding-top: 0.25rem; /* bridge the gap so hover doesn't break */
    background: transparent;
    z-index: 200;
}

.dropdown-panel-inner {
    background: var(--navy-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    padding: 0.75rem;
    min-width: 18rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.nav-dropdown:hover .dropdown-panel,
.nav-dropdown:focus-within .dropdown-panel {
    display: block;
}

.dropdown-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.625rem;
    border-radius: 0.25rem;
    color: var(--text-muted) !important;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: background 0.1s, color 0.1s;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-inverse) !important;
}

.dropdown-icon { font-size: 1rem; width: 1.25rem; text-align: center; }

/* ============================================
   HERO
   ============================================ */

.hero {
    max-width: var(--content-width);
    padding: 3.5rem 2rem 2.5rem;
    border-bottom: 2px solid var(--border);
    margin-bottom: 2.5rem;
    border-radius: var(--radius);
    background:
        repeating-linear-gradient(
            135deg,
            transparent,
            transparent 20px,
            rgba(15, 23, 42, 0.02) 20px,
            rgba(15, 23, 42, 0.02) 21px
        ),
        linear-gradient(135deg, rgba(15, 23, 42, 0.03) 0%, transparent 60%);
}

.hero h1 {
    font-family: var(--font-display);
    font-size: 2.75rem;
    font-weight: 500;
    line-height: 1.1;
    margin: 0 0 1rem;
    color: var(--navy);
    letter-spacing: -0.03em;
}

.hero-sub {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.65;
    max-width: 36rem;
    margin: 0 0 1.25rem;
}

.hero-updated {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================
   EVENT SECTIONS
   ============================================ */

.event-section { margin-bottom: 3rem; }

.section-heading {
    font-family: var(--font-display);
    font-size: 1.375rem;
    font-weight: 500;
    margin: 0 0 0.25rem;
    color: var(--navy);
}

.heading-accent { color: var(--green); }

.section-sub {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0 0 1.25rem;
}

.section-more {
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 1rem;
}

/* ============================================
   BIG QUESTIONS
   ============================================ */

.questions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
}

.question-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s, transform 0.2s;
}

.question-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.question-text {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 500;
    line-height: 1.3;
    margin: 0 0 0.625rem;
    color: var(--navy);
}

.question-assessment {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0 0 0.75rem;
    line-height: 1.5;
    flex: 1;
}

.question-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.controversy-badge {
    font-size: 0.5625rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.1875rem 0.5rem;
    border-radius: 2rem;
}

.controversy-contested { color: var(--red); background: var(--red-bg); }
.controversy-leaning { color: var(--amber); background: var(--amber-bg); }
.controversy-settled { color: var(--green); background: var(--green-bg); }

.question-event {
    font-size: 0.6875rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    padding-top: 0.5rem;
    margin-top: 0.25rem;
}

/* Tension bar */
.tension-bar {
    display: flex;
    height: 0.375rem;
    border-radius: 2rem;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.tension-h1 {
    width: var(--bar-pct);
    background: var(--accent);
    transition: width 0.3s;
}

.tension-h2 {
    width: var(--bar-pct);
    background: var(--border-strong);
    transition: width 0.3s;
}

.question-competing {
    font-size: 0.75rem;
    color: var(--accent-hover);
    font-weight: 600;
    margin-top: 0.25rem;
}

/* ============================================
   TOPIC CARDS (hierarchical)
   ============================================ */

.topics-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.25rem;
}

.topic-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.topic-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.topic-title-link {
    text-decoration: none;
    color: var(--navy);
}

.topic-title-link:hover { color: var(--accent-hover); }

.topic-card h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 500;
    margin: 0;
    line-height: 1.3;
}

.topic-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    flex-shrink: 0;
    align-items: center;
}

.topic-type {
    background: var(--bg);
    padding: 0.125rem 0.5rem;
    border-radius: 2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.625rem;
}

.topic-summary {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0.5rem 0 0;
    line-height: 1.6;
}

.sub-events {
    margin-top: 1rem;
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
}

.sub-event {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    margin: 0 -0.75rem;
    border-radius: 0.25rem;
    text-decoration: none;
    color: var(--text);
    font-size: 0.875rem;
    transition: background 0.1s;
    gap: 0.75rem;
}

.sub-event:hover { background: var(--surface-alt); }

.sub-event-title { flex: 1; }

.sub-event-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    font-weight: 500;
}

.tier-badge {
    font-size: 0.5625rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.1875rem 0.5rem;
    border-radius: 2rem;
}

.tier-analysed { color: var(--green); background: var(--green-bg); }
.tier-monitoring { color: var(--amber); background: var(--amber-bg); }

.tier-dot {
    font-size: 0.5rem;
    margin-right: 0.125rem;
}

.sub-event-overflow {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-align: center;
    padding: 0.375rem 0;
}

/* ============================================
   EVENT CARDS (featured grid)
   ============================================ */

.event-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
}

.event-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.375rem;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s, transform 0.2s;
    border-left: 4px solid var(--border);
}

.event-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

/* Category border colours */
.card-military    { border-left-color: var(--cat-military); }
.card-economic    { border-left-color: var(--cat-economic); }
.card-diplomatic  { border-left-color: var(--cat-diplomatic); }
.card-geopolitical{ border-left-color: var(--cat-geopolitical); }
.card-humanitarian{ border-left-color: var(--cat-humanitarian); }
.card-legal       { border-left-color: var(--cat-legal); }
.card-social      { border-left-color: var(--cat-social); }
.card-technological{ border-left-color: var(--cat-technological); }
.card-criminal    { border-left-color: var(--cat-criminal); }
.card-political   { border-left-color: var(--cat-political); }
.card-environmental{ border-left-color: var(--cat-environmental); }
.card-terrorist   { border-left-color: var(--cat-terrorist); }

.card-type {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: 0.375rem;
}

.event-card h3 {
    font-family: var(--font-display);
    font-size: 1.0625rem;
    font-weight: 500;
    line-height: 1.3;
    margin: 0 0 0.5rem;
    color: var(--navy);
}

.card-summary {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0;
    flex: 1;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.6875rem;
    color: var(--text-muted);
    padding-top: 0.75rem;
    margin-top: 0.75rem;
    border-top: 1px solid var(--border);
    font-weight: 500;
}

.new-badge {
    background: var(--green-bg);
    color: var(--green);
    font-weight: 700;
    padding: 0.125rem 0.5rem;
    border-radius: 2rem;
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================
   EVENT GROUPS (collapsible)
   ============================================ */

.event-group {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    background: var(--surface);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.group-heading {
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9375rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: background 0.1s;
}

.group-heading:hover { background: var(--surface-alt); }

.group-count {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg);
    padding: 0.125rem 0.625rem;
    border-radius: 2rem;
}

.event-list-compact { border-top: 1px solid var(--border); }

.event-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 1.25rem;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    font-size: 0.875rem;
    transition: background 0.1s;
    gap: 1rem;
}

.event-row:last-child { border-bottom: none; }
.event-row:hover { background: var(--surface-alt); }

.row-title { flex: 1; }

.row-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    font-weight: 500;
}

.indicator-rising {
    color: var(--green);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.indicator-rising::before {
    content: '';
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 50%;
    background: var(--green);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

@media (prefers-reduced-motion: reduce) {
    .indicator-rising::before { animation: none; }
}
.indicator-declining { color: var(--red); }

.inline-sparkline {
    width: 2.5rem;
    height: 0.75rem;
    color: var(--text-muted);
    vertical-align: middle;
    flex-shrink: 0;
}

.recently-updated {
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--accent);
    background: var(--amber-bg);
    padding: 0.125rem 0.5rem;
    border-radius: 2rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.recently-updated-dot { color: var(--accent); font-size: 0.5rem; margin-right: 0.125rem; }

.group-overflow {
    padding: 0.5rem 1.25rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-align: center;
    margin: 0;
}

/* ============================================
   BREADCRUMB
   ============================================ */

.breadcrumb {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing);
    font-weight: 500;
}

.breadcrumb a { color: var(--accent-hover); }
.breadcrumb a:hover { text-decoration: underline; }

/* ============================================
   EVENT BRIEF (Layer 2)
   ============================================ */

.event-brief, .analysis, .claim-detail { max-width: var(--content-width); }

/* Event banner — category colour strip */
.event-banner {
    height: 4px;
    border-radius: var(--radius) var(--radius) 0 0;
    margin-bottom: var(--spacing);
}

.banner-military { background: var(--cat-military); }
.banner-economic { background: var(--cat-economic); }
.banner-diplomatic { background: var(--cat-diplomatic); }
.banner-geopolitical { background: var(--cat-geopolitical); }
.banner-humanitarian { background: var(--cat-humanitarian); }
.banner-legal { background: var(--cat-legal); }
.banner-social { background: var(--cat-social); }
.banner-technological { background: var(--cat-technological); }
.banner-criminal { background: var(--cat-criminal); }
.banner-political { background: var(--cat-political); }
.banner-environmental { background: var(--cat-environmental); }

/* Section icons */
.section-icon {
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    margin-right: 0.25rem;
    color: var(--accent);
}

.event-brief h1, .analysis h1 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 500;
    line-height: 1.2;
    margin-bottom: 0.25rem;
    color: var(--navy);
    letter-spacing: -0.02em;
}

.brief-meta {
    color: var(--text-muted);
    font-size: 0.8125rem;
    margin-bottom: var(--spacing);
    font-weight: 500;
}

.brief-section, .analysis-section, .detail-section {
    margin-bottom: calc(var(--spacing) * 1.5);
}

.brief-section h2, .analysis-section h2, .detail-section h2 {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    color: var(--accent);
    border-bottom: 2px solid var(--accent-light);
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
}

.brief-section ul { padding-left: 1.25rem; }

.brief-section li {
    margin-bottom: 0.5rem;
    line-height: 1.65;
    color: var(--text-secondary);
}

.monitoring-banner {
    background: var(--amber-bg);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: var(--accent-hover);
    font-weight: 500;
    margin-bottom: var(--spacing);
}

.assessment-text {
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--text);
}

.assessment-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: baseline;
    margin-top: 0.75rem;
    font-size: 0.8125rem;
}

.assessment-basis {
    color: var(--text-secondary);
}

.claim-category-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
}

.assessment-confidence {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 0.25rem;
}

.confidence-phrase {
    font-weight: 700;
    font-style: normal;
    color: var(--accent);
}

.source-hint {
    font-size: 0.6875rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-left: 0.25rem;
}

.evidence-list li {
    margin-bottom: 0.625rem;
    line-height: 1.6;
}

.show-more {
    font-size: 0.8125rem;
    color: var(--accent-hover);
    cursor: pointer;
    font-weight: 600;
    list-style: none;
    padding: 0.5rem 0;
}

.show-more::-webkit-details-marker { display: none; }

details[open] > .show-more {
    font-size: 0;
    padding: 0;
    height: 0;
    overflow: hidden;
}

.more-note {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0.5rem 0;
}

.more-regions { margin-top: 0.75rem; }

.source-section h2 {
    display: inline;
    cursor: pointer;
}

.if-prefix {
    font-weight: 700;
    color: var(--accent);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: 0.25rem;
}

.section-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
    margin: -0.25rem 0 0.5rem;
}

.source-bars { display: flex; flex-direction: column; gap: 0.25rem; }

.source-bar {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    padding: 0.25rem 0;
}

.region-count { font-weight: 700; color: var(--text-secondary); }

/* Narrative Gap comparison */
.narrative-gap-section {
    background: var(--surface);
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.narrative-gap-section h2 {
    font-family: var(--font-display);
    font-size: 1.125rem;
    text-transform: none;
    letter-spacing: -0.01em;
    color: var(--navy);
    border-bottom: 2px solid var(--accent);
    font-weight: 500;
}

.gap-subsection { margin-bottom: 1.25rem; }

.gap-heading {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--navy);
    margin: 0 0 0.5rem;
}

.disagreement-card {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-left: 3px solid var(--red);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
}

.disagreement-claim {
    font-size: 0.875rem;
    margin: 0 0 0.375rem;
}

.disagreement-stances {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.75rem;
}

/* Region badges for disagreements */
.region-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.375rem;
}

.region-badge {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.1875rem 0.5rem;
    border-radius: 2rem;
}

.badge-supports {
    color: var(--green);
    background: var(--green-bg);
    /* Colour-blind: subtle pattern */
    background-image: none;
}

.badge-contradicts {
    color: var(--red);
    background: var(--red-bg);
    /* Colour-blind: striped pattern for differentiation */
    background-image: repeating-linear-gradient(
        135deg, transparent, transparent 2px,
        rgba(185, 28, 28, 0.08) 2px, rgba(185, 28, 28, 0.08) 4px
    );
}

.omission-card {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.omission-card p { margin: 0 0 0.25rem; }

.omission-meta {
    font-size: 0.6875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.narrative-intro {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    font-style: italic;
}

.narrative-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
    gap: 1rem;
}

.narrative-column {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
}

.narrative-region {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin: 0 0 0.625rem;
    padding-bottom: 0.375rem;
    border-bottom: 2px solid var(--accent-light);
}

.narrative-claims { list-style: none; padding: 0; margin: 0; }

.narrative-claims li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--text-secondary);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.narrative-claims li:last-child { border-bottom: none; }

.narrative-source-count {
    display: block;
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

/* Underreported claims */
.underreported-section h2 {
    color: var(--navy) !important;
    border-bottom-color: var(--navy) !important;
}

.underreported-card {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-left: 3px solid var(--navy);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.underreported-card p { margin: 0 0 0.25rem; }

.underreported-meta {
    font-size: 0.6875rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Go deeper CTA */
.go-deeper {
    margin: var(--spacing) 0;
    padding: 1rem 1.5rem;
    background: var(--accent-light);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    text-align: center;
}

.deeper-link {
    color: var(--accent-hover) !important;
    font-weight: 700;
    font-size: 0.9375rem;
}

.deeper-link:hover { text-decoration: underline; }

/* ============================================
   ANALYSIS (Layer 3)
   ============================================ */

.question-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.375rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow);
}

.question-card h3 {
    font-family: var(--font-display);
    font-size: 1.0625rem;
    font-weight: 500;
    margin: 0 0 0.75rem;
    color: var(--navy);
}

.hypotheses { display: flex; flex-direction: column; gap: 0.5rem; }

.hypothesis {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    background: var(--surface-alt);
    border: 1px solid var(--border);
}

.hypothesis-leading {
    font-weight: 600;
    background: var(--accent-light);
    border-color: var(--accent);
}

.hyp-bar-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.hyp-bar-track {
    flex: 1;
    height: 0.375rem;
    background: var(--border);
    border-radius: 2rem;
    overflow: hidden;
}

.hyp-bar-fill {
    height: 100%;
    width: var(--bar-pct);
    background: var(--accent);
    border-radius: 2rem;
    transition: width 0.3s;
}

.hypothesis-leading .hyp-bar-fill { background: var(--green); }

.hyp-label { flex: 1; }
.hyp-phrase { color: var(--text-muted); font-size: 0.8125rem; font-style: italic; }

.hyp-confidence, .confidence-badge {
    font-size: 0.5625rem;
    font-weight: 800;
    padding: 0.25rem 0.625rem;
    border-radius: 2rem;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.confidence-high-confidence { color: var(--green); background: var(--green-bg); }
.confidence-moderate-confidence { color: var(--amber); background: var(--amber-bg); }
.confidence-low-confidence { color: var(--red); background: var(--red-bg); }
.confidence-very-low-confidence { color: #7f1d1d; background: var(--red-bg); }

.balance-warning {
    color: var(--accent-hover);
    background: var(--accent-light);
    border: 1px solid var(--accent);
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
}

.source-bars-visual, .region-bars { display: flex; flex-direction: column; gap: 0.375rem; margin-top: 0.75rem; }

.region-bar-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.region-label { width: 8rem; flex-shrink: 0; font-weight: 600; color: var(--text-secondary); }

.region-bar-track {
    flex: 1;
    height: 0.375rem;
    background: var(--border);
    border-radius: 2rem;
    overflow: hidden;
}

.region-bar-fill {
    height: 100%;
    width: var(--bar-pct);
    background: var(--accent);
    border-radius: 2rem;
    transition: width 0.3s;
}

.category-stacked-bar {
    display: flex;
    height: 0.625rem;
    border-radius: 2rem;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.cat-segment { width: var(--bar-pct); transition: width 0.3s; }

.cat-color-observed_fact { background: var(--cat-economic); }
.cat-color-capability { background: var(--cat-military); }
.cat-color-intent { background: var(--cat-diplomatic); }
.cat-color-prediction { background: var(--cat-geopolitical); }
.cat-color-causation { background: var(--cat-humanitarian); }
.cat-color-impact { background: var(--cat-legal); }
.cat-color-trajectory { background: var(--cat-social); }

.category-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cat-dot {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    margin-right: 0.25rem;
    vertical-align: middle;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
    gap: 0.5rem;
}

.category-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    box-shadow: var(--shadow);
}

.cat-count { font-weight: 800; color: var(--accent); font-family: var(--font-mono); }

.claims-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.claims-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    background: var(--navy);
    color: var(--text-muted);
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
}

.claims-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.claims-table tr:last-child td { border-bottom: none; }
.claims-table tr:hover { background: var(--surface-alt); }

.claims-table a { color: var(--text); }
.claims-table a:hover { color: var(--accent-hover); }

.source-count-cell { text-align: center; font-weight: 700; font-family: var(--font-mono); }

.resolved-card {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 0.5rem;
}

.resolved-card h3 { font-size: 0.9375rem; margin: 0 0 0.25rem; }
.resolution-outcome { font-size: 0.875rem; color: var(--text-secondary); margin: 0; }

/* ============================================
   CLAIM DETAIL (Layer 4)
   ============================================ */

.reported-claim-label {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    color: var(--accent);
}

.claim-text {
    font-family: var(--font-display);
    font-size: 1.5rem;
    line-height: 1.4;
    font-weight: 500;
    font-style: italic;
    color: var(--navy);
    margin-top: 0.25rem;
}

.claim-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: var(--spacing);
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.confidence-reason {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: var(--spacing);
}

.sparkline-container { max-width: 28rem; }
.belief-sparkline { width: 100%; height: 5rem; }
.sparkline-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.6875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.assertion-list { display: flex; flex-direction: column; gap: 0.75rem; }

.assertion-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    border-left: 4px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.assertion-supports { border-left-color: var(--green); }
.assertion-contradicts { border-left-color: var(--red); }
.assertion-hedges { border-left-color: var(--accent); }

.assertion-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    flex-wrap: wrap;
}

.source-name { font-weight: 700; color: var(--navy); }

.stance-badge {
    font-size: 0.5625rem;
    font-weight: 800;
    padding: 0.1875rem 0.5rem;
    border-radius: 2rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.stance-supports { color: var(--green); background: var(--green-bg); }
.stance-contradicts { color: var(--red); background: var(--red-bg); }
.stance-hedges { color: var(--amber); background: var(--amber-bg); }

.reliability-tier { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }
.tier-high { color: var(--green); }
.tier-low { color: var(--red); }

.assertion-quote {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    border-left: 3px solid var(--accent);
    padding-left: 0.75rem;
    margin: 0.625rem 0 0.25rem;
    font-style: italic;
    line-height: 1.6;
}

.assertion-date { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }

.related-list { padding-left: 1.25rem; }
.related-list li { margin-bottom: 0.5rem; font-size: 0.875rem; }
.relationship-type {
    font-size: 0.5625rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--bg);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    margin-right: 0.25rem;
}

/* ============================================
   STATIC PAGES
   ============================================ */

.static-page { max-width: 36rem; }

.static-page h1 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 500;
    margin-bottom: var(--spacing);
    color: var(--navy);
}

.static-page h2 {
    font-size: 1.0625rem;
    font-weight: 700;
    margin-top: calc(var(--spacing) * 1.5);
    color: var(--navy);
}

.static-page p { color: var(--text-secondary); }
.static-page ul { padding-left: 1.25rem; }
.static-page li { margin-bottom: 0.5rem; line-height: 1.65; color: var(--text-secondary); }

.error-page { text-align: center; padding: 4rem 0; }
.error-mark {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent);
    display: block;
    margin-bottom: 1rem;
    opacity: 0.3;
}
.error-page h1 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 500;
    color: var(--navy);
}
.error-link {
    font-weight: 700;
    color: var(--accent-hover);
}

/* How it works flow */
.how-it-works {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: var(--spacing) 0;
    flex-wrap: wrap;
    justify-content: center;
}

.how-step {
    flex: 1;
    min-width: 8rem;
    text-align: center;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.how-icon {
    width: 2rem;
    height: 2rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.how-step h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    margin: 0 0 0.375rem;
    color: var(--navy);
}

.how-step p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.how-arrow {
    color: var(--accent);
    font-size: 1.25rem;
    align-self: center;
    font-weight: 700;
}

/* Confidence guide */
.confidence-guide {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    margin: var(--spacing) 0;
}

.confidence-example {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.confidence-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

@media (max-width: 640px) {
    .how-arrow { display: none; }
    .how-it-works { flex-direction: column; }
}

.donate-cta {
    margin: var(--spacing) 0;
}

.donate-btn-large {
    display: inline-block;
    background: var(--accent);
    color: var(--text-inverse);
    padding: 0.875rem 2.5rem;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 1.0625rem;
    text-decoration: none;
    box-shadow: var(--shadow-md);
    transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
}

.donate-btn-large:hover {
    background: var(--accent-hover);
    box-shadow: var(--shadow-hover);
    transform: translateY(-1px);
    color: var(--text-inverse);
}

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
    background: var(--navy);
    border-top: 3px solid var(--accent);
    margin-top: 4rem;
    color: var(--text-muted);
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2.5rem var(--spacing) 1.5rem;
    display: flex;
    gap: 3rem;
    flex-wrap: wrap;
}

.footer-brand { flex: 1; min-width: 14rem; }

.footer-mark {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    display: block;
    margin-bottom: 0.5rem;
}

.footer-tagline {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin: 0;
}

.footer-links-grid {
    display: flex;
    gap: 3rem;
    flex-wrap: wrap;
}

.footer-col { min-width: 7rem; }

.footer-col h4 {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(248, 250, 252, 0.5);
    margin: 0 0 0.75rem;
}

.footer-col a {
    display: block;
    color: var(--text-muted);
    font-size: 0.8125rem;
    padding: 0.25rem 0;
    transition: color 0.15s;
}

.footer-col a:hover { color: var(--text-inverse); }

.footer-legal {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem var(--spacing) 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.6875rem;
    color: rgba(148, 163, 184, 0.6);
    text-align: center;
    line-height: 1.6;
}

.footer-legal a { color: rgba(148, 163, 184, 0.6); text-decoration: underline; }

.disclaimer {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--spacing);
    line-height: 1.6;
    font-style: italic;
}

.disclaimer a { color: var(--text-muted); text-decoration: underline; }

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .hero-sub { font-size: 1rem; }
    .event-grid { grid-template-columns: 1fr; }
    .narrative-grid { grid-template-columns: 1fr; }
    .footer-inner { flex-direction: column; gap: 1.5rem; }
    .footer-links-grid { gap: 1.5rem; }
}

@media (max-width: 640px) {
    :root { --spacing: 1rem; }

    .header-inner { height: auto; padding: 0.75rem var(--spacing); flex-wrap: wrap; gap: 0.5rem; }
    .brand-name { font-size: 1rem; }
    .main-nav { gap: 1rem; }
    .event-brief h1, .analysis h1 { font-size: 1.5rem; }
    .claim-text { font-size: 1.125rem; }
    .hypothesis { flex-wrap: wrap; }
    .claims-table { font-size: 0.8125rem; }
    .claims-table th, .claims-table td { padding: 0.5rem; }
}
