/* =============================================================================
   FedWell — Design System
   ============================================================================= */

:root {
    --fw-cream:        #FDF8F0;
    --fw-charcoal:     #2D2D2D;
    --fw-dark-brown:   #3D2B1F;
    --fw-warm-green:   #4A7C59;
    --fw-warm-green-d: #3A6348;
    --fw-soft-gold:    #C9A96E;
    --fw-light-sage:   #E8EDE5;
    --fw-muted:        #8B8B8B;
    --fw-border:       #E0D8CD;
}

/* =============================================================================
   Reset & Base
   ============================================================================= */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--fw-cream);
    color: var(--fw-charcoal);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: Georgia, 'Times New Roman', serif;
    color: var(--fw-dark-brown);
    line-height: 1.3;
}

a {
    color: var(--fw-warm-green);
    text-decoration: none;
}

a:hover {
    color: var(--fw-warm-green-d);
}

.fw-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =============================================================================
   Header
   ============================================================================= */

.fw-header {
    background: white;
    border-bottom: 1px solid var(--fw-border);
    padding: 14px 0;
}

.fw-header-inner {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.fw-logo {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--fw-dark-brown);
}

.fw-logo:hover {
    color: var(--fw-dark-brown);
}

.fw-byline {
    font-size: 0.85rem;
    color: var(--fw-muted);
}

/* =============================================================================
   Footer
   ============================================================================= */

.fw-footer {
    background: var(--fw-dark-brown);
    color: #ccc;
    padding: 32px 0;
    margin-top: 60px;
    text-align: center;
}

.fw-footer-brand {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.1rem;
    color: white;
    margin-bottom: 6px;
}

.fw-footer-tagline {
    font-size: 0.85rem;
    color: #aaa;
}

.fw-footer-links {
    margin-top: 16px;
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.fw-footer-link {
    font-size: 0.75rem;
    color: #777;
    text-decoration: none;
    transition: color 0.2s;
}

.fw-footer-link:hover {
    color: #ccc;
}

/* =============================================================================
   Hero
   ============================================================================= */

.fw-hero {
    text-align: center;
    padding: 64px 0 48px;
}

.fw-hero-title {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.fw-hero-subtitle {
    font-size: 1.1rem;
    color: var(--fw-muted);
    margin-bottom: 32px;
}

/* =============================================================================
   Search
   ============================================================================= */

.fw-search-form {
    display: flex;
    max-width: 560px;
    margin: 0 auto;
    gap: 0;
}

.fw-search-input {
    flex: 1;
    height: 48px;
    padding: 0 20px;
    border: 1px solid var(--fw-border);
    border-right: none;
    border-radius: 24px 0 0 24px;
    font-size: 1rem;
    background: white;
    color: var(--fw-charcoal);
    outline: none;
}

.fw-search-input:focus {
    border-color: var(--fw-warm-green);
}

.fw-search-btn {
    height: 48px;
    padding: 0 24px;
    background: var(--fw-warm-green);
    color: white;
    border: none;
    border-radius: 0 24px 24px 0;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.fw-search-btn:hover {
    background: var(--fw-warm-green-d);
}

.fw-search-form-inline {
    margin-bottom: 32px;
}

/* =============================================================================
   Stats Bar
   ============================================================================= */

.fw-stats-bar {
    background: white;
    border-top: 1px solid var(--fw-border);
    border-bottom: 1px solid var(--fw-border);
    padding: 20px 0;
}

.fw-stats-inner {
    display: flex;
    justify-content: center;
    gap: 48px;
}

.fw-stat {
    text-align: center;
}

.fw-stat-number {
    display: block;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--fw-dark-brown);
}

.fw-stat-label {
    font-size: 0.85rem;
    color: var(--fw-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =============================================================================
   Sections
   ============================================================================= */

.fw-section {
    padding: 48px 0;
}

.fw-section-alt {
    background: var(--fw-light-sage);
}

.fw-section-title {
    font-size: 1.5rem;
    margin-bottom: 8px;
    text-align: center;
}

.fw-section-subtitle {
    text-align: center;
    color: var(--fw-muted);
    font-size: 0.95rem;
    margin-bottom: 28px;
}

.fw-link {
    color: var(--fw-warm-green);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.fw-link:hover {
    border-bottom-color: var(--fw-warm-green);
}

.fw-muted-text {
    color: var(--fw-muted);
    text-align: center;
    font-size: 0.95rem;
}

/* =============================================================================
   Contributors
   ============================================================================= */

.fw-contributors {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 32px;
}

.fw-contributor {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 160px;
    text-align: center;
}

.fw-contributor-photo {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 4px;
}

.fw-contributor-name {
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--fw-dark-brown);
    line-height: 1.2;
}

.fw-contributor-role {
    font-size: 0.8rem;
    color: var(--fw-warm-green);
    font-weight: 500;
}

.fw-contributor-affil {
    font-size: 0.75rem;
    color: var(--fw-muted);
    line-height: 1.3;
}

/* =============================================================================
   How It Works (Pipeline Flow)
   ============================================================================= */

.fw-pipeline {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    padding: 12px 0;
}

.fw-pipe-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 160px;
}

.fw-pipe-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--fw-soft-gold);
    color: var(--fw-soft-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    transition: all 0.2s;
}

.fw-pipe-icon-challenge {
    border-color: #D4845A;
    color: #D4845A;
}

.fw-pipe-icon-consensus {
    border-color: var(--fw-warm-green);
    color: var(--fw-warm-green);
}

.fw-pipe-icon-publish {
    border-color: var(--fw-dark-brown);
    color: var(--fw-dark-brown);
}

.fw-pipe-label {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--fw-dark-brown);
    margin-bottom: 4px;
}

.fw-pipe-detail {
    font-size: 0.8rem;
    color: var(--fw-charcoal);
    line-height: 1.4;
    opacity: 0.75;
}

.fw-pipe-arrow {
    display: flex;
    align-items: center;
    padding-top: 16px;
    color: var(--fw-border);
    flex-shrink: 0;
    margin: 0 4px;
}

.fw-pipeline-footnote {
    text-align: center;
    font-size: 0.85rem;
    color: var(--fw-muted);
    margin-top: 24px;
    font-style: italic;
}

/* Why FedWell Section */
.fw-why-section {
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
}

.fw-why-text {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--fw-charcoal);
    margin-bottom: 16px;
}

