/* Dorothy - Newspaper of Averages */

:root {
    --bg-primary: #f8f6f1;
    --bg-secondary: #fff;
    --text-primary: #1a1a1a;
    --text-secondary: #444;
    --text-muted: #777;
    --border-color: #d4d0c8;
    --border-dark: #1a1a1a;
    --accent: #1a1a1a;
    --accent-hover: #444;

    /* Bias colors */
    --bias-left: #3b82f6;
    --bias-lean-left: #60a5fa;
    --bias-center: #a855f7;
    --bias-lean-right: #f97316;
    --bias-right: #ef4444;
}

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

body {
    font-family: Georgia, 'Times New Roman', serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

/* ========================================
   HEADER / MASTHEAD
======================================== */
.site-header {
    background: var(--bg-secondary);
    border-bottom: 3px solid var(--border-dark);
    padding: 1rem 2rem;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.logo {
    display: block;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.logo:hover {
    text-decoration: none;
}

.logo h1 {
    font-family: 'Old English Text MT', 'Times New Roman', serif;
    font-size: 3.5rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    margin: 0;
}

.tagline {
    display: block;
    font-size: 0.85rem;
    font-style: italic;
    color: var(--text-muted);
    margin-top: 0.25rem;
    letter-spacing: 0.1em;
}

.dateline-rule {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 0.5rem 0 0 0;
}

.dateline {
    font-family: Georgia, serif;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
}

.main-nav {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.nav-link {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-secondary);
    padding: 0.4rem 0.8rem;
    border: 1px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
    background: var(--bg-primary);
    border-color: var(--border-color);
    text-decoration: none;
}

/* ========================================
   MAIN CONTENT
======================================== */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
}

/* ========================================
   FRONT PAGE - ABOVE THE FOLD
======================================== */
.above-fold {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 0;
    padding-bottom: 1.5rem;
    margin-bottom: 0;
}

.lead-story {
    padding-right: 1.5rem;
    border-right: 1px solid var(--border-color);
}

.lead-image {
    overflow: hidden;
    margin-bottom: 1rem;
    background: #e8e5de;
}

.lead-image img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
}

.lead-headline {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.lead-headline a:hover {
    text-decoration: none;
    opacity: 0.8;
}

.lead-summary {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.lead-meta {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.lead-meta .sep {
    color: var(--border-color);
}

.read-full {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
}

.read-full:hover {
    text-decoration: underline;
}

/* ========================================
   FRONT PAGE - SIDEBAR STORIES
======================================== */
.sidebar-stories {
    padding-left: 1.5rem;
    display: flex;
    flex-direction: column;
}

.sidebar-story {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sidebar-image {
    display: block;
    overflow: hidden;
    margin-bottom: 0.5rem;
    background: #e8e5de;
}

.sidebar-image img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

.sidebar-image:hover img {
    opacity: 0.9;
}

.sidebar-content {
    flex: 1;
}

.column-label {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.25rem;
}

.sidebar-headline {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.3rem;
}

.sidebar-headline a:hover {
    text-decoration: none;
    opacity: 0.8;
}

.sidebar-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 0.75rem 0;
}

/* ========================================
   FRONT PAGE - SECTION GRID (Below Fold)
======================================== */
.fold-rule {
    border: none;
    border-top: 2px solid var(--border-dark);
    margin: 1.5rem 0;
}

.section-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem 0;
}

.section-block {
    padding: 0 1.25rem;
    border-left: 1px solid var(--border-color);
}

.section-block:nth-child(3n+1) {
    padding-left: 0;
    border-left: none;
}

.section-block:nth-child(3n) {
    padding-right: 0;
}

.section-block:nth-child(n+4) {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

.section-header {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--border-dark);
}

.section-header a {
    color: var(--text-primary);
}

.section-header a:hover {
    text-decoration: none;
    opacity: 0.7;
}

.section-thumb {
    display: block;
    overflow: hidden;
    margin-bottom: 0.75rem;
    background: #e8e5de;
}

.section-thumb img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

.section-headlines {
    list-style: none;
    padding: 0;
    margin: 0 0 0.75rem 0;
}

.section-headlines li {
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border-color);
}

.section-headlines li:last-child {
    border-bottom: none;
}

.section-headlines li > a {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    display: block;
    color: var(--text-primary);
}

.section-headlines li > a:hover {
    text-decoration: none;
    opacity: 0.8;
}

.section-headlines .story-meta {
    display: block;
    margin-top: 0.15rem;
}

.section-more {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    display: block;
}

.section-more:hover {
    color: var(--text-primary);
}

/* ========================================
   SHARED STORY COMPONENTS
======================================== */
.story-headline {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 0.35rem;
}

.story-headline a {
    color: var(--text-primary);
}

.story-headline a:hover {
    text-decoration: none;
    opacity: 0.8;
}

.story-meta {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.7rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bias-indicators {
    display: inline-flex;
    gap: 3px;
}

.bias-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* ========================================
   COLUMN PAGE
======================================== */
.column-page .section-title {
    font-size: 2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--border-dark);
}

.stories-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.story-card-full {
    background: var(--bg-secondary);
    padding: 1.25rem;
    border: 1px solid var(--border-color);
}

.story-card-full .story-headline {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
}

.story-summary {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0.75rem 0;
    line-height: 1.6;
}

.bias-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.75rem 0;
}

.bias-pill {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    color: white;
}

.source-list {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0.5rem 0;
}

.source-label {
    font-weight: 600;
}

.source-name {
    color: var(--text-secondary);
}

.more-sources {
    color: var(--text-muted);
    font-style: italic;
}

.read-more {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
    margin-top: 0.5rem;
}

/* ========================================
   STORY DETAIL PAGE
======================================== */
.story-detail {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-secondary);
    padding: 2rem;
    border: 1px solid var(--border-color);
}

