/* ============================================
   TINSEL NEWS — Visual Component Library
   v1.0.0 — Inline article visual elements

   Design tokens inherited from existing visuals:
   - accent-red: #d63031 (matches --signal in style.css)
   - accent-gold: #b08d3a (established in Sudan series visuals)
   - surface: #ffffff, surface-alt: #f2f0ec
   - border: #e5e2dd
   - Playfair Display for numbers/titles
   - DM Sans for body/labels
   ============================================ */

/* --- VISUAL COMPONENT VARIABLES --- */
:root {
  --tn-accent-red: #d63031;
  --tn-accent-gold: #b08d3a;
  --tn-surface: #ffffff;
  --tn-surface-alt: #f2f0ec;
  --tn-border: #e5e2dd;
  --tn-text: #1a1a1a;
  --tn-text-muted: #666;
  --tn-text-dim: #999;
  --tn-bg-dark: #0a0a0a;
  --tn-font-display: 'Playfair Display', Georgia, serif;
  --tn-font-body: 'DM Sans', -apple-system, sans-serif;
  --tn-font-mono: 'JetBrains Mono', monospace;
}

/* ============================================
   1. STAT STRIP — Row of key statistics
   Usage: 2-4 statistics in a horizontal grid
   ============================================ */
.tn-stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: var(--tn-border);
  border: 1px solid var(--tn-border);
  margin: 32px 0;
}

.tn-stat-strip .tn-stat {
  background: var(--tn-surface);
  padding: 28px 20px;
  text-align: center;
}

.tn-stat-strip .tn-stat-number {
  font-family: var(--tn-font-display);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 900;
  color: var(--tn-accent-red);
  line-height: 1;
  margin-bottom: 2px;
}

.tn-stat-strip .tn-stat-number.gold {
  color: var(--tn-accent-gold);
}

.tn-stat-strip .tn-stat-unit {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--tn-text-dim);
  font-weight: 600;
  margin-bottom: 6px;
}

.tn-stat-strip .tn-stat-label {
  font-size: 12px;
  color: var(--tn-text-muted);
  line-height: 1.4;
}

/* ============================================
   2. STAT BOX — Single featured statistic
   Usage: One key number with context
   ============================================ */
.tn-stat-box {
  background: var(--tn-surface);
  border: 1px solid var(--tn-border);
  border-left: 3px solid var(--tn-accent-red);
  padding: 24px 28px;
  margin: 32px 0;
}

.tn-stat-box .tn-stat-number {
  font-family: var(--tn-font-display);
  font-size: 36px;
  font-weight: 900;
  color: var(--tn-accent-red);
  line-height: 1;
  margin-bottom: 4px;
}

.tn-stat-box .tn-stat-number.gold {
  color: var(--tn-accent-gold);
}

.tn-stat-box .tn-stat-context {
  font-size: 14px;
  color: var(--tn-text-muted);
  line-height: 1.5;
}

.tn-stat-box .tn-stat-source {
  font-size: 11px;
  color: var(--tn-text-dim);
  margin-top: 8px;
  font-style: italic;
}

/* ============================================
   3. INFO PANEL — Context/background box
   Usage: Key context, definitions, background
   ============================================ */
.tn-info-panel {
  background: var(--tn-surface);
  border: 1px solid var(--tn-border);
  padding: 24px 28px;
  margin: 32px 0;
}

.tn-info-panel .tn-info-label {
  font-family: var(--tn-font-body);
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--tn-accent-red);
  font-weight: 600;
  margin-bottom: 10px;
}

.tn-info-panel .tn-info-title {
  font-family: var(--tn-font-display);
  font-size: 20px;
  font-weight: 900;
  color: var(--tn-text);
  margin-bottom: 4px;
}

.tn-info-panel .tn-info-subtitle {
  font-size: 13px;
  color: var(--tn-text-dim);
  margin-bottom: 16px;
  font-style: italic;
}

.tn-info-panel .tn-info-body {
  font-size: 14px;
  color: var(--tn-text-muted);
  line-height: 1.65;
}

.tn-info-panel .tn-info-body p {
  margin-bottom: 0.8em;
}

.tn-info-panel .tn-info-body p:last-child {
  margin-bottom: 0;
}

/* ============================================
   4. PULL QUOTE — Large editorial pull quote
   Usage: Key quote from source or editorial voice
   ============================================ */
.tn-pull-quote {
  margin: 40px 0;
  padding: 0;
  text-align: center;
  border: none;
}

