/* 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;

    /* Region colors (sports) */
    --region-us: #3b82f6;
    --region-canada: #ef4444;
    --region-mexico: #22c55e;
    --region-uk: #6366f1;
    --region-australia: #eab308;
    --region-india: #f97316;
    --region-japan: #ec4899;
    --region-korea: #14b8a6;
    --region-international: #8b5cf6;

    /* Perspective colors (tech) */
    --perspective-consumer: #3b82f6;
    --perspective-enterprise: #f97316;
    --perspective-academic: #a855f7;
    --perspective-culture: #22c55e;

    /* Misc */
    --img-placeholder: #e8e5de;
    --bar-bg: #e8e5de;
    --nav-bg: #fff;
    --nav-btn-bg: #1a1a1a;
    --nav-btn-color: #fff;
    --nav-btn-hover-bg: #444;
    --nav-disabled-border: #e0e0e0;
    --hint-bg: rgba(0,0,0,0.6);
    --hint-color: #fff;
    --link-stroke: #bbb;
    --node-stroke: #fff;
    --matrix-low: #e8e4f0;
    --matrix-mid: #d97706;
    --matrix-high: #7e22ce;
    --shadow-color: rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #242424;
    --text-primary: #e8e5de;
    --text-secondary: #b0ada6;
    --text-muted: #888;
    --border-color: #3a3a3a;
    --border-dark: #e8e5de;
    --accent: #e8e5de;
    --accent-hover: #b0ada6;

    --img-placeholder: #2a2a2a;
    --bar-bg: #333;
    --nav-bg: #242424;
    --nav-btn-bg: #e8e5de;
    --nav-btn-color: #1a1a1a;
    --nav-btn-hover-bg: #b0ada6;
    --nav-disabled-border: #3a3a3a;
    --hint-bg: rgba(255,255,255,0.7);
    --hint-color: #1a1a1a;
    --link-stroke: #555;
    --node-stroke: #242424;
    --matrix-low: #2a2a3a;
    --matrix-mid: #d97706;
    --matrix-high: #a855f7;
    --shadow-color: rgba(0, 0, 0, 0.5);
}

* {
    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;
    align-items: center;
    gap: 0.25rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.theme-toggle {
    background: none;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.3rem 0.5rem;
    color: var(--text-muted);
    line-height: 1;
    transition: color 0.15s;
    margin-left: 0.25rem;
}

.theme-toggle:hover {
    color: var(--text-primary);
    border-color: 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: var(--img-placeholder);
}

.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: var(--img-placeholder);
}

.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: var(--img-placeholder);
}

.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;
}

.story-timing {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    gap: 1rem;
    margin-top: 0.4rem;
}

.timing-item {
    font-weight: 600;
    letter-spacing: 0.02em;
}

time.timeago,
time.timeago-full {
    font-weight: 400;
}

.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);
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.sort-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.sort-btn {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.sort-btn:hover {
    border-color: var(--border-dark);
    color: var(--text-primary);
}

.sort-btn.active {
    background: var(--text-primary);
    color: var(--bg-secondary);
    border-color: var(--text-primary);
}

.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,
.region-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;
}

.photo-credit {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 0.3rem 0;
    font-style: italic;
}

.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;
}

/* Article & analysis prose typography */
.article-text p,
.analysis-text p {
    font-size: 1.05rem;
    line-height: 1.75;
    margin-bottom: 1.75em;
}

.article-text p:last-child,
.analysis-text p:last-child {
    margin-bottom: 0;
}

.article-text ul,
.article-text ol,
.analysis-text ul,
.analysis-text ol {
    font-size: 1.05rem;
    line-height: 1.75;
    margin: 0.75rem 0 1rem 0;
    padding-left: 1.5rem;
    list-style-position: outside;
}

.article-text li,
.analysis-text li {
    margin-bottom: 0.4rem;
}

.article-text li:last-child,
.analysis-text li:last-child {
    margin-bottom: 0;
}

.article-text blockquote,
.analysis-text blockquote {
    border-left: 3px solid var(--border-color);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--text-secondary);
    font-style: italic;
}

.article-text h4,
.analysis-text h4 {
    font-size: 1rem;
    font-weight: 700;
    margin: 1.25rem 0 0.5rem;
}

.article-text strong,
.analysis-text strong {
    font-weight: 700;
}

/* 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: var(--bar-bg);
    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 TABS
======================================== */
.story-tabs {
    margin-bottom: 1.5rem;
}

.tab-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.tab-bar {
    display: flex;
    border-bottom: 2px solid var(--border-dark);
    margin-bottom: 1.5rem;
    gap: 0;
}

.tab-label {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.6rem 1.25rem;
    cursor: pointer;
    color: var(--text-muted);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
    user-select: none;
}

