/**
 * CivicOS Homepage — NYT-Style Newspaper Layout
 */

/* ============================================================================
   Foundation
   ============================================================================ */
.nyt-homepage {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #1a202c;
    overflow-x: hidden;
    max-width: 100vw;
    width: 100%;
    box-sizing: border-box;
}

/* ============================================================================
   Section Labels (NYT pattern)
   ============================================================================ */
.section-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #1a202c;
    border-bottom: 2px solid #1a202c;
    padding-bottom: 0.375rem;
    margin-bottom: 1rem;
    display: inline-block;
}

/* ============================================================================
   Links — newspaper style (inherit color, underline on hover)
   ============================================================================ */
.lead-headline a,
.secondary-headline a,
.three-up-headline a {
    color: inherit;
    text-decoration: none;
}

.lead-headline a:hover,
.secondary-headline a:hover,
.three-up-headline a:hover {
    text-decoration: underline;
}

.lead-dateline a,
.secondary-dateline a,
.three-up-dateline a {
    color: inherit;
    text-decoration: none;
}

.lead-dateline a:hover,
.secondary-dateline a:hover,
.three-up-dateline a:hover {
    text-decoration: underline;
}

a.lead-issue-title,
a.ticker-title {
    color: #1a202c;
    text-decoration: none;
}

a.lead-issue-title:hover,
a.ticker-title:hover {
    text-decoration: underline;
}

/* ============================================================================
   A. Dateline Strip
   ============================================================================ */
.dateline-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
}

.dateline-date {
    font-size: 0.8125rem;
    color: #4a5568;
    font-weight: 500;
}

.dateline-stats {
    font-size: 0.75rem;
    color: #718096;
    letter-spacing: 0.02em;
}

@media (max-width: 600px) {
    .dateline-strip {
        flex-direction: column;
        gap: 0.25rem;
        text-align: center;
    }
}

/* ============================================================================
   B. Lead Story Section
   ============================================================================ */
.lead-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 1px minmax(0, 0.54fr);
    gap: 0 2rem;
    margin-bottom: 2rem;
}

.lead-divider {
    background: #cbd5e0;
    width: 1px;
}

/* Lead story (left) */
.lead-dateline,
.secondary-dateline,
.three-up-dateline {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #718096;
    margin-bottom: 0.5rem;
}

.lead-headline {
    font-family: 'Crimson Text', Georgia, serif;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    color: #1a202c;
    margin: 0 0 0.75rem;
}

.lead-excerpt {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: #2d3748;
    margin: 0 0 1rem;
}

.lead-issues {
    list-style: none;
    margin: 0 0 0.75rem;
    padding: 0;
}

.lead-issue-item,
.secondary-issue-item,
.three-up-issue {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #edf2f7;
    position: relative;
}

.lead-issue-item:last-child,
.secondary-issue-item:last-child,
.three-up-issue:last-child {
    border-bottom: none;
}

.lead-issue-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1a202c;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lead-issue-badge {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.125rem 0.5rem;
    border-radius: 2px;
    white-space: nowrap;
    flex-shrink: 0;
}

.lead-vote-count {
    font-size: 0.75rem;
    color: #2b6cb0;
    font-weight: 600;
}

/* Secondary story (right) */
.secondary-headline {
    font-family: 'Crimson Text', Georgia, serif;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.25;
    color: #1a202c;
    margin: 0 0 0.5rem;
}

.secondary-excerpt {
    font-size: 0.875rem;
    line-height: 1.65;
    color: #4a5568;
    margin: 0 0 0.75rem;
}

.secondary-issues {
    list-style: none;
    margin: 0;
    padding: 0;
}