.fw-why-coda {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.05rem;
    color: var(--fw-dark-brown);
    font-style: italic;
}

/* =============================================================================
   Topics
   ============================================================================= */

.fw-topics {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.fw-topic-pill {
    display: inline-block;
    padding: 8px 16px;
    background: var(--fw-light-sage);
    color: var(--fw-dark-brown);
    border-radius: 20px;
    font-size: 0.9rem;
    transition: background 0.2s, color 0.2s;
}

.fw-topic-pill:hover {
    background: var(--fw-warm-green);
    color: white;
}

/* =============================================================================
   Search Results
   ============================================================================= */

.fw-search-page {
    padding: 32px 0;
}

.fw-results {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.fw-result-card {
    background: white;
    border: 1px solid var(--fw-border);
    border-radius: 8px;
    padding: 20px;
    transition: border-color 0.2s, box-shadow 0.2s;
    display: block;
    color: inherit;
}

.fw-result-card:hover {
    border-color: var(--fw-warm-green);
    box-shadow: 0 2px 8px rgba(74, 124, 89, 0.1);
    color: inherit;
}

.fw-result-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.fw-result-category {
    display: inline-block;
    font-size: 0.75rem;
    padding: 2px 10px;
    background: var(--fw-light-sage);
    color: var(--fw-warm-green);
    border-radius: 10px;
    font-weight: 500;
}

.fw-result-badge {
    font-size: 0.75rem;
    color: var(--fw-soft-gold);
    font-weight: 500;
}

.fw-result-title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.15rem;
    color: var(--fw-dark-brown);
    margin-bottom: 6px;
}

.fw-result-snippet {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
    margin-bottom: 8px;
}

.fw-result-source {
    font-size: 0.8rem;
    color: var(--fw-muted);
}

.fw-no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--fw-muted);
}

/* =============================================================================
   Article
   ============================================================================= */

.fw-article-page {
    padding: 32px 0;
}