.tab-label:hover {
    color: var(--text-secondary);
}

/* Active tab highlighting via :checked sibling selectors */
#tab-article:checked ~ .tab-bar label[for="tab-article"],
#tab-analysis:checked ~ .tab-bar label[for="tab-analysis"],
#tab-sources:checked ~ .tab-bar label[for="tab-sources"] {
    color: var(--text-primary);
    border-bottom-color: var(--text-primary);
}

/* Tab panel visibility */
.tab-panel {
    display: none;
}

#tab-article:checked ~ #panel-article,
#tab-analysis:checked ~ #panel-analysis,
#tab-sources:checked ~ #panel-sources {
    display: block;
}

/* ========================================
   SIMILARITY WEB
======================================== */
.similarity-section {
    margin-bottom: 1.5rem;
}

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

.similarity-caption {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-style: italic;
}

#similarity-web {
    position: relative;
    width: 100%;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    border-radius: 2px;
    overflow: hidden;
}

#similarity-web svg {
    display: block;
}

.sim-label {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 11px;
    fill: var(--text-secondary);
    pointer-events: none;
    transition: opacity 0.2s;
}

.sim-tooltip {
    position: absolute;
    padding: 0.5rem 0.75rem;
    background: var(--text-primary);
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.75rem;
    line-height: 1.4;
    border-radius: 3px;
    pointer-events: none;
    max-width: 260px;
    z-index: 10;
    transition: opacity 0.15s;
}

.sim-info-panel {
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary, #f5f5f0);
    border-top: 1px solid var(--border-color);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--text-primary);
}

.sim-info-connections {
    color: var(--text-secondary);
}

.sim-zoom-hint {
    position: absolute;
    bottom: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.35rem 0.75rem;
    background: var(--hint-bg);
    color: var(--hint-color);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.7rem;
    border-radius: 12px;
    pointer-events: none;
    white-space: nowrap;
    z-index: 10;
}

.sim-node {
    cursor: grab;
}

.sim-node:active {
    cursor: grabbing;
}

/* ── Adjacency Matrix (mobile) ── */
.sim-matrix-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem 0;
}

.sim-matrix {
    display: inline-block;
}

.sim-matrix-header-row {
    display: flex;
    align-items: flex-end;
}

.sim-matrix-corner {
    flex-shrink: 0;
    width: 80px;
    height: 60px;
}

.sim-matrix-col-header {
    flex-shrink: 0;
    width: 28px;
    height: 60px;
    position: relative;
}

.sim-matrix-col-header span {
    display: block;
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform-origin: bottom left;
    transform: rotate(-45deg);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 9px;
    white-space: nowrap;
    font-weight: 600;
}

.sim-matrix-row {
    display: flex;
    align-items: center;
}

.sim-matrix-row-header {
    flex-shrink: 0;
    width: 80px;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 9px;
    font-weight: 600;
    text-align: right;
    padding-right: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sim-matrix-cell {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: outline 0.1s;
}

.sim-matrix-cell:hover,
.sim-matrix-cell-active {
    outline: 2px solid var(--text-primary);
    outline-offset: -2px;
    z-index: 1;
}

@media (max-width: 600px) {
    .sim-info-panel {
        font-size: 0.7rem;
        padding: 0.4rem 0.6rem;
    }
}

/* 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;
    }

    .tab-bar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tab-label {
        font-size: 0.7rem;
        padding: 0.5rem 0.75rem;
        white-space: nowrap;
    }

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

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

    .dateline {
        font-size: 0.7rem;
    }
}
/* ========================================
   PODCAST PLAYER STRIP (Front Page)
======================================== */
.podcast-strip {
    border: 1px solid var(--border-color);
    border-top: 2px solid var(--text-primary);
    border-bottom: 2px solid var(--text-primary);
    padding: 0.6rem 1rem;
    margin-bottom: 1.5rem;
    background: var(--bg-color);
}

.ps-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.4rem;
}

.ps-section-label {
    font-family: 'Old English Text MT', 'Times New Roman', serif;
    font-size: 1rem;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}