@media (max-width: 768px) {
    .lead-section {
        grid-template-columns: 1fr;
        gap: 1.5rem 0;
    }
    .lead-divider {
        display: none;
    }
    .secondary-story {
        padding-top: 1.5rem;
        border-top: 1px solid #e2e8f0;
    }
    .lead-headline {
        font-size: 1.5rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    .lead-excerpt,
    .secondary-excerpt {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    .lead-issue-item,
    .secondary-issue-item {
        flex-wrap: wrap;
        max-width: 100%;
    }
    .lead-issue-title {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }
    .ticker-title {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }
    .vote-doc-title {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }
    .recent-vote-row {
        flex-wrap: wrap;
        max-width: 100%;
    }
}

/* ============================================================================
   C. Section Rule
   ============================================================================ */
.section-rule {
    border: none;
    border-top: 3px double #1a202c;
    margin: 0 0 1.5rem;
}

/* ============================================================================
   D. Three-Up Story Row
   ============================================================================ */
.three-up {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr) 1px minmax(0, 1fr);
    gap: 0 1.5rem;
    margin-bottom: 2rem;
}

.three-up-story,
.accountability-watch {
    min-width: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.three-up-divider {
    background: #cbd5e0;
    width: 1px;
}

.three-up-headline {
    font-family: 'Crimson Text', Georgia, serif;
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.3;
    color: #1a202c;
    margin: 0 0 0.5rem;
}

.three-up-excerpt {
    font-size: 0.8125rem;
    line-height: 1.6;
    color: #4a5568;
    margin: 0 0 0.75rem;
}

.three-up-issues {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Accountability Watch card */
.accountability-watch {
    background: #fafaf9;
    padding: 1rem;
    border: 1px solid #e2e8f0;
}

.accountability-watch .three-up-headline {
    color: #c53030;
}

.watch-themes {
    margin-top: 0.5rem;
}

.watch-themes-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #718096;
    display: block;
    margin-bottom: 0.375rem;
}

.watch-theme-tag {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #4a5568;
    background: #e2e8f0;
    padding: 0.125rem 0.5rem;
    border-radius: 2px;
    margin: 0.125rem 0.25rem 0.125rem 0;
}

@media (max-width: 768px) {
    .three-up {
        grid-template-columns: 1fr;
        gap: 1.5rem 0;
    }
    .three-up-divider {
        display: none;
    }
    .three-up-story {
        padding-bottom: 1.5rem;
        border-bottom: 1px solid #e2e8f0;
    }
    .three-up-story:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }
    .three-up-issue {
        flex-wrap: wrap;
        max-width: 100%;
    }
}

/* ============================================================================
   E. Scoreboard Strip
   ============================================================================ */
.scoreboard-strip {
    display: flex;
    justify-content: space-between;
    background: #f7fafc;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}

.scoreboard-item {
    text-align: center;
    flex: 1;
}

.scoreboard-number {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a202c;
    line-height: 1.2;
}

.scoreboard-label {
    display: block;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #718096;
    margin-top: 0.25rem;
}

@media (max-width: 768px) {
    .scoreboard-strip {
        flex-wrap: wrap;
        gap: 0.75rem;
        padding: 1rem;
    }
    .scoreboard-item {
        flex: 1 1 calc(33.333% - 1rem);
        min-width: 0;
    }
    .scoreboard-number {
        font-size: 1.375rem;
    }
}

@media (max-width: 480px) {
    .nyt-homepage {
        padding: 0 0.75rem 2rem;
    }
    .scoreboard-strip {
        gap: 0.5rem;
        padding: 0.75rem 0.5rem;
        justify-content: center;
    }
    .scoreboard-item {
        flex: 1 1 calc(50% - 0.5rem);
        min-width: 0;
    }
    .scoreboard-number {
        font-size: 1.125rem;
    }
    .scoreboard-label {
        font-size: 0.5625rem;
    }
    .lead-headline {
        font-size: 1.25rem;
    }
    .lead-issue-badge,
    .ticker-theme {
        font-size: 0.5625rem;
        padding: 0.125rem 0.375rem;
    }
}

/* ============================================================================
   F. Committee Focus Grid
   ============================================================================ */
.committee-focus-section {
    margin-bottom: 2rem;
}

.committee-focus-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.focus-card {
    padding: 1rem;
    border: 1px solid #e2e8f0;
}

.focus-committee {
    font-family: 'Crimson Text', Georgia, serif;
    font-size: 0.9375rem;
    font-weight: 700;
    color: #1a202c;
    margin: 0 0 0.25rem;
}

.focus-meeting-count {
    font-size: 0.6875rem;
    color: #718096;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.focus-points {
    margin: 0.625rem 0 0;
    padding: 0 0 0 1rem;
}

.focus-points li {
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #4a5568;
    margin-bottom: 0.25rem;
}

.focus-points li:last-child {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .committee-focus-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================================
   G. Issues in Motion Ticker
   ============================================================================ */
.issues-ticker-section {
    margin-bottom: 2rem;
}

.issues-ticker {
    columns: 2;
    column-gap: 2rem;
    column-rule: 1px solid #e2e8f0;
}

.ticker-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #edf2f7;
    break-inside: avoid;
    position: relative;
}

.ticker-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #1a202c;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ticker-theme {
    font-size: 0.5625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #718096;
    background: #edf2f7;
    padding: 0.125rem 0.375rem;
    border-radius: 2px;
    white-space: nowrap;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .issues-ticker {
        columns: 1;
    }
}

/* ============================================================================
   H. Footer Strip
   ============================================================================ */
.homepage-footer {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2rem;
    border-top: 3px double #1a202c;
    padding-top: 1.5rem;
}

.footer-heading {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #1a202c;
    margin: 0 0 0.75rem;
    padding-bottom: 0.375rem;
    border-bottom: 1px solid #e2e8f0;
}

.footer-about p {
    font-size: 0.8125rem;
    line-height: 1.65;
    color: #4a5568;
    margin: 0;
}

.footer-nav {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.footer-nav a {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #1a202c;
    text-decoration: none;
    padding: 0.25rem 0;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s;
}

.footer-nav a:hover {
    border-bottom-color: #1a202c;
    color: #1a202c;
}

/* Leaderboard */
.leaderboard-group {
    margin-bottom: 0.75rem;
}

.leaderboard-group:last-child {
    margin-bottom: 0;
}

.leaderboard-label {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #718096;
    display: block;
    margin-bottom: 0.25rem;
}

.leaderboard-row {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    border-bottom: 1px solid #edf2f7;
}

.leaderboard-name {
    font-size: 0.8125rem;
    color: #1a202c;
}

.leaderboard-rate {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #2d3748;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 768px) {
    .homepage-footer {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .leaderboard-row {
        flex-wrap: wrap;
    }
}

/* ============================================================================
   Phase Badge Colors (shared across all sections)
   ============================================================================ */
.phase-discussed .lead-issue-badge,
.phase-mentioned .lead-issue-badge {
    background: #faf5ff;
    color: #805ad5;
}

.phase-introduced .lead-issue-badge,
.phase-raised .lead-issue-badge {
    background: #ebf8ff;
    color: #2b6cb0;
}

.phase-referred .lead-issue-badge {
    background: #fefcbf;
    color: #975a16;
}

.phase-voted .lead-issue-badge,
.phase-vote_passed .lead-issue-badge {
    background: #c6f6d5;
    color: #276749;
}

.phase-vote_failed .lead-issue-badge {
    background: #fed7d7;
    color: #c53030;
}

.phase-updated .lead-issue-badge,
.phase-implementation .lead-issue-badge {
    background: #bee3f8;
    color: #2b6cb0;
}

.phase-resolved .lead-issue-badge {
    background: #c6f6d5;
    color: #22543d;
}

/* Default badge style (for phases without specific color) */
.lead-issue-badge {
    background: #e2e8f0;
    color: #4a5568;
}

/* ============================================================================
   Ask Button (chat icon on issue items)
   ============================================================================ */
.issue-ask-btn {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: #a0aec0;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s, background 0.15s;
    line-height: 1;
    flex-shrink: 0;
}

.lead-issue-item:hover .issue-ask-btn,
.secondary-issue-item:hover .issue-ask-btn,
.three-up-issue:hover .issue-ask-btn,
.ticker-item:hover .issue-ask-btn,
.focus-card:hover .issue-ask-btn,
.leaderboard-row:hover .issue-ask-btn,
.recent-vote-row:hover .issue-ask-btn {
    opacity: 1;
}

.issue-ask-btn:hover {
    color: #4299e1;
    background: #ebf8ff;
}

.issue-ask-btn svg {
    display: block;
}

/* ============================================================================
   Recent Votes Section
   ============================================================================ */
.recent-votes-section {
    margin-bottom: 2rem;
}

.recent-votes-list {
    border-top: 1px solid #e2e8f0;
}

.recent-vote-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0;
    border-bottom: 1px solid #edf2f7;
    position: relative;
}

.vote-result-badge {
    font-size: 0.5625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.1875rem 0.5rem;
    border-radius: 2px;
    flex-shrink: 0;
    width: 2.5rem;
    text-align: center;
}

.vote-result-badge.vote-passed {
    background: #c6f6d5;
    color: #276749;
}

.vote-result-badge.vote-failed {
    background: #fed7d7;
    color: #c53030;
}

.vote-row-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.vote-doc-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1a202c;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vote-doc-meta {
    font-size: 0.6875rem;
    color: #718096;
    letter-spacing: 0.02em;
}

.section-more-link {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #1a202c;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s;
}

.section-more-link:hover {
    border-bottom-color: #1a202c;
    color: #1a202c;
}

/* ============================================================================
   City Signals Preview (sparkline cards)
   ============================================================================ */
.signals-preview-section {
    margin-bottom: 2rem;
}

.signals-preview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.signal-preview-card {
    padding: 1rem;
    border: 1px solid #e2e8f0;
}

.signal-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.signal-preview-name {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #718096;
}

.signal-preview-trend {
    font-size: 0.6875rem;
    font-weight: 700;
}

.signal-preview-trend.trend-good { color: #276749; }
.signal-preview-trend.trend-bad { color: #c53030; }
.signal-preview-trend.trend-flat { color: #718096; }

.signal-preview-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a202c;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.signal-preview-value small {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #718096;
}

.signal-sparkline {
    display: block;
    width: 100%;
    height: 36px;
}

.signal-year-range {
    display: flex;
    justify-content: space-between;
    font-size: 0.625rem;
    color: #a0aec0;
    margin-top: 0.125rem;
}

@media (max-width: 600px) {
    .signals-preview-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================================
   Focus Card Header (with chat icon)
   ============================================================================ */
.focus-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
}

.focus-card-header .focus-committee {
    flex: 1;
}

.focus-ask-btn {
    opacity: 0;
}