.fw-back-link {
    display: inline-block;
    font-size: 0.9rem;
    color: var(--fw-warm-green);
    margin-bottom: 24px;
}

.fw-back-link:hover {
    color: var(--fw-warm-green-d);
}

.fw-article {
    background: white;
    border: 1px solid var(--fw-border);
    border-radius: 8px;
    padding: 32px;
}

.fw-article-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--fw-border);
}

.fw-article-title {
    font-size: 2rem;
    margin-bottom: 12px;
}

.fw-article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.fw-article-content {
    font-size: 1rem;
    line-height: 1.7;
}

.fw-article-content h1 {
    font-size: 1.75rem;
    margin: 28px 0 12px;
}

.fw-article-content h2 {
    font-size: 1.4rem;
    margin: 24px 0 10px;
}

.fw-article-content h3 {
    font-size: 1.15rem;
    margin: 20px 0 8px;
}

.fw-article-content p {
    margin-bottom: 14px;
}

.fw-article-content ul,
.fw-article-content ol {
    margin: 10px 0 14px 24px;
}

.fw-article-content li {
    margin-bottom: 6px;
}

.fw-article-content a {
    color: var(--fw-warm-green);
    text-decoration: underline;
}

.fw-article-source {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--fw-border);
    font-size: 0.9rem;
    color: var(--fw-muted);
}

.fw-article-source a {
    color: var(--fw-warm-green);
}

/* =============================================================================
   Evidence Level Badges
   ============================================================================= */

.fw-evidence-badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 2px 10px;
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.fw-contested-badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 2px 10px;
    border-radius: 10px;
    font-weight: 600;
    background: #FEE2E2;
    color: #DC2626;
    letter-spacing: 0.3px;
}

/* =============================================================================
   Consensus Point Cards (search results)
   ============================================================================= */

.fw-consensus-result-card {
    border-left: 3px solid var(--fw-soft-gold);
}

.fw-consensus-claim-text {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.05rem;
    color: var(--fw-dark-brown);
    margin-bottom: 8px;
    line-height: 1.4;
}

.fw-consensus-sources-text {
    font-size: 0.8rem;
    color: var(--fw-muted);
    font-style: italic;
    margin-bottom: 4px;
}

.fw-consensus-expert-text {
    font-size: 0.8rem;
    color: var(--fw-muted);
}

/* =============================================================================
   Consensus Point Detail View
   ============================================================================= */

.fw-consensus-detail-claim {
    font-size: 1.6rem;
    line-height: 1.35;
    margin-bottom: 16px;
}

.fw-consensus-detail-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.fw-consensus-date {
    font-size: 0.8rem;
    color: var(--fw-muted);
}

.fw-evidence-desc {
    font-size: 0.85rem;
    color: var(--fw-muted);
    font-style: italic;
    padding: 8px 12px;
    background: var(--fw-light-sage);
    border-radius: 6px;
    margin-bottom: 20px;
}

.fw-consensus-detail-sources {
    font-size: 0.95rem;
    margin-bottom: 12px;
    padding: 12px;
    background: var(--fw-light-sage);
    border-radius: 6px;
}

.fw-consensus-detail-expert {
    font-size: 0.9rem;
    color: var(--fw-charcoal);
    margin-bottom: 20px;
}

/* =============================================================================
   Contested Section
   ============================================================================= */

/* Review Due Date */
.fw-review-due {
    font-size: 0.8rem;
    color: var(--fw-muted);
    margin: 8px 0;
    font-style: italic;
}

/* Corroboration Status */
.fw-corroboration {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 12px;
    margin: 8px 0;
}

.fw-corroboration-pending {
    background: #FDF5E6;
    color: #B8860B;
}

.fw-corroboration-corroborated {
    background: #E8EDE5;
    color: #4A7C59;
}

.fw-corroboration-disputed {
    background: #FEF2F2;
    color: #DC2626;
}

.fw-corroboration-suggestion {
    background: #E8F0F8;
    color: #5B8DB8;
}

