/* Insights Page Styles - SpaceX Design System */

/* Carousel - CSS-only using radio buttons */
.insight-carousel {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--space-gray-900) 0%, var(--space-black) 100%);
}

@media (width <= 768px) {
    .insight-carousel { height: 400px; }
}

.carousel-radio { display: none; }

.carousel-container {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity var(--transition-slow);
}

#slide-1:checked ~ .carousel-container .carousel-slide:nth-child(1),
#slide-2:checked ~ .carousel-container .carousel-slide:nth-child(2),
#slide-3:checked ~ .carousel-container .carousel-slide:nth-child(3),
#slide-4:checked ~ .carousel-container .carousel-slide:nth-child(4),
#slide-5:checked ~ .carousel-container .carousel-slide:nth-child(5) {
    opacity: 1;
}

.carousel-slide-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: brightness(0.4);
}

.carousel-slide-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
}

.carousel-slide-text {
    text-align: left;
    padding: var(--space-8);
    padding-bottom: var(--space-16);
    max-width: 800px;
}

.carousel-headline {
    font-size: var(--text-4xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    margin-bottom: var(--space-4);
    text-shadow: 0 2px 4px rgb(0 0 0 / 0.5);
    line-height: 1.2;
}

@media (width <= 768px) {
    .carousel-headline { font-size: var(--text-2xl); }
}

.carousel-subheadline {
    font-size: var(--text-xl);
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
    text-shadow: 0 1px 2px rgb(0 0 0 / 0.5);
}

@media (width <= 768px) {
    .carousel-subheadline { font-size: var(--text-lg); }
}

.carousel-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--spacex-blue-light);
    font-weight: var(--font-medium);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.carousel-link:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

/* Carousel Nav */
.carousel-nav {
    position: absolute;
    bottom: var(--space-6);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: var(--space-2);
    z-index: 10;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    background: rgb(255 255 255 / 0.4);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
}

.carousel-dot:hover { background: var(--text-primary); }

#slide-1:checked ~ .carousel-nav .carousel-dot:nth-child(1),
#slide-2:checked ~ .carousel-nav .carousel-dot:nth-child(2),
#slide-3:checked ~ .carousel-nav .carousel-dot:nth-child(3),
#slide-4:checked ~ .carousel-nav .carousel-dot:nth-child(4),
#slide-5:checked ~ .carousel-nav .carousel-dot:nth-child(5) {
    background: var(--text-primary);
    transform: scale(1.25);
}

/* Main Content */
.insight-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-12) var(--space-6);
}

@media (width <= 768px) {
    .insight-main { padding: var(--space-8) var(--space-4); }
}

/* Summary */
.insight-summary {
    background: var(--glass-bg);
    padding: var(--space-8);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    margin-bottom: var(--space-12);
}

.insight-summary-content {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    line-height: 1.8;
}

.insight-summary-content p { margin-bottom: var(--space-4); }
.insight-summary-content strong { color: var(--text-primary); }

.insight-summary-content ul, .insight-summary-content ol {
    margin: var(--space-4) 0;
    padding-left: var(--space-6);
}
.insight-summary-content li { margin-bottom: var(--space-2); }

/* Section Title */
.insight-section-title {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-3);
    border-bottom: 2px solid var(--border-color);
}

/* Results Grid */
.insight-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-10);
}

@media (width <= 768px) {
    .insight-results-grid { grid-template-columns: 1fr; }
}

.insight-result-card {
    background: var(--card-bg);
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.insight-result-card:hover {
    transform: var(--hover-lift-md);
    box-shadow: var(--shadow-xl);
}

.insight-result-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin-bottom: var(--space-3);
    line-height: 1.4;
}

.insight-result-title a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.insight-result-title a:hover { color: var(--spacex-blue-light); }

.insight-result-description {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    line-height: 1.6;
    margin-bottom: var(--space-3);
}

.insight-result-meta {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--text-muted);
    font-size: var(--text-xs);
}