.ps-archive {
    font-family: Georgia, serif;
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.ps-archive:hover {
    color: var(--text-primary);
    text-decoration: none;
}

.ps-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ps-play-btn {
    background: var(--text-primary);
    border: none;
    color: var(--bg-color);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.15s;
    padding: 0 0 0 3px;
    line-height: 1;
}

.ps-play-btn:hover {
    opacity: 0.75;
}

.ps-track {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.ps-title {
    font-family: Georgia, serif;
    font-size: 0.8rem;
    font-style: italic;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ps-progress-wrap {
    height: 3px;
    background: var(--border-color);
    cursor: pointer;
    min-width: 60px;
}

.ps-progress-bar {
    height: 100%;
    background: var(--text-primary);
    width: 0%;
    transition: width 0.1s linear;
}

.ps-time {
    font-family: Georgia, serif;
    font-size: 0.7rem;
    color: var(--text-muted);
    flex-shrink: 0;
    min-width: 3em;
    text-align: right;
}

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

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

.podcast-featured {
    margin-bottom: 1.5rem;
}

.featured-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.podcast-player {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-primary);
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
}

.player-play-btn {
    background: var(--text-primary);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0 0 0 2px;
    transition: background 0.15s;
}

.player-play-btn:hover {
    background: var(--accent-hover);
}

.player-progress-wrap {
    flex: 1;
    height: 6px;
    background: var(--border-color);
    cursor: pointer;
    border-radius: 3px;
}

.player-progress-bar {
    height: 100%;
    background: var(--text-primary);
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
}

.player-time {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-shrink: 0;
    min-width: 3em;
    text-align: right;
}

.podcast-subscribe {
    margin-bottom: 1.5rem;
}

.subscribe-link {
    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(--text-primary);
    border: 1px solid var(--border-dark);
    padding: 0.4rem 0.8rem;
    display: inline-block;
}

.subscribe-link:hover {
    background: var(--text-primary);
    color: #fff;
    text-decoration: none;
}

.archive-heading {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.episode-table {
    width: 100%;
    border-collapse: collapse;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.85rem;
}

.episode-table th {
    text-align: left;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding: 0.5rem 0.75rem;
    border-bottom: 2px solid var(--border-dark);
}

.episode-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.ep-date {
    white-space: nowrap;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.ep-duration {
    white-space: nowrap;
    color: var(--text-muted);
    text-align: center;
}

.play-link {
    font-weight: 600;
    font-size: 0.8rem;
    white-space: nowrap;
}

/* ========================================
   PODCAST RESPONSIVE
======================================== */
@media (max-width: 600px) {
    .podcast-strip {
        padding: 0.5rem 0.75rem;
    }

    .ps-section-label {
        font-size: 0.85rem;
    }

    .ps-title {
        font-size: 0.7rem;
    }

    .podcast-page {
        padding: 1rem;
    }

    .episode-table th:first-child,
    .episode-table td:first-child {
        display: none;
    }
}

/* ========================================
   MOBILE STORY NAVIGATION (PWA)
======================================== */
.story-navigation {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex !important;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--nav-bg);
    border-top: 2px solid var(--border-dark);
    box-shadow: 0 -2px 10px var(--shadow-color);
    z-index: 100;
    margin-top: 2rem;
    margin-left: -2rem;
    margin-right: -2rem;
    margin-bottom: -2rem;
    padding-left: 2rem;
    padding-right: 2rem;
}

.story-nav-btn {
    flex: 1;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    background: var(--nav-btn-bg);
    color: var(--nav-btn-color);
    border: 2px solid var(--nav-btn-bg);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    user-select: none;
}

.story-nav-btn:hover {
    background: var(--nav-btn-hover-bg);
    color: var(--nav-btn-color);
    text-decoration: none;
    border-color: var(--nav-btn-hover-bg);
}

.story-nav-btn:active {
    transform: scale(0.98);
}

.story-nav-prev,
.story-nav-next {
    flex: 1.2;
}

.story-nav-column {
    flex: 0.8;
    font-size: 0.8rem;
}

.story-nav-disabled {
    background: transparent !important;
    border-color: var(--nav-disabled-border) !important;
    opacity: 0;
    cursor: not-allowed;
    pointer-events: none;
}

.nav-icon {
    font-size: 1.1rem;
    font-weight: 700;
}

.nav-label {
    display: inline;
}

/* Mobile optimizations */
@media (max-width: 600px) {
    .story-navigation {
        padding: 0.5rem;
        gap: 0.4rem;
    }

    .story-nav-btn {
        padding: 0.6rem 0.75rem;
        font-size: 0.85rem;
    }

    .story-nav-column {
        font-size: 0.75rem;
    }

    /* Hide labels on very small screens, keep icons */
    .nav-label {
        display: none;
    }

    .nav-icon {
        display: inline;
        font-size: 1.3rem;
    }

    .story-nav-column .nav-label {
        display: inline; /* Keep column label */
    }

    /* Hide footer back links on mobile (navigation replaces them) */
    .story-footer {
        display: none;
    }
}

/* Larger screens - show both navigation and footer */
@media (min-width: 601px) {
    .story-navigation {
        position: relative;
        margin-bottom: 0;
        border-top: 1px solid var(--border-color);
        border-bottom: 1px solid var(--border-color);
    }
}