.story-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.story-header .story-headline {
    font-size: 1.75rem;
    line-height: 1.25;
    margin-bottom: 1rem;
}

.hero-image {
    margin: 0 0 1.5rem 0;
    overflow: hidden;
}

.hero-image img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    display: block;
}

.column-tag {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: var(--text-primary);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 2px;
}

.column-tag:hover {
    background: var(--text-secondary);
    color: white;
    text-decoration: none;
}

.story-content {
    margin-bottom: 1.5rem;
}

.story-content h3 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.summary-text {
    font-size: 1.05rem;
    line-height: 1.75;
    white-space: pre-wrap;
}

/* Bias Section */
.bias-section {
    margin: 1.5rem 0;
    padding: 1.25rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
}

.bias-section h3 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.bias-chart {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.bias-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.bias-label {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    width: 75px;
    text-align: right;
}

.bar-container {
    flex: 1;
    height: 18px;
    background: #e8e5de;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
}

.bias-count {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.75rem;
    color: var(--text-muted);
    width: 25px;
}

/* Sources Section */
.sources-section {
    margin: 1.5rem 0;
}

.sources-section h3 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.source-list-detailed {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.85rem;
    columns: 2;
    column-gap: 2rem;
    list-style: none;
}

.source-item {
    padding: 0.2rem 0;
    break-inside: avoid;
}

/* Articles Section */
.articles-section {
    margin: 1.5rem 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
}

.articles-section h3 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.articles-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.article-item {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.8rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.bias-pill.small {
    font-size: 0.6rem;
    padding: 0.15rem 0.3rem;
}

.article-link {
    flex: 1;
    min-width: 200px;
}

.article-source {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Story Footer */
.story-footer {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1.5rem;
}

.back-link {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.8rem;
}

/* ========================================
   ABOUT PAGE
======================================== */
.about-page {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-secondary);
    padding: 2rem;
    border: 1px solid var(--border-color);
}

.about-page .section-title {
    font-size: 2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--border-dark);
}

.about-content p {
    font-size: 1.05rem;
    line-height: 1.75;
    margin-bottom: 1.25rem;
    color: var(--text-secondary);
}

.about-content p:last-child {
    margin-bottom: 0;
}

/* ========================================
   SITE FOOTER
======================================== */
.site-footer {
    background: var(--bg-secondary);
    border-top: 2px solid var(--border-dark);
    padding: 1.5rem 2rem;
    text-align: center;
    margin-top: 2rem;
}

.site-footer p {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.8rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 0.75rem;
}

.bias-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.4rem;
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 900px) {
    .above-fold {
        grid-template-columns: 1fr;
    }

    .lead-story {
        padding-right: 0;
        border-right: none;
        padding-bottom: 1.5rem;
        border-bottom: 1px solid var(--border-color);
    }

    .lead-headline {
        font-size: 1.75rem;
    }

    .sidebar-stories {
        padding-left: 0;
        padding-top: 1rem;
    }

    .sidebar-story {
        flex-direction: row;
        gap: 1rem;
    }

    .sidebar-image {
        width: 140px;
        flex-shrink: 0;
        margin-bottom: 0;
    }

    .sidebar-image img {
        aspect-ratio: 4 / 3;
    }

    .section-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Reset 3-col rules for 2-col layout */
    .section-block {
        padding: 0 1.25rem;
        border-left: 1px solid var(--border-color);
        border-top: none;
        padding-top: 0;
    }

    .section-block:nth-child(3n+1) {
        padding-left: 0;
        border-left: none;
    }

    .section-block:nth-child(2n+1) {
        padding-left: 0;
        border-left: none;
    }

    .section-block:nth-child(2n) {
        padding-right: 0;
    }

    .section-block:nth-child(n+3) {
        border-top: 1px solid var(--border-color);
        padding-top: 1.5rem;
    }

    .stories-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .site-header {
        padding: 0.75rem 1rem;
    }

    .logo h1 {
        font-size: 2.25rem;
    }

    .main-nav {
        gap: 0;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-link {
        font-size: 0.6rem;
        padding: 0.3rem 0.5rem;
    }

    .main-content {
        padding: 1rem;
    }

    .lead-headline {
        font-size: 1.5rem;
    }

    .lead-summary {
        font-size: 0.95rem;
    }

    .sidebar-story {
        flex-direction: column;
    }

    .sidebar-image {
        width: 100%;
    }

    .sidebar-image img {
        aspect-ratio: 16 / 9;
    }

    .section-grid {
        grid-template-columns: 1fr;
    }

    .section-block {
        padding: 0 !important;
        border-left: none !important;
        border-top: none !important;
        padding-top: 0 !important;
        margin-bottom: 1.5rem;
        padding-bottom: 1.5rem !important;
        border-bottom: 1px solid var(--border-color);
    }

    .section-block:last-child {
        border-bottom: none;
        margin-bottom: 0;
    }

    .story-detail {
        padding: 1rem;
    }

    .source-list-detailed {
        columns: 1;
    }

    .story-footer {
        flex-direction: column;
        gap: 0.75rem;
    }

    .dateline {
        font-size: 0.7rem;
    }
}