.insight-result-source {
    padding: var(--space-1) var(--space-2);
    background: rgb(0 102 255 / 0.15);
    color: var(--spacex-blue-light);
    border-radius: var(--radius-sm);
    font-weight: var(--font-medium);
}

.insight-video-thumb {
    margin-bottom: var(--space-3);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.insight-video-thumb img {
    width: 100%;
    height: auto;
    display: block;
}

.insight-error {
    background: rgb(239 68 68 / 0.1);
    border: 1px solid rgb(239 68 68 / 0.3);
    color: var(--color-error);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-6);
}

.insight-empty {
    text-align: center;
    padding: var(--space-16) var(--space-6);
    color: var(--text-secondary);
}

.insight-fallback-hero {
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, var(--spacex-blue-dark) 0%, var(--space-black) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.insight-fallback-headline {
    font-size: var(--text-4xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    text-align: center;
    padding: var(--space-8);
    text-shadow: 0 2px 4px rgb(0 0 0 / 0.5);
}

/* ========================================
   Directory Page - Newspaper Style
   ======================================== */

.insights-directory {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

/* Hero Section with Featured Content */
.directory-hero {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    margin-bottom: var(--space-8);
}

@media (width <= 768px) {
    .directory-hero { height: 400px; }
}

.directory-hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: brightness(0.4);
}

.directory-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgb(0 0 0 / 0.9) 0%, transparent 60%);
}

.directory-hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-8);
    max-width: 800px;
}

.directory-hero-category {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    background: var(--spacex-blue);
    color: #ffffff;
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-3);
}

.directory-hero-headline {
    font-size: var(--text-4xl);
    font-weight: var(--font-bold);
    color: #ffffff;
    margin-bottom: var(--space-4);
    line-height: 1.2;
    text-shadow: 0 2px 4px rgb(0 0 0 / 0.5);
}

@media (width <= 768px) {
    .directory-hero-headline { font-size: var(--text-2xl); }
}

.directory-hero-summary {
    font-size: var(--text-lg);
    color: #b0b0b0;
    margin-bottom: var(--space-4);
    line-height: 1.6;
}

.directory-hero-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--spacex-blue-light);
    font-weight: var(--font-medium);
    text-decoration: none;
}

.directory-hero-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* Fallback Header */
.directory-header {
    text-align: center;
    margin-bottom: var(--space-8);
    padding: var(--space-12) var(--space-4);
    background: linear-gradient(135deg, var(--space-gray-900) 0%, var(--space-black) 100%);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
}

.directory-title {
    font-size: var(--text-5xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    margin-bottom: var(--space-4);
    letter-spacing: -0.02em;
}

@media (width <= 768px) {
    .directory-title { font-size: var(--text-3xl); }
}

.directory-description {
    font-size: var(--text-xl);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Main Content Layout */
.directory-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: var(--space-8);
    padding: 0 var(--space-6);
}

@media (width <= 1024px) {
    .directory-content {
        grid-template-columns: 1fr;
    }
}

.directory-main {
    min-width: 0;
}

/* Sidebar */

.sidebar-title {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: #ffffff;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 2px solid var(--spacex-blue);
}

.stories-feed {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.story-category {
    display: inline-block;
    font-size: var(--text-xs);
    color: var(--spacex-blue-light);
    font-weight: var(--font-medium);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-2);
}

.story-title {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    line-height: 1.4;
    margin-bottom: var(--space-2);
}

.story-title a {
    color: #ffffff !important;
    text-decoration: none;
}

.story-title a:hover {
    color: var(--spacex-blue-light) !important;
}

.story-source {
    font-size: var(--text-xs);
    color: #808080;
}

.stories-empty {
    text-align: center;
    padding: var(--space-8);
    color: #808080;
}

.stories-empty i {
    font-size: var(--text-2xl);
    margin-bottom: var(--space-3);
    display: block;
}

/* Topic Image */
.topic-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
}

.topic-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-base);
}