.tn-pull-quote .tn-quote-text {
  font-family: var(--tn-font-display);
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 700;
  font-style: italic;
  color: var(--tn-text);
  line-height: 1.35;
  margin-bottom: 12px;
  position: relative;
}

.tn-pull-quote .tn-quote-text::before {
  content: '\201C';
  font-size: 3em;
  color: var(--tn-accent-red);
  position: absolute;
  top: -0.3em;
  left: -0.15em;
  line-height: 1;
  opacity: 0.25;
}

.tn-pull-quote .tn-quote-attribution {
  font-family: var(--tn-font-body);
  font-size: 13px;
  color: var(--tn-text-dim);
  letter-spacing: 0.5px;
}

/* ============================================
   5. TIMELINE — Vertical timeline with events
   Usage: Chronological sequence of events
   ============================================ */
.tn-timeline {
  margin: 32px 0;
  border: 1px solid var(--tn-border);
  background: var(--tn-surface);
  padding: 28px;
}

.tn-timeline .tn-timeline-title {
  font-family: var(--tn-font-display);
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 4px;
}

.tn-timeline .tn-timeline-subtitle {
  font-size: 12px;
  color: var(--tn-text-dim);
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--tn-border);
}

.tn-timeline-entry {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--tn-border);
  position: relative;
}

.tn-timeline-entry:last-child {
  border-bottom: none;
}

.tn-timeline-entry .tn-timeline-date {
  font-family: var(--tn-font-display);
  font-size: 16px;
  font-weight: 900;
  color: var(--tn-accent-gold);
  padding-top: 2px;
}

.tn-timeline-entry .tn-timeline-event {
  font-size: 14px;
  color: var(--tn-text);
  line-height: 1.55;
}

.tn-timeline-entry .tn-timeline-event strong {
  font-weight: 700;
  color: var(--tn-text);
}

.tn-timeline-entry .tn-timeline-detail {
  font-size: 13px;
  color: var(--tn-text-muted);
  margin-top: 4px;
  line-height: 1.5;
}

/* Compact variant for short timelines */
.tn-timeline.compact .tn-timeline-entry {
  padding: 10px 0;
}

.tn-timeline.compact .tn-timeline-date {
  font-size: 14px;
}

/* ============================================
   6. COMPARISON TABLE — Side-by-side comparison
   Usage: Two opposing concepts/frameworks/policies
   ============================================ */
.tn-comparison {
  margin: 32px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--tn-border);
  border: 1px solid var(--tn-border);
}

.tn-comparison .tn-compare-col {
  background: var(--tn-surface);
  padding: 24px;
}

.tn-comparison .tn-compare-col.failing {
  border-top: 3px solid var(--tn-accent-red);
}

.tn-comparison .tn-compare-col.positive {
  border-top: 3px solid var(--tn-accent-gold);
}

.tn-comparison .tn-compare-heading {
  font-family: var(--tn-font-display);
  font-size: 16px;
  font-weight: 900;
  margin-bottom: 4px;
}

.tn-comparison .tn-compare-subtitle {
  font-size: 11px;
  color: var(--tn-text-dim);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
  margin-bottom: 16px;
}

.tn-comparison .tn-compare-item {
  font-size: 13px;
  color: var(--tn-text-muted);
  line-height: 1.55;
  padding: 8px 0;
  border-bottom: 1px solid var(--tn-border);
}

.tn-comparison .tn-compare-item:last-child {
  border-bottom: none;
}

/* ============================================
   7. KEY TAKEAWAY — Highlighted conclusion box
   Usage: Bottom line, key finding, editorial conclusion
   ============================================ */
.tn-key-takeaway {
  background: var(--tn-surface-alt);
  border-left: 3px solid var(--tn-accent-gold);
  padding: 24px 28px;
  margin: 32px 0;
}

.tn-key-takeaway .tn-takeaway-label {
  font-family: var(--tn-font-body);
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--tn-accent-gold);
  font-weight: 700;
  margin-bottom: 8px;
}

.tn-key-takeaway .tn-takeaway-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--tn-text);
  line-height: 1.6;
}

/* ============================================
   8. FULL BLEED — Dark immersive section break
   Usage: Mid-article narrative break, investigation emphasis
   ============================================ */
.tn-full-bleed {
  background: var(--tn-bg-dark);
  color: #e8e0d4;
  padding: 48px 28px;
  margin: 40px calc(-50vw + 50%);
  width: 100vw;
}