/* Contested Section */
.fw-contested-section {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.fw-contested-section h3 {
    color: #DC2626;
    font-size: 1rem;
    margin-bottom: 6px;
}

.fw-contested-section p {
    font-size: 0.9rem;
    color: #991B1B;
    margin-bottom: 16px;
}

/* Debate Thread */
.fw-debate-thread {
    background: white;
    border: 1px solid #FECACA;
    border-radius: 6px;
    padding: 16px;
    margin-top: 12px;
}

.fw-debate-thread h4 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 0.95rem;
    color: var(--fw-dark-brown);
    margin-bottom: 6px;
}

.fw-debate-thread p {
    font-size: 0.85rem;
    color: var(--fw-charcoal);
    margin-bottom: 10px;
}

.fw-debate-contribute-link {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--fw-warm-green);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.fw-debate-contribute-link:hover {
    border-bottom-color: var(--fw-warm-green);
}

/* Video Discussion */
.fw-debate-video {
    background: white;
    border: 1px solid #FECACA;
    border-radius: 6px;
    padding: 16px;
    margin-top: 10px;
}

.fw-debate-video h4 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 0.95rem;
    color: var(--fw-dark-brown);
    margin-bottom: 6px;
}

.fw-debate-video p {
    font-size: 0.85rem;
    color: var(--fw-charcoal);
    margin-bottom: 8px;
}

.fw-coming-soon {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--fw-muted);
    background: var(--fw-light-sage);
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: 500;
}

/* =============================================================================
   Expandable Dialogue Section
   ============================================================================= */

.fw-dialogue-expand {
    margin-top: 24px;
    border: 1px solid var(--fw-border);
    border-radius: 8px;
    overflow: hidden;
}

.fw-dialogue-expand summary {
    padding: 14px 20px;
    background: var(--fw-light-sage);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--fw-dark-brown);
}

.fw-dialogue-expand summary:hover {
    background: #DDE5DA;
}

.fw-dialogue-content {
    padding: 20px;
    font-size: 0.9rem;
    line-height: 1.6;
    max-height: 500px;
    overflow-y: auto;
}

/* =============================================================================
   Related Points Section
   ============================================================================= */

.fw-related-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--fw-border);
}

.fw-related-title {
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.fw-related-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--fw-border);
    border-radius: 6px;
    margin-bottom: 8px;
    color: inherit;
    transition: border-color 0.2s;
}

.fw-related-card:hover {
    border-color: var(--fw-warm-green);
    color: inherit;
}

.fw-related-claim {
    font-size: 0.9rem;
    color: var(--fw-dark-brown);
}

/* =============================================================================
   Topic Bubble Map
   ============================================================================= */

.fw-topic-map {
    max-width: 800px;
    margin: 0 auto;
}

.fw-bubble-svg {
    width: 100%;
    height: auto;
}

.fw-bubble-circle {
    transition: opacity 0.2s;
}

.fw-bubble-group:hover .fw-bubble-circle {
    opacity: 0.8;
}

.fw-bubble-text {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 12px;
    font-weight: 600;
    pointer-events: none;
}

.fw-bubble-count {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 10px;
    pointer-events: none;
    opacity: 0.7;
}

/* =============================================================================
   Header Navigation
   ============================================================================= */

.fw-nav {
    margin-left: auto;
}

.fw-nav-link {
    font-size: 0.9rem;
    color: var(--fw-warm-green);
    font-weight: 500;
}

/* =============================================================================
   Responsive
   ============================================================================= */

@media (max-width: 640px) {
    .fw-hero {
        padding: 40px 0 32px;
    }

    .fw-hero-title {
        font-size: 1.75rem;
    }

    .fw-hero-subtitle {
        font-size: 1rem;
    }

    .fw-search-form {
        max-width: 100%;
    }

    .fw-stats-inner {
        gap: 24px;
    }

    .fw-stat-number {
        font-size: 1.35rem;
    }

    .fw-pipeline {
        flex-wrap: wrap;
        gap: 8px;
    }

    .fw-pipe-step {
        width: 140px;
    }

    .fw-pipe-arrow {
        display: none;
    }

    .fw-contributors {
        gap: 20px;
    }

    .fw-contributor {
        width: 140px;
    }

    .fw-contributor-photo {
        width: 72px;
        height: 72px;
    }

    .fw-article {
        padding: 20px;
    }

    .fw-article-title {
        font-size: 1.5rem;
    }
}