.topic-card:hover .topic-image img {
    transform: scale(1.05);
}

/* Topic Category Label */
.topic-category {
    display: inline-block;
    font-size: var(--text-xs);
    color: var(--spacex-blue-light);
    font-weight: var(--font-medium);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-2);
}

/* Topic Stats */
.topic-stats {
    display: flex;
    gap: var(--space-4);
    margin-top: var(--space-3);
    font-size: var(--text-xs);
    color: #808080;
}

.topic-stats span {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.topic-stats i {
    color: var(--spacex-blue-light);
}

/* Topics Grid - Newspaper Layout */
.topics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
}

@media (width <= 640px) {
    .topics-grid { grid-template-columns: 1fr; }
}

/* Featured card spans 2 columns */
.topic-card--featured {
    grid-column: span 2;
}

@media (width <= 640px) {
    .topic-card--featured { grid-column: span 1; }
}

.topic-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
    overflow: hidden;
}

.topic-card:hover {
    transform: var(--hover-lift-md);
    box-shadow: var(--shadow-xl);
    border-color: var(--spacex-blue);
}

.topic-link-wrapper {
    display: flex;
    flex-direction: column;
    padding: var(--space-6);
    height: 100%;
}

.topic-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: #ffffff;
    flex: 1;
}

.topic-link:hover {
    color: #ffffff;
}

.topic-card--featured .topic-link {
    flex-direction: column;
}

.topic-card--featured .topic-image {
    width: 100%;
    height: 280px;
    margin-bottom: var(--space-4);
}

.topic-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgb(0 102 255 / 0.1);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-4);
    flex-shrink: 0;
}

.topic-icon i {
    font-size: var(--text-2xl);
    color: #3399ff;
}

.topic-card--featured .topic-icon {
    width: 80px;
    height: 80px;
    margin-bottom: var(--space-4);
}

.topic-card--featured .topic-icon i {
    font-size: var(--text-3xl);
}

.topic-content {
    flex: 1;
    min-width: 0;
    width: 100%;
}

/* Force text visibility inside anchor links - override global a styles */
.topic-link .topic-title,
a.topic-link .topic-title {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: #ffffff !important;
    margin-bottom: var(--space-2);
    line-height: 1.3;
    display: block;
}

.topic-card--featured .topic-title {
    font-size: var(--text-2xl);
}

.topic-link .topic-description,
a.topic-link .topic-description {
    font-size: var(--text-sm);
    color: #b0b0b0 !important;
    margin-bottom: var(--space-4);
    line-height: 1.6;
    display: block;
}

.subtopic-list {
    list-style: none;
    padding: 0;
    margin: var(--space-4) 0 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.subtopic-list li {
    margin: 0;
}

.subtopic-link {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    background: var(--space-gray-800);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    color: #b0b0b0 !important;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.subtopic-link:hover {
    background: var(--spacex-blue);
    color: #ffffff !important;
}

.subtopic-more {
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    color: #808080 !important;
}

.topic-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--space-gray-800);
    border-radius: var(--radius-full);
    color: var(--text-muted);
    margin-top: auto;
    align-self: flex-end;
    transition: all var(--transition-fast);
}

.topic-card:hover .topic-arrow {
    background: var(--spacex-blue);
    color: var(--text-primary);
}

/* ========================================
   Vendor Intelligence Section
   ======================================== */

.vendor-intelligence {
    margin: var(--space-10) 0;
}

.vendor-intelligence .insight-section-title {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.vendor-intelligence .insight-section-title i {
    color: var(--spacex-blue-light);
}

.vendor-ratings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-6);
}

@media (width <= 768px) {
    .vendor-ratings-grid { grid-template-columns: 1fr; }
}

.vendor-rating-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.vendor-rating-card:hover {
    transform: var(--hover-lift-md);
    box-shadow: var(--shadow-xl);
}