.tn-full-bleed .tn-bleed-inner {
  max-width: 680px;
  margin: 0 auto;
}

.tn-full-bleed .tn-bleed-label {
  font-family: var(--tn-font-mono);
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--tn-accent-red);
  margin-bottom: 12px;
}

.tn-full-bleed .tn-bleed-title {
  font-family: var(--tn-font-display);
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 900;
  color: #e8e0d4;
  line-height: 1.2;
  margin-bottom: 12px;
}

.tn-full-bleed .tn-bleed-text {
  font-size: 15px;
  color: rgba(232, 224, 212, 0.6);
  line-height: 1.65;
}

.tn-full-bleed .tn-bleed-text a {
  color: var(--tn-accent-red);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ============================================
   9. SOURCE BOX — Attribution/methodology box
   Usage: Investigations, data-sourced pieces
   ============================================ */
.tn-source-box {
  background: var(--tn-surface);
  border: 1px solid var(--tn-border);
  padding: 20px 24px;
  margin: 32px 0;
  font-size: 13px;
}

.tn-source-box .tn-source-label {
  font-family: var(--tn-font-body);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--tn-text-dim);
  font-weight: 600;
  margin-bottom: 8px;
}

.tn-source-box .tn-source-text {
  color: var(--tn-text-muted);
  line-height: 1.55;
}

.tn-source-box .tn-source-text a {
  color: #2d5bf0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ============================================
   10. SERIES NAV — Multi-part series navigation
   Usage: Top of articles in a series (e.g., Sudan 1-6)
   ============================================ */
.tn-series-nav {
  border: 1px solid var(--tn-border);
  background: var(--tn-surface);
  padding: 20px 24px;
  margin: 32px 0;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.tn-series-nav .tn-series-label {
  font-family: var(--tn-font-body);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--tn-accent-red);
  font-weight: 700;
  flex-shrink: 0;
}

.tn-series-nav .tn-series-links {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
}

.tn-series-nav .tn-series-links a {
  font-family: var(--tn-font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--tn-text-muted);
  padding: 6px 14px;
  border: 1px solid var(--tn-border);
  margin-left: -1px;
  text-decoration: none;
  transition: all 0.15s;
}

.tn-series-nav .tn-series-links a:first-child {
  margin-left: 0;
}

.tn-series-nav .tn-series-links a:hover {
  color: var(--tn-text);
  background: var(--tn-surface-alt);
}

.tn-series-nav .tn-series-links a.current {
  background: var(--tn-accent-red);
  color: #fff;
  border-color: var(--tn-accent-red);
}

/* ============================================
   11. DATA TABLE — Styled data table
   Usage: Structured data presentation
   ============================================ */
.tn-data-table {
  margin: 32px 0;
  border: 1px solid var(--tn-border);
  background: var(--tn-surface);
  overflow-x: auto;
}

.tn-data-table .tn-table-title {
  font-family: var(--tn-font-display);
  font-size: 18px;
  font-weight: 900;
  padding: 20px 24px 12px;
}

.tn-data-table .tn-table-subtitle {
  font-size: 12px;
  color: var(--tn-text-dim);
  padding: 0 24px 16px;
  border-bottom: 1px solid var(--tn-border);
}

.tn-data-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.tn-data-table th {
  font-family: var(--tn-font-body);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--tn-text-dim);
  font-weight: 600;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 2px solid var(--tn-border);
  background: var(--tn-surface-alt);
}

.tn-data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--tn-border);
  color: var(--tn-text-muted);
  vertical-align: top;
  line-height: 1.45;
}

.tn-data-table tr:last-child td {
  border-bottom: none;
}

.tn-data-table td:first-child {
  font-weight: 600;
  color: var(--tn-text);
}

/* ============================================
   RESPONSIVE — MOBILE (max-width: 640px)
   ============================================ */
@media (max-width: 640px) {
  .tn-stat-strip {
    grid-template-columns: 1fr 1fr;
  }

  .tn-comparison {
    grid-template-columns: 1fr;
  }

  .tn-timeline-entry {
    grid-template-columns: 60px 1fr;
    gap: 12px;
  }

  .tn-timeline-entry .tn-timeline-date {
    font-size: 14px;
  }

  .tn-full-bleed {
    padding: 32px 20px;
  }

  .tn-series-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .tn-pull-quote .tn-quote-text {
    font-size: 20px;
  }

  .tn-pull-quote .tn-quote-text::before {
    position: static;
    display: block;
    margin-bottom: -8px;
  }
}