/* Quadrant-specific border colors */
.vendor-rating-card.leader { border-left: 4px solid #22c55e; }
.vendor-rating-card.challenger { border-left: 4px solid #3b82f6; }
.vendor-rating-card.visionary { border-left: 4px solid #a855f7; }
.vendor-rating-card.niche { border-left: 4px solid #f59e0b; }

.vendor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.vendor-name {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
}

.quadrant-badge {
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.quadrant-badge.leader {
    background: rgb(34 197 94 / 0.15);
    color: #22c55e;
}

.quadrant-badge.challenger {
    background: rgb(59 130 246 / 0.15);
    color: #3b82f6;
}

.quadrant-badge.visionary {
    background: rgb(168 85 247 / 0.15);
    color: #a855f7;
}

.quadrant-badge.niche {
    background: rgb(245 158 11 / 0.15);
    color: #f59e0b;
}

.vendor-layer {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.layer-tag {
    padding: var(--space-1) var(--space-2);
    background: rgb(0 102 255 / 0.15);
    color: var(--spacex-blue-light);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
}

.layer-name {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.raasta-rating {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
}

.rating-value {
    font-size: var(--text-3xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
}

.rating-label {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.trajectory {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    width: fit-content;
}

.trajectory.rising {
    background: rgb(34 197 94 / 0.15);
    color: #22c55e;
}

.trajectory.declining {
    background: rgb(239 68 68 / 0.15);
    color: #ef4444;
}

.trajectory.stable {
    background: rgb(148 163 184 / 0.15);
    color: #94a3b8;
}

.trajectory.new-entrant {
    background: rgb(168 85 247 / 0.15);
    color: #a855f7;
}

.key-strength {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.mention-context {
    font-size: var(--text-xs);
    color: var(--text-muted);
    background: var(--space-gray-800);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    margin: 0;
}

.detail-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--spacex-blue-light);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    text-decoration: none;
    margin-top: auto;
    padding-top: var(--space-3);
    transition: color var(--transition-fast);
}

.detail-link:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

/* ========================================
   Companies Mentioned Section
   ======================================== */

.companies-section {
    margin: var(--space-10) 0;
}

.companies-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.company-tag {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    background: rgb(0 102 255 / 0.1);
    color: var(--spacex-blue-light);
    border: 1px solid rgb(0 102 255 / 0.2);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    transition: all var(--transition-fast);
}

.company-tag:hover {
    background: rgb(0 102 255 / 0.2);
    border-color: var(--spacex-blue-light);
}

/* ========================================
   Thesis Fit Summary Section
   ======================================== */

.pillar-scores-section {
    margin: var(--space-10) 0;
}

.thesis-summary {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
}

.thesis-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3);
}

.thesis-score-label {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
}

.thesis-score-value {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--spacex-blue-light);
}

.pillar-bar {
    width: 100%;
    height: 6px;
    background: var(--space-gray-800);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--space-3);
}

.pillar-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--spacex-blue) 0%, var(--spacex-blue-light) 100%);
    border-radius: var(--radius-full);
    transition: width 0.6s ease;
}

.thesis-top-pillars {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.thesis-pillar-chip {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    background: rgb(0 102 255 / 0.1);
    color: var(--spacex-blue-light);
    border: 1px solid rgb(0 102 255 / 0.2);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
}

.thesis-rationale {
    font-size: var(--text-sm);
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
}

/* ========================================
   Reader Page - Article Rewrite View
   ======================================== */

.reader-breadcrumb {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-6) var(--space-6) 0;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--text-muted);
    flex-wrap: wrap;
}

.reader-breadcrumb a {
    color: var(--spacex-blue-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

.reader-breadcrumb-sep {
    color: var(--text-muted);
}

.reader-breadcrumb-current {
    color: var(--text-secondary);
}

/* Reader Layout - Article + Sidebar */
.reader-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-8) var(--space-6);
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: var(--space-8);
}

@media (width <= 1024px) {
    .reader-layout {
        grid-template-columns: 1fr;
    }
}

/* Article */
.reader-article {
    min-width: 0;
}

.reader-relevance-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: rgb(0 102 255 / 0.1);
    border: 1px solid rgb(0 102 255 / 0.2);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    color: var(--spacex-blue-light);
    margin-bottom: var(--space-6);
}

.reader-title {
    font-size: var(--text-3xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: var(--space-8);
}

@media (width <= 768px) {
    .reader-title { font-size: var(--text-2xl); }
}

/* Hero Image */
.reader-hero-image {
    margin-bottom: var(--space-8);
    border-radius: 8px;
    overflow: hidden;
}

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

.reader-body {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    line-height: 1.8;
}

.reader-body p { margin-bottom: var(--space-6); }
.reader-body strong { color: var(--text-primary); }

.reader-body ul, .reader-body ol {
    margin: var(--space-4) 0;
    padding-left: var(--space-6);
}

.reader-body li { margin-bottom: var(--space-2); }

.reader-body h2 {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    margin: var(--space-10) 0 var(--space-4);
}

.reader-body h3 {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin: var(--space-8) 0 var(--space-3);
}

.reader-body blockquote {
    border-left: 3px solid var(--spacex-blue);
    padding-left: var(--space-4);
    margin: var(--space-6) 0;
    color: var(--text-muted);
    font-style: italic;
}

/* Source Attribution */
.reader-source {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-10);
    padding-top: var(--space-6);
    border-top: 1px solid var(--border-color);
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.reader-source a {
    color: var(--spacex-blue-light);
    text-decoration: none;
}

.reader-source a:hover {
    text-decoration: underline;
}

/* Sidebar */
.reader-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

@media (width <= 1024px) {
    .reader-sidebar {
        position: static;
    }
}

.reader-sidebar-title {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    margin-bottom: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.reader-sidebar-title i {
    color: var(--spacex-blue-light);
}

/* Key Takeaways */
.reader-takeaways {
    background: var(--glass-bg);
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
}

.reader-takeaways-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.reader-takeaways-list li {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.6;
    padding-left: var(--space-5);
    position: relative;
}

.reader-takeaways-list li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: var(--spacex-blue-light);
    font-size: var(--text-xs);
    font-weight: 700;
}

/* Companies */
.reader-companies {
    background: var(--card-bg);
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.reader-companies-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

/* Back Link */
.reader-back-link a {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--spacex-blue-light);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.reader-back-link a:hover {
    color: var(--text-primary);
}

/* Error State */
.reader-error-container {
    max-width: 600px;
    margin: var(--space-16) auto;
    padding: var(--space-12);
    text-align: center;
}

.reader-error-icon {
    font-size: var(--text-4xl);
    color: var(--text-muted);
    margin-bottom: var(--space-6);
}

.reader-error-title {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    margin-bottom: var(--space-4);
}

.reader-error-message {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    margin-bottom: var(--space-8);
    line-height: 1.6;
}

.reader-error-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    background: var(--spacex-blue);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: var(--font-medium);
    transition: background var(--transition-fast);
}

.reader-error-link:hover {
    background: var(--spacex-blue-light);
}

/* ========================================
   Directory Timeline Page
   ======================================== */

.directory-timeline-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-6) var(--space-12);
}

.directory-timeline-section {
    margin-bottom: var(--space-12);
}

.directory-timeline-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--space-6);
}

@media (width <= 768px) {
    .directory-timeline-grid { grid-template-columns: 1fr; }
}

.directory-timeline-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-fast);
}

.directory-timeline-card:hover {
    transform: var(--hover-lift-md);
    box-shadow: var(--shadow-xl);
    border-color: var(--spacex-blue);
}

.directory-timeline-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.directory-timeline-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.directory-timeline-body {
    padding: var(--space-5);
}

.directory-timeline-badge {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    background: rgb(0 102 255 / 0.15);
    color: var(--spacex-blue-light);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-3);
}

.directory-timeline-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin-bottom: var(--space-3);
    line-height: 1.4;
}

.directory-timeline-title a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.directory-timeline-title a:hover {
    color: var(--spacex-blue-light);
}

.directory-timeline-relevance {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-3);
}

.directory-timeline-snippet {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-3);
}

.directory-timeline-date {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

/* News Feed - Infinite Scroll */
.news-feed-sentinel {
    grid-column: 1 / -1;
}

.news-feed-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--space-8);
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.news-feed-loading i {
    margin-right: var(--space-2);
}

/* ========================================
   Infinite Scroll / Continuous Reading
   ======================================== */

/* Article blocks for infinite scroll */
.reader-article-block {
    position: relative;
    margin: var(--space-12) 0;
    scroll-margin-top: var(--space-16); /* Account for fixed header */
}

/* Separator between articles */
.article-separator {
    border: 0;
    border-top: 1px solid var(--glass-border);
    margin: var(--space-16) 0;
    opacity: 0.3;
}

/* Infinite scroll trigger container */
.article-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    padding: var(--space-8) 0;
    margin: var(--space-8) 0;
}

/* Loading indicator */
.loading-next-article {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--spacex-blue-light);
    font-size: var(--text-base);
    padding: var(--space-4) var(--space-6);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    transition: opacity var(--transition-base);
}

.loading-next-article i {
    font-size: var(--text-lg);
}

/* Hide loading indicator when HTMX finishes (via htmx:afterSwap) */
.article-divider.htmx-swapping .loading-next-article {
    opacity: 0.5;
}

/* No more articles message */
.no-more-articles {
    text-align: center;
    padding: var(--space-8);
    color: var(--text-tertiary);
    font-size: var(--text-sm);
    font-style: italic;
}

/* Mobile responsive */
@media (width <= 768px) {
    .reader-article-block {
        margin: var(--space-8) 0;
    }

    .article-separator {
        margin: var(--space-8) 0;
    }

    .article-divider {
        min-height: 80px;
        padding: var(--space-6) 0;
    }
}

/* ========================================
   Thesis Evolution Timeline
   ======================================== */

.evolution-timeline {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-12) var(--space-6);
}

/* Current Thesis Card */
.current-thesis {
    background: linear-gradient(135deg, var(--spacex-blue-dark) 0%, var(--spacex-blue) 100%);
    padding: var(--space-10);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-12);
    border: 2px solid var(--spacex-blue-light);
}

.current-badge {
    display: inline-block;
    padding: var(--space-2) var(--space-4);
    background: rgb(255 255 255 / 0.2);
    color: var(--text-primary);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-4);
}

.current-statement {
    font-size: var(--text-2xl);
    color: var(--text-primary);
    line-height: 1.5;
    margin-bottom: var(--space-6);
}

.current-meta {
    display: flex;
    gap: var(--space-6);
    font-size: var(--text-sm);
    color: rgb(255 255 255 / 0.8);
}

.current-meta-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* Timeline Container */
.timeline-container {
    position: relative;
    padding-left: var(--space-12);
}

.timeline-line {
    position: absolute;
    left: 23px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--spacex-blue), transparent);
}

.evolution-entry {
    position: relative;
    margin-bottom: var(--space-12);
}

.evolution-entry:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -37px;
    top: 8px;
    width: 16px;
    height: 16px;
    background: var(--spacex-blue);
    border: 3px solid var(--space-black);
    border-radius: var(--radius-full);
    box-shadow: 0 0 0 3px rgb(0 102 255 / 0.3);
}

.evolution-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    transition: all var(--transition-fast);
}

.evolution-card:hover {
    border-color: var(--spacex-blue);
    box-shadow: var(--shadow-xl);
}

.evolution-version {
    font-size: var(--text-sm);
    color: var(--spacex-blue-light);
    font-weight: var(--font-bold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-3);
}

.evolution-statement {
    font-size: var(--text-xl);
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: var(--space-6);
}

.evolution-rationale {
    background: var(--space-gray-900);
    padding: var(--space-4);
    border-left: 3px solid var(--spacex-blue);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-6);
}

.evolution-rationale-label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: var(--font-bold);
    margin-bottom: var(--space-2);
}

.evolution-rationale-text {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.6;
}

.evolution-stats {
    display: flex;
    gap: var(--space-6);
    margin-bottom: var(--space-6);
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.evolution-stat {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.proof-points-section {
    margin-top: var(--space-6);
    padding-top: var(--space-6);
    border-top: 1px solid var(--border-color);
}

.proof-points-title {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin-bottom: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.proof-points-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-4);
}

.proof-point-card {
    background: var(--space-gray-900);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.proof-point-card:hover {
    border-color: var(--spacex-blue-light);
    transform: var(--hover-lift-sm);
}

.proof-point-claim {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: var(--space-3);
}

.proof-point-source {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.proof-point-source a {
    color: var(--spacex-blue-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.proof-point-source a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.relevance-badge {
    display: inline-block;
    padding: var(--space-1) var(--space-2);
    background: rgb(0 102 255 / 0.15);
    color: var(--spacex-blue-light);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
}

@media (width <= 768px) {
    .current-statement {
        font-size: var(--text-xl);
    }

    .current-meta {
        flex-direction: column;
        gap: var(--space-2);
    }

    .timeline-container {
        padding-left: var(--space-8);
    }

    .timeline-dot {
        left: -33px;
    }

    .proof-points-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Directory Sidebar (from insights/directory.html) ── */

.directory-sidebar {
  position: fixed;
  right: 0;
  top: 100px;
  width: 320px;
  height: calc(100vh - 100px);
  overflow-y: auto;
  padding: var(--space-6);
  background: var(--space-gray-800);
  border-left: 1px solid var(--glass-border);
}

.directory-sidebar__title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.story-card {
  padding: var(--space-3);
  background: var(--space-dark);
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  margin-bottom: var(--space-3);
  transition: border-color 0.2s ease;
}

.story-card:hover {
  border-color: var(--spacex-blue);
}

.story-card__category {
  font-size: var(--text-xs);
  color: var(--spacex-blue);
  font-weight: 600;
}

.story-card__title {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
  margin-top: var(--space-1);
  line-height: 1.4;
}

.story-card__title a {
  color: var(--text-primary);
  text-decoration: none;
}

.story-card__title a:hover {
  color: var(--spacex-blue);
}

.story-card__source {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-top: var(--space-1);
  display: block;
}

@media (width <= 1400px) {
  .directory-sidebar {
    display: none;
  }
}

/* ── Inline Citation (from insights/qa_answer.html) ── */

.inline-citation {
    color: var(--spacex-blue);
    font-weight: 700;
    background: rgba(0, 112, 243, 0.1);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.inline-citation:hover {
    color: var(--spacex-blue-bright);
    background: rgba(0, 112, 243, 0.2);
    text-decoration-thickness: 3px;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* ── Analysis Error (from insights/analysis_error.html) ── */

.analysis-error {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: var(--space-6);
}

.error-card {
    max-width: 500px;
    text-align: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
}

.error-icon {
    font-size: 4rem;
    color: var(--color-warning);
    margin-bottom: var(--space-4);
}

.error-card h1 {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    margin-bottom: var(--space-4);
}

.error-message {
    color: var(--text-secondary);
    margin-bottom: var(--space-6);
}

.error-stats {
    background: var(--space-gray-900);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin-bottom: var(--space-6);
}

.error-stats .stat {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.error-stats .stat-value {
    font-size: var(--text-3xl);
    font-weight: var(--font-bold);
    color: var(--color-warning);
}

.error-stats .stat-label {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.error-stats .stat-note {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: var(--space-2);
}

.error-actions {
    text-align: left;
}

.error-actions h3 {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-3);
}

.error-actions ol {
    margin: 0 0 var(--space-6) var(--space-4);
    padding: 0;
}

.error-actions li {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
}

.error-actions a {
    color: var(--spacex-blue);
}
